mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
bring back flying wing w/all configuration options
config version bumped, settings cleared. git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@213 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
b94c13b1c5
commit
70884d69d5
5 changed files with 2850 additions and 2783 deletions
18
src/mixer.c
18
src/mixer.c
|
@ -322,15 +322,17 @@ void mixTable(void)
|
|||
|
||||
case MULTITYPE_FLYING_WING:
|
||||
motor[0] = rcCommand[THROTTLE];
|
||||
if (f.PASSTHRU_MODE) { // do not use sensors for correction, simple 2 channel mixing
|
||||
int p = 0, r = 0;
|
||||
servo[0] = p * (rcData[PITCH] - cfg.midrc) + r * (rcData[ROLL] - cfg.midrc);
|
||||
servo[1] = p * (rcData[PITCH] - cfg.midrc) + r * (rcData[ROLL] - cfg.midrc);
|
||||
} else { // use sensors to correct (gyro only or gyro+acc)
|
||||
int p = 0, r = 0;
|
||||
servo[0] = p * axisPID[PITCH] + r * axisPID[ROLL];
|
||||
servo[1] = p * axisPID[PITCH] + r * axisPID[ROLL];
|
||||
if (f.PASSTHRU_MODE) {
|
||||
// do not use sensors for correction, simple 2 channel mixing
|
||||
servo[0] = cfg.pitch_direction_l * (rcData[PITCH] - cfg.midrc) + cfg.roll_direction_l * (rcData[ROLL] - cfg.midrc);
|
||||
servo[1] = cfg.pitch_direction_r * (rcData[PITCH] - cfg.midrc) + cfg.roll_direction_r * (rcData[ROLL] - cfg.midrc);
|
||||
} else {
|
||||
// use sensors to correct (gyro only or gyro + acc)
|
||||
servo[0] = cfg.pitch_direction_l * axisPID[PITCH] + cfg.roll_direction_l * axisPID[ROLL];
|
||||
servo[1] = cfg.pitch_direction_r * axisPID[PITCH] + cfg.roll_direction_r * axisPID[ROLL];
|
||||
}
|
||||
servo[0] = constrain(servo[0] + cfg.wing_left_mid, cfg.wing_left_min, cfg.wing_left_max);
|
||||
servo[1] = constrain(servo[1] + cfg.wing_right_mid, cfg.wing_right_min, cfg.wing_right_max);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue