Either the climb rate is wrong or I need explanations on it

Ok, I got it guys. It comes from the EKF !

AltHold is not the problem, the CRt and Alt estimations from the EKF are.

For some reason, using the GPS makes the EKF worse. So I used EK2_GPS_TYPE=1 to only use 2D GPS and not use the altitude from the GPS (I’ll fix the GPS fusion later).

I switched EK2_ALT_M_NSE=3 to EK2_ALT_M_NSE=1, so the EKF uses more of the baro and it was nice (IDK why it was on 3, the default is 1). Using 0.5 created some clear and fast oscillations, using 5 worsen the phenomenon described all above.

The strange thing is that I’ve also lowered EK2_ACC_P_NSE=0.6 to EK2_ACC_P_NSE=0.1, thus making the accelerometer more important. This improved the EKF further.

So I increased the importance of both the accelero and baro (without GPS), and now the EKF is better ? ¯_(ツ)_/¯ that’s weird but I’m not a pro in Kalman Filter.

Anyway, after those tweaks, CRt is much closer to d(Alt)/dt. You can see that in NKF1/ VD & dPD. VD is the vertical speed from the EKF (this is also CRt) and dPD is the derivative of the altitude from the EKF (this is also d(Alt)/dt ).

This is VD & dPD with the latest settings, they are close to each other :

This is from one of the first log/flight, VD is awfully wrong :

My question is then : Why not use dPD in AltHold for the climb rate instead of VD ? Because as seen here a difference between the two fucks with the PID.

I also don’t know why such a huge difference between VP and dPD was present, maybe it’s only me but it could lead to poor AltHold performances for many other.

1 Like