Shop OBEX P1 Docs P2 Docs Learn Events
Hardware-in-the-loop simulation questions — Parallax Forums

Hardware-in-the-loop simulation questions

velociostrichvelociostrich Posts: 40
edited 2009-11-17 03:29 in General Discussion
I have been working on an autonomous plane project of sorts, powered by the
BASIC Stamp, and I have encountered a small problem (not mentioning the others
I posted questions about previously).

Thus far, I have almost completed the schematics, PCB layouts, and source
code, but I would like a means of testing my autopilot without actually having
it fly the plane. I can easily have FlightGear, an open-source flight
simulator, generate NMEA GPS strings and send them to my autopilot, but as for
having my autopilot control FlightGear in turn, well, I found nothing.
Granted, I could exploit the open-source nature of FlightGear and allow
bi-directional serial communication or something along those lines, but
instead, I chose to modify a gamepad such that it could be connected to
my autopilot, and in turn, connected to a PC running FlightGear.

This I have decided to do with a digital potentiometer hooked up to where
the analog stick potentiometers currently are -- the only problem is that I
do rather enjoy playing games with my gamepad, and though they are not
terribly expensive at about $20, I would prefer not to make any permanent
modifications that would prevent me from using it normally.

I figure that I could easily use a dip switch to switch between autopilot
(digital potentiometer) and manual input, but they're a tad large for the
amount of space I have. Does anyone know of some kind of IC switch that I
could use, with four separate circuits (at least)?

That, and does anyone know of a good digital potentiometer with at least
four outputs?

Comments

  • velociostrichvelociostrich Posts: 40
    edited 2009-10-21 21:00
    No one?
  • FranklinFranklin Posts: 4,747
    edited 2009-10-21 21:59
    Apparently not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • stamptrolstamptrol Posts: 1,731
    edited 2009-10-22 00:10
    If you don't mind using an "oldie but a goodie" chip, try a CD4066 quad bilateral switch. 4 circuits, both directions, individually controlled.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • metron9metron9 Posts: 1,100
    edited 2009-10-22 06:03
    What resistance values does the controller have now, it might be nice to have the switch automatically switch auto back to manual when you move the controller and have a single momentary contact button to switch to auto.I have used the cat5113 100 tap series increment decrement signals set the resistance. they come in 1k and up to 100k flavors.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • velociostrichvelociostrich Posts: 40
    edited 2009-11-17 03:29
    Strangely, I didn't receive e-mails for any of these replies, hence my not replying. I must not have checked the "notify" button.

    Anyway, the potentiometers are 5k and there's four of them. I could make do with only three by sacrificing aileron control (which my model plane doesn't have), but I've already gone through the trouble of soldering wires to the gamepad board as I thought it might be nice to have in the future. Plus, I don't think they make digital potentiometers with three circuits, anyhow.

    I looked on Digi-Key, and they don't seem to have any four-circuit digital potentiometers that are also 5k, and they don't seem to have really anything at all in a DIP package, which I find far easier to solder. That leaves various surface-mount ICs which I could use, leaving only the question of communication protocol. I have a BASIC Stamp 2p set aside for my autopilot, so I guess I could use I2C, but I really don't know anything about that or SPI. In other words, which is better that would also work on the BS2p?

    As for the whole switching part, I think I'll just go for a five-position dip-switch -- one for cutting power to the existing potentiometers (which might not be necessary; I haven't really thought that part out), and the other four for switching between manual- and autopilot-control of each input (i.e., ailerons, elevator, rudder, throttle).
Sign In or Register to comment.