diff --git a/UAV-ControlSystem/src/drivers/motormix.c b/UAV-ControlSystem/src/drivers/motormix.c index 3bf211f..ea8dd04 100644 --- a/UAV-ControlSystem/src/drivers/motormix.c +++ b/UAV-ControlSystem/src/drivers/motormix.c @@ -199,6 +199,10 @@ void mix() PidProfile[PID_ID_GYRO].PID_Out[YAW] * mixerUAV[i].yaw * ((mixerConfig.yaw_reverse_direction) ? -1 : 1); } + for (int i = 0; i < MOTOR_COUNT; i++) + // Find the minimum and maximum motor output + if (RPY_Mix[i] < RPY_Mix_Min) RPY_Mix_Min = RPY_Mix[i]; + /* Mixer Low Scale - Scaling output around low throttle */ if (flags_IsSet_ID(systemFlags_mixerlowscale_id)) @@ -219,6 +223,9 @@ void mix() } } + /* Recalculating RPY_Mix_Min */ + RPY_Mix_Min = throttleMid; + for (int i = 0; i < MOTOR_COUNT; i++) { // Find the minimum and maximum motor output