Real-time control of an underactuated double-gimbal control moment gyroscope
The problem
A control moment gyroscope steers a spacecraft, ship, or robot by tilting a fast-spinning rotor. The double-gimbal version has two motors and four rigid bodies, so one axis is never driven directly. It has to be moved through gyroscopic coupling, and the coupling itself changes with the gimbal angles. At certain angles the gimbal axes line up and one control direction disappears entirely. That is gimbal lock, and a controller that wanders into it loses the plant. When I started, nobody had stabilized this configuration on hardware.
Where control moment gyroscopes are used
A control moment gyroscope exchanges angular momentum instead of spending propellant, which is why it turns up wherever something heavy has to be pointed precisely without a rigid reference to push against. Every long-duration space station has flown them: Skylab carried three double-gimbal units in 1973, Mir carried banks of gyrodynes, China's Tiangong carries six, and the International Space Station holds its attitude with four double-gimbal CMGs on the Z1 truss, each spinning a 100 kg wheel at 6600 rpm to store 4760 Nms of momentum and deliver 258 Nm of torque without the disturbances that thrusters would put into the microgravity experiments. Agile Earth-imaging satellites use clusters of small single-gimbal CMGs to swing between targets in seconds: Pleiades points a 1000 kg spacecraft at more than 3 degrees per second with four 45 Nm units in a pyramid, and the WorldView and Ikonos satellites fly Honeywell CMGs for the same reason. At sea, gyro stabilizers such as the Seakeeper series spin a vacuum-sealed flywheel at up to 9750 rpm and precess it against the waves to remove most of a boat's roll. The same mechanism is being applied to underwater vehicle orientation, robotic stabilization platforms, self-balancing two-wheeled vehicles, and the lateral stability of agricultural tractors. The station units are double-gimbal CMGs, the same family as my platform, and the unpowered outer frame on my rig plays the part of the vehicle they steer.
What I built
The full stack from model to rig. Euler-Lagrange dynamics with a configuration-dependent inertia matrix; a MATLAB/Simulink controller running through QUARC on a Q8-USB data acquisition board at a 2 ms cycle; optical encoders on every body, filtered and differentiated for velocity; torque commands converted to motor current through a linear current amplifier with saturation limits to protect the motors. I ran all of the hardware experiments and the digital-twin simulations they are compared against.
What the hardware taught me
My first controller was an adaptive LQR built on a state-dependent Riccati equation. It passed every stability check in the linear region and worked on the rig for stabilization tasks. Under a time-varying reference, one gimbal drifted across the gimbal-lock boundary, the linearization behind the Riccati update stopped being valid, and the closed loop diverged. Simulation had not shown this because the model had no notion of the boundary. The hardware did.
So I redesigned the controller as an adaptive sliding mode law with the constraint written into the control law itself. A composite sliding manifold couples the actuated gimbal velocities to the unactuated tracking error, a barrier Lyapunov function pushes the gimbals away from the singular boundaries before they get there, a fractional-power reaching law gives finite-time convergence with a computable time bound, and a gradient adaptation law absorbs friction, encoder quantization, and external disturbance torques without needing to know their bound in advance.
Measured on the rig
| Test | FT-ASMC | Adaptive LQR |
|---|---|---|
| Release from initial error, 2% settling time | 0.94 s | 3.02 s |
| Smooth S-curve tracking, RMS error | 0.12° | diverged past gimbal lock |
| Smooth S-curve tracking, peak error | 0.28° | 18.1° before shutdown |
| Same tracking with an external disturbance torque on the unpowered frame, RMS error | 0.19° | diverged |
Two recent controllers from the underactuated-systems literature were also run on the rig as baselines; both diverged in every test because their stability arguments rely on a gravitational restoring torque that a horizontally mounted gyroscope does not have.
Mathematical background
- Euler-Lagrange modeling of multibody systems, partial linearization, controllability of the actuated and unactuated subsystems
- State-dependent Riccati equation control and its local stability argument
- Sliding mode control for underactuated systems: composite manifolds, reaching laws, chattering and its mitigation
- Lyapunov direct method, LaSalle's invariance principle, barrier Lyapunov functions for state constraints
- Finite-time stability theory, comparison lemmas, Young's and Cauchy-Schwarz inequalities used in the convergence proofs
- Online parameter and disturbance adaptation without a known disturbance bound