Suggestion for Althold adjustment with sticks

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Suggestion for Althold adjustment with sticks

Post by pm1 »

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) {
...

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Suggestion for Althold adjustment with sticks

Post by Alexinparis »

Hi,

ok, I think it makes sense in a mode where alt change is smooth (vario)

pm1
Posts: 136
Joined: Sun Jan 22, 2012 7:26 pm

Re: Suggestion for Althold adjustment with sticks

Post by pm1 »

Sorry,
I didn't get the point somehow. How is this piece of code related to vario?

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Suggestion for Althold adjustment with sticks

Post by Alexinparis »

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.

Post Reply