Jump to content

Custom hardware control/switch panel - simpit WIP


Mulbin

Recommended Posts

I'm thinking about doing something like this for myself, but I have no idea how to work with USBs and/or Serial Ports in programming and I don't have the slightest idea on how I would integrate this into KSP. Could anyone give be a basic idea of what I'd be doing or point me in the right direction for some information on this?

It depends on what you want to make - an input or an output.

INPUT DEVICE

This first panel I'm making is purely an input device like a joystick or keyboard and needs no programming knowledge. You just plug it in and windows sees it as a gamepad. You can make one with push buttons simply by taking the innards out of a cheap gamepad, removing the microswitches and soldering the new switches on. Alternatively you can buy a ready made control board that will work out of the box. I am doing both for this, a dismantled joystick for "Push to activate" switchs (that just work like tapping a key), as well as a specialist board for toggle switches that converts the "constant on" signal of a switch into the "tap" signal of a button. This is where I got it from, they can advise if you describe what you are making - http://www.desktopaviator.com/ They also have some ready made panels but they are really geared towards aircraft rather than spacecraft.

OUTPUT DEVICE

This is a little more complicated. By output device I mean something that takes information from ksp (like your speed, fuel etc) and converts it to a signal to send to a hardware dashboard (dials, or LEDs etc). I was daunted by this but I'm now quite hopeful, mainly because...

...this guy has done the hardest part for you! - http://forum.kerbalspaceprogram.com/threads/66393-Hardware-Plugin-KSP-Arduino-based-physical-display-and-serial-port-plugin-%28WIP%29

There is a plugin on that page which you just drop into your gamedata folder (like any other mod) and it sends lots of useful data from KSP to your serial COM (which is what Arduino reads via USB). This is by far the hardest part and its already been done for you, all that remains is to set up an arduino to take this information and convert it to something useful (like moving a gauge, displaying numbers on an LCD, flashing a light etc.). I have my first Arduino arriving tomorrow along with a starter kit and tutorials, I'll work through them and learn as much as I can. There are also many examples and tutorials online if you google things like "analogue dial control arduino". There is a basic tutorial for ksp warning lights on the link above complete with the code for the arduino.

I hope this helps... basically, you (and I!) need to learn basic arduino... which isn't that hard if you take your time and learn through online tutorials, everything else is already in place from other KSP'ers!

Link to comment
Share on other sites

I'm thinking about doing something like this for myself, but I have no idea how to work with USBs and/or Serial Ports in programming and I don't have the slightest idea on how I would integrate this into KSP. Could anyone give be a basic idea of what I'd be doing or point me in the right direction for some information on this?

So long as you can get the USB input (perhaps through one of the circuitboards from here: http://www.desktopaviator.com/Pages/Boards/index.html), making an AutoHotKey script to take a gamepad/joystick input and make a keystroke (0-9 for action groups, B for brakes, etc) would work well. There are quite a few other possible ways, I'm sure, that'd just be the one I would do. I'm so very tempted to do one of these myself lol

Link to comment
Share on other sites

So long as you can get the USB input (perhaps through one of the circuitboards from here: http://www.desktopaviator.com/Pages/Boards/index.html), making an AutoHotKey script to take a gamepad/joystick input and make a keystroke (0-9 for action groups, B for brakes, etc) would work well. There are quite a few other possible ways, I'm sure, that'd just be the one I would do. I'm so very tempted to do one of these myself lol

There are also aps already available that convert joypad buttons to keystrokes - this means you can have the switch board AND a joystick without them conflicting :)

Link to comment
Share on other sites

That looks amazing Mulbin. Because of reading through this thread. I've decided I'm going to make my own KSP simpit. But simplified and modular (i.e. disconnect it and stick it in a box for transit).

I'm currently designing my whole control pad (yep every single key that KSP uses) Might look into making output devices a little later down the line.

Keep up the good work Mulbin!

For input you could hack a keyboard, buy a cheap one (for those living in UK argos does a 6pounds one) and follow this guide, its a little bit OTT but in the end I think it will look tidy.

although its not KSP related but it gives the rough idea, as long as your using actual keyboard commands for your input or finding a stable workaround for a flight stick(s). Edited by Aescwulf
Link to comment
Share on other sites

Wow. It needs a few labels, but it's looking really good. Starting to make me really consider what I can do.

How are you running the panel with the gauges?

Yes, It will have transfer printed labels but I'm holding off until I take it for a few flights to make sure I know which switches I want to do what. But the labels should be close to the layout in the plan view (first picture on post).

The dial panel will be run by an Arduino (or two).

Link to comment
Share on other sites

There are also aps already available that convert joypad buttons to keystrokes - this means you can have the switch board AND a joystick without them conflicting :)

That's exactly what I was trying to convey with AutoHotKey lol, you just script it yourself rather than use an application. I just love AHK and use it for everything, rather than download stuff to do what takes me a minute to script XD

Link to comment
Share on other sites

So the panel shown in the picture is not actually functional at this time?

The panel in the picture is wired but just waiting for the pulse generator control board (not an arduino) to arrive, then it just plugs in and will be ready to go. I'm using one of these - http://www.desktopaviator.com/Products/Model_2120/index.htm

Link to comment
Share on other sites

Awesome to see projects like this taking off.

I will be doing something similar, but my goal will be to build something that is fairly flexible and fully custom. (Including joystick, quad-throttle with secondary adjustments, pedals, pneumatic force feedback on everything, etc.) Something that is reasonably flexible and can be used for KSP, Star Citizen, flight combat sims, etc. Still not sure what I want to do for read out panels however. They might just become fully software and stuck on a second monitor/laptop. Python, with PySide and Qt can make for a VERY slick GUI that is quick and easy to throw together.

Link to comment
Share on other sites

http://i.imgur.com/wHBxdu1.jpg

Is this panel with the dials functional? If so, how is it working?

Yes, that works, its a temporary solution until i get a hardware panel made. It is my samsung tablet acting as a third monitor using an android ap that lets you turn android devices into monitors. KSP is spanned across all three screens. The dials are the SteamGauges mod which I have just pulled onto the center screen.

This is the ap to use a tablet/phone as an extra monitor - http://www.getidisplay.com/

And this is the SteamGauges mod for KSP - http://forum.kerbalspaceprogram.com/threads/40730-0-23-SteamGauges-Release-V1-3-4

If you want to use multiple monitors you just need to run KSP in a window and edit the config file so the resolution is really wide.

Link to comment
Share on other sites

With your switch board, are you powering it all through the USB?

Yes, it's all 5v through the usb.. if I decide to add any lights to the switchboard I may need to add a power supply (and keep the lights on an isolated circuit).

Link to comment
Share on other sites

For those who want to really go overboard there are some switch guards from Shuttle that you can buy on ebay...

http://www.ebay.co.uk/itm/Repro-Space-Shuttle-Toggle-Switch-Guards-/180691383314?pt=Motors_Car_Truck_Parts_Accessories&hash=item2a120bb412

Darned expensive... even D rings are expensive for what they are. Makes more sense to buy some nylon rod, a die (to make the thread) and a hot air gun and make your own. That way you can make the D as rounded as you need without leaving too much thread exposed (yeah, it's something I thought about for my build).

Keep it up Mulbin and maybe I'll finish a working plan for my real life nav ball (one that doesn't have friction probs). I know what's wrong with it but I need to get my CNC machine to finish the support disk for the motors (cutting it by hand is just too inaccurate).

Regarding switches... look out for old aerospace switches in auctions. I have a ton of old switches I have collected for my sim builds now...

Like these...

$_12.JPG

Yup... having locking toggle switches for various things such as... I don't know... staging maybe (hint, hint) actually saves a lot of missions heh.

Edit: PS - look at the date on that switch... Right year for sure...

Oh yeah, forgot one thing... Mulbin, get in touch with Rich from Telemachus. That mod is great for linking hardware to KSP. Tell him I recommended his mod (and he's great to work with).

Edited by NeoMorph
Link to comment
Share on other sites

In your original sketch, I noticed you wanted an abort lock, and I was looking into this as well. if you were the abort button's input to a normal on/off switch's output, it should give you a non-software approach to locking the abort button. Essentially put the button in series with a switch, so the switch has to be "on" to even pass current through the momentary press button.

I had to set up a dead man switch a similar way.

Edit: I know, unrequested advice. I'd probably do a manual stage lock that way as well for the stage button, getting rid of the need for ALT-L

Edit 2: And now I want to build a console for KSP...

Edited by air805ronin
Link to comment
Share on other sites

In your original sketch, I noticed you wanted an abort lock, and I was looking into this as well. if you were the abort button's input to a normal on/off switch's output, it should give you a non-software approach to locking the abort button. Essentially put the button in series with a switch, so the switch has to be "on" to even pass current through the momentary press button.

I had to set up a dead man switch a similar way.

Edit: I know, unrequested advice. I'd probably do a manual stage lock that way as well for the stage button, getting rid of the need for ALT-L

Edit 2: And now I want to build a console for KSP...

I was thinking that I would just fit a hardware switch like you say, wired in series. At present my stage is just covered with a flip guard, but now you mention it I might conect something to Alt-L... that way I can get KSP to send a signal to an Arduino when staging is locked so it can turn a "stage locked" light on!

Link to comment
Share on other sites

It depends on the switch, but I had a few that would reroute off the third post when in the off position. This could be used to power said light, and staging switch depending on how its toggled.

I have only rudimentary experience with the Arduino, but I have one down with the rest of my electronics. You're seriously building a crafting bug in me.

Link to comment
Share on other sites

It depends on the switch, but I had a few that would reroute off the third post when in the off position. This could be used to power said light, and staging switch depending on how its toggled.

I have only rudimentary experience with the Arduino, but I have one down with the rest of my electronics. You're seriously building a crafting bug in me.

ohhh... that's a thought, a third post... I bet I could run 5 volts from somewhere on the old gamepad board that controls some of the buttons, then just add a resistor and an LED.

Link to comment
Share on other sites

Just get a locking toggle switch. You have to pull them before flipping. It's what most flight capable craft use. In that picture I posted above you can see there there is an indentation in both up and down positions so it can be locked in either. There are a lot of different varieties.

The one I use for abort is usually only used during launch so I have one that is locked for the off (up) position, is moved to the middle position to arm it and then can be pushed down to trigger the abort (it's momentary). Model number for that is a Rotax 13533/1... that is if you can find one. Took a while to locate what I was looking for.

Link to comment
Share on other sites

Just get a locking toggle switch. You have to pull them before flipping. It's what most flight capable craft use. In that picture I posted above you can see there there is an indentation in both up and down positions so it can be locked in either. There are a lot of different varieties.

The one I use for abort is usually only used during launch so I have one that is locked for the off (up) position, is moved to the middle position to arm it and then can be pushed down to trigger the abort (it's momentary). Model number for that is a Rotax 13533/1... that is if you can find one. Took a while to locate what I was looking for.

yes... I may use some. But I also want the flip covers on some too as they were used in Mercury and Gemini along side lockables.

Link to comment
Share on other sites

  • 3 weeks later...

Panel is now wired up and is working quite well... although I'm considering replacing the board with an Arduino once Xitronen has finished his plugin. At present the switches all toggle properly. Otherwise I'm enjoying testing the panel out, it really adds an extra level of immersion.

Still to do on this panel...

Notification lights

More switch guards

Finish case

vwuCw4r.jpg

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...