Hardware-in-the-loop simulation questions
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?
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk
http://www.siskconsult.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
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).