Hallo, schau Dir mal die mal die Failsafe Anleitung für den APM an. Hier ist eigentlich alles schon festgelegt, wenn der Wert für das Gas unter 975 PWM fällt, geht der Copter erst in den Loiter Modus und danach automatisch in RTL.
Arduplane Failsafe Documentation (APM 2.x)
Throttle Failsafe
How it works. Your RC transmitter outputs a PWM signal that is captured by your receiver and relayed to the APM. Each channel on your transmitter has a PWM range usually between 1100 - 1900 with 1500 being its neutral position. When you start your radio calibration on the mission planner, all your values will be at 1500. By moving your sticks, knobs and switches you will set your PWM range for each channel. APM monitors your throttle channel and if notices a drop lower than THR_FS_VALUE (Default is 950) it will go into failsafe mode.
RC transmitters usually have a default range for each channel that goes from -100% to 100%, however most transmitters will allow you to extend this to -150% and 150% respectively. In the default setup, bringing your throttle to -100% will translate to a value close to 1100 and bringing it to -150% will translate to a value closer to 900. What we want to achieve is to let your receiver know that the throttle can go as low as -150% but keep the APM control range between -100% and 100%. Meaning that when flying, our throttle values will range between 1100 - 1900. But if we lose RC range, the receiver if set up properly, will drop to the lowest known throttle value of ~900. This value falls bellow the THR_FS_VALUE and will trigger the APM to go into failsafe mode.
First the APM will go into short failsafe (FS_SHORT_ACTN, 0=Disabled, 1=Enabled) when it detects loss of signal for more than 1.5 sec. The default setting for short failsafe is Circle mode. If the loss of signal is longer than 20 sec the APM will go into long failsafe (FS_LONG_ACTN, 0=Disabled, 1=Enabled). The default setting for long failsafe is RTL (Return to Launch).
Ext. Range Normal Range Ext. Range
|-----------------|-----------------|-----------------|
-150% -100% 100% 150%
|_________________|
|
Failsafe
Setup.
1. Enable throttle failsafe by setting THR_FS_Value to 1 (0=Disabled, 1=Enabled).
2. First turn on your transmitter and enable the throttle range to extend past -100%, we want to extend the throttle range past its low threshold.
3. Once this is done, bind with your receiver. This will let your receiver know the lowest possible value for your throttle channel.
4. Next revert the first change you made to the transmitter to limit the throttle to the original range.
5. Do the radio calibration using the Mission Planner.
6. Once the radio calibration is completed, drop the throttle on your transmitter and read what PWM value is being outputted to the mission planner on that channel.
7. Turn off the transmitter. You should see the value drop significantly. This will be the PWM value relayed to the APM in the event RC link was lost during flight.
8. Make sure THR_FS_VALUE is an adequate number to trigger the failsafe function on the APM.
9. Make sure FS_SHORT_ACTN and FS_LONG_ACTN are both enabled (set to 1).
10. Connect on the mission planner with your RC transmitter on. Verify on the bottom right corner of the HUD that you are “flying” in a non auto mode (Manual, Stabilize, FBW are ok).
11. Turn off your transmitter. After 1.5 sec the flight mode should switch to Circle. After 20 sec the flight mode should switch to RTL. If you observe this behavior, your failsafe function has been set up correctly.