Browse Source

mpc: leave room for altitude error control during descent and descent

Since the same parameter is used to generate the trajectory and to
saturate the controller, there is no additional space for the output of
the position controller once it is filled with the feedforward, letting
the altitude grow uncontrolled.
master
bresch 3 years ago committed by Mathieu Bresciani
parent
commit
4fc7348582
  1. 5
      src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp

5
src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp

@ -830,6 +830,11 @@ void FlightTaskAuto::_updateTrajConstraints() @@ -830,6 +830,11 @@ void FlightTaskAuto::_updateTrajConstraints()
_position_smoothing.setMaxAccelerationZ(_param_mpc_acc_down_max.get());
_position_smoothing.setMaxVelocityZ(_param_mpc_z_v_auto_dn.get());
}
// Stretch the constraints of the velocity controller to leave some room for an additional
// correction required by the altitude/vertical position controller
_constraints.speed_down = math::max(_constraints.speed_down, 1.2f * _param_mpc_z_v_auto_dn.get());;
_constraints.speed_up = math::max(_constraints.speed_up, 1.2f * _param_mpc_z_v_auto_up.get());;
}
bool FlightTaskAuto::_highEnoughForLandingGear()

Loading…
Cancel
Save