diff --git a/libraries/AP_Motors/AP_MotorsMulticopter.cpp b/libraries/AP_Motors/AP_MotorsMulticopter.cpp index e4a75ef330..cece6dd8cd 100644 --- a/libraries/AP_Motors/AP_MotorsMulticopter.cpp +++ b/libraries/AP_Motors/AP_MotorsMulticopter.cpp @@ -733,8 +733,8 @@ void AP_MotorsMulticopter::output_motor_mask(float thrust, uint16_t mask, float _motor_mask_override = mask; for (uint8_t i = 0; i < AP_MOTORS_MAX_NUM_MOTORS; i++) { - if (motor_enabled[i]) { - if ((mask & (1U << i)) && armed() && get_interlock()) { + if (motor_enabled[i] && (mask & (1U << i)) != 0) { + if (armed() && get_interlock()) { /* apply rudder mixing differential thrust copter frame roll is plane frame yaw as this only @@ -742,11 +742,12 @@ void AP_MotorsMulticopter::output_motor_mask(float thrust, uint16_t mask, float */ float diff_thrust = get_roll_factor(i) * rudder_dt * 0.5f; set_actuator_with_slew(_actuator[i], thrust + diff_thrust); - int16_t pwm_output = pwm_min + pwm_range * _actuator[i]; - rc_write(i, pwm_output); } else { - rc_write(i, pwm_min); + // zero throttle + _actuator[i] = 0.0; } + int16_t pwm_output = pwm_min + pwm_range * _actuator[i]; + rc_write(i, pwm_output); } } } diff --git a/libraries/AP_Motors/AP_MotorsTri.cpp b/libraries/AP_Motors/AP_MotorsTri.cpp index c109ade093..ab566944ae 100644 --- a/libraries/AP_Motors/AP_MotorsTri.cpp +++ b/libraries/AP_Motors/AP_MotorsTri.cpp @@ -92,7 +92,7 @@ void AP_MotorsTri::output_to_motors() // sends minimum values out to the motors for (uint8_t i = 0; i < AP_MOTORS_MAX_NUM_MOTORS; i++) { if (motor_enabled_mask(i)) { - rc_write(AP_MOTORS_MOT_1+i, output_to_pwm(0)); + _actuator[AP_MOTORS_MOT_1+i] = 0; } } rc_write_angle(AP_MOTORS_CH_TRI_YAW, 0);