From dac7f45326aacb2678c56ed380ffebe9a5523c93 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 21 Sep 2016 11:46:15 +1000 Subject: [PATCH] Plane: fixed use of multicopter mix_max we need a settable mix_max for some vehicles --- ArduPlane/quadplane.cpp | 15 ++++++++++++--- ArduPlane/quadplane.h | 1 + 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ArduPlane/quadplane.cpp b/ArduPlane/quadplane.cpp index b41714ed78..1b041c01a8 100644 --- a/ArduPlane/quadplane.cpp +++ b/ArduPlane/quadplane.cpp @@ -1006,7 +1006,7 @@ void QuadPlane::update_transition(void) } assisted_flight = true; hold_hover(assist_climb_rate_cms()); - attitude_control->rate_controller_run(); + run_rate_controller(); motors_output(); last_throttle = motors->get_throttle(); break; @@ -1027,7 +1027,7 @@ void QuadPlane::update_transition(void) } assisted_flight = true; hold_stabilize(throttle_scaled); - attitude_control->rate_controller_run(); + run_rate_controller(); motors_output(); break; } @@ -1041,6 +1041,15 @@ void QuadPlane::update_transition(void) } } +/* + run multicopter rate controller + */ +void QuadPlane::run_rate_controller(void) +{ + attitude_control->set_throttle_mix_max(); + attitude_control->rate_controller_run(); +} + /* update motor output for quadplane */ @@ -1067,7 +1076,7 @@ void QuadPlane::update(void) assisted_flight = false; // run low level rate controllers - attitude_control->rate_controller_run(); + run_rate_controller(); // output to motors motors_output(); diff --git a/ArduPlane/quadplane.h b/ArduPlane/quadplane.h index 05103f65e4..07bb47b91a 100644 --- a/ArduPlane/quadplane.h +++ b/ArduPlane/quadplane.h @@ -168,6 +168,7 @@ private: void init_hover(void); void control_hover(void); + void run_rate_controller(void); void init_loiter(void); void init_land(void);