ArduPPM mod on 0.9.86 for better failsafe by Augusto Sala _________________________________________________________ The new ArduPPM have a different failsafe functionality. It is meant to override the RX failsafe instead of using it as previous version of ArduPPM did. __________________ | | NEW FEATURES | These are the main improvements: - Possibility to monitor just the throttle signal instead of all of them (for overriding the RX failsafe) - Failsafe only affects throttle, pitch, roll, yaw and flight mode (channel 5). Channels 6, 7 and 8 won't be affected and will mantain the last value. - When in failsafe, the flight mode is changed to flight mode 6 (instead of 4). The throttle, pitch, roll and yaw signals are overwritten with those set as failsafe settings. - When entering failsafe, the values for each channel can reach the failsafe values slowly instead of plain overwrite (for example the throttle can be decreased slowly). The speed is settable. - For throttle there's an option of keeping the last value if the failsafe value is higher than last one. - For pitch, roll and yaw, there's an option of inverting the last value before starting going toward the failsafe values (in this way, the copter could locally invert its direction in the event of TX signal lost) - Some flight modes can be selected to have no failsafe operation from the ArduPPM (for example flight mode 5 could be a failsafe disabled flight mode). In failsafe disabled modes, the last values for throttle, pitch and roll are manteined (VERY DANGEROUS for everything but loiter, RTL or Auto). - Added a strobo functionality on PB5. This light flashes every 1.5 second normally and blinks fast when signal is lost or external alarm is issued from PB4 (useful for battery monitor or other alarms). - Added a buzzer functionality on PB3. This buzzer will beep once every 1.5 seconds until TX signal is found (at bootup) and then will beep fast when signal is lost or external alarm is issued from PB4. PLEASE BE CAREFUL AND TEST EVERYTHING IN MISSION PLANNER BEFORE FLIGHT. TRY TURN ON AND OFF THE TX AND LOOK AT THE RADIO INPUT ON MISSION PLANNER ALSO STARTING FROM DIFFERENT PITCH ROLL YAW THROTTLE AND FLIGHT MODE POSITION. NOT ALL THE OPTIONS HAVE BEEN TESTED SO PLEASE TEST DEEPLY YOUR CONFIGURATION BEFORE HURTING PEOPLE AROUND... And don't use FAILSAFE_KEEPLAST_ZONES_ENABLED unless needed. __________________ | | SETTING EVERYTHING UP | in Encoder-PPM.c you can set the buzzer and strobo (tones, timings, etc). These settings are easy to understand and not critical so won't be commented here. in PPM_Encoder.h you can set the failsafe behaviour: FAILSAFE_CHECKS_THROTTLE_ONLY if defined the failsafe will trigger if the throttle is missing. If not defined (commented out), the failsafe will trigger when all signals are missing (like in previous version). FAILSAFE_ALWAYS_KEEPLAST_CHS1234 If defined disables the failsafe and keeps last values on every channel (very dangerous). If not defined the failsafe will trigger if needed. FAILSAFE_INVERT_CHS124 If defined, channels 1, 2 and 4 (pitch, roll and yaw) will be inverted before entering failsafe (if pitch was 1300 it will be set to 1700) so that the copter can invert its direction and obtain TX signal again (hopefully). If not defined the failsafe will be entered directly. FAILSAFE_SMOOTH_ENABLED If defined the failsafe values for channels 1, 2, 3 and 4 will be reached smoothly. If not defined, the channel values will be overwritten immediately with the failsafe ones. FAILSAFE_KEEPLAST_ZONES_ENABLED If defines, some flight modes can be set to not have failsafe enabled, in this case, the last signals will be kept instead of using the failsafe ones. Please consider that this can be VERY DANGEROUS. If not defined all the flight modes will have failsafe enabled. FAILSAFE_KEEPLAST_ZONE_CH5_MIN This defines the lower signal for channel 5 value to be in the failsafe disabled flight modes. FAILSAFE_KEEPLAST_ZONE_CH5_MAX This defines the high signal for channel 5 value to be in the failsafe disabled flight modes. PPM_THROTTLE_FAILSAFE Defines the throttle to be set during failsafe (in previous version it was 900) PPM_CH5_FAILSAFE Defines which value to set channel 5 when in failsafe mode (please remember that this mode must not be in the failsafe disabled flight modes range). PPM_FAILSAFE_REDUCTION_SHIFT PPM_FAILSAFE_THROTTLE_REDUCTION_SHIFT These define the time needed for failsafe values to be reached on channels 1, 2 and 4 and for throttle (channel 3). PPM_FAILSAFE_THROTTLE_HOLD_IF_LOWER If defined the throttle will be left untouched by the failsafe if the target setting is higher than the current setting PASSTHROUGH_MODE_ENABLED If defined, the channel 8 can trigger passthrough mode (manual commands). This is useful only for planes.