Plane: reset roll/pitch integrators for APM_Control in takeoff

when airspeed is below airspeed minimum. This is consistent with the
previous controllers

Pair-Programmed-With: Paul Riseborough <p_riseborough@live.com.au>
This commit is contained in:
Andrew Tridgell 2013-05-05 22:03:13 +10:00
parent 46c6aa8a9a
commit 0e6a64fc14

View File

@ -1048,7 +1048,6 @@ static void update_current_flight_mode(void)
nav_pitch_cd = constrain_int32(nav_pitch_cd, 500, takeoff_pitch_cd); nav_pitch_cd = constrain_int32(nav_pitch_cd, 500, takeoff_pitch_cd);
} }
if (g.att_controller == ATT_CONTROL_PID) {
float aspeed; float aspeed;
if (ahrs.airspeed_estimate(&aspeed)) { if (ahrs.airspeed_estimate(&aspeed)) {
// don't use a pitch/roll integrators during takeoff if we are // don't use a pitch/roll integrators during takeoff if we are
@ -1056,7 +1055,8 @@ static void update_current_flight_mode(void)
if (aspeed < g.flybywire_airspeed_min) { if (aspeed < g.flybywire_airspeed_min) {
g.pidServoPitch.reset_I(); g.pidServoPitch.reset_I();
g.pidServoRoll.reset_I(); g.pidServoRoll.reset_I();
} g.pitchController.reset_I();
g.rollController.reset_I();
} }
} }