I wrote down a napkin sketch of an altitude filter a while back and finally got around to testing it in the simulator. I designed it to improve the sensed altitude of the ardupilot. It is based on a fixed gain observer model and shows very promising results. The idea is to use the "lagless" airspeed sensor to give you a less noisy lagless altitude estimate. Enjoy!
K_alt = -0.01;
avg_aoa = 0.52*(pi/180); //alpha = 0.52 deg on the average
gamma = theta - avg_aoa;
alt_est = alt_est + Vair*sin(gamma)*dt;
alt_error = alt_est - GPS_alt;
alt_est += K_alt*alt_error;
Comments
Thanks for all your help. I have this implemented now on 2.6.3! It's working great.