Plane: fix quadplane integrator to always clip to at least 0 to throttle_max

This commit is contained in:
Tom Pittenger 2016-06-03 23:39:20 -07:00
parent 82763ec8a9
commit b9cee76bbe

View File

@ -1715,7 +1715,7 @@ int8_t QuadPlane::forward_throttle_pct(void)
vel_forward.integrator += fwd_vel_error * deltat * vel_forward.gain * 100;
// constrain to throttle range. This allows for reverse throttle if configured
vel_forward.integrator = constrain_float(vel_forward.integrator, plane.aparm.throttle_min, plane.aparm.throttle_max);
vel_forward.integrator = constrain_float(vel_forward.integrator, MIN(0,plane.aparm.throttle_min), plane.aparm.throttle_max);
vel_forward.last_pct = vel_forward.integrator;