hello,
I found the rate of altitude change in Baro mode a little bit slow.
1.) I found a bug (?), as I tried to improve it:
In IMU.cpp line 1296 the change of AltHold is computed according to the difference of rcCommand[THROTTLE] and
initialThrottleHold. As I understand the code, BaroPID should be also considered:
Code: Select all
if (f.BARO_MODE) {
static uint8_t isAltHoldChanged = 0;
static int16_t AltHoldCorr = 0;
if (abs(rcCommand[THROTTLE]-BaroPID-initialThrottleHold)>ALT_HOLD_THROTTLE_NEUTRAL_ZONE) { //BaroPID correction
// Slowly increase/decrease AltHold proportional to stick movement ( +100 throttle gives ~ +50 cm in 1 second with cycle time about 3-4ms)
AltHoldCorr+= rcCommand[THROTTLE] - BaroPID - initialThrottleHold ; //BaroPID correction
if(abs(AltHoldCorr) > 512) {
AltHold += AltHoldCorr/512;
AltHoldCorr %= 512;
}
isAltHoldChanged = 1;
} else if (isAltHoldChanged) {
AltHold = alt.EstAlt;
isAltHoldChanged = 0;
}
rcCommand[THROTTLE] = initialThrottleHold + BaroPID; // !!! rcCommand[THROTTLE] changed !!!
}
2.) is it safe to change Line 292 in IMU.cpp from
Code: Select all
BaroPID = constrain((conf.pid[PIDALT].P8 * error16 >>7), -150, +150);
to
Code: Select all
BaroPID = constrain((conf.pid[PIDALT].P8 * error16 >>7), -250, +250);
for a faster climb/descent ?
3.) thank you again for the NAV-Version. No problems found so far, during 15 Batteries of test flights. (Three different missions flown with xmas-release.)