Altitude Hold and MPC_Z_P

Hi all,

dealing with my altitude hold problem since I changed to Release 1.5.x I found this entry by @Pturcotte:


based on this post from @LorenzMeier

LPE Feedback
@PKocmoud Can you try to lower the MPC_VEL_P gain significantly and if that does not help, reduce the MPC_POS_P (try both independently)? It looks like your controller is unstable. I’m not sure yet why. But its certainly worth trying.
Using the LOCAL_POSITION_ESTIMATOR I have changed MPC_Z_P from 1.0 to 0.2 and it helped a lot !!! It is in fact perfect now !!!


But any time I set MPC_Z_P to 0.2 it seems to get reset to default 1.0 when board is restarted or when parameters get saved to file.

Is this a “feature” or am I doing wrong anything?

@juliett.papa u may try to change it here:

yes, but this means recompiling. I am not used to this yet :worried:

@metinburak: done compiling, test will follow.

Apart from that, I think this workaround can’t be the default solution. :frowning:

Test has been successful. THNX

AFAIK This is only setting the defaults as well as Min / Max and Precision for each value. The Values should be possible to set independently of this.


Yes, this is my understanding, too.
But lately it seemed, that after rebooting the board the value was set to default. Therefore the default value was adapted by abovementioned workaround.

Actually, now I think it was an issue due to changing the value by WLAN and therefore not storing this value correctly. If I change the value via USB-cable it seems to remain in memory as it’s supposed to do.