The USU AeroLab set out to learn more about PID controllers during our annual lab challenge this year. The objective of this week's challenge was to develop a PID controller that could recover a stabilized F-16 from a steady coordinated turn to steady level flight. This is an example of a cascade PID control loop running in the in-house developed MAVIS flight simulation environment. This controller was designed to recover an unstable F-16 to steady level flight, allow for manual control of the aircraft, and control the aircraft's speed and altitude.
https://aerolab.usu.edu/projects/lab-challenges
The aerodynamic model is based on NASA wind tunnel tests and includes the effects of stall, actuator dynamics, engine rotational inertia, controller update frequency, sensor update frequency, and a Dryden turbulence model. The data used for this simulator can be found in NASA-TP-1538. This aircraft is inherently unstable in pitch allowing for higher pitch rates, however, this requires the controller to constantly adjust the elevator to maintain controlled flight.
The controller developed is a cascade PID controller. This means that a PID controller is nested within other PID controllers for effective control of a system. This controller consists of rotation rate controllers for p, q, and r that affect aileron, elevator, and rudder commands respectively. These controllers are wrapped with a roll angle controller and a climb angle controller. Finally, these controllers are wrapped in an altitude controller and heading controller. In addition to these controllers, an automatic throttle controller is used to maintain airspeed.
This controller was implemented as a C++ struct to allow for easy control of the MAVIS simulator which is written in C++. However, the code communicates with MAVIS via a UDP port so this is not necessary. The code utilizes an optional Clegg integrator and maximum integral error magnitude limits to prevent integral windup. In addition, the struct is set up for simple user interaction with separate calls for control output changes and error updating to allow for asynchronous updating of sensors seperate from the controllers update freqency