
As long as you keep servo middle at 1500 and max at 1000/2000 everything is fine, the problem is how MWII/Baseflight work when you change one / more of these settings: One side will be constrained and the other reflection wont be reached... This is a no-go for serious planes where you need asymetric servo reflection for flaps, ailerons and so forth
For better understanding see the illustration, left the current problem and right the result of the change.
Actually it is very easy to improve! With this changes MWII will work proportional and respect the max & min servo reflection. So a full extension of your stick will result in the max/min servo reflection.
When you think twice, you realize that now only min / mid / max is of interest, the servo rates dont make sense any more

The code changes simple!
Airplane mod, replace one line ~1336
Code: Select all
for(i=3;i<7;i++) {
// servo[i] = ((int32_t)conf.servoConf[i].rate * servo[i])/100L; // servo rates
// propotional Servo patch
// here we honor the servo rate and reversing! if rate is 100 we get full propotional path
int32_t path = (int32_t)conf.servoConf[i].rate * servo[i];
// depending on the side the left path to max/min is different so taking that in account for propotional path
servo[i] = (path*(path>=0 ? conf.servoConf[i].max-conf.servoConf[i].middle:conf.servoConf[i].middle-conf.servoConf[i].min))/(100L*500L);
servo[i] += get_middle(i);
}
Fixed Wing mod, replace ~1231 - this should be probably aligned to 2.4
Code: Select all
for (i=3; i<=4; i++) {
if (f.PASSTHRU_MODE) { // do not use sensors for correction, simple 2 channel mixing
servo[i] = (SERVODIR(i,1) * rcCommand[PITCH])*PITCHRATE + (SERVODIR(i,2) * rcCommand[ROLL])*ROLLRATE;
} else { // use sensors to correct (gyro only or gyro+acc according to aux1/aux2 configuration
servo[i] = (SERVODIR(i,1) * axisPID[PITCH])*PITCHRATE + (SERVODIR(i,2) * axisPID[ROLL])*ROLLRATE;
}
// depending on the side the left path to max/min is different so taking that in account for propotional path
servo[i] = (int32_t) servo[i]*(servo[i]>=0 ? conf.servoConf[i].max-conf.servoConf[i].middle:conf.servoConf[i].middle-conf.servoConf[i].min)/500;
servo[i] += get_middle(i);
}
Just for noting that, this code is currently being flown by several guys in our club with great success. I'm flying this already since months, and have no drawback. A sentence regarding the calculation time - I counted 37 more instructions in sum and the round trip could be a bit longer but I was unable to see any differences than before. So I can confirm it not realy time consuming.
I really hope this or something similar would go into master for the future.
Comments welcome!
Sam