stibbons

My KSP control panel

200 posts in this topic

This is my attempt to build a KSP simpit, using Arduino microcontrollers and the KSPSerialIO plugin. It started off small and is currently a lot less small.

Current status 20160815:  I've been slowly refining my current build. The altitude and vertical speed analogue gauges are now hooked up and working (it only took two years). I have a digital navball that shows current vessel attitude, and have been banging my head against the KSP API trying to work out how to extract the other orbital vectors in a format I can easily render on the ball.

I've also started work on machining a new enclosure, this will be more compact and more streamlined and made out of MDF and aluminium composite. It looks awesome in my head, but progress is hampered by my inability to drive a CNC well.

 

Build log entries

 

Source code and hardware designs

My git repository contains almost all of the details for this build. Design and implementation documentation. Part lists. Source code for the two four arduino microcontrollers. Schematics and board layouts for the printed circuit boards. 2D design files for the laser-cut panels. All under a couple of different open source licences, check LICENSE.md in the source tree.

My documentation assumes some basic knowledge of Arduino and digital electronics fundamentals. I didn't bother drawing up schematics for the protoboards containing three switches with pulldown resistors, for example. Hopefully anybody who's completed a few Arduino tutorials or sample projects will get by.

First build log

This is still very much a work in progress, and there's some obvious controls missing just because I haven't yet figured out the best way to lay them out. These ones got done first because they were the simplest and easiest to lay out, and were a good chance to refine my method for producing the faceplates.

After preparing hardware for a few of the sections, I threw together a quick mounting from 10mm perspex and a few M6 bolts. This let me lay down the basic firmware, and the panel's now in active use even though I'm still tweaking it. Because honestly, it's hard to go back to shift and control after that throttle.

 

 

 

 

The panels are made from 3mm perspex, that I've painted and then etched/cut with a laser cutter. There's a longer writeup of how I'm doing those on my blog. I'm using an Arduino Mega 2560 to drive it, with a Mux Shield II to multiplex the inputs, because I was too lazy to string together my own multiplexer.

On the software side, I'm using zitronen's KSPSerialIO mod to get telemetry from the game and send commands. My Arduino just communicates with the game over a USB connection.

I'm trying to group the controls and readouts in to logical panels. Right now I'm designing attitude control panels, with a couple of small joysticks for translational control as well as toggles for SAS and RCS and strength adjustment. The other section in progress right now uses a couple of analogue gauges for vertical velocity and radar altitude, intended as a landing aid. Further down the line I've got plans in the works to add displays, and then I can start thinking about the size and shape of the final enclosure. Probably.

EDIT:

This is the panel for managing descents, with the gauges I'm planning on using. It still has the paper backing on the other side, making the lettering a little harder to read in this pic.

qVw7jmc.jpg

The scales will both be logarithmic, with the vert speed covering -100 to 100 m/s, and the radar alt going from 0-10000. The switch will toggle between the radar alt showing metres or kilometres. Drawing the scales has been a big challenge, and trying to write efficient code for dealing with logarithms on an Arduino without an FPU even more of a challenge.

Edited by stibbons
21 people like this

Share this post


Link to post
Share on other sites

Must be difficult to resist every time you launch yelling, "LUDICROUS SPEED, GO!" :P

Impressive setup.

Share this post


Link to post
Share on other sites

I have that same joystick :D, darn now I need to do this to be "cool" like you guys...

Share this post


Link to post
Share on other sites

Not a lot of progress over the last couple of weeks. The holiday season and trying to get ahead in a new hard-mode career game in 0.90 have kept me busy. :-)

I've been trying to make some headway designing new inserts for those analogue panel dials. It's coming along slowly, partly because I suck at driving Inkscape, and partly because I can't decide whether they should be true logarithmic scales (with some fudging around 0), or closer to a more traditional radar altimeter like so:

ali55-jpg.16670

I wanted a couple of digital joysticks for RCS translation control - my intention is to use my existing analogue USB stick for most rotational control, with simple digital sticks on the panel for translation while docking. After trialling a couple of eBay buys I found a nice, compact little stick that doesn't look too arcadey. But the mounting holes are offset from the corners a little oddly and there's no dimensional drawing. It took me a full day of measuring and testing before I was able to laser cut a piece of cardboard to mount them in. :-)

B4tT59_CYAEEOB3.jpg

Share this post


Link to post
Share on other sites

After a couple of iterations I finished my attitude control panels. Two joysticks and toggles for RCS and SAS. I seem to have already run out of (or probably lost) the bezels I bought for mounting LEDs, hence holes that will remain empty until I order some more.

EBDB21L.jpg

I've still got two or three more panels I want to add to the board. Current plan is to at least get designs for them on paper, so I can get an idea of what I need for the enclosure.

Edited by stibbons
1 person likes this

Share this post


Link to post
Share on other sites

How do you make your panels? They look _very_ professional.

Share this post


Link to post
Share on other sites

Thanks! :)

They're 3mm translucent perspex. I paint one side with grey primer, then cut and etch in a laser cutter. The final enclosure will include backlighting for the panels.

Share this post


Link to post
Share on other sites

Wow. That's all I've got to say.

Wish I had the time to do this.

How are you communicating to KSP with the Arduino? I remember some talk about a plugin a while back, wondering if I could make an autopilot with Python.

Share this post


Link to post
Share on other sites

Glad you like it. :)

I'm using Zitronen's KSPSerialIO mod to let the game talk to my arduino over a USB connection. It's geared more towards microcontrollers, probably not the best choice if you want to write an autopilot in a higher level language.

I've dabbled with kOS, an in-game scripting system. Then there's Telemachus for web-based control and kRPC is worth a look too.

Edited by stibbons
fixing links

Share this post


Link to post
Share on other sites
Glad you like it. :)

I'm using Zitronen's KSPSerialIO mod to let the game talk to my arduino over a USB connection. It's geared more towards microcontrollers, probably not the best choice if you want to write an autopilot in a higher level language.

I've dabbled with kOS, an in-game scripting system. Then there's Telemachus for web-based control and kRPC is worth a look too.

I'll check it out, I've got a decent knowledge of Arduino. Rigged an R.C. car to navigate autonomously with one. :D

Yeah, I've tried kOS, made a few circularizer scripts and such, but it was a little complicated and slow to get the stupid code on every ship when you launch... what was it, "copy copyall"

"run copyall"

(A script that copies the five or six programs I had)

"run kosLaunch1"

A custom interface like that would be fun to make. At least some analog instruments. I'll check out the I/O mod.

Share this post


Link to post
Share on other sites

kRPC is pretty much on hiatus I believe. No updates on github for a couple of months.

Share this post


Link to post
Share on other sites

That's a shame. If my KSP hacking time wasn't already all tied up I'd think about learning some C# and seeing if I could knock the dust off it.

Share this post


Link to post
Share on other sites

I know exactly how you feel :). Well the author wrote that he hopes to reach less busy times and hopes to be able to pick it up again so there is hope. But then that post is a few months old... anyway, I keep my eyes on the github just in case :)

Share this post


Link to post
Share on other sites
Thanks! :)

They're 3mm translucent perspex. I paint one side with grey primer, then cut and etch in a laser cutter. The final enclosure will include backlighting for the panels.

Freshmeat is right, your panels look really really good.

Since Day Of Construction is nigh for my panel :D, one question: Do you think 3mm perspex will be stiff enough to not make a single panel 25 x 50 cm in size flex when buttons are pressed?

I did some tests with 1mm aluminium sheets but that is waaaaaay to flexible and won't work for that intention and due to the button density on my panel I won't have much option to support it midway.

Share this post


Link to post
Share on other sites

I'm poking and prodding a 50x50 sheet right now and, no, it's got way too much movement. I don't think I'd even trust a single midway support once the panel has holes cut in it.

5mm might not be too bad for what you want. But I think you're going to have to start looking at adding support posts wherever you can.

EDIT: The base I'm using right now is 10mm perspex, 320mm by 250mm. Even that has a little bit of flex, although It'd probably be OK in a more rigid box.

Edited by stibbons

Share this post


Link to post
Share on other sites

I use aluminium composite board (often known as dibond). Basically it's a sheet of plastic sandwiched between two very thin sheets of aluminium. Very rigid even on large sheets but you can cut it with a craft knife. Its what they make commercial signs from.

Share this post


Link to post
Share on other sites

Oh nice. I was thinking about using that for my enclosure, figured it would be lighter and easier to work with than wood. And if it looks as good as your panels I'm sold. :)

Share this post


Link to post
Share on other sites

Thanks Stibbons & Mulbin. I'll go to the hardware store and check what's available. I've been contemplating a re-layout of my controls anyway - that way I not only reduce button density but also have space for supports... let's see what the hardware store research brings :)

I'll report back.

Share this post


Link to post
Share on other sites

I don't want to start on the enclosure proper until I've got a better idea of all of the panels that are going in to it, but at the same time Ido want to start writing code for and using the panels I've finished. So today I knocked up a second small enclosure for the panels I have ready to go. Of course, the only 5mm acrylic I could find was clear.

kc1wlZn.jpg

So, this evening I'll be working on getting these boards wired up and installed, and writing some code to use them. Looking forward to trying these sticks out. :)

Edited by stibbons
1 person likes this

Share this post


Link to post
Share on other sites

The attitude control panels are wired up, and I spent some time this week fixing a few things that were bugging me about the KSPSerialIO plugin. End result, this evening I am testing rover control with my new sticks. :)

3 people like this

Share this post


Link to post
Share on other sites

That looks very ..... Those sticks man... those sticks...

Share this post


Link to post
Share on other sites

I designed them with a view for fine translational control while doing things like docking. But they're also wired up for rotational control at the flip of a toggle. And they always send wheel control commands. The rover driving turned out to be a lot more fun than I thought it would be. :) But I'm really looking forward to using them when I start building an orbital station.

Share this post


Link to post
Share on other sites

I don't really have any useful progress to report on my panel this week. But I did note with interest that somebody finally got around to getting serial port access in Unity working on non-windows platforms. Will be very happy to go back to running KSP in Linux on my gaming machine.

About the only other thing, and it's a pretty minor one, was starting to work towards 3d printing translucent button caps to go over some illuminated tac switches I'm planning on using for my displays. Pretty excited to start working on that.

Share this post


Link to post
Share on other sites

Oh please keep us posted on the progress on those translucent caps! One of the things I'm not too happy about on the YAKK Mk 1 is the labelling of the DSKY keys, translucent buttons would solve that in a Mk 1.1 ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now