From 4da4736257343b0e882886cad7300ebb09ed3faf Mon Sep 17 00:00:00 2001 From: philsson Date: Tue, 25 Oct 2016 09:17:45 +0200 Subject: [PATCH] Fix for motormix low. Not tested! --- UAV-ControlSystem/src/drivers/motormix.c | 7 +++++++ 1 file changed, 7 insertions(+) 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