Knowing where the spacecraft is pointing (attitude sensors) and having something to rotate it with (reaction wheels and actuators) is not enough: what is missing is the control law that turns the measured attitude error, tens of times per second, into a torque that corrects it. This lesson goes through the laws that actually fly: per-axis PD and PID, with their bandwidth design rules; quaternion feedback, whose stability is proven with a Lyapunov function; large rate-limited maneuvers; the B-dot law for detumbling after launch; thruster control with its limit cycle; and the flight modes that tie everything together. The starting dynamics are Euler's equations from attitude and quaternions.
The plant: a double integrator
For small errors about a reference attitude, at low angular rates, the axes decouple and each one is a double integrator:
J · θ̈ = τ_c + τ_d → θ(s) / τ(s) = 1 / (J s²)
with θ the attitude error about that axis, τ_c the control torque and τ_d the disturbance torque. It is a simple plant but unstable in open loop: without control, any torque makes it drift. The gyroscopic term ω × Jω, neglected here, matters in fast maneuvers, with momentum-loaded wheels or on spinning spacecraft.
Per-axis PD and PID control
The most widely used law in the history of attitude control:
τ_c = −K_p · θ − K_d · θ̇ − K_i · ∫θ dt
Without the integral term, the closed-loop equation is J s² + K_d s + K_p = 0, a damped oscillator with:
ωₙ = √(K_p / J) ζ = K_d / (2 √(K_p J)) t_settling (2%) ≈ 4 / (ζ ωₙ)
steady-state error under a constant torque: θ_ss = τ_d / K_p
The integral term removes that steady-state error at the cost of a little phase margin, and it needs anti-windup protection: if the actuator saturates, the integrator keeps accumulating and then causes a large overshoot.
Bandwidth: between noise and flexible modes
Choosing ωₙ, or the loop bandwidth, is the central trade-off:
- From below, it must be high enough to reject disturbances and track the reference: a slow loop leaves large errors under varying torques.
- From above, it is limited by four things. Sensor noise, which a fast loop turns into torque and jitter. Actuator saturation. Sampling and delays: the computer must sample of the order of 10-20 times faster than the bandwidth, and every millisecond of delay costs phase. And, above all, flexible modes: solar arrays, antennas, booms and propellant slosh have low natural frequencies, often from tenths of a hertz to a few hertz on large spacecraft, poorly known before flight and with very little damping (of the order of 0.1-1%).
The rule of thumb is to keep the bandwidth of the order of 5-10 times below the first mode and add notch filters at the known modes. Classical margins are required: of the order of 6 dB of gain and 30-45° of phase on the rigid-body mode, and more gain margin on the flexible modes that are "gain stabilized". When sensor and actuator are at the same location (collocated), the flexible modes alternate poles and zeros and the loop is robust; when they are not, a mode can become unstable.
The classic case of what happens if this is ignored: Hubble's first solar arrays flexed abruptly when entering and leaving the Earth's shadow and made the telescope vibrate, which degraded the pointing. The control software was improved to compensate, and the first servicing mission, in 1993, replaced the arrays with thermally stiffer ones.

Quaternion control
For large errors the per-axis approximation no longer holds. The standard nonlinear law (Wie, Weiss and Arapostathis, 1989) feeds back directly the vector part of the error quaternion q_e = q_ref* ⊗ q (in the Hamilton convention) and the angular velocity:
τ_c = −K_p · q_e,v − K_d · ω + ω × (J ω + h_w)
The last term cancels the gyroscopic coupling. For regulation to a fixed attitude, stability is proven with the Lyapunov function:
V = ½ ωᵀ J ω + 2 K_p (1 − q_e,4) (V ≥ 0, and V = 0 only with ω = 0 and q_e,4 = 1)
Its derivative, using Euler's equations and the kinematics q̇₄ = −½ q_v · ω, is:
V̇ = ωᵀ τ_c' + K_p q_e,vᵀ ω = −ωᵀ K_d ω ≤ 0
where τ_c' is the control without the gyroscopic term (which does no work). The total energy of the system (kinetic plus an attitude "spring") can only decrease, and by LaSalle's invariance principle the spacecraft converges to the desired attitude. With K_p = k · J and K_d = c · J, the spacecraft rotates about the eigenaxis of the error, the shortest angular path.
To track a moving reference (pointing at the Earth, at a ground target or at the ISS from a cargo vehicle), the feedforward torque that the reference alone would require is added: J ω̇_ref + ω_ref × (J ω_ref + h_w). In nadir pointing, the reference rotates at the orbital rate n about the orbit normal: one revolution every 92 minutes for the ISS.
Large maneuvers: rate-limited profiles
In practice, a large maneuver is performed by generating a reference trajectory about the eigenaxis, with angular acceleration limited by the wheel torque (α = τ_max/J) and rate limited by their angular momentum (ω_max = h_max/J) and by the sensors (star trackers lose track above a certain rate). The PD or quaternion loop only corrects small errors relative to that reference. The profile is trapezoidal (or with smoothed corners so as not to excite modes):
if θ > ω_max² / α : t = θ / ω_max + ω_max / α (accelerate, coast, brake)
otherwise: t = 2 √(θ / α) (triangular)
Detumbling: the B-dot law
After separating from the launch vehicle, a satellite may be tumbling at several degrees per second in any direction, and the star trackers are not yet usable. The B-dot law needs only a magnetometer and magnetorquers:
m = −k · Ḃ (Ḃ: derivative of the measured field in body axes)
If the spacecraft rotates quickly compared with the orbital variation of the field, Ḃ ≈ −ω × B, and the torque τ = m × B = k (ω × B) × B always has a component opposing the part of ω perpendicular to B: it dissipates rotational energy. It needs no knowledge of attitude or orbit, which is why it is the first mode of almost every small satellite in low orbit.
Thruster control: the limit cycle
Thrusters are on-off devices. The classic law is a bang-bang control with a deadband in the phase plane (θ, θ̇): there is no firing while the error stays within ±θ_d, and a pulse is fired when the trajectory crosses the switching line. To make the pulses resemble a proportional torque, pulse-width pulse-frequency (PWPF) modulators are used. The result, without disturbances, is a limit cycle: the spacecraft bounces between the two edges of the deadband.
Passive and spin stabilization
Not every spacecraft needs active three-axis control. Spin stabilization uses gyroscopic stiffness (see nutation in attitude and quaternions): the Juno probe spins at between 1 and 5 rpm depending on the mission phase, and its instruments sweep the sky with each revolution. Dual-spin spacecraft combine a rotor and a stabilized platform, and gravity gradient with a boom gives Earth pointing to within a few degrees with no power. The trade-off: accuracy and pointing freedom in exchange for simplicity and reliability.
Flight modes
A real spacecraft does not have one control law but a state machine of modes, with automatic and commanded transitions:
| Mode | Sensors | Actuators | Law | When |
|---|---|---|---|---|
| Detumble | Magnetometer, gyroscopes | Magnetorquers or thrusters | B-dot, rate damping | After separation |
| Sun acquisition / safe mode | Coarse Sun sensors, gyroscopes | Wheels or thrusters | PD on the Sun vector | Start-up and any anomaly |
| Coarse pointing | Sun, Earth, magnetometer | Wheels | Quaternion PD | Transition, communications |
| Fine pointing / science | Star tracker, gyroscopes, fine guidance | Wheels (and steering mirrors) | Quaternion PID with feedforward | Normal operation |
| Orbit maneuver | Gyroscopes, star tracker | Attitude thrusters or engine gimbal | Thrust vector control | Trajectory corrections |
| Momentum unloading | Magnetometer or star tracker | Magnetorquers or thrusters | Wheel momentum control | Periodic |
Safe mode is the most important mode on the spacecraft: it must work with the minimum of equipment, point the solar arrays at the Sun, keep the spacecraft at a safe temperature and wait for instructions. It is the mode that saves a mission when everything else fails, which is why it is designed and tested before the science mode. All modes are verified in hardware-in-the-loop simulations and, in parts, in the clean room (systems engineering).

