@ -196,7 +196,7 @@ void AP_MotorsCoax::output_armed_stabilizing()
@@ -196,7 +196,7 @@ void AP_MotorsCoax::output_armed_stabilizing()
limit . throttle_upper = true ;
}
_throttle_ave _max = constrain_float ( _throttle_ave _max , throttle_thrust , _throttle_thrust_max ) ;
_throttle_avg _max = constrain_float ( _throttle_avg _max , throttle_thrust , _throttle_thrust_max ) ;
float rp_thrust_max = MAX ( fabsf ( roll_thrust ) , fabsf ( pitch_thrust ) ) ;
@ -219,15 +219,15 @@ void AP_MotorsCoax::output_armed_stabilizing()
@@ -219,15 +219,15 @@ void AP_MotorsCoax::output_armed_stabilizing()
// calculate the minimum thrust that doesn't limit the roll, pitch and yaw forces
thrust_min_rpy = MAX ( fabsf ( rp_scale * rp_thrust_max ) , fabsf ( yaw_thrust ) ) ;
thr_adj = throttle_thrust - _throttle_ave _max ;
if ( thr_adj < ( thrust_min_rpy - _throttle_ave _max ) ) {
thr_adj = throttle_thrust - _throttle_avg _max ;
if ( thr_adj < ( thrust_min_rpy - _throttle_avg _max ) ) {
// Throttle can't be reduced to the desired level because this would mean roll or pitch control
// would not be able to reach the desired level because of lack of thrust.
thr_adj = MIN ( thrust_min_rpy , _throttle_ave_max ) - _throttle_ave _max ;
thr_adj = MIN ( thrust_min_rpy , _throttle_avg_max ) - _throttle_avg _max ;
}
// calculate the throttle setting for the lift fan
thrust_out = _throttle_ave _max + thr_adj ;
thrust_out = _throttle_avg _max + thr_adj ;
if ( fabsf ( yaw_thrust ) > thrust_out ) {
yaw_thrust = constrain_float ( yaw_thrust , - thrust_out , thrust_out ) ;