Hand Calculations logo Hand Calculations All help pages ▾

Autopilot Heading Hold⚠ unverified

Aerospace / Controls · Compute a simple heading-hold autopilot command

Parameters

InputSymbolUnitDefaultDescription
kpkp1.0Proportional ga
heading_errorheadingerrorrad1.0Heading error
kiki1.0Integral ga
integral_errorintegralerrorrad*s1.0Accumulated integral of the heading error
OutputSymbolUnitDescription
resultcmdradCommanded roll (or heading-correction) output, in radians (rad)

The science & history

Understanding the Parameters

Derivation (Approaching a Proof)

Heading hold is a feedback loop whose job is to drive the heading error to zero. Define the error as selected minus actual heading:

$$e_\psi(t) = \psi_{\text{cmd}} - \psi(t).$$

Apply a PI control law — proportional plus integral action on this error (the PID law with $k_d = 0$):

$$\text{cmd}(t) = k_p\,e_\psi(t) + k_i\int_0^t e_\psi(\tau)\,d\tau. \qquad\blacksquare$$

Why PI suffices, term by term. The proportional term gives a bank command that produces a turn rate roughly proportional to the error, so the aircraft turns toward the target and the error shrinks. But proportional control of a system that must hold a value leaves a steady-state error whenever a constant disturbance (a crosswind pushing the track, a trim asymmetry) is present. The integrator's infinite DC gain forces that steady-state error to zero: it keeps accumulating until $e_\psi = 0$ exactly. Derivative action is usually unnecessary because the underlying airframe/roll-loop dynamics already provide damping, so the heading loop is kept as PI.

The command feeds an inner roll loop (hold the commanded bank) which in turn commands ailerons — a cascade of loops, of which this is the outer, heading-level one.

Dimensional check. $k_p\,e_\psi$: gain times radians. $k_i\int e_\psi\,dt$: gain times radian-seconds. For both to be a consistent bank command (radians), $k_p$ is dimensionless and $k_i$ carries $1/\text{s}$ — the gains absorb the units, and the registry labels them dimensionless ✓.

History and Development

Related Concepts: Pid Controller, Pid Output, Turn Radius, Roll Mode Time Constant, Damping Ratio, Settling Time 2%, Cross Track Error

Notes: A PI controller (Pid Controller without the D term) on heading error, commanding bank (an outer loop feeding an inner roll loop) — a coordinated aircraft turns by banking, not rudder. P turns toward the target; I removes the standing heading error (crosswind/trim bias). No D (airframe/roll-loop supply damping; heading-rate is noisy). Real ones bank-limit the command. Heading error in rad, integral in rad·s; gains carry the units; defaults ⇒ cmd $=2$.

← Back to the workspace  ·  All help pages  ·  Getting started