HaydenBarca
Registered:1537152273 Posts: 455
Posted 1643420531
· Edited
Reply with quote
#1
Inspired by EricF's build I'm going to try my hand at a weapons console. Here's my layout With 2.8 we now have target acquisition buttons for Weapons (like Science), so I decided to forego the joystick control like Angel of Rust had (can't do manual beams with this console, but I can live with that). Most of these are 16mm buttons, the lock switches are mini toggle switches (inspired by Angel of Rust to lock the tubes), and the camera angle buttons are 6mm buttons. Display Zoom and Beam Frequency are momentary 3 way toggle switches (ON)-OFF-(ON), and the shield switch is a illuminated latching toggle switch (shines blue when on). A stretch goal is to put button covers over Nuclear and Mine with dire warnings (or just the nuclear symbol). Anything missing or unclear from a user interface perspective? Any cooler terminology to use? Did we ever decide what to call the basic explodey torpedo? I know most torpedo types are homing, but for historic reasons the standard torpedoes get called homing. Is there a better name than "standard" or "homing". High-explosive? Kinetic? Conventional? Heavy?
NoseyNick
Registered:1519077343 Posts: 349
Posted 1643512853
Reply with quote
#2
Nice!Quote:
Anything missing or unclear from a user interface perspective? Any cooler terminology to use?
What are the "lock", and how do you have 1 lock per tube? Usually when we are talking about "weapons lock" we are talking about the same thing you call "target acquisition" I think? Is this like an indicator light when the tube is full? And maybe blinking when loading/unloading? Not sure of a better word, but also not quite sure what yours mean Some ships have less than 4 tubes, obviously. I guess you can probably just ignore some of the controls for those? I don't think any have MORE than 4 tubes, do they? Even the missile cruiser has 4? Love the look of them though, and cool layout - look forward to seeing photos of the real thing!
HaydenBarca
Registered:1537152273 Posts: 455
Posted 1643559539
· Edited
Reply with quote
#3
Good point. The "Lock" switches disable the function of the load/unload and fire buttons. So, for instance, you could load a nuke in Tube 2, then lock tube 2 so that you don't accidentally begin unloading it (wait another 30s to get it back) or fire it before you're ready. It's kind of a "safety", borrowing from Angel of Rust's Lock and Armed buttons. Maybe "tube lock" or "hold"? At this stage I'm avoiding controlled LEDs (other than backlighting) to avoid the scope spinning out of control (because there's so much that could be done). I plan to use resistors to gang several buttons to a single controller input, ala How-to-access-5-buttons-through-1-Arduino-input , to try to keep it to a microcontroller. At this stage, I'm thinking about using these acrylic trays as the frame:https://smile.amazon.com/STORi-Clear-Plastic-Drawer-Organizers/dp/B08NCWGY6Y It's 2mm thick and available in a variety of sizes, so I could end up with a variety of stations that have a uniform look, but in different sizes.
NoseyNick
Registered:1519077343 Posts: 349
Posted 1643566944
Reply with quote
#4
Quote:
Originally Posted by HaydenBarca [...] kind of a "safety", borrowing from Angel of Rust's Lock and Armed buttons. Maybe "tube lock" or "hold"?
Ah gotcha. Or "arm", sure. I guess it doesn't matter TOO much what you call it as long as you explain it to your players and are consistent with orders / instructions. Don't let me put you off, definitely give it a try and see if you can make it work reliably, BUT be aware this technique is a bit of a compromise. Obviously requires an analog port, most microcontrollers have a very finite number of those... but that said, it does make good use of an analog port if you DIDN'T have any better plan for it. However if your resistor tolerances are off a bit, if there's moisture in the wrong place, or corrosion on connectors etc, resistance can drift up/down a bit, and/or other electrical noise can push your analog reading into the wrong band and give you false readings. You also tend to get unpredictable (and seemingly "random") results if users press 2 or more buttons at once. Randomly doing the wrong thing on a weapons control panel, or even helm, could prove fatal! Consider as an alternative... https://en.wikipedia.org/wiki/Charlieplexing which is a technique more well known for LED OUTPUTS but also has variations usable for switch/button INPUTS. It can give you access to (for example) 4x3 = 12 buttons between 4 digital pins, or any combination of 56 buttons/switches/LEDs between 8 microcontroller pins. It does require a diode per button, but on the other hand the analog technique requires a resistor per button. That page also links to some interesting hybrid variants that can squeeze a few more combinations of I/Os per pin by charlieplexing buttons where the diodes ARE LEDs
HaydenBarca
Registered:1537152273 Posts: 455
Posted 1643571349
· Edited
Reply with quote
#5
Thanks for the feedback on the resistor "plexing". I did look at charlieplexing, but was trying to keep things simple (both for my own learning curve, as well as making it accessible for others). Right now there's 35 pins needed if it's one pin per control. Looking at Angel of Rust's setup it looks like he did an x/y matrix to fit the larger control counts on a 20 pin Teensy. I guess if I really want to keep things simple and beginner friendly, I need to retreat to a mega-format and get the 54 pins. Though at this stage I think I'll need to remove the "Low Cost" part of the title . I guess "panel only requiring basic tools" would be more appropriate. Finding a 54pin that is keyboard compatible is a bit tricky (the Arduino Due works, but is 3.3V, so not good for driving LEDs, adafruit has a cheaper one: https://www.adafruit.com/product/4064). I might just be down to using a shift register or IO expansion board. Maybe this one:https://smile.amazon.com/Waveshare-MCP23017-Expansion-Interface-Expands/dp/B07P2H1NZG/ Seeduino with 20 pins , drop 2 for the IO expansion board, gain 16 = 34 io pins (drop Auto Beams to get there) Or use the Teensy LC 27 pins , expanded for 41 IO pins. Hmm... keeping things simple is becoming complicated.
NoseyNick
Registered:1519077343 Posts: 349
Posted 1643584477
· Edited
Reply with quote
#6
The megas are RARELY worth it, I won't say NEVER, but I would definitely be looking at X/Y multiplexing first. Seeing as you mentioned 54, you can put 7x8 = 56 controls in an X/Y grid, for 7 column pins + 8 row pins = 15 microcontroller GPIO pins (or 8x7 if you prefer) Charlieplexing is arguably taking X/Y to its illogical extreme. Imagine an N by N grid where each of your N GPIO pins goes to a row AND a corresponding column. You can have a button / switch / LED on each of those EXCEPT the X=Y diagonal, so for example instead of the 15 pins above, you use 8 GPIO pins to 8 rows and 8 columns, EXCEPT the X=Y diagonal (no point in connecting a button between pin 3 and pin 3 or whatever). This is mathematically equivalent to a fully-populated N x (N-1) grid... So you get essentially 7*8 for only 8 microcontroller pins, instead of 7+8 = 15 pins. ... but you're right, arguably less "beginner friendly", bit harder to wrap your head around the concept, harder still to code for, and harder still to debug when something is shorted or connected wrong somewhere and you have to work out what/where. Assuming you HAVE wired and coded it right, it's probably less error-prone during "normal operation" than the analog resistor 'plexing though Your 20 pin teensy should be FINE driving 10 rows and 10 columns for 100 switches/buttons in a way that even beginners would understand... no? ... or 20 pins for 20 x 19 = 380 buttons / switches / LEDs if you charlieplexed See, who needs megas? OK, I'll tell you who needs megas. STEPPER MOTORS basically need 4 IO pins each, and there's really no getting around it and no realistic way to multiplex them unless you want to add all sorts of extra shift registers and stuff... So if you need more than 5 steppers for your robot, or your 3D printer with X+Y+Z + Extruder + a few more for heaters and thermistors and end-stop-switches and displays and controls and lights... THEN you can eat through those 20 pins pretty fast... and you probably want a mega... OR you give up and drive everything from less pins via SPI-controlled driver chips or shift-register chips from "about 2" GPIO pins for "almost infinite" GPIO opportunities but at much more cost and circuitry. NN
EricF
Registered:1510413974 Posts: 239
Posted 1643587771
Reply with quote
#7
Awesome! This looks exciting. Regarding which microcontroller to use: true the Mega is usually overkill except that it has one very useful trick up its sleeve: 16 Analog pins. For something like an engineering console where you might want 8 power levels and a few other spinny-slidy things, it's sure nice to be able to wire them directly to the microcontroller.
Also if you want to wire up toggle switches (not just momentary buttons), which spend a lot of time in a "pressed" state, the various matrixing options won't likely work as you'll end up with shadowing problems. Shift registers do solve that, but buying one and putting it on some sort of breakout board starts to close the gap on price with a mega.
And the Mega isn't too expensive anymore, there are clones for around $13 USD, shipped .
I'm a fan of the Mega. I would recommend it as the clearest, easiest place to start. One slight disadvantage is that it can't emulate a keyboard and mouse, but I might have a solution to suggest for that to post shortly.
NoseyNick
Registered:1519077343 Posts: 349
Posted 1643598422
Reply with quote
#8
Quote:
Originally Posted by EricF Also if you want to wire up toggle switches (not just momentary buttons), which spend a lot of time in a "pressed" state, the various matrixing options won't likely work as you'll end up with shadowing problems
The correct way to fix that is diodes. Which are basically as cheap as resistors if you buy a big bag of 'em, less than 1c each. EG in your X/Y row/column grids you might pull a column high, go through a button/switch AND DIODE into each row. You then can't have "shadowing" because the diodes prevent the incorrect "backwards" shorting. Charlieplexing is then taking the same to an (il)logical extreme. Each GPIO pin has a switch+diode (OR LED) to each other GPIO pin... Or if you prefer, pin N powers column N and senses row N, but again the diodes (or LEDs which of course ARE diodes) prevent back-flow into the "wrong" columns/rows.
HaydenBarca
Registered:1537152273 Posts: 455
Posted 1644804279
Reply with quote
#9
I've got an update and the construction end. I found a great Ikea box frame, to which I've added 1/8" (3mm) acrylic plexiglass, adhered two printouts to, and then drilled out for buttons and switches. Lining up the two pages made for easier printing, but more careful gluing (with 3M 77 spray adhesive). I lined it up with a backlight and the taped on "hinges" before spraying the adhesive. I used a stepped acrylic drill, which worked well once I got the hang of it Drilled holes definitely took time and drifted a little (even with pilot holes), but the round buttons and collars help cover things up. So far so good on the no-solder goal And I'm particularly proud of the safety caps over the nuclear ordnance Next up. Wiring.
NoseyNick
Registered:1519077343 Posts: 349
Posted 1644806166
Reply with quote
#10
Quote:
So far so good on the no-solder goal
I love soldering, don't understand why anyone would have a no-solder goal. Why are you deliberately depriving yourself of the joy of the metal flowing into place? Love the look of your panels though. Especially love the safety flaps on the nukes and mines
EricF
Registered:1510413974 Posts: 239
Posted 1644806440
Reply with quote
#11
Outstanding, this looks great! That IKEA picture frame looks like it will work perfectly as a lightbox. You've gotta give us a beauty shot with the backlighting, even if it's just you holding it up to a sunny window
Angel of Rust
Registered:1483481942 Posts: 442
Posted 1644812165
Reply with quote
#12
Quote:
Originally Posted by
HaydenBarca I've got an update and the construction end. I found a great Ikea box frame, to which I've added 1/8" (3mm) acrylic plexiglass, adhered two printouts to, and then drilled out for buttons and switches.
And I'm particularly proud of the safety caps over the nuclear ordnance
Sweet! This looks awesome!
HaydenBarca
Registered:1537152273 Posts: 455
Posted 1644862142
Reply with quote
#13
Thanks. For the safety flaps, I'm waffling between just adding the nuclear hazard symbol on the cover Or something like "Prior Authorization Required".
HaydenBarca
Registered:1537152273 Posts: 455
Posted 1644872306
Reply with quote
#14
Quote:
Originally Posted by
EricF Outstanding, this looks great! That IKEA picture frame looks like it will work perfectly as a lightbox. You've gotta give us a beauty shot with the backlighting, even if it's just you holding it up to a sunny window
I'll have to try again with a darker setting, but you can see some of the backlighting here
HaydenBarca
Registered:1537152273 Posts: 455
Posted 1644900990
· Edited
Reply with quote
#15
Here are some in a dark room Getting the exposure is hard, but it glows nice and purdy.