Crashpilot1000 wrote:....
@Vertigo: I should do a readme on the failsafe. If the internal Failsafe of Harakiri (not speaking of internal FS settings of your receiver here) is triggered it tries the best to do something healthy with the copter depending on available sensors and their status. If GPS becomes unhealthy and a Baro is present it will center the (virtual) roll / pitch sticks, engage level mode (and magmode to try stabilizing yaw) and do an autolanding (without PH because GPS isn't working..).
Please look into config.c for details on parameters.
Besides having FEATURE_FAILSAFE enabled there are some variables that might be of interest for you:
https://github.com/Crashpilot1000/TestC ... fig.c#L279https://github.com/Crashpilot1000/TestC ... fig.c#L295Code: Select all
cfg.rtl_mnh = 0; // (0 - 200m) Minimal RTL hight in m, 0 disables feature
cfg.rtl_cr = 80; // [10 - 200cm/s] When rtl_mnh is defined this is the climbrate in cm/s
cfg.rtl_mnd = 0; // 0 Disables. Minimal distance for RTL in m, otherwise it will just autoland, prevent Failsafe jump in your face, when arming copter and turning off TX
cfg.gps_rtl_flyaway = 0; // [0 - 100m] 0 Disables. If during RTL the distance increases beyond this value (in meters relative to RTL activation point), something is wrong, autoland
cfg.fs_delay = 10; // in 0.1s (10 = 1sec)
cfg.fs_ofdel = 200; // in 0.1s (200 = 20sec)
cfg.fs_rcthr = 1200; // decent Dfault which should always be below hover throttle for people.
cfg.fs_ddplt = 0; // EXPERIMENTAL Time in sec when FS is engaged after idle on THR/YAW/ROLL/PITCH, 0 disables max 250
cfg.fs_jstph = 0; // Does just PH&Autoland an not RTL, use this in difficult areas with many obstacles to avoid RTL crash into something
cfg.fs_nosnr = 1; // When snr_land is set to 1, it is possible to ignore that on Failsafe, because FS over a tree could turn off copter
Will it fly to the African East coast (as Naza's seem to do), or will it hover, autoland, or something?
Yes, why not, probably pretty places there... Ok serious now. If something goes wrong (like jammed motor in an hexa/octo etc, suddenly mag going crazy, strong unfightable wind etc.) and copter is spiraling away the calculated distance between the homeposition on engaging RTL and the currently gps reported spot distance to home will increase and not decrease like expected. So the RTL is a return to somewhere else for whatever reason. That's where
gps_rtl_flyaway comes into play. Lets say you set gps_rtl_flyaway = 50 (meters).
Failsafe occurs 800m away from the homepoint and RTL is engaged (you or failsafe). Those 800m are calculated and stored for comparison. If on the supposed way home the distance increases beyond your threshold of 50 m (like distance suddenly 850m) it will try PH and autoland. So it will flyaway but not too much.
fs_ddplt is a dead pilot detection in seconds. So if the RX is still receiving healthy but unchanged signals for that period of time (in seconds) dead sticks/internal TX error or a dead pilot is assumed and FS engaged.
fs_jstph is for the people that don't want RTL (even if possible) but just a PH and autoland (flying in the woods or other cluttered areas).
rtl_mnh is the minimal hight in meters BEFORE RTL to avoid trees etc. So copter does PH checks if minimal hight is ok, climbs if necessary (with predefined climbrate rtl_cr) and then does RTL. So if rtl_mnh = 35 (meters, more than enough to avoid trees in my area..) and RTL engaged in 100 m hight, no climbing/descending is done just RTL sequence (autoland).
fs_rcthr is just for the guys that don't have a baro to ensure a smooth autolanding (that value is ignored, if baro is present). Even the cheapest Bosch baro can save your copter a great deal (broken arms, bent motors etc..), so hard to understand why not to have such a simple safety device even if no althold is desired in flight. If it's going down with a baro guided autolanding or just a predefined throttle makes a difference... that difference can be much more expensive than a 4$ BMP breakout board...
rtl_mnd is the minimal distance in meters where a complete RTL sequence with - if defined rtl_mnh - is done. Reason: Failsafe can be just engaged if the copter is airborne. The airbornestatus is assumed after an autostart sequence (like as_trgt = 2 (meters), althold and throttlestick middle -> airjump to 2 meters - don't try this indoors...) or if the esc_nfly throttle is exceeded. So in the worst case you exceeded esc_nfly on the ground and the copter thinks it could be airborne and you have set a minimal RTL hight like rtl_mnh = 35 meters and something goes wrong with your transmitter (you turn it off, or it fails) it will do PH and climb to 35 m and that maybe into your face. So if you set rtl_mnd = 20 meters an RTL sequence in that radius around the homeposition will not be possible, you will have to walk and pick it up. If RTL is triggered (by you or failsafe) beyond that distance, a complete RTL will be done.
What is a Homeposition in Harakiri?
The homeposition is set when Harakiri has a valid set of Lat/Lon GPS coordinates and the copter is armed. So simply watch the red led. It will start to flicker when 5 sats are found and you can count the flickers to know how many sats are seen right now. After a flicker block a pause of 2 seconds is done, then the flickerblock is send again. Example: you see it flicker 2 times and then pause (ca. 2secs) and then flicker again lets say 3 times. You know Harakiri received valid GPS data coming from 6 sats and then having most probably better data from 7 sats etc. If you arm now your homeposition will be taken from these reported values.
Worst case: User: "Fu** that red LED stuff I want to fly" Lifts off with no red led flicker (no sats, no homepos). During flight a FS occurs (user: "Ohh sh*t..") with no homepos -> Autoland (or no baro: fs_rcthr and fs_ofdel). Or during flight 5 sats are reached and copter (obviously) armed - Homepos set somewhere on the flightpath. FS occurs - copter will do "RTH" to that random point of the flight where the homelock was done.
Other example: Copter is sitting in place A with sufficient GPS reception and was armed but then disarmed and carried to place B while still under power and then armed again - liftoff etc.. In this case the last armingpoint (place B) is the homeposition. So armed status will set a homeposition if at least 5 sats are present, disarming will clear the homeposition.
-Sorry for my bumpy English-
Cheers Rob.