Skip to content

Commit

Permalink
Plane: added fast attitude recovery in Q modes
Browse files Browse the repository at this point in the history
when we start the VTOL motor stabilisation with an attitude beyond
normal attitude limits we will reset the thrust angle target to give
faster recovery
  • Loading branch information
tridge committed Oct 6, 2024
1 parent cc65fb4 commit 2ab01b4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ArduPlane/quadplane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,18 @@ void QuadPlane::motors_output(bool run_rate_controller)
if (now - last_att_control_ms > 100) {
// relax if have been inactive
relax_attitude_control();
/*
when starting the motors apply a limit to the target
thrust angle to allow us to rapidly recover from an
upset attitude.
We add 10% past our limit so we don't trigger this
recovery code too often for normal fixed wing flight
*/
const float angle_limit_cd = MAX(plane.aparm.roll_limit*100, aparm.angle_max)*1.1;
const bool needed_limiting = attitude_control->limit_target_thrust_angle(angle_limit_cd);
if (needed_limiting) {
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "Fast attitude recovery");
}
}
// run low level rate controllers that only require IMU data and set loop time
const float last_loop_time_s = AP::scheduler().get_last_loop_time_s();
Expand Down

0 comments on commit 2ab01b4

Please sign in to comment.