Difference between revisions of "Failsafe"

From PaparazziUAV
Jump to navigation Jump to search
(forgot gps lost)
Line 28: Line 28:
   </section>
   </section>
In this example it is set to 1.5 times the '''max_dist_from_home''' (attribute set in your flight plan).
In this example it is set to 1.5 times the '''max_dist_from_home''' (attribute set in your flight plan).
== GPS signal lost ==
In this mode, the autopilot uses the failsafe roll, pitch and throttle settings defined in the airframe file.


== Lost datalink communication ==
== Lost datalink communication ==

Revision as of 14:33, 22 October 2010

Paparazzi has several built-in failsafe features.

The exceptions feature of the flight-plans allow for very flexible failsafe features.

Home mode

The HOME mode is a failsafe mode where the standard navigation is suspended and the aircraft flies a circle around the HOME waypoint at a safe altitude (security_height attribute in your flight-plan). This mode is triggered on different events.

Far from HOME

Home mode is triggered if the distance to the HOME waypoint is greater than a threshold (max_dist_from_home attribute) set in the fight-plan (displayed as a circle on the GCS map).

RC uplink failure

Home mode is triggered if RC uplink is lost in MANUAL or AUTO 1 modes.

Kill mode

In this mode the throttle is killed (also the initial mode). You can enter this mode manually with the kill button (with confirmation). Kill mode is also triggered in the following cases:

Catastrophic battery level

If the battery level goes under the catastrophic low level (defined in the airframe file)

Way too far from HOME

The plane goes into kill mode if it is too far away from the HOME waypoint. You can configure this KILL_MODE_DISTANCE in your airframe file:

 <section name="MISC">
   ...
   <define name="KILL_MODE_DISTANCE" value="(1.5*MAX_DIST_FROM_HOME)"/>
   ...
 </section>

In this example it is set to 1.5 times the max_dist_from_home (attribute set in your flight plan).

GPS signal lost

In this mode, the autopilot uses the failsafe roll, pitch and throttle settings defined in the airframe file.

Lost datalink communication

This is done via the a flight-plan exception, e.g. go to the Standby block after 30 seconds:

 <exceptions>
   ...
   <exception cond="datalink_time > 30"  deroute="Standby"/>
 </exceptions>

You also need to include the datalink.h header file in the header section of your flight plan.

Outside mission boundary

Also use exceptions and/or function calls for this.

For an example see EMAV2009_safety.xml in the directory conf/flight_plans is an example of a safety procedure that can be included in other flight-plans. It uses two sectors defined in EMAV2009_data.xml, a smaller Green "soft boundary" and a hard boundary defined by the Red sector.

<procedure>
  <exceptions>
    <exception cond="Or(! InsideGreen(GetPosX(), GetPosY()), GetPosAlt() > ground_alt + 150)" deroute="Center"/>
  </exceptions>

  <blocks>
    <block name="Center" pre_call="if (!InsideRed(GetPosX(), GetPosY())) NavKillThrottle();">
      <circle wp="_CENTER" radius="DEFAULT_CIRCLE_RADIUS"/>
    </block>
  </blocks>

</procedure>

The first exception deroutes the plane to the Center block below it, if it is outside the Green sector or higher than 150m over ground. While in the Center block the statement in the pre_call function gets evaluated each time, if the plane is now also outside of the Red sector throttle is killed.