Jump to content

Summer KSP controller : Arduino + KSP Serial IO + Joystick


Cbrollin

Recommended Posts

So this summer, I and a fellow grad student decided to both work on making a controller for Kerbal Space Program. My controller has all of the main functions working now, so I thought I would post the progress so far.

Current Progress

l6tuzDWl.jpg?1

Credit

I have zitronen to thank for his excellent plugin and tutorial on the arduino working with KSP. You can find his page here.

I was very much inspired by the K.E.E.B. controller made by Luis, and took many of my ideas from his design.

I took a look at Odysseus by Sputnix. It is very clean and an excellent design. I will probably implement some of his design elements in my controller as it progresses. I also liked the form of Sputnix's forum post, and I am trying to emulate that here.

Also, thanks to all on the forums for all your wonderful ideas and knowledge, especially in C# and arduino coding.


Functions

The main joystick is just a Saitek ST290 chopped in half. I figured it was easier to use an existing joystick than having to wire it up to the arduino and code it. This handles main flight, rotation, yaw and pitch. This also handles the throttle. It also means this will take up 2 USB ports instead of 1. Thank goodness for powered USB hubs.

The small center joystick is a work in progress. It is the only thing currently not wired up. It is a small hat switch that will be used for translation movements for docking.

The 5 red buttons handle SAS, RCS, Lights, gears, and brakes. They are backlit by LEDs and display the current in game status, regardless of the switch position.

The red arm switch is essentially a stage lock. The yellow staging button is only active when the arm switch is armed.

The yellow staging button launches and stages the rocket. It blinks similar to the LED on the in game staging panel. It blinks when the rocket is on the launch pad. When in flight it is solid until there are no stages left. When there are no stages left, or the arming switch isnt armed, the light is off.

The blue switch opens Map View, and is lit up when in Map View.

Finally, the LCD displays information from the game. I currently have it only displaying altitude and velocity. I would like to add a selector switch to change between different information. I would also like to add the functionality to display sci notation with units instead of a very large number.

The next things I am going to add are a few buttons to switch between staging, docking, and maybe horizontal flight modes. I also need to add a handle for the top of the throttle.

Parts

1x Arduino Uno R3

1x Saitek St290

1x old computer case (for the metal)

1x MCP23017 I/O expander - adding another later, link, arduino code library, you can also get them cheaper here

5x Red Latching Illuminated buttons - link

1x Toggle switch with Missile cover - here and here

1x Yellow momentary illuminated button - link

1x Blue momentary illuminated button - link

1x hat switch - salvaged from another old joystick

1x 16x2 LCD screen

I will add links to these and to the other things that I used

Edited by Cbrollin
Link to comment
Share on other sites

Very nice work. I like how you're using the indicator LED on the stage button, think I might have to borrow that idea for my controller. :)

What's the enclosure built from? I'm also curious about how you got the Saitek mounted, just disassemble the original box and screw it in to the panel?

Link to comment
Share on other sites

Looks like a very neat project! Good start!

I would recommend to anyone that can afford it, to go with a Mega 2560. You run out of pins very quickly (depending on what exactly you want to do - that is).

Although, bit-registers are fun to use too :)

(Clone-Duino's are quite affordable -- even down under with the distance-tax).

I took a look at Odysseus by Sputnix. It is very clean and an excellent design. I will probably implement some of his design elements in my controller as it progresses. I also liked the form of Sputnix's forum post, and I am trying to emulate that here.

Aww shucks. Thanks :blush:

If you're interested in how to do the spoiler tags -- here's the code (with the content going between the blocks):

Just replace the opening / closing parenthesis ( ) with brackets [ ]

(spoiler=Click to see the full log )

(/spoiler)

Edited by Sputnix
Link to comment
Share on other sites

Very nice work. I like how you're using the indicator LED on the stage button, think I might have to borrow that idea for my controller. :)

What's the enclosure built from? I'm also curious about how you got the Saitek mounted, just disassemble the original box and screw it in to the panel?

Yeah, I really wanted the staging button to do that. The button was hard to find though. Not many people selling yellow. Got it from adafruit.

So the enclosure is built from the metal sides of an old computer case and some wood. Just what I had laying around. I just had to cut the Saitek in half, and solder some longer wires to the potentiometer for the throttle.

Then I just put some screws straight into the plastic of the controller. I will try to get some pictures of the inside later, though it isnt pretty.

Looks like a very neat project! Good start!

I would recommend to anyone that can afford it, to go with a Mega 2560. You run out of pins very quickly (depending on what exactly you want to do - that is).

Yeah. The other student that is also doing a controller got a Due to do his project. A lot more I/O pins. Im kinda jealous. I have limited funds though, with a wife and kid, so I had to work with what I had laying around at first. I already had an Uno, and the MCP23017 chips give me 16 more IO pins per chip at about 3 dollars a chip. So that was cheaper for me.

The only thing is that I am not sure how the code is gonna look once I add the second IO chip. I am currently using an MCP library from adafruit.

Next time I post some code, I will go for the spoiler look. More clean for sure.

Link to comment
Share on other sites

Yeah. The other student that is also doing a controller got a Due to do his project. A lot more I/O pins. Im kinda jealous. I have limited funds though, with a wife and kid, so I had to work with what I had laying around at first. I already had an Uno, and the MCP23017 chips give me 16 more IO pins per chip at about 3 dollars a chip. So that was cheaper for me.

The only thing is that I am not sure how the code is gonna look once I add the second IO chip. I am currently using an MCP library from adafruit.

Next time I post some code, I will go for the spoiler look. More clean for sure.

You can go back to clean it up ;)

I completely understand the funding thing. I actually looked into using a bit-shift register (And combining three of them together). In the end I decided to go a simpler route, and because I just had enough on the mega, figured I'd save myself a bit of heartache with another level of complexity :P

I'm not completely foreign to electronics (and have more of a programming background) -- but this Arduino thing is a whole new minefield to navigate.

I look forward to seeing your progress :)

PS - I like your re-purposing of the computer case. I almost went down that route - but I don't have the necessary metal-work tools to do that.

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...