3D Robotics
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.
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • N.B. Above based on v1.5
  • 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
  • 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
    }

  • Moderator
    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.
This reply was deleted.