mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 13:43:35 +08:00
Fix takeoff overshoot (issue #319).
This commit is contained in:
committed by
Lorenz Meier
parent
18293875b7
commit
91d2ad17b7
@@ -1230,7 +1230,8 @@ MulticopterPositionControl::control_non_manual(float dt)
|
||||
} else {
|
||||
// copter has reached our takeoff speed. split the thrust setpoint up
|
||||
// into an integral part and into a P part
|
||||
_thrust_int(2) = _takeoff_thrust_sp - _params.vel_p(2) * fabsf(_vel(2));
|
||||
// remembering to remove _params.thr_hover which is added later as a feed-forward in control_position.
|
||||
_thrust_int(2) = _takeoff_thrust_sp - _params.vel_p(2) * fabsf(_vel(2)) - _params.thr_hover;
|
||||
_thrust_int(2) = -math::constrain(_thrust_int(2), _params.thr_min, _params.thr_max);
|
||||
_vel_sp_prev(2) = -_params.tko_speed;
|
||||
_takeoff_jumped = true;
|
||||
|
||||
Reference in New Issue
Block a user