Today it was the perfect day to test the new airspeed and altitude control loops. The wind was very gusty and with an average wind speed of 10 m/s, normally I would avoided flying my EasyStar in a day like that but what a better way to test the sensors and control loops! I had a few flights the day before in more mild conditions and had a chance to tune the altimeter and airspeed gains (see previous post for implementation details). The GPS only vertical control loops do a very good job when the wind is not too gusty, usually in days like today I would have to modify my airframe configuration to force the throttle to higher values than usual. With the airspeed sensor this is no longer needed, it will keep the airspeed in changing wind or attitude (e.g. climbing).
The following plots is from today’s flight. I was flying an oval against and with the wind, wind speed was about 10 m/s. Altitude hold was done with the barometric altitude sensor.
For comparison the GPS altittude is also shown. Aggressive climb mode is still not enabled. The EagleTree altimeter is read at 20Hz and the existing Kalman filter is used to calculate the rate of climb. What I found interesting was that the pitch and altitude gains had to be increased considerably when the barometric altitude was used instead of the GPS. I am not sure why, it might have something to do with the update rate or the slightly modified Kalman filter parameters. After some tuning, I am fairly satisfied with the altitude hold (+/- 2m from setpoint for most of the flight), especially considering the effects of the high wind speeds.
The airspeed hold was the main reason I started this project and the benefits are obvious in this example. The throttle adjusts to keep the airspeed close to the setpoint. This time the airspeed deviation from the setpoint was higher than the last flight, the gains were the same so I believe the winds gusts might be to blame. I will try to see if I can improve the gains in the next flight.
The new airspeed and altitude control loops will come in handy in the next DIY Drones T3 contest! Since endurance and not speed is the next objective, optimized throttle control will be essential.
I have a total of about 10 flights with the modified code and the EagleTree sensors with no major problems. I will be submitting my changes to SVN in the next few days. I still need to look into the following (hopefully in the next few weeks):
- Test EagleTree sensors in 3rd party mode
- Revert to GPS measurements if any of the sensors fail


