Bugfix for 3D inverted flight using a tricopter. The yaw servo now should reverse when the throttle is lower than the midpoint.

This commit is contained in:
Ben Hitchcock 2015-03-03 11:47:35 +08:00
parent 266fe45b7e
commit 97fae94053
1 changed files with 7 additions and 1 deletions

View File

@ -546,6 +546,12 @@ static void airplaneMixer(void)
void mixTable(void)
{
uint32_t i;
int8_t yawDirection3D = 1;
// Reverse yaw servo when inverted in 3D mode
if (feature(FEATURE_3D) && (rcData[THROTTLE] < rxConfig->midrc)) {
yawDirection3D = -1;
}
if (motorCount > 3) {
// prevent "yaw jump" during yaw correction
@ -572,7 +578,7 @@ void mixTable(void)
break;
case MIXER_TRI:
servo[5] = (servoDirection(5, 1) * axisPID[YAW]) + determineServoMiddleOrForwardFromChannel(5); // REAR
servo[5] = (servoDirection(5, 1) * axisPID[YAW] * yawDirection3D) + determineServoMiddleOrForwardFromChannel(5); // REAR
break;
case MIXER_GIMBAL: