Skip to content
Snippets Groups Projects
Commit 1b4ac37e authored by rmackay9's avatar rmackay9
Browse files

AP_MotorsMatrix - fixed stability patch issue in which it would not limit a...

AP_MotorsMatrix - fixed stability patch issue in which it would not limit a motor's output unless an opposite motor had been defined.  This would only have affected Y6 frames.
parent c5f3410a
No related branches found
No related tags found
No related merge requests found
...@@ -146,14 +146,14 @@ void AP_MotorsMatrix::output_armed() ...@@ -146,14 +146,14 @@ void AP_MotorsMatrix::output_armed()
_rc_pitch->pwm_out * _pitch_factor[i] + _rc_pitch->pwm_out * _pitch_factor[i] +
_rc_yaw->pwm_out*_yaw_factor[i]; _rc_yaw->pwm_out*_yaw_factor[i];
} }
// ensure motor is not below the minimum
motor_out[AP_MOTORS_MOT_1] = max(motor_out[AP_MOTORS_MOT_1], out_min);
} }
// stability patch // stability patch
for( i=0; i<AP_MOTORS_MAX_NUM_MOTORS; i++ ) { for( i=0; i<AP_MOTORS_MAX_NUM_MOTORS; i++ ) {
if( motor_enabled[i] && opposite_motor[i] != AP_MOTORS_MATRIX_MOTOR_UNDEFINED && motor_out[i] > out_max ) { if( motor_enabled[i] && motor_out[i] > out_max ) {
motor_out[opposite_motor[i]] -= motor_out[i] - out_max; if( opposite_motor[i] != AP_MOTORS_MATRIX_MOTOR_UNDEFINED ) {
motor_out[opposite_motor[i]] -= motor_out[i] - out_max;
}
motor_out[i] = out_max; motor_out[i] = out_max;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment