Step 4: Setting Up the Plane
I added the system to my Swift AT (Aileron Trainer). I really like this glider. Doesn't take too much wind to fly and is capable of a variety of manuevers. Flying with a glider is great if you got the wind, you can fly for hours (no motor/ engine no need to come down and refuel).
Our new board set up will be very similar to our orignial PID; we will be running two PID loops back forth very quickly to control pitch and roll with the elevator and ailerons. This should allow ample testing time in good wind.
I am using Airtronics radio equipment with a 6 channel transmitter/receiver. I used the fifth channel on the radio (a landing gear toggle) to set the autopilot on & off from the transmitter. Connect to a servo wire from the receiver and connect it to a digital input to measure the the pulse length of the two positions (toggle on/toggle off). Use the pulseIn() function to do so. Once you have a value from the two states pick one to indicate off and one for on. When the arduino reads and ON signal it should send out a digital HIGH to flip a relays or trigger some transistors. I used relays because I did not want my signal passing through a transistor (a descision I would later regret).
You can see the schematics I drew for wiring up a circuit that would throw one servo from the radio to the arduino. There are two: one for transistors and one for a radio. Note the positon of PNP and NPN transistors. When the arduino output wire is low the servo signal defaults to the radio, when it is written high it switches to the board. Likewise, on the relay circuit, the normally closed terminal is connected to the radio, and the normally open to the arduino.
you can find my functions for for the autopilot_engage at the bottom of this step
Here is a video showing the arduino receiving radio input and throwing an led, later used to arm the autopilot: