mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 14:25:20 +03:00
Initial implementation of Runaway Takeoff Prevention (anti-taz)
Detects runaway pidSum values on takeoff and auto-disarms to prevent the "Tasmanian Devil" caused by incorrect props, wrong motor order/direction, incorrect flight controller orientation, etc. After a successful takeoff and normal flight is detected the feature is disabled for the remainder of the battery.
This commit is contained in:
parent
52c629751c
commit
a32b05c284
12 changed files with 222 additions and 3 deletions
|
@ -69,9 +69,21 @@ PG_REGISTER_WITH_RESET_TEMPLATE(pidConfig_t, pidConfig, PG_PID_CONFIG, 1);
|
|||
#else
|
||||
#define PID_PROCESS_DENOM_DEFAULT 2
|
||||
#endif
|
||||
|
||||
#ifdef USE_RUNAWAY_TAKEOFF
|
||||
PG_RESET_TEMPLATE(pidConfig_t, pidConfig,
|
||||
.pid_process_denom = PID_PROCESS_DENOM_DEFAULT,
|
||||
.runaway_takeoff_prevention = true,
|
||||
.runaway_takeoff_threshold = 60, // corresponds to a pidSum value of 60% (raw 600) in the blackbox viewer
|
||||
.runaway_takeoff_activate_delay = 75, // 75ms delay before activation (pidSum above threshold time)
|
||||
.runaway_takeoff_deactivate_throttle = 25, // throttle level % needed to accumulate deactivation time
|
||||
.runaway_takeoff_deactivate_delay = 500 // Accumulated time (in milliseconds) before deactivation in successful takeoff
|
||||
);
|
||||
#else
|
||||
PG_RESET_TEMPLATE(pidConfig_t, pidConfig,
|
||||
.pid_process_denom = PID_PROCESS_DENOM_DEFAULT
|
||||
);
|
||||
#endif
|
||||
|
||||
PG_REGISTER_ARRAY_WITH_RESET_FN(pidProfile_t, MAX_PROFILE_COUNT, pidProfiles, PG_PID_PROFILE, 2);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue