Switching between Waypoint and RTL modes in ArduPilot 2.0

One of the cool things about ArduPilot 2.0 is that it supports three in-flight modes: manual, autonomous (waypoint) and autonomous (return-to-launch/RTL). These are selected with your autopilot-enable toggle switch on your transmitter. If you have a three-position switch the middle position defaults to waypoint mode. The up position is RTL mode.

You can also use a proportional dial for this channel; half-way turned is the middle position. Or, if you have a mixing Tx, you can mix two toggles switches to create an in-between state on the enable channel.

When the autopilot is in waypoint mode, the yellow Mode LED will be on. It is off in manual and RTL modes.

If you want to modify these defaults, you can change them in the software. I've posted on how to do that here.

Views: 390


Moderator
Comment by Brian on March 19, 2009 at 12:49pm
My radio (DX6) does not have a 3 position switch, but it does have seperate high/low toggles for the gear and flap switches. I think you could configure the high/low off the flaps or gear switch to toggle between the on/off/rtl settings. Since I'm waiting for my new board to arrive, (toasted eprom on first board) I've not had the opportunity to test it out. If anyone has a similar configuration and knows please reply.
Comment by Hessel on April 13, 2009 at 2:50am
I modified the ATTINY code a little bit in order to facilitate mode switching through analog channel 4. I made this modification because my transmitter only has four channels. Cannel four was unused because my EZ* has no ailrons.

I used Ladyada's USBtinyISP programmer to load the code to the ATTINY (I had to replace R4 and R7 with jumpers, as described with the solder instructions of the USBtinyISP) using WinAVR and AvrStudio.

The disadvantage is that there is no feedback on the ground on the current mode.

N.B. This is experimental code and has not been air tested yet, use at your own risk!

Extra global var below state definition:

unsigned char latch = 0; // state lock switch; ulocked


Modification of channel readout:

// code modified to allow switchting modes using analog channel
if(pulse_length < 1200) //If the PWM pulse is less than 1200 ms
{
if (latch == 0) // if state unlocked
{
latch = 1; // lock state
if (state == 2) // if in auto mode 01
state = 0; // return to manual
else
state = 2; // engage auto mode 01
}
}
else
{
if(pulse_length > 1800) //if the PWM pulse is greater than 1800 ms
{
if (latch == 0) // if state unlocked
{
latch = 1; // lock state
if (state == 1) // if in auto mode 02
state = 0; // return to manual
else
state = 1; // engage auto mode 02
}
}
else//If not the value is between 1200 and 1800 ms, so
latch = 0; //state unlocked
}

Comment by Hessel on April 28, 2009 at 12:31pm
I changed the initialization line to meet the "start in manual mode" requirement by the calibration procedure.

unsigned char latch = 1; // state lock switch; locked manual mode on power-on
Comment by Hessel on April 30, 2009 at 2:15am
N.B. Above based on v1.5

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service