Airspeed control is critical when flying sailplanes. You want to fly close to stall but never beyond it, since that will normally cause a tip stall and great loss of energy. How do you teach an autopilot to fly on the edge of stall?
One solution is to teach the autopilot about the aircraft geometry and aerodynamics. First you start with the wing section. From the wing section you can use a simulation tool to generate aerofoil polars (picture above from XFLR5). These polars describe the lift, drag and moment coefficients generated at different airspeeds and flap settings.
From the aircraft position and the amount of corrective pitch movement you need, you can calculate the acceleration you require from the wing. This is known as load. From load, geometry and aircraft mass, the lift coefficient can be calculated.
From lift coefficient and the wing polar you can calculate the required angle of attack for the wing. From the required angle of attack, you can calculate required elevator pitch.
From the wing polars, you know the maximum possible lift coefficient. Now you can avoid increasing angle of attack beyond Cl(max) and avoid stalling. This is only half of stall prevention. The other half is in energy management.
Both when gliding and under power, the aircraft loses energy due to drag. For a glider this determines the descent angle. For a powered aircraft it determines the engine power. By using the estimate of drag coefficient from the wing section polar, the autopilot can set the target climb/descent rate and pitch angle. When power is applied, it adds energy to the system so the estimated climb rate and target pitch increases.
Working in combination with basic estimated climb rate is airspeed error feedback. Airspeed error is converted into meters of potential energy error and added to the target pitch. The combination of target estimate and energy feedback are great for stall prevention.
Document describing airspeed by energy management
If you change flap settings then the wing polar changes. As the flaps are changed, the autopilot has to interpolate between the different wing flap polars. The result is a smooth transition between airspeeds.
This method also automatically re-trims the elevator for different airspeeds. It also automatically does airspeed control fadeout. It also reduces dependency on PID gains. Some optional gains are still required for different flying styles.
One problem with this method is that it relies on knowing the initial wing-elevator incidence. At high airspeeds the aoa is small and sensitivity to change is high. The solution is to have a feedback from the accelerometers comparing to calculated load. This error feeds an integrator which retrims the elevator. The result is an even better trim for low speed flight.
Despite all the stall prevention, my first test flight resulted in terrible tip stall when turning downwind. Adding a little bit of extra airspeed command resulted in lovely smooth turns. When I went back to the estimated airspeed calculation, I had set airspeed setpoint 2m/s too slow.
If this all sounds new, it isn’t. It is simply re-applying the basics that we know about aerodynamics. If you are interested in aerodynamics basics you might start here
The project is based on a branch of MatrixPilot based here:
https://github.com/crashmatt/MP_Aerodyn
The original Matrixpilot project wiki is here:
https://code.google.com/p/gentlenav/
Aerodyn uses the MatrixPIlot code base for hardware drivers and IMU. My thanks go to the MatrixPilot team for their support and innovation.
The Aerodyn project also uses a flexible field programmable mixer which is used to move the flight surfaces with accuracy. This is used to fly this 5m, 10 channel aircraft. More about that later.
Comments
great post - super interesting!
All this being said, a properly designed wing does not tip stall. It should stall near the fuselage. On a straight, high aspect ratio wing such as a sail plane, the wing should have more twist (leading edge down at the tip). To fix tip,stall on an existing wing, you can try vortex generators or a turbulator at the tip. If you don't want to twist the wing, in your next build, might want to try a bit of FORWARD sweep. Forward swept wings stall at the root not the tip.
A small correction: gliders do not fly all day close to stall as it seems from your first paragraph. We do come close to stall once in while when thermalling but it all depends on a glider and the task at hand.
Gliders are one of the few aircraft that uses flaps-up position on high speeds to actually reduce drug and use the best of penetration technics.
When it comes to stall - you can basically stall most of any aircraft at any speed, low or high.
I have flown many times over and over high performance gliders on speeds below the stall speeds without actually stalling them fully and stalled on speeds way higher than stall speed.
Stall on glider depends on many things: airspeed, wing angle of attack, weight, yaw, bank angle, thermal speed and thermal centering to name a few.
Gliders are way to complicated aircraft to describe in one short sentence. It takes years to master gliding which includes but by no means limited to weather, ballast, maneuvering, resting in flight, prioritizing, thinking ahead..
cheers,
Mark
There are a bunch of other features in the project, mostly improving flight performance without the dependence on limited pid control.
This topic might be a bit much for the crowd concerned with the latest quadrotor colour.
/Matt
Blimey top banana, thanks for sharing.