From bfec265d2e874142d4f62a8b9c6756282a98e8aa Mon Sep 17 00:00:00 2001 From: nerdCopter <56646290+nerdCopter@users.noreply.github.com> Date: Sat, 15 Jun 2024 11:00:32 -0500 Subject: [PATCH] 3D-mode fix --- src/main/flight/mixer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index 66d510837a..ad4aa6c9b4 100644 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -865,13 +865,13 @@ void mixThingsUp(const float scaledAxisPidRoll, const float scaledAxisPidPitch, float controllerMixMin = 0, controllerMixMax = 0; for (int i = 0; i < motorCount; i++) { - float yawMixVal = controllerMix3DModeSign * scaledAxisPidYaw * currentMixer[i].yaw; + float yawMixVal = scaledAxisPidYaw * currentMixer[i].yaw; if (yawMixVal > yawMixMax) { yawMixMax = yawMixVal; } else if (yawMixVal < yawMixMin) { yawMixMin = yawMixVal; } - yawMix[i] = yawMixVal; + yawMix[i] = yawMixVal * controllerMix3DModeSign; float rollPitchMixVal = scaledAxisPidRoll * currentMixer[i].roll + scaledAxisPidPitch * currentMixer[i].pitch; if (rollPitchMixVal > rollPitchMixMax) { @@ -879,15 +879,15 @@ void mixThingsUp(const float scaledAxisPidRoll, const float scaledAxisPidPitch, } else if (rollPitchMixVal < rollPitchMixMin) { rollPitchMixMin = rollPitchMixVal; } - rollPitchMix[i] = rollPitchMixVal; + rollPitchMix[i] = rollPitchMixVal * controllerMix3DModeSign; - float controllerMixVal = controllerMix3DModeSign * (rollPitchMixVal + yawMixVal); + float controllerMixVal = (rollPitchMixVal + yawMixVal); if (controllerMixVal > controllerMixMax) { controllerMixMax = controllerMixVal; } else if (controllerMixVal < controllerMixMin) { controllerMixMin = controllerMixVal; } - controllerMix[i] = controllerMixVal; + controllerMix[i] = controllerMixVal * controllerMix3DModeSign; } controllerMixRange = controllerMixMax - controllerMixMin; // measures how much the controller is trying to compensate