Shop OBEX P1 Docs P2 Docs Learn Events
Custom Space Simulator System for KSP using the Prop - Page 3 — Parallax Forums

Custom Space Simulator System for KSP using the Prop

13

Comments

  • xanaduxanadu Posts: 3,347
    edited 2015-11-03 20:20
    This thread is in the wrong category. It should be under "Freakin Awesome".

    Nice work Keith! I look forward to seeing what you do. I may start my EVA controller over the xmas holiday, it would be sweet to see your driver in OBEX by then... no pressure :)
  • Thanks Xanadu.

    I feel like a kid on christmas. I can flip a switch and stability control works for my rocket. So cool.

    Well I'm in the phase where I need to start planning what to buy.

    First off, I decided this first one is going to be styled Apollo like rather than SpaceX like.

    What type of switches? How many?
    What type of 7/16 segments? How many?
    Rotary Encoders? Need some sort of twisting snappy knobs.
    Some POTs and stuff for interior light dimming.
    Backlit buttons? How many?
    How to make the ship vibrate?
    Ship sounds
    "Radio" communications to Kerbal Command and Control
    Joysticks
    Throttles

    How to deal with the tons of IO. One great suggestion was I2C.
    How to interface to the segment displays?

    A really big one. How to delay any audio and signals between control and space to simulate the light minutes between planets. I really don't know how to do this yet and I suspect it won't only involve the Prop.

    Tons and tons of work to do. I have a feeling I'm going to be shadowing Erco for a while. He always seems to find the odd deal, and I'll be needing them.

    I'd love to hear any recommendations you guys have.

    Thanks for the help so far guys. I'd still be stressing out over copying memory and making Floats work etc if it weren't for these great forums.
  • I will start compiling a parts list. I'd also like to take a look at the IVA view in the game, I remember it being on the bland side, but it might be good for some ideas.
  • I do need to find a way to bind the view with the ship so as it rotates, so does the view. Hopefully there is a mod for that.

    Currently looking at some different things:

    Capture.PNG

    It would be really cool to be able to make a working version of this:

    p54.jpg
  • Did you see this pdf in that KSP forum thread?

    APOLLO EXPERIENCE REPORT -
    CREW STATION INTEGRATION
    Volume II - Crew Station Displays and Controls
  • RDL2004 wrote: »
    Did you see this pdf in that KSP forum thread?

    APOLLO EXPERIENCE REPORT -
    CREW STATION INTEGRATION
    Volume II - Crew Station Displays and Controls

    Awesome. Thanks for sharing that.

    Here is part of my collection:

    amazon.com/Apollo-Guidance-Computer-Architecture-Operation/dp/1441908765

    In other news:

    S150.jpg

    Maybe I could use that for rovers? Probably expensive though, but looks awesome.

    Stay, on, target. Don't get distracted with cool HIDs.
  • I really hope I can feasibly make some tape indicators like in that same forum page. That's so cool.

    First thing's first. Figure out what chips I need for all these IO.
  • Do you guys know of a good way to simulate the light-minutes between the space ship and control?

    One problem is while in low orbit the delay can be ignored, then at the moon delay needs to be a couple seconds, but then at another planet the delay will be minutes.

    So finding an affordable item could be difficult, since most probably have a setting and you can't really just change it on the fly.

    It needs to delay the video and audio (it can be more than one item doing this). Also for video, it needs to appear as a monitor to the computer so I can use multi-screen, and basically I'm delaying 1 of 3 screens.

    In addition I need to find a way to delay data from the space ship. So this will likely have to be done somehow with the Prop one way or another. It's getting about 1KB/s of data that it would need to store for up to say 10 minutes before streaming it to control.

    Know of hardware/software that will do some of these things?
  • Why do you want to do this? KSP doesn't really have any communications between spacecraft and Mission Control. There are some instances where "data" is transmitted, but in game, it's instant.
  • It would work out nice for the multiplayer plugin :)

    You'd need to know the distance to Kerbin, if the serial plugin doesn't do that it sounds like you'd have to modify it.

    This can record and playback - http://www.aplusinc.com.tw/exec/product.php?lg=E&mod=show&cid=43&pid=aPR33A3

  • the reason is because there will be kids on earth/kerbin trying to talk to the kerbalnauts. i want them to see first hand the difficulty in talking particulalrry during Duna descent for example. sorry for typing on a small touch screen
  • Well, between Kerbin/Mun/Minmus the delay is going to be so small that it won't be that noticeable. I guess it could be worth doing for longer distances, at least for demonstration purposes.
  • kwinnkwinn Posts: 8,697
    Keith, I found this old block diagram of the multiplexing method that may give you an idea of what I proposed. Three chips, eight transistors, and four prop pins (three at slightly lower speed) to drive 64 leds (or 8 7 segment displays) and read 64 switches.

    If you decide to go this route I will pull the code and actual schematics from my backup drive when I get home.
  • kwinnkwinn Posts: 8,697
    Oops. Forgot attachment
  • Thanks Kwinn.

    So one thing I'm noticing is in game there are a ton of different ship types you can make. For example there is a drill, which won't be on all my ships.

    So I think I want to have the main controls that will always be there, then some modular sections that fit in a standardized panel area.

    So I have a few questions about this:

    If I have multiple instances of the same I2C chip, will they have different addresses?

    Can I make a program in the Prop, hopefully in SPIN, that can do something to the effect of:
    
    PUB DoStuff
    
      repeat
        MainControls
        if drill_i2c_found == 1
          DrillControls
        if asteroidgrabber_i2c_found == 1
          AsteroidGrabberControls
    
    

    I hope to not have to always change my code, but just snap in modular control panels and have the SPIN code detect it, then do stuff, or ignore that stuff if the particular panel is not found.
  • kwinnkwinn Posts: 8,697
    Thanks Kwinn.

    So one thing I'm noticing is in game there are a ton of different ship types you can make. For example there is a drill, which won't be on all my ships.

    So I think I want to have the main controls that will always be there, then some modular sections that fit in a standardized panel area.

    So I have a few questions about this:

    If I have multiple instances of the same I2C chip, will they have different addresses?

    Can I make a program in the Prop, hopefully in SPIN, that can do something to the effect of:
    
    PUB DoStuff
    
      repeat
        MainControls
        if drill_i2c_found == 1
          DrillControls
        if asteroidgrabber_i2c_found == 1
          AsteroidGrabberControls
    
    

    I hope to not have to always change my code, but just snap in modular control panels and have the SPIN code detect it, then do stuff, or ignore that stuff if the particular panel is not found.

    All the I2C chips I have come across had two or three pins that let you set the address, so you can have multiple addresses. I think you should be able to detect if a chip/panel is present by writing and reading back data from the I2C register that interfaces that panel. If the chip has 3 address pins you could have 8 panels on one bus.

    If the panels have a lot of leds and switches or require some smarts I would be tempted to use a propeller.
  • Yeah I was wondering whether I'd need Props on each panel. Strikes me as overkill.

    I just tackled one of my last big issues. I need to be able to move the Navball horizontally and vertically to make this work. Luckily I found an existing mod and managed to alter the code so I can move it in X and Y.

    It's looking like I'm going to be modifying that KSPIO mod after all. I can change what data I get, and I hope to be able to control more items than the game normally allows with their limited hotkeys.

    Anyway in the mean time I'm still going to be looking in to hardware. There is a local company that sells industrial joysticks so I'm going to have to check them out in the near future. Should be easy to interface to the Prop.

    I've seen some that are USB and others with 3 wires per axis.
  • kwinnkwinn Posts: 8,697
    edited 2015-11-06 14:15
    Yeah I was wondering whether I'd need Props on each panel. Strikes me as overkill.
    ...............
    I suppose it is overkill when you compare what it is doing to what it is capable of. OTOH when you look at the cost vs the benefit it makes a lot of sense for all but the simplest applications. On top of replacing a few chips it can also simplify the design by making it more modular, and the hardware/software is familiar so there is no digging through data sheets trying to figure out how to use other interface chips.

    You really need to decide on the display and switch hardware and number of panels you want before deciding on how to control/communicate with it.
    Anyway in the mean time I'm still going to be looking in to hardware. There is a local company that sells industrial joysticks so I'm going to have to check them out in the near future. Should be easy to interface to the Prop.

    I've seen some that are USB and others with 3 wires per axis.

    Those 3 wire ones could be connected directly to the potentiometers, or could be serial data out. Most of the ones I have seen were connected to potentiometers.
  • That is a good point, having it all be Props would probably save a ton of time.

    I think they're Pots as well.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-11-07 03:39
    Edit: Sorry, I forgot to add a link to the joystick. Here it is!

    I saw this joystick in a KSP project and I thought it was really cool.

    6651531430034322186.jpg

    Here's a picture of the joystick prior to mounting it to the PVC cap. The Dr. Pepper can is for scale.

    6758911430034212523.jpg

    I used a MCP3208 to read the three pots.

    Here's a link to a video showing the joystick being used with my CNC project. The joystick isn't shown until 2:43.

    I'm not sure if they've been mentioned yet in this thread but 74HC165 chips are really simple to use and can be chained together to read lots of inputs. Edit: I see kwinn used them in his schematic.

    I used a combination of '165 and '595 chips to read a 16 button pad. I had to shield the wires since I was using a small NTSC display right next to the keypad.

    Here are some other input/display gizmos I like.

    Ws2812Dials150121a.jpg

    The encoders have RGB LEDs (purchased from SparkFun) and the rings are Adafruit's 16 pixel rings.
    790 x 469 - 144K
  • kwinnkwinn Posts: 8,697
    Great use of those 16 pixel rings.
  • kwinnkwinn Posts: 8,697
    edited 2015-11-07 03:15
    That is a good point, having it all be Props would probably save a ton of time.

    I think they're Pots as well.

    Using a propeller or other chips is a bit of a trade off. I used a propeller to "read" the main status display and send the data to a remote status panel that consisted of TPIC's and transistor drivers for the leds and 7 segment displays. No point in having a prop on the receiving end since the led drivers were needed anyway. The only other chips used were '172/3 line drivers/receivers.
  • Duane you have no idea how much I want to make a wacky control panel with a bunch of those LEDs etc. I have to keep forcing myself not to do it almost to the point of having to use my left hand to pull away my right.

    That's basically the type of joystick I'm going for. Turns out there is an industrial supply company nearby (I'm in the Engineering suburbs of Detroit) so I'm going to check them out. Hopefully I can dink around with stuff to see what I like.

    Thanks for the input on that and the interfacing.

    I'm still working on how to get 100 buttons to work in a game that only supports 20 (made up numbers).

    I finally managed to switch Autopilot modes with my PPDB.

    My biggest and best step will be to communicate with MechJeb or KOS using Apollo style stuff. So my ultimate goal is to make an Apollo DSKY and have that tell MechJeb or KOS what to do.

    This is all very hacky still. I've yet to find good API documentation, so I find a bunch of other mods and make a frankenstein. It is Halloween after all.

    Thanks again for the input guys.
  • Duane you have no idea how much I want to make a wacky control panel with a bunch of those LEDs etc. I have to keep forcing myself not to do it almost to the point of having to use my left hand to pull away my right.

    I saw your first post to this thread but then I forced myself not to follow it. I'm having a really hard time not joining in the fun.

    BTW, I added a link to the joystick. I forgot to add it earlier. It was a very reasonable price ($24). Industrial joysticks can be very expensive. Of course the quality of an industrial joystick will be vastly superior to the one I have.

    EEVBlogs did an episode of taking apart a nice joystick. I thought it was very interesting.

    I found the video.



    Speaking of nice joysticks, the one Parallax sells is really nice. It has all sorts of ways it can be adjusted. I was very impressed by its quality.
  • I've got 2 of those, but they strike me as the wrong thing to use for the main controls (Parallax Gimbals). Plus I think I need 3 Axis items. One for general rotation and the other for RCS translation.

    Looking forward to this video. Have one thing to settle tonight (some bitwise stuff to control extra buttons etc in game) before I can watch it.

    Hope you can join in. This can be done small scale. One guy built one in a shoebox. Mine is going to be a ridiculous full sized space module. I'm going to have to design it in 2 pieces so it can fit through doors etc.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-11-07 08:39
    I've got 2 of those, but they strike me as the wrong thing to use for the main controls (Parallax Gimbals).

    Agreed. The joysticks Parallax sells aren't a good match for this project, I just thought I'd add "a message from our sponsors."

    (At first I thought you had two of the joysticks seen in the EEVBlog still.)
    Plus I think I need 3 Axis items. One for general rotation and the other for RCS translation.

    In case it's not obvious, the $24 one I mentioned in my first post to this thread is a 3-axis controller. The seller refers to it as a "4-axis" joystick. Apparently the button is an axis.

    [off-topic]
    There used to be 3-axis joysticks on commercially available RC transmitters. I think they were more common in helicopter transmitters than other sorts of transmitters. Curtis Youngblood Jr. (pro model helicopter pilot) is a big fan of 3-axis joysticks. Here's a video showing the transmitter and his super cool quadcopter (it should start at 3:06.

  • xanaduxanadu Posts: 3,347
    edited 2015-11-07 18:59
    Couldn't resist. What do you think of the flag?


    1801 x 685 - 787K
  • haha that's awesome.
  • So to make it work the way I'm hoping it looks like I need to be able to write text files (saved with extension .ks) to the windows hard drive.

    I know there are ways to write text files to SD in SPIN, but is there a way to read and write in Windows?

    If not I might have to get a bit more creative here. One option could be hacking an SD card to fit to Prop pins while in a PC and use Batch files to copy the ks scripts to the correct folder. Sounds like a terrible idea though.

    Another might involve a Teensy.

    Know of a good way to tackle this problem? Just getting this to decide on what to write based on simple (non keyboard) key-presses will be tough enough. Hopefully there's an easy way I've yet to find to write simple files to windows.
  • I went without KOS and basically found out how it works in the game and wrote my own Autopilot (still a lot more AutoPilot modes to code in). I can adjust attitude, throttle, and individual parts such as solar panels etc using the PPDB.

    As far as I know I'm past all the hard but necessary parts. The rest will mostly be tedious, with some probable snags, then some really hard perks to add in later.

    It's basically time for me to start coding in the DSKY, so I'll be needing a lot of buttons etc. Also interchangeable panels is in the near future.

    Kwinn, do you have the code for running the multiple switches/LEDs?
Sign In or Register to comment.