ArduPilot failsafe RTL in case of out of RC range

Hello,My new board has arrived (thank you Chris) and is working fine. I am an FPV flyer at the first place and automatic RTL mode is so tempting for me... Arduilot doesnt want to cooperate with my Corona RP8D1 in case of loosing RC signal. I added two little friends to the wire mess inside my small FPV platform.This is one of them:

First one is added between IN CTRL of ArduPilot and RC Rx. Second one between CPD4 RMT and Rx. This way I am not afraid of loosing the airplane during long runs.I think most of todays RC transmitters would benefit from such setup.
E-mail me when people leave their comments –

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

Join diydrones


  • Today I managed to make a video with FCO2 (sorry for poor qality) with a few attempts of RTL. All went smooth. I have to change max16_throttle from 2100 to 2300 and AP climbed to required alt.

  • Thank you Chris, thank you Jordi!
    And now all I can say is my ArduPilot with failsafes work great! Today I lowered max and min heading PIDs from 35 to 22, reversed yaw and voila! Too much heading min/max was responsible for GPS not getting stable readings (the plane was zig-zaging trying to obtain continous GPS info). Now with the winds around 5 m/s my trainer is RTLing (heh - new word) very time I switch off my RC tx or set auto mode.

    One thing is waiting to be fine tuned - I want my plane to climb every time to 50m after swithing to auto mode. I applied a routine:
    test3=middle_thr+PID_altitude(50, (alt-launch_altitude));//Will mantain 50 meters altitude cruise when in auto mode
    With this AP stays on initial altitude at best or lower the alt constantly. I think that AP doesnt use max throttle to climb. Should I change:
    #define max16_throttle 2100
    to 2500 for instance? As far as I understand larger number means more throttle applied?
  • I got EM411 which is almost the same unit as EM406. After reflashing the code once more I did some ground testing today (driving the car). They brought different results than the ones before reflashing. This should be confirmed early next week when I will have possibility to test it in the air once more.
  • 3D Robotics
    If you've downloaded the right code and the Arduino IDE says it's loaded correctly, it should work.

    Aside from those funky in-line failsafes, is there anything non-standard in your setup?> You've using the EM406?
  • Actually it went against the wind all the time... The code is woking to the point of turning the nose of the plane to NE and then locking the direction (going not straight line but there was clearly visible rudder corrections: left 1second, rudder right 1 second and again). I will try to make video next time.

    Would it be possible that some parts of the code was not loaded via FTDI cable properly? The previous version of uploaded code was the test one.
    Best regards
  • This is very strange. I have made several tests today and 50 meters altitude works fine but it seems that the code is in test mode (flying NE all the time).

    The model after switching MUX to autonomous mode every time head up to NE and followed this direction.

    I checked it several times and my uploaded code looks like this:

    test=middle_yaw+PID_heading(compass_error(wp_bearing, course)); //Central Position + PID(compass_error(desired course, current course)).
    //test=middle_yaw+PID_heading(compass_error(45, course)); // Special mode to just fly NE. Comment out line above and use this one to test autopilot

    So it should return home. I have set very big heading PIDs (42 actually). Would it be the reason?
  • Thank you Jordi. Your eplanation sheds a light to my programming problems :)
  • Developer
    Hello Michael:

    "There is "test3" variable that I believe is responsible for that:
    test3=middle_thr+PID_altitude(wp_alt[current_wp], (alt-launch_altitude));"

    Lets explained it well:

    PID_altitude(wp_alt[current_wp], (alt-launch_altitude));

    alt=the current altitude coming from the GPS
    launch_altitude=The altitude from the launch pad, example if your launch altitude is 50 and your are in 60, your actual altitude from the launch pad equals to 10mts, this is nice when you fly in different places....

    wp_alt[current_wp] = The altitude you want to maintain depending in the waypoint you are, in this case if you want to set the altitude always to 50, you need to do this:

    test3=middle_thr+PID_altitude(50, (alt-launch_altitude));

    It will try to maintain 50 meters high relative to the launch pad altitude...
  • Would someone guide me to the right direction regarding 1.0 code? If I understand corectly (I am not a programmer of any kind) in RTL mode the plane will keep the initial altitude - the one when RTL mode was switched on?
    How to obtain such effect: When I switch RTL mode on I would like the model to climb to an altitude of 50m while turning with the rudder to launch point. So when the initial alt is 23 meters it needs to climb 27 meters.

    There is "test3" variable that I believe is responsible for that:
    test3=middle_thr+PID_altitude(wp_alt[current_wp], (alt-launch_altitude));

    Should I change it to:
    test3=middle_thr+PID_altitude(wp_alt[current_wp], (alt+50));

    Thank you in advance
  • I am in Poland but right now I dont want to change all my equipment to 900 MHz. I have lots of Tx and 4channel diversity for 2.4GHz. Thats why I want to stick to 35 and 2.4 MHz
This reply was deleted.