Hi,
the code for manual adjustment of AltHold resets ErrorAltitudeI. The height is then maintained only by P term, which means, that the initial throttle position has to be set very exact, otherwise the copter drops or climbs significantly (a high P rate is *really* not good if you own a BMP085). I have commented out that line. For me this works much better then...
MultiWii.cpp:
...
AltHold += AltHoldCorr/512;
AltHoldCorr %= 512;
}
// errorAltitudeI = 0;
isAltHoldChanged = 1;
} else if (isAltHoldChanged) {
...
Suggestion for Althold adjustment with sticks
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Suggestion for Althold adjustment with sticks
Hi,
ok, I think it makes sense in a mode where alt change is smooth (vario)
ok, I think it makes sense in a mode where alt change is smooth (vario)
Re: Suggestion for Althold adjustment with sticks
Sorry,
I didn't get the point somehow. How is this piece of code related to vario?
I didn't get the point somehow. How is this piece of code related to vario?
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: Suggestion for Althold adjustment with sticks
Yes, it is.
Before, the default baro code was based on temporary deactivation of pid control when the throttle is changed.
Resetting I term was useful to start a new pid control condition.
Now, the only mode is vario, and there is no need to reset I term as the pid control is always active.
Before, the default baro code was based on temporary deactivation of pid control when the throttle is changed.
Resetting I term was useful to start a new pid control condition.
Now, the only mode is vario, and there is no need to reset I term as the pid control is always active.