Jump to content

Custom hardware / simpit repository. For people who take KSP a little too far.


Mulbin

Recommended Posts

[quote name='JTpopcorn']Where did you all learn how to do this, I would really like to learn/make my own, but it is really confusing to try to figure out what to actually do.

Thanks,
-JT[/QUOTE]

The best inspiration is to have an idea and go from there :)

Most people here have some sort of background either in computers, some electronics, or even more mechanical stuff.

I hope to be doing a series of videos soon going through the process of building your own simpit (doing a variation on my own build); but the best thing you can do is (money permitting, of course) is to buy an arduino kit off ebay, and start playing / learning about how it works and how to do stuff. That will give you a point of reference to build from.

Otherwise, there are also small little hobby / electronics kits you can get (at least down-under, not sure where you're from, and what they have where you live) that can help step into electronics.

There's three key areas with this stuff - Construction, electronics, and programming. Your only limit is your imagination, your bank account, and also how much one is willing to invest in learning and understanding. And this community (I've found) is great. If you have questions, shoot me a PM. I've already helped out a couple people on the forums as much as I can :) I'm no expert by any stretch, but I'm always happy to try and help out :D
Link to comment
Share on other sites

I've been playing with arduino projects for a while, mostly little home automation type stuff - I've got little temperature sensors, movement-activated lights, an Internet-enabled clock, stuff like that. Got my start on my controller project because I wanted to build something with a more interactive physical interface (lots of switches and lights).

Sputnix speaks truth. Get yourself an Arduino starter kit, and play around with the examples in it. That will give you a basic understanding of how to read input from buttons, and do stuff based on that. You'll have turned lights on and off, probably written numbers to a display, played basic sounds through a buzzer, and sent and received data over a serial connection to your computer.

And really, once you've got that grounding, it's a fairly small step to using the same kit parts to talk to the game. I'm using KSPSerialIO, which comes with an Arduino sketch that should be fairly easy to start adding your own inputs to.
Link to comment
Share on other sites

I got two mini joysticks drom my RC plane radio, the plane itself flew only once and it crashed but that is not the question.
Im kinda poor right now so it may take a while before I do anything but how do you connect two joystick to an arduino?
They are both regular two-pot joystick with 3 wires on each potentiometer.
Also how much stuff do you usualy need to have all the basics controls on a panel? (brakes, SAS, RCS, lights, gears, all the actions groups and the thing to toggle to docking mode and back. And of course the sticks)

EDIT: I also have a bunch of servos from the plane, I think real life motorised pitch-yaw-roll indicators would be fun. Edited by Fluburtur
Link to comment
Share on other sites

Each axis on your stick [I]should[/I] just work as a regular [URL="https://www.arduino.cc/en/Tutorial/Potentiometer"]potentiometer[/URL]. One of those wires connects to the 5V, one to GND, and the third feeds to an analogue input on the Arduino. Four pots means you'll be sampling four analogue inputs, which you can do on a standard Arduino without any extra parts.

Simplest way to do all of that is to pick up an Arduino Mega board (just because it has a lot of I/O pins; you can hook things up directly to it without worrying about multiplexing). If you haven't worked with Arduino before I still highly recommend getting a starter kit. It'll have a book with examples you can use to learn the basics, and you'll have a good set of the odds and ends you'll need like resistors, hookup wire, a breadboard for prototyping on etc.
Link to comment
Share on other sites

Thanks, I think I will get an Arduino Uno starter kit since apparently there is no Mega starter kit.
I just have to get a job, hopefully that will be done soon.

EDIT: while looking at the first page I noticed [COLOR=#333333]zitronen uses the same joysticks as I will
[/COLOR]https://sites.google.com/site/zitronfiles/IMG_8486.JPG Edited by Fluburtur
Link to comment
Share on other sites

TL;DR;
I've quit using KSPserialIO as it crasches the game. I use kRPC instead.
/TL;DR;

Long story:

If anyone is having problems really [I]playing[/I] the game using your hardware controls It may be due to KSPserialIO. My game crashed after playing only a couple of minutes and I in the end I removed every single mod except KSPserialIO in order to make it run reliably. I still had crashes (or actually lockups) after 3 to 10 minutes. Nothing in the logs so I couldn't pinpoint what went wrong.

I tried to decrease the number of control packets I sent back to KSP and even stopped using control packets entirely and added another joystick emulation to handle all the control axes and switches. It still crashed. Then I decreased the serial transmission speed as I didn't need to update as often when I didn't use the mod for input. That seemed to work, but in the end it only delayed the crashes and gave about ten more minutes extra game time before going catatonic.

Then I finally threw out KSPserialIO and searched for at workaround. My first thought was to use Telemachus and write a json to serial converter in Python. While it certainly was doable it would force me to start dabbling with websockets and JSON in a language I didn't know. I searched on and found kRPC, a mod that makes KSP innards available using RPC calls over the network (warranty void if used outside localhost). This made connecting to KSP using Python or LUA using ordinary objects or function calls.

Ok, I didn't feel like learning LUA so I still had to learn Python, but without the added hassle of web tech which was nice for a old school guy like me. It took me about three or four days to get the first kRPC to serial converter up and running and it worked most of the time. No game craches and if the converter crashed (which it did alot) I could restart it without having to restart the game. A couple of days later I had error handling in place and the whole thing run smooth as butter.

After doing a Jool expedition in one single session without crashes I've decided that the problem is solved.

<shameless_plug>
For even more reading about my project go to my blog: [URL]http://antipaten.blogspot.se/[/URL]
</shameless_plug>
Link to comment
Share on other sites

I've been thinking about moving to pretty much exactly the same setup (kRPC -> python daemon -> serial connection) as a way to work around the issues Unity has firing the appropriate callbacks on Windows 10, Linux and OSX. But I put it off in the hope that the Unity 5 update would improve things.

I'd be interested to see the code for your current work!
Link to comment
Share on other sites

[quote name='stibbons']
I'd be interested to see the code for your current work![/QUOTE]

It's still ugly but it works. I will clean it up when I've learned enough Python (and maybe C++) to do it. I've used Python 3.5 and only added kRPC and the serial lib. The Arduino code is just the part that handles the serial communication. It's much more primitive than KSPserialIO as I have no buffering or checksums. If I get a bit error I will simply get confused data. I don't think that's a big problem though as the actual serial connection is located inside the chip and the rest is USB. If it becomes a problem I will add a checksum and send it before the payload. I've made a separate header file for the type declarations as I needed them to be added before the main program during compilation. If I just tossed everything into the .ino file it got added in some arbitrary place in the end of the compile.

Edit: By the way. The Python code can handle multiple serial connections. I've tested it with two, but it should be able to handle more. Remember however that transmissions are not concurrent so each additional clients will get an increasing transmission delay.

EditEdit: Maybe I should point out that this is in no way a plugin replacement to KSPserialIO and is not intended to be in the future. It uses a different data format and only transfers what I have use for at the client side at the moment. It should however be rather simple to adapt to your own needs by adding those fields that you need (and remove those you don't. Another note: This is for 1.0.4. I'm still waiting for a kRPC that is compatible with 1.0.5. Go and give djungelorm some appreciation so it's clear we want this update badly. :-)

[B]K42_server.py[/B]
[CODE]
import krpc
import serial
import time
import os
import struct
from serial.tools.list_ports_windows import *

conn = 0
slask = 0
a=0
p=0
ser = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
s = 0
vessel = 0

os.system('cls')

while ...:

time.sleep(0.5)

try:
if s < 1:
ports = comports()
for port in ports:
try:
ser[s] = serial.Serial(port[0], 115200)
ser[s].timeout = 1
ser[s].write_timeout = 1

slask = ser[s].write(b"Mhi\0")
slask = ser[s].read(4)
if slask != b'K42':
ser[s].close()
ser[s] = 0
#print("Handshake failed for K-42 on", port[0])
else:
s += 1
print ("Connected to client on", port[0])
except serial.SerialException:
print("Could not open serial port",port[0])
ser[s] = 0
except serial.SerialTimeoutException:
print("Serial communication timeout")
ser[s].close()
ser[s] = 0

if conn == 0:
try:
conn = krpc.connect(address='192.168.0.101', name='K-42 Connector')
print ("Connected to kRPC!")
except krpc.error.NetworkError:
conn = 0

else:
if vessel == 0:
try:
vessel = conn.space_center.active_vessel
print ("Vessel selected:", vessel.name)

Warp = conn.add_stream(getattr, conn.space_center, 'warp_factor')
Apoapsis = conn.add_stream(getattr, vessel.orbit, 'apoapsis_altitude')
TimeApoapsis = conn.add_stream(getattr, vessel.orbit, 'time_to_apoapsis')
Periapsis = conn.add_stream(getattr, vessel.orbit, 'periapsis_altitude')
TimePeriapsis = conn.add_stream(getattr, vessel.orbit, 'time_to_periapsis')

Gforce = conn.add_stream(getattr, vessel.flight(), 'g_force')
AtmDensity = conn.add_stream(getattr, vessel.flight(), 'atmosphere_density')
RadarAltitude = conn.add_stream(getattr, vessel.flight(), 'surface_altitude')
Mach = conn.add_stream(getattr, vessel.flight(), 'mach')
VerticalSpeed = conn.add_stream(getattr, vessel.flight(), 'vertical_speed')
HorizontalSpeed = conn.add_stream(getattr, vessel.flight(), 'horizontal_speed')
SolidFuelCurrent = conn.add_stream(vessel.resources.amount, 'SolidFuel')
SolidFuelMax = conn.add_stream(vessel.resources.max, 'SolidFuel')
OxidizerCurrent = conn.add_stream(vessel.resources.amount, 'Oxidizer')
OxidizerMax = conn.add_stream(vessel.resources.max, 'Oxidizer')
LiquidFuelCurrent = conn.add_stream(vessel.resources.amount, 'LiquidFuel')
LiquidFuelMax = conn.add_stream(vessel.resources.max, 'LiquidFuel')
MonoPropellantCurrent = conn.add_stream(vessel.resources.amount, 'MonoPropellant')
MonoPropellantMax = conn.add_stream(vessel.resources.max, 'MonoPropellant')
IntakeAirCurrent = conn.add_stream(vessel.resources.amount, 'IntakeAir')
IntakeAirMax = conn.add_stream(vessel.resources.max, 'IntakeAir')
XenonGasCurrent = conn.add_stream(vessel.resources.amount, 'XenonGas')
XenonGasMax = conn.add_stream(vessel.resources.max, 'XenonGas')
ElectricChargeCurrent = conn.add_stream(vessel.resources.amount, 'ElectricCharge')
ElectricChargeMax = conn.add_stream(vessel.resources.max, 'ElectricCharge')

Parts = conn.add_stream(getattr, vessel.parts, 'all')

Stage = conn.add_stream(getattr, vessel.control, 'current_stage')
SAS = conn.add_stream(getattr, vessel.control, 'sas')
RCS = conn.add_stream(getattr, vessel.control, 'rcs')
Gear = conn.add_stream(getattr, vessel.control, 'gear')
Lights = conn.add_stream(getattr, vessel.control, 'lights')
Brakes = conn.add_stream(getattr, vessel.control, 'brakes')
Abort = conn.add_stream(getattr, vessel.control, 'abort')



except krpc.error.RPCError:
vessel = 0


if vessel != 0 and s > 0:

try:
if LiquidFuelMax() > 0: # Percentage of max in stage (if none always 101%)
LiquidFuel = 100 * LiquidFuelCurrent() / LiquidFuelMax()
else:
LiquidFuel = 101

if OxidizerMax() > 0: # Percentage of max in stage (if none always 101%)
Oxidizer = 100 * OxidizerCurrent() / OxidizerMax()
else:
Oxidizer = 101

if SolidFuelMax() > 0: # Percentage of max in stage (if none always 101%)
SolidFuel = 100 * SolidFuelCurrent() / SolidFuelMax()
else:
SolidFuel = 101

if MonoPropellantMax() > 0: # Percentage of max in stage (if none always 101%)
MonoPropellant = 100 * MonoPropellantCurrent() / MonoPropellantMax()
else:
MonoPropellant = 101

if IntakeAirMax() > 0: # Percentage of max in stage (if none always 101%)
IntakeAir = 100 * IntakeAirCurrent() / IntakeAirMax()
else:
IntakeAir = 101

if XenonGasMax() > 0: # Percentage of max in stage (if none always 101%)
XenonGas = 100 * XenonGasCurrent() / XenonGasMax()
else:
XenonGas = 101

if ElectricChargeMax() > 0: # Percentage of max in stage (if none always 101%)
ElectricCharge = 100 * ElectricChargeCurrent() / ElectricChargeMax()
else:
ElectricCharge = 101

MaxHeat = 0
p = Parts()
for part in p:
MaxHeat = max(MaxHeat, part.temperature / part.max_temperature)
MaxHeat = max(MaxHeat, part.skin_temperature / part.max_skin_temperature)
MaxHeat *= 100 # Percentage of max for most sensitive part

Switches = 0
if SAS():
Switches += 1;
if RCS():
Switches += 2;
if Gear():
Switches += 4;
if Lights():
Switches += 8;
if Brakes():
Switches += 16;
if Abort():
Switches += 32;

msg = struct.pack('<4sB10f10B', b'MSG\0', int(Warp()), Apoapsis(), TimeApoapsis(), Periapsis(), TimePeriapsis(), Gforce(),
(AtmDensity()/1.136), RadarAltitude(), Mach(), VerticalSpeed(), HorizontalSpeed(), int(LiquidFuel), int(Oxidizer), int(SolidFuel), int(MonoPropellant), int(IntakeAir),
int(XenonGas), int(ElectricCharge), int(MaxHeat), int(Stage()), int(Switches))

for connection in ser:
if connection != 0:
slask = connection.write(msg)

# unsigned char Warp;
# float Apoapsis;
# float TimeApoapsis;
# float Periapsis;
# float TimePeriapsis;
# float Gforce;
# float AtmDensity;
# float RadarAltitude;
# float Mach;
# float VerticalSpeed;
# float HorizontalSpeed;
# unsigned char LiquidFuel;
# unsigned char Oxidizer;
# unsigned char SolidFuel;
# unsigned char MonoPropellant;
# unsigned char IntakeAir;
# unsigned char XenonGas;
# unsigned char ElectricCharge;
# unsigned char MaxHeat;
# unsigned char Stage;
# unsigned char Switches;


except krpc.error.RPCError:
print("Vessel disconnected")
vessel = 0

except OSError:
print("Server shut down")
time.sleep(1)
conn.close()
conn = 0
vessel = 0

except ConnectionAbortedError:
print("Connection aborted")
time.sleep(1)
conn.close()
conn = 0
vessel = 0

except KeyboardInterrupt:
print("Quit")
for q in ser:
if q != 0:
q.close()
if conn != 0:
conn.close()
time.sleep(1)
break
[/CODE]

[B]serial.h
[/B][CODE]
// Kommodore_42 communication Code v 1.0
// Copyleft: Rescalable Decomposites 2015
// No rights Deserved

#define KSPOUT_SAS 1
#define KSPOUT_RCS 2
#define KSPOUT_GEAR 4
#define KSPOUT_LIGHTS 8
#define KSPOUT_BRAKES 16
#define KSPOUT_ABORT 32

struct KSP_ODATA {
unsigned char Warp;
float Apoapsis;
float TimeApoapsis;
float Periapsis;
float TimePeriapsis;
float Gforce;
float AtmDensity;
float RadarAltitude;
float Mach;
float VerticalSpeed;
float HorizontalSpeed;
unsigned char LiquidFuel;
unsigned char Oxidizer;
unsigned char SolidFuel;
unsigned char MonoPropellant;
unsigned char IntakeAir;
unsigned char XenonGas;
unsigned char ElectricCharge;
unsigned char MaxHeat;
unsigned char Stage;
unsigned char Switches;
};
[/CODE]

[B]serial.ino
[/B]I've removed some code that sent and cleared error indicators on my alarm module. I haven't tried to compile it in its current form so there might be I've removed too much somewhere. Just let me know if it looks uncomprehensible and I'll post the complete code.
[CODE]
// Kommodore_42 communication Code v 1.0
// Copyleft: Rescalable Decomposites 2015
// No rights Deserved


void getFromSerial() {
static unsigned long timer_KSP;

// Get data from Kerbal using K42-server and kRPC
if(Serial.available() >= 3){
while(Serial.peek() != 'M') Serial.read(); // Get rid of garbage
Serial.readBytes(s,4); // Get header
if(strncmp(s,"Mhi",4) == 0){ // Handshake
Serial.print("K42"); // Return handshake
}else if(strncmp(s,"MSG",4) == 0){ // Data packet
b = (byte *) &ksp_out;
for(i = 0 ; i < sizeof(KSP_ODATA) ; i++){ // This doesn't work very well actually. We get garbage if packet is truncated.
b[i] = Serial.read();
}
if(!ksp_avail) {
ksp_avail = true;
}
}
timer_KSP = millis();
} else {
// We didn't get anything within reasonable time.
if (millis() - timer_KSP > 2500) { // Timeout 2.5 seconds
timer_KSP = millis() - 2400;
if(ksp_avail) {
ksp_avail = false;
}
}
}
}
[/CODE] Edited by Antipaten
Link to comment
Share on other sites

[quote name='Antipaten']TL;DR;
I've quit using KSPserialIO as it crasches the game. I use kRPC instead.
/TL;DR;
[/QUOTE]

:O Blasphemy!

* * *

On a more serious note - did you try to increase the buffer size on the arduino itself?
Link to comment
Share on other sites

[quote name='Fluburtur']...I think I will get an Arduino Uno starter kit since apparently there is no Mega starter kit...[/QUOTE]

Depending on your country there should be plenty on ebay made by other manufacturers. Don't assume you have to buy an official Arduino. Arduino is open source so there are plenty of manufacturers making identical boards with full support from Arduino.

[url]http://www.ebay.co.uk/itm/Sintron-Mega-2560-Starter-Kit-LCD-Servo-Motor-Sensor-for-Arduino-AVR-Learner-/171504782547?hash=item27ee7b4cd3:g:fA8AAOSw1x1UQNnT[/url]

I only ever use third party boards as they are much cheaper and have never failed on me yet. They are not ripping Arduino off as Arduino have deliberately allowed anyone to make clones of their boards to help spread the technology and make it affordable.


Here's one that ships worldwide from china, I often import direct from there as most components you use are made there anyway.

[url]http://www.ebay.com/itm/NEW-RFID-Master-Kit-with-MEGA-2560-Motor-Relay-LCD-Servo-for-Arduino-AVR-Starter-/121586882088?hash=item1c4f249628:g:JvEAAOSwMmBV3GvB[/url]

Shop around until you find one that comes with stuff that interests you.

[COLOR="silver"][SIZE=1]- - - Updated - - -[/SIZE][/COLOR]

When buying third party a good rule is to ignore stuff that is pretending to be official... so if it says "Arduino" on the board with a fake logo its a knock-off and is kind of stealing from Arduino's brand (although it may still work just as well). Look at the boards that are honest about being made by another manufacturer. I've used a lot of Funduino boards, they are great. Edited by Mulbin
Link to comment
Share on other sites

@Mulbin hey the first link is actually very interesting, I would be tempted to buy it even though it costs half the money I have right now.
I should give myself a few minutes to think about it before an impulsive purchase at a very bad time :sticktongue:

EDIT: nah Edited by Fluburtur
Link to comment
Share on other sites

  • 2 weeks later...

So, I just ditched the cheap toggle switches I'd previously bought from China, in favor of these puppies:

85904-007.JPG

All Electronics - Toggle

A little research indicates that it's the Dorman 85904Z (35 amp) switch manufactured primarily for automotive applications. I am really uncertain about All Electronic's listed 50 amps. It really looks like a Dorman 35 amp toggle. Regardless, we don't care how many KC lights this puppy can power on! :sticktongue: We just care to toggle Arduino I/O lines. All Electronics got a supply of these and at quantities over 10 (you'd use at least 15, right?), they're only $3 each. These are surplus, so cheaper than retail. More expensive than the cheap Chinese ones I got... But then again, half those Chinese switches housings wanted to pop open and didn't wanna stay snapped shut. :rolleyes:

Also, those doorman switches, they seem to be available on Amazon right now for a little bit more than All Electronics has them. Even if they run out in surplus, it looks like they are available from a number of auto parts retailers. Just search for "dorman toggle switch", and you should find them.

Anyone with eyeballs should notice that these have a metallic colored wedge shaped tab lever for a toggle... I suspect this switch is the CLOSEST I will get to an Apollo "looking" toggle switch, PERIOD! The lever is actually plastic, with a "chrome" finish. I ordered a couple extras, and I might play with a triangular file to see if I can easily groove these to look even more like Apollo switches. I can just hit them up with some silver paint to fill in the new grooves. If it's a real pain, I'll skip it. If it's not so bad, I might mod them all! Expect laziness to dictate the result of this experiment as "meh, good enough". The wedge is longer than the Apollo switches were, but I won't complain if none of you guys do! :wink:

I also ordered some $0.50 14 segment alphanumeric green LED displays. I'm going to use them to display "m", "Km", "Gm", etc after the displays that actually display distances. I think i can crate ∆v on them as well, for the readout that will sit beneath the navball, and with 3 of the displays, m/S above the navball (unless I just find one of those thin rectangular LEDs and mount it diagonally for the "/", or I do "m.S", using the decimal as a separator). I'll post pictures of the finished DSKY display board when they show up and I solder them in. Unfortunately, to get them that cheap, I had to settle with common anode, so they are NOT compatible with the MAX7219 LED driver chips... but that's okay. I have over 9000 33 volt zener diodes on a reel... I need to use them for... something... :confused: An Arduino will never generate a voltage over 5 volts, so I can never, EVER possibly reverse bias those zeners passed their breakdown voltage. In other words, they may as well technically be plain old signal diodes at Arduino voltage levels. I will use a technique called diode steering to control the LED segments. It's kinda like making a ROM lookup table using discrete diodes. I can then control it with a few binary values outputted from the Arduino. This actually WOULD be a good use for shift registers. 4 bits can easily cover states on any display for m, Km, Mm, Gm, Tm, Pm, Em, Zm, Ym, ∆v, and m.S given that only one state exits at a time. The above is 11 states, plus 0000 being off. It also leaves me room to add 4 more states, If I need them. Inclination and time will be in fixed displays, and already have their own custom indication (the Time to: X indicator and the flat topped LED masked in the center to form a ° symbol).

All Electronics ALSO had impedance matching transformers that appear to have windings almost perfectly suited for driving the FDAI synchro inputs! Best of all, they were only $1 each! WIN! I'll probably still have to look for a larger transformer to power the reference, but that shouldn't be hard to find. I just need to find a 5-6 volt AC brick.

The last thing isn't so much a part of my Kerbal controller, but I wanted to share anyway, It will sit between the joysticks, after all! :cool:

I got my plates that I had custom made for my keyboard! Blue anodized aluminum. I disassembled every single keyswitch (Gateron MX Blue) and lubricated all the sliding parts, but I also experimented with dyes, and dyed all the top keyswitch housings blue, to match the Danger Zone blue and grey theme. A lot better than a bunch of milky white switches exposed between blue and blue grey key caps and the blue anodized plate. I REALLY LOVE how it turned out, and I can't wait till February, when the actual key caps will arrive!

Keyboard75_AllSwitches.jpg

**EDIT**

Looks like Dorman does make a 50 Amp rated version of the switch, but couldn't find a currently listed part number... If they discontinued it, in favor of only doing the 35 Amp switch, it would then make plenty sense why the 50 Amp switch just hit the surplus market.

Edited by richfiles
Link to comment
Share on other sites

@Mulbin

Since you are the OP on this thread, can you check it over and make sure this has a hardware tag... I think that is something that can be added, but I've not seen a way to do that myself, so maybe it's something the OP has to add themselves, under the new system??? I dunno. I just miss the old, easy to search hardware label these posts used to have... Having to manually add a tag back in still doesn't help find all the other hardware threads, sadly.

Stupid Fallout 4 and it's stupidly addictive settlement building... I haven't TOUCHED my controller build since it came out! :rolleyes::sticktongue:
Anyway... Free weekend...

1: Keyboard Matrix
2: FDAI controller
3: DSKY readouts
4: Fallout 4

Hmm, which one will happen... :rolleyes:
Hint... bet on 4, with possibly a hint of 3! :P

On a side note, my package from All Electronics has taken a 3 day detour to Anchorage Alaska... Make that 4 days... Stupid postal service... What they heck are they doing?! :huh:

Edited by richfiles
Link to comment
Share on other sites

  • 2 weeks later...

FINALLY... It showed leaving Alaska after the 4th day, and reaching the local sorting location. Arrived at the local post office. I told them to hold it there, at the local office, and I'd pick it up in person... I wanna examine the package in person before walking out with it... Anyway...

At least I got this done before staying up till 5 AM playing Fallout 4!

KerbalCM_DSKYLEDAlpha.jpg
I REALLY needed to have done this on a bigger PC board. It really did end up far more cobbled together than it deserves to be. It's still not wired either, but it will be, just as soon as I can pull myself away from Fallout 4. :rolleyes:

The new addition is the alphanumeric 14 segment displays in the two top AP and PE rows, and in the last reconfigurable row. As I mentioned in my last post, the low cost alpha displays do have a limit. They are common anode parts, so not compatible with the MAX7219 LED driver chip. Not a problem. I'll use diode steering to select the correct segments, and probably a Binary to Decimal converter chip to decode the input. Honestly, a shift register might be fine as well. Either way ought to work, since it is a 1-of-X display (only one result of a limited set will display at any given time). I could even use 2 lines and a CD4017 as a ring counter to select the unit to display. One line would be an input, and would read the start bit (for indexing). The program would clock the 4017 to step the units, rapidly clocking it 9 times to select a previous unit. Basically, there are SEVERAL ways I can do it. THe CD4017 method works fine for me, cause I already have tubes of the chips, cause I use them for nixie tube clocks. I may still try to go with a simple BCD (if I wanna blow I/O lines, 4 I/O per single unit display pair), or a shift register (requires similar clock counting to serially push a single bit to the right line, but can potentially chain all display pairs on one set of I/O lines. This has the need for the fewest number of I/O lines, but takes more complex programming... Something I've not even touched since initially getting my LEDs first lit back in... I think August.

The MAX7219 board will be a little bit of a nuisance, but not HARD to install. The LED modules I bought have the same pinout as the Chinese ones did, thus meaning they are pin compatible witht he module, but they use wide pins, and have an even wider gap between module, since the modules are physically larger. I think what i will plan on doing, is to solder a single 6 pin header to the PC board and connect it to the traces on one set of 6 pins on the LED module. I'll solder 6 wire wrap wires to the 6 pins not he same side of the other module (cause they will soon be covered by the PC board, and then mount the PC board and solder it to the 6 header pins. Those, unfortunately, will be the only possible direct connections. I'll need to run 18 short wires PER MODULE to connect the LEDs... The cost of using proto-board instead of custom stuff.fortunately for me, the LED modules had nice long pins, and can be easily wire wrapped. I'll need to do that 5 times for the DSKY display panel (30 header pins to solder, 90 little jumper wires to solder... Oh dear, how fun). I'll have to tie power and ground and link the serial connections as well. Once all that is wired, I will get power wires to the indicators and the Time To X display. Most will just get power. A couple, a dedicated I/O line (for simplicity). I only need 2 I/O lines to display time to data. I might actually consider wiring a matrix to the remaining indicators and see if I can run it off an extra module. Not sure.

Ultimately, I am definitely happy with the alpha displays. I particularly like the smaller character size of the units displays in comparison to the number readout. I think it'll look very nice!

Edited by richfiles
Link to comment
Share on other sites

  • 1 month later...

In another thread I mentioned my plans for the tiny color CRT display I found, and got pretty elaborate...
Decided to snip the whole thing short, and put the meat of my ideas here, where it won't hijack someone else's simpit thread. :rolleyes:

 

So, as far as project status goes... Cold weather and the Minutemen... Almost all work on this custom controller project has ground to a near stand still, as all my major wood and metal working tools reside in an unheated barn a town over, and that is far too cold right now to be venturing that far away, for that amount of time, to do that kind of work! 

Fortunately, I can still work on electronics, but cash flow has been slow, so parts are on a trickle supply. I've also been focusing almost all my spare project time on my mechanical keyboard. It'll be only a couple more weeks before the key caps show up, so it's a rush to finish by then. Said cold forced me to saw oak with a hand saw, and file the curves I wanted, with a hand file. Dat oak tho... Hard stuff... Anyway, very excited about finishing that project! It's okay though... I'm really just waiting for 1.1 to launch, and for the mods to catch up on Kerbal stuff again... In the meantime, I'm busy having too much fun playing Fallout 4.

My plan for my CRT is to get one of those cheap little Raspberry Pi Zero boards (the ones that are super cheap). I want to set it up to auto play animations of the IVA and mission control characters (Gene Kerman, etc) at random. If I can make that work, then I'll mount the CRT in portrait mode. It'd be purely aesthetic. Maybe SOMEDAY, it'll be possible to feed it a docking camera video feed to it, somehow. I'm sure the Raspberry Pi can do that, as long as the game has a mod and a means to actually stream the video to another device. Does anything even DO this yet? I know there are IN GAME docking port cameras. Are there ones that can stream the video? For now, I doubt if it'd even have any interactivity, other than a "Coms" switch on the panel that will be able to turn it on or off. Maybe "UHF Coms" could cover switching power to the CRT video section of the panel.

That's one area where I plan to have a number of non game switches to make it feel more "space capsuley". I actually have enough ideas that I don't know if the 25 switches I ordered will be sufficient to cover my requirements anymore. Off the top of my head, I need 10 for Action Groups, unless I go with my nice pushbuttons, and i need 5 for basic flight state controls. I need one for the FDAI (Pro/retro-anti mode switch) and another for selecting stage or total resource display. If I have 2 Coms switches, that leaves me 6 switches to handle power. Not sure if that'll be sufficient. I haven't even considered an SCE to Aux switch! Thinking of mapping that one to "Escape", so it can save my ass and let me revert my telemetry to a previously known state! :D

 

Basically, my idea is that power for the various components of the system will each have unique switches, with their own DC Bus or AC Bus supplies. To turn on the FDAI, for example, I'd need to tun on "AC BUS A" to enable the 400 Hz Sine wave generator that powers it (and provides the reference signal), but I'd also have to turn on a "DC Bus B" to power up the controller for it. "Main Fuel Cell" would be the primary power supply. "DC Bus A" could switch on the main controller circuits. "DC Bus Aux" could power on the 12 volt rail for some of my side projects, like integrated dimmer lighting controls for my display cabinets and desk lighting (yes, they are getting centrally controlled). "AC Bus B" could power up my CRT display. "AC Bus Aux" and "24v Bus Reg" could both trip a relay to power up the Hakko 927 soldering station guts I'm transplanting into the panel to do double service as a desk mounted quick access soldering station, and to supply the 24 volts I need to power up my 4-20mA loop current meters for resource display (4 of my analog meters were super cheap, but require extra circuitry to run). Each switch will enable it's respective function only, though. "24v Bus Reg" and "AC Bus Aux" would physically provide 24 volts to their respective circuits, only, but both would activate the relay that powers up the transformer. That's real simple to do with a couple diodes.

 

As an example, I could have "Main Fuel Cell" and "DC Bus Aux" powered on to run my lighting, and the controller would effectively be off, save for probably a couple panel indicators indicating what's active.

Plugging a soldering iron handle into the front panel and flipping the "AC Bus Aux" switch would power on the soldering station. I'll change the red LED displays of the soldering station to green LEDs, to match the style I'm using elsewhere in the control panel. A small number pad will allow temp settings to be entered, though I may be able to rig up the DSKY to do double duty, if I can get it to selectively interface. It currently does have a number pad, after all, but I'm not sure... I did previously talk about changing the DSKY keypad to KSP centric legends, vs Apollo legends. If I do use the DSKY keypad, I could control the existing soldering station keypad with transistors wired to close each button position, with the Arduino activating specific transistors to match the pressed DSKY keypad Key. Maybe I should double legend the DSKY keypad. Retain the numbers and Apollo stuff, but have secondary KSP specific legends for ease of operation and use. Turning "AC Bus Aux" off, and "24v Bus Reg" on will keep the 24 volt power supply enabled and bring up the resource meters. If I were ever so inclined to play KSP with one hand while soldering with the other... I guess I could flip both switches on and multitask. :confused:

If the "AC Bus A" is off, then that also means the Gyro "OFF" flag will be popped in the FDAI. It's a mechanical flag indicator on the navball that pops out any time the system fails to read the gyros or has a gyro power failure. The "LOC" flag... I think I'll have it pop the "LOC" flag off when the controller powers up, when "DC Bus B" is enabled. For it to function, both flags must go away. If either flag appears, then the unit will not function. I have a Glide Slope flag too, but I have no idea what I'll use it for. Maybe Gs. "GS" for Gs. Pop the flag if I read high Gs.

Edited by richfiles
Link to comment
Share on other sites

  • 4 weeks later...

I have a feeling that the Windows 10 issues might have killed some of the development efforts on these KSP Serial IO based controllers and Simpits. That, or people are just holding their breath for 1.1. I have to admit, between Fallout 4 coming out in November, and the wait for 1.1... I HONESTLY have not really sat down with 1.0.5 at all!

The good news, Is I'm on the final stretch of my mechanical keyboard build. I think once that's officially done with, I'll have one less project and an excuse to get back to my Kerbal controller. I think the end of bad (cold) weather will also help, as I tend to do a lot of my big projects by traveling to my father's place, and working in his barn turned small shop.

I have considered trying to layout a PCB for the FDAI controller. I certainly HAVE copper clad board I can etch one out with. We'll see... Wait, what's that... Preston Garvey needs me to clear out some raiders from... Yeah? Ah, and I see you marked the location on my map for me... Thanks... :rolleyes:

Link to comment
Share on other sites

  • 3 weeks later...

KerbalCM_DeskPanelsKeyboard.jpg
So, I found something while looking for a bottom plate to close up my custom keyboard build... These panels came from 1960s/70s era test equipment... the heart of the Apollo era. They have both a color and a texture that I think feels and looks good, and suits the period well. They are aluminum panels with a laminated and textured plastic layer on the top, and gloss paint on the bottom. They have a rounded front edge. I am now considering using these as my primary controller surface panel. I'll have to trim/bend them to size, and there will be seams, but that's fine. The Apollo panels had seams too, and my seams will be located at the edges where the keyboard notch sits. I also have some mildly curved steel square tube from an old Gamestop PS3 display I disassembled. I might mount that underneath for rigidity, and to put a uniform convex curve to the panel. Haven't decided definitively on that one yet. It would mean the front edge would be very thin, but the thickness would rapidly increase, allowing me more forward clearances for my throttle and my Stage and Abort buttons.

KerbalCM_DeskPanelsEdge.jpg
The small wood piece with the wires hanging out is for a future number pad attachment for my keyboard. I used an Apple MagSafe connector to create magnetically locking side panels. I will be able to slide the keyboard forward, and snap my number pad to it for regular use, and when I want to game, I can snap off the number pad and set it aside, and slide my keyboard into the cutout in the controller where it can comfortably sit during a KSP gaming session. Keyboard still has some wiring and programming left, before it's functional.

KerbalCM_DeskPanelsTexture.jpg
Look at that beautiful texture! It's a little beat up, but I have close to a dozen of these panels, If I'm not mistaken. I'll just pick through them all and grab the nicest two for the horizontal surface. I think I'll use a few more of these vertically for the vertical readout/gauge surface or for the top panels. That will have the benefit of providing me with a nice rounded edge on the top as well. The aluminum is thin enough that I can drill it and use my nibbler tool easily on it. That will make for very custom tailored openings for the various gauges and meters. A touch of grey paint will be used to cover the exposed aluminum underneath, wherever cuts must be made that might be exposed. I can also still do rectangular cutouts and backlight those with plexi and those translucent printable sheets. I'll still need to have it done at a print shop, as my printer is deteriorating. Benefit of having cutouts with plexi behind, Is I can get most of the legends on a few sheets. No huge sheets needed for whole panels. It won't be an Apollo copy, but I think it'll still do, while still keeping a decent look.

And for those curious about the keyboard, Here it is, in all it's glory!
Keyboard76_DangerZone.jpg
Yup! That's a "Danger Zone" key! :cool:

Keyboard76_DangerZoneEnd.jpg
There's the magnetic connector and the embedded magnets in the side trim.

Keyboard75_MagSafeSplit.jpg
The magnetically locking number pad side trim. They make such a lovely snap when they come together! :D

Keyboard75_Matrix.jpg
And here's part of the hand wiring. I decided to hand wire LEDs later on... I still need to finish that. Went old school and made this my first practice in the classic art of wire lacing/looming. I actually used waxed dental floss as my cord. There are only 4 pieces of continuous floss not he entire thing. Once piece is a single short bit at the right shift key to secure a single wire, and two pieces could have been one, but I did a short trial run down by the space bar, just to see if I could do it right. Technically could have been done in 2 pieces! It's really a continuous knotting method. I plan to use the technique inside my kerbal controller, to keep wiring in tight, managed bundles.

Edited by richfiles
Link to comment
Share on other sites

Can someone please tell me what those vertical rolling linear gauges like richfiles had are called? I've sat here for hours searching Google for the most obscure words to describe them. I finally quit when I searched "360 degree analog circular scale rolling linear gauge with a fixed pointer". Without them, I'll have to resort to using split-flap displays, which are cool, but may turn out to be more like playing "London Train Station Sim"...

 

 

Link to comment
Share on other sites

Edgewise_Panel_Meters.JPG
The type of vertical gauges I currently have are called analog edgewise panel meters, or simply edgewise meters for short. Specifically, mine are General Electric 180 (the single pointer meters) and International Instruments 1251 (the dual pointer meter) models. The 180 models tend to cost around $40-80 each, but it you are VERY patient, you might sometimes find a better deal. I got mine for $11 a PAIR! :0.0: The catch, is I have to build a converter circuit to run them with an Arduino, cause the ones I got are not compatible with the 0-5 volt signaling used by an Arduino. Basically, cheap, but more work.

For a MUCH cheaper meter, you can get GE 185 meters. They are half the height of the 180 model (3 vs 6 inches, or 7.5 vs 15 cm), and have a needle instead of an arrow pointer, but can be found cheap, and commonly available in Arduino compatible voltage ranges (0-5 volts). Any analog edgewise meter makes for a GREAT resource readout. They were the documented favored meter by NASA astronauts. They are super easy to read at just a glance.


shuttle_AVVI_sim_600.jpg
If you are referring to the discussion I had a while back about a meter with moving numbers and a needle that stays fixed, then as far as i am aware, that is typically called a tape meter. Google REALLY fails at finding these, cause it assumes you're shopping for tape measures... :rolleyes: I have never** actually seen one. They are incredibly uncommon. I have only encountered them in aerospace instrumentation, and they have been obsolete since the introduction of glass cockpits in the 1990s, thus finding them tends to be quite difficult. I have considered building one from scratch. You can do this in two ways:

1: You can have a single wheel behind a window. Print labels and apply them to the wheel, and drive it with an arduino controlled stepper motor. You'll need some sort of index sensor, or a full encoder to "home" the wheel (find the "0 position").
2: You can have two reels with a "tape" between them. You can drive this with two motors, one motor with gears and belts, or you can have one reel on a spring, and one motor to take up tape from the supply reel or release it back to the sprung supply reel by reversing.

AVVI_in1_600.jpg
As you can see, tape meters are VERY complex. I know exactly how they work, and even I'm reluctant to attempt it. In general, if you're wanting to do a tape meter, the easiest way to do it these days is on an LCD or OLED display. Get a small arduino and a small OLED display and render vertically scrolling numbers and a fixed line to mark the center of the screen. The other problem with tape meters, is the scale tends to be very application specific. With a traditional meter, you just replace the meter "face" and you can have a whole new set of numbers, graticules, and unit legends. With a tape meter, you have to make a durable tape that contains all the relevant numerical data, at the scale you want. Much harder to do.

If I lived near an aviation scrap yard, you bet I'd be digging' through the piles of junk, looking for one of these puppies!

**Never means I've never seen one as instrumentation. I have seen a tape readout tied to a mechanical rotary switch. It read 360° in 5° increments. It was big and clunky... not exactly a mechanism I'd see fit for fine readout. Still have never seen one used in actual instrumentation.

Edited by richfiles
Link to comment
Share on other sites

Thank you so much. I'm brand new to both Arduino and interfacing with a computer, but I understand the theory of all this. An OLED display is the way to go by far, but since we are talking about building gauges you can probably answer this as well. Referring to a single wheel based tape meter or an avionics altimeter, it seems that a servo would not be able to to do consecutive full rotations, but provides feedback that seems necessary for accurate measurement on gauges. Stepper motors have the ability to do multiple full rotations, but lack that feedback back into the system. Even with a reel based tape gauge, you would have to gear it down quite a bit to prevent a servo from needing to rotate more than 360 degrees. Would this be a necessary concern when building actual gauges, or am I off base?

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