Previously, at minimum throttle, the quad would do absolutely no self-leveling

and simply run the motors at constant minthrottle.  This allowed the chance
for the quad to lose control during flight if the throttle was set to minimum,
say, to drop from a high altitude to a lower one.

With this edit, the quad will still self-level at minimum throttle when armed,
allowing for safe decents from altitude.  To prevent motors spinning when
arming/disarming, the yaw input is ignored if the throttle is at minimum and
we're using the sticks to arm/disarm.

Conflicts:
	src/main/flight/mixer.c

added cli command disable_pid_at_min_throttle

(same as previous)
This commit is contained in:
Dominic Clifton 2015-03-09 23:42:18 +01:00
parent 5e3734946e
commit 1b1163da10
3 changed files with 4 additions and 1 deletions

View File

@ -380,6 +380,7 @@ static void resetConf(void)
masterConfig.small_angle = 25;
masterConfig.disable_pid_at_min_throttle = 0;
masterConfig.airplaneConfig.flaps_speed = 0;
masterConfig.airplaneConfig.fixedwing_althold_dir = 1;

View File

@ -65,7 +65,7 @@ typedef struct master_t {
uint8_t disarm_kill_switch; // allow disarm via AUX switch regardless of throttle value
uint8_t auto_disarm_delay; // allow automatically disarming multicopters after auto_disarm_delay seconds of zero throttle. Disabled when 0
uint8_t small_angle;
uint8_t disable_pid_at_min_throttle; // when enabled (nonzero), ignore pids at minimum throttle
uint8_t disable_pid_at_min_throttle; // when enabled (nonzero), ignore pids at minimum throttle
airplaneConfig_t airplaneConfig;

View File

@ -701,6 +701,8 @@ void mixTable(void)
if ((rcData[THROTTLE]) < rxConfig->mincheck) {
if (feature(FEATURE_MOTOR_STOP)) {
motor[i] = escAndServoConfig->mincommand;
} else if (masterConfig.disable_pid_at_min_throttle != 0) {
motor[i] = escAndServoConfig->minthrottle;
}
}
}