If you use the MultiWii in an airplane, you may need to change the PID attenuation not via the THROTTLE stick position but via an AUX channel so you can choose in a dynamic way the PID attenuation for the different flight conditions (dive, high speed pass, slow fly, strong wind and so on) regardless the throttle stick position
Here the original MWii code for TPA (file MultiWii_2_1)
Code:
#define BREAKPOINT 1500
// PITCH & ROLL only dynamic PID adjustemnt, depending on throttle value
if (rcData[THROTTLE]<BREAKPOINT) {
prop2 = 100;
} else {
if (rcData[THROTTLE]<2000) {
prop2 = 100 - (uint16_t)conf.dynThrPID*(rcData[THROTTLE]-BREAKPOINT)/(2000-BREAKPOINT);
} else {
prop2 = 100 - conf.dynThrPID;
}
}
Following my Dynamic PID Attenuation mod (file MultiWii_2_1)
Code:
#define BREAKPOINT 1050
// PITCH & ROLL only dynamic PID adjustemnt, depending on AUX4 value
if (rcData[AUX4]<BREAKPOINT) {
prop2 = 100;
} else {
if (rcData[AUX4]<2000) {
prop2 = 100 - map(rcData[AUX4],1050,2000,50,100);
} else {
prop2 = 100 - conf.dynThrPID;
}
}
*** ATTENTION ***
The code has been tested on the bench only!
Try at your own risk