The X-Plane autopilot works with cascaded PID controllers. Tuning the PID controllers for your aircraft is key to having a smooth working autopilot. This article explains the parameters you can set in Plane Maker, and how to tweak them.
Roll and Pitch PIDs
In X-Plane, you parameterize the dependent from of the PID. That is . Note that is the error term (setpoint – actual value), but the derivative term uses so the derivative of the value, not the error, to provide protection against the derivative kick. X-Plane uses the following naming conventions for the constants:
- The gain is given as in the parameters “error for full deflection” or how much error will result in full control deflection
- The time is set as “prediction” or how far to look into the future
- The time is set as “tune time” or how long to take to apply fine tuning.
These gains are applied for the roll, pitch and yaw channel of the last controllers in the cascade.
Glideslope PD
The glideslope cascade uses a PD controller on the glideslope deflection to generate the pitch to feed down into the pitch controller. The glideslope parameters are:
- The gain as “glideslope CDI gain” or how much pitch change for one degree of deflection
- The time as “glideslope CDI prediction” or how far to look into the future to anticipate glideslope reaction
The nav cascade transforms the VOR, LOC or GPS deviation into linear space to increase stability on localizer and LPV approaches. It then uses a PD with the parameters:
- The gain as “localizer CDI gain” or how many degree course to change for one degree of deviation. Note that this is given in angular deviation for localizers, where 1 degree deviation equals 1.2 dots needle deflection. X-Plane takes care of modifying the gain for VOR and GPS sources.
- The time as “roll response”, which is calculated based on airspeed, maximum bank angle and the parameter “roll rate”, or how fast the airplane is allowed to roll.
Airspeed by pitch PD
The airspeed by pitch cascade uses a PD controller on the airspeed error to generate the input for the pitch PID controller. The parameters for the airspeed controller are:
- The gain as “pitch degrees per knot” or how much pitch change for one knot of speed error
- The time as “speed prediction” or how far to look into the future to predict the airspeed
Airspeed by throttle PD
The autothrottle airspeed controller uses a PD with the parameters:
- The gain as the “speed error for full throttle” or how many knots difference result in idle/max power setting
- The time as “speed prediction” or how far to look into the future to predict the airspeed
The output is fed through a delay circuit to prevent engine overboosting. The maximum rate of throttle change can be set in the “throttle control per second” parameter.
N1/EPR by throttle PID
To achieve a setpoint EPR or N1 on the engines, an independent PID is used. It uses the form
Whether it works on N1 or EPR is chosen on the engine limits page. The autopilot page allows you to set , and gains directly.
Yaw by rudder PID
CAUTION: This is NOT the yaw damper! This is the autopilot directional servo, which not many planes have!
This controller is only used during the flare and rollout phase of the autoland. Don’t bother to set it if your plane doesn’t have autoland. This controller uses the rudder to align the airplane with the runway centerline. This is what kicks the crab out in a crosswind landing, and keeps you on the runway during rollout.
- The gain is given as in the parameters “error for full deflection” or how much yaw error will result in full rudder deflection
- The time is set as “prediction” or how far to look into the future for yawing
- The time is set as “tune time” or how long to take to apply fine tuning
Yaw damper PD
The yaw damper is separate from the autopilot, and instead part of the artificial stability system. The yaw damper for a airplane is set up as a high-speed artificial stability system. The high-speed art stab system has three channels, and for a simple yaw damper you only want to parameterize the heading/yaw channel. The yaw damper works as an independent PD controller on the yaw (sideslip) angle and yaw rate . The meaning of the parameters is:
- The “raw stick input” in combination with the “target deg sideslip” defines the sideslip angle that should be stabilized at a given input on the pedals. For most civilian aircraft, that maximum stabilized sideslip is 0, as the yaw damper is not designed to maintain a given side-slip from a digital input, but rather only dampen deflections from the 0 side-slip. This is the case especially for yaw-dampers that make the pedals feel “stiff” when activated. However, some aircraft have systems that can stabilize on a non-zero side-slip in case of engine failure, in which case a non-zero number were needed here.
In other words, this parameter defines the range of valid setpoints for the controller and how the pedal deflection is scaled into the yaw setpoint. Often, a yaw damper only has a setpoint of 0. - “fraction deflection per degree difference” is the proportional gain and defines how much the rudder will deflect for each degrees of yaw away from the setpoint.
- “fraction deflection per degree per second” is the differential gain and defines how much the rudder will deflect against a yaw rate of 1 degree per second.
Tips and Tricks
- Use the Developer > Aircraft Performance > Set autopilot constants menu in the sim to tune the constants in real time. Don’t forget to write down your results at the end of the experiment, so you can save them permanently in Plane Maker!
- Tune the basic controllers (pitch and roll) first. Don’t bother tweaking the localizer and glideslope before the basic hold modes work. Once the airplane holds pitch and bank without oscillating, then it’s time to look into nav and glideslope.
- The data graph output window in X-Plane is great! Use it to watch what the autopilot is doing and note when you introduce oscillations.
- Tune the nav cascade on a localizer. Once it follows the localizer without oscillating, it will work perfectly on VORs as well.
- Be gentle with the glideslope gain. It is easy to overdo it.
- No idea what any of this means? Start with the Wikipedia article for the introduction, and then browse the Control Guru website for articles.