The state of the art: milliarcseconds
Space telescopes push control to its limit with a cascaded architecture. Hubble holds its pointing with a stability of the order of 0.007″ (a 1 cm object seen from about 300 km) using reaction wheels, gyroscopes and its fine guidance sensors, and since 2024 it does so with a single gyroscope, relying more on the guidance sensors. Webb splits the work: the wheels and the spacecraft control provide coarse pointing, and a fine steering mirror inside the telescope, driven at high rate by the fine guidance sensor, corrects the rest; the result is a stability of the order of a few milliarcseconds. ESA standardizes how these requirements are specified in its ECSS-E-ST-60-10C standard, which distinguishes absolute pointing error (APE), relative pointing error (RPE) and knowledge error.
Current trends: model predictive control (MPC) with explicit constraints (Sun exclusion for the star trackers, momentum limits), which now fits in flight processors; singularity-free CMG steering for agile satellites; and onboard autonomy for distant spacecraft where signal delay prevents intervention from the ground, such as those described in navigation and orbit determination.

Key points
- Near the target each axis is a double integrator: PD with
K_p = J ωₙ²andK_d = 2ζωₙJ; the integral term removes the error under constant torques. - The bandwidth sits between disturbance rejection and the limits set by noise, saturation, sampling and flexible modes (of the order of 5-10 times below the first one).
- Quaternion feedback
τ = −K_p q_e,v − K_d ω + ω × Jωis Lyapunov-stable; the quaternion sign must be chosen to avoid unwinding. - Large maneuvers follow a torque- and rate-limited profile:
t = θ/ω_max + ω_max/α. - B-dot (
m = −k Ḃ) detumbles without knowing the attitude; thrusters leave a limit cycle that costs propellant. - Every spacecraft is a mode machine, and the most important mode is safe mode.
Further reading
- B. Wie, Space Vehicle Dynamics and Control, AIAA Education Series (2nd ed., 2008).
- B. Wie, H. Weiss and A. Arapostathis, "Quaternion Feedback Regulator for Spacecraft Eigenaxis Rotations", Journal of Guidance, Control, and Dynamics 12(3), 375-380 (1989).
- K. D. Bilimoria and B. Wie, "Time-Optimal Three-Axis Reorientation of a Rigid Spacecraft", Journal of Guidance, Control, and Dynamics 16(3), 446-452 (1993).
- F. L. Markley and J. L. Crassidis, Fundamentals of Spacecraft Attitude Determination and Control, Springer (2014).
- M. J. Sidi, Spacecraft Dynamics and Control: A Practical Engineering Approach, Cambridge University Press (1997).
- ESA, ECSS-E-ST-60-10C, Space engineering — Control performance (2008).
Test yourself
With PD control about an axis of inertia J, what proportional gain gives a natural frequency ωₙ?
In the law τ = −K_p · q_v − K_d · ω, why is the sign of the error quaternion flipped when its scalar part is negative?
A spacecraft must rotate 90° with a maximum rate of 0.15 °/s and an angular acceleration of 4.3·10⁻⁴ °/s². Roughly how long does the maneuver take with a trapezoidal profile?
What does the B-dot control law do?
Why is the attitude control bandwidth usually kept well below the spacecraft's first flexible mode?