Jump to content

KSP Gegi - a custom status and control panel + plea for ideas


ytmytm

Recommended Posts

This is a control panel that I constructed for KSP. It is a prototype and I still learn what works and what doesn't. On the bottom of this post there is a plea for help and ideas.

This is the project's page with build log, more pictures and some extra information how it was built, what I learned over the time and how the very first prototype on a cardboard looked like:

https://hackaday.io/project/8891-ksp-gegi

This is the project's source code repository:

https://github.com/ytmytm/ksp-gegi

This project wouldn't be possible without kRPC mod:

http://krpc.github.io/krpc/

7284391453075626111.JPG

The enclosure is made out of gutted IKEA LACK shelf and inside there are two Arduinos: one Arduino Micro Pro for USB Serial communication and HID joystick emulation and one Arduino Mini Pro for handling extra I/O. The knobs on joysticks are just wooden pegs. Throttle potentiometer was salvaged from a broken humidifier.

Joysticks work without any extra software support - simply as USB joysticks.

The status indicators and display data are transmitted over serial port and parsed by Python program that talks through kRPC with the game.

Here is an overview of the schematic and connections. There is no proper schematic as it evolved as it was built.

7597931451565415217.png

 

Features

Status display

  1. Analog display of remaining electrical power
  2. Analog display of current G-force acceleration felt onboard
  3. Warning LED for low fuel condition; will be on if less 20% of fuel remains and blink if less than 10% of fuel remains
  4. Warning LED for low power condition (as above)
  5. Warning LED for overheat condition; will be on if any part of the ship is heated to at least 60% of its max temperature and blink if it is heated to at least 80% of maxiumum temperature
  6. Status indicator LEDs for vessel lights / gears / rcs / sas; green is ON, red is OFF and if the status of the switch doesn't match status in the game then the relevant indicator blinks (for example if I have sas switch ON but in the game it is OFF the green sas indicator will blink)
  7. 16x2 LCD display with three modes of action (first one doesn't match the label on the picture):
    1. Eccentricity and inclination of vessel's orbit
    2. Apoapis + time to apoapsis, periapsis + time to periapsis (orbit mode)
    3. Speed and horizontal/vertical surface speed (surface mode)
  8. 128x64 OLED display with uncertain mode of action (the switch below has three positions)
    1. Current orbit data: horizontal line is major axis, vertical line is minor axis, if the eccentricity is not too high then also an ellipse with proper eccentricity; an additional line shows orbit inclination (like a hand on a clock between hours 12 and 3)
    2. I don't have idea for two remaining modes yet, so the switch remained unlabeled

Controls

  1. Two 2-axis joysticks are presented to the host as one 3-axis joystick with 3 rotation axes, a throttle, a rudder and some 32 buttons. Those analog joysticks have buttons under them but if you push such button then you can't make any accurate moves anymore. So I configured the microcontroller to enable extra axes if button on the opposite joystick is pressed. For example the joystick on the left works as X/Y axis mode if button on the joystick on the right is released or X/Y rotation if it is pressed.
  2. Knob for time warp control
  3. Knob for throttle control
  4. Abort / Stage mode switch for EMERGENCY push button (in a very Kerbal way - make sure that you are in the right mode before panicking to enable parachutes instead of next stage boosters)
  5. Mode switch for LCD display with 3 positions
  6. Mode switch for OLED display with 3 positions
  7. Toggle switches for lights / gears / rcs / sas

When not connected to Python interface/kRPC this control panel works like a toy for my 3-year old son. The red/green indicators will turn on and off as expected with toggle switches. The analog displays will move their hands if you turn time warp and throttle controls. And OLED screen will show the position of both joysticks (two dots in two circles, like goggly eyes). It is enough to just connect it to a powerbank.

Status

What is very nice

Switches and indicators are very useful for the game. With two joysticks I can finally do EVA with intuitive control and the RCS control for docking (translation+rotation) is also easy. LCD display with orbit parameters is very useful too, but I should mount it slight angled (it's not very well visible if I don't look straight on it).

What is not nice

My woodwork is ugly, The labels are temporary. I had no idea how to mount joysticks (this is why one hole is round and the other rectangular) and the wires inside are a mess.

What doesn't work (HELP!)

That OLED display has 128x64 pixels, the top 16 rows are yellow, remaining 48 rows are cyan. In my code I wrote a simple graphics interpreter so I can send from Python interface commands like "draw line from here to there; put pixel here; draw a frame from here to there" etc. There is also possibility to put text on OLED, but it works too slowly and I would avoid it.

At the moment I simply have no idea what kind of information to put there. The information must be useful for space flight, should be graphical in nature and must fit on a tiny 128x64 (16+48) screen. I put a 3-position switch under this display so there are three modes of display possible.

Link to comment
Share on other sites


First of all, a very warm welcome to the forums.

I like your controller a lot, you have gotten what I feel is the really important stuff sorted first. You probably feel a world of difference between flying keyboard and your own setup, not the least because you get to choose what to put where.

If you want suggestions, I would add a landing mode to the 16 x 2 display. It would need to display radar altitude, and horizontal and vertical speed (you would have to be a bit creative there with placement). Or you could put Radar Alt on one of your analogue gauges, as G-force is not that critical to your flight. Personally, I have Radar Alt, Fuel, Charge and Mono on gauges (when I get around to install the panel, I am in the process of rebuilding).

The 128 x 64 is interesting, I bought one myself but have still not decided. The most probable outcome is an indicator of the ships deviation from prograde, as I tend to look a lot more on my AP/alt/velocity indicator than my screen during ascent, and often the rocket then drifts a bit.

Finally, I can recommend the other hardware threads around. A lot of arduino coding gets tossed around in zitronens plugin thread, and lots of inspiration can be gotten from Mulbins hardware thread, and the other threads linked from there. Feel free to ask questions anywhere, people love to share their knowledge.

Link to comment
Share on other sites

Thank you for warm welcome and suggestions!

I have visited those threads and I took a lot of inspiration from there.

I didn't do many landings yet, but it's clear that a landing mode with this key information will be much more useful than what I already have.

Your hint about putting on OLED display deviation from prograde points me in some direction. kRPC exposes a lot of information about vessel position, orientation with respect to various frames of reference. So that would be one mode. Now I'm thinking that second mode would be for docking. I would need some indication about relative speed and if my vessel is parallel to the target.

For the next revision I would go with four analog gauges too for power/fuel/mono and G-force. The last one is not necessary for flight at all, but it's nice to have for extra immersion effect. It gives me instant feedback of engine power once I move the throttle up.

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