loading...
...
running...
The science
The vehicle is a small throttleable thrust-vector test stage (hobby scale: 1.4 kg dry, up to 1.0 kg of propellant, 55 N maximum thrust, Isp 90 s). It hops from the launch pad, flies a smooth reference path at 25 m altitude and lands inside a marked ring on a landing pad. Everything here is control theory: how a feedback loop keeps a vehicle on a path against wind, drag, sensor noise and limited actuators.
Rocket equation. Thrust T burns propellant at mdot = T / (Isp g0), dv = Isp g0 ln(m0 / mf) so the vehicle gets lighter as it flies; the controller must scale thrust by the changing mass.
Translation. With pitch angle th (from vertical) and gimbal angle d:
m x'' = T sin(th + d) + Fdx, m z'' = T cos(th + d) + Fdz - m g
Quadratic drag relative to the moving air (wind plus a gust process): F = -1/2 rho CdS |v - w| (v - w) with CdS = 0.10 m2 sideways and 0.02 m2 along the axis. Terminal speed of the unpowered vehicle is sqrt(2 m g / (rho CdS)).
Rotation. The nozzle swings about a pivot at the lever arm L = 0.5 m below the centre of mass:
J th'' = - T L sin(d) - c th' - weathercock term with J = 0.25 kg m2. The gimbal has a first-order lag (50 ms), a rate limit and a saturation; thrust has a first-order lag (80 ms).
Cascaded loops. The outer loops turn path errors into a commanded acceleration, the geometry turns it into a thrust magnitude and a tilt command, and the inner attitude loop drives the gimbal:
a_x = a_ref + Kp e + Kd e' + Ki sum(e) dt, th_c = atan2(a_x, g + a_z), T_c = m |(a_x, g + a_z)|
d = -(Kp_th (th_c - th) + Kd_th (0 - th'))
Discrete form at 100 Hz: I_k = I_(k-1) + e_k dt, derivative taken on the observer velocity (not on raw noisy samples), integrator frozen while thrust saturates (anti-windup).
Observer. A third-order observer (poles at -6 rad/s) estimates position, velocity and a constant disturbance acceleration (mainly drag) from the noisy position sensor, so the controllers see a filtered state. Noise scale 1 means 6 cm on position, 0.25 deg on attitude and 0.6 deg/s on the gyro.
MPC. Each axis is modelled as a double integrator. Over a 2.5 s horizon (25 steps of 0.1 s) the controller minimises J = sum Q (p - p_ref)^2 + Qv (v - v_ref)^2 + R u^2 subject to acceleration limits (thrust range and 25 deg tilt). The unconstrained optimum comes from a precomputed matrix inverse, is clipped to the limits and polished by projected-gradient steps; only the first move is used (receding horizon). The estimated disturbance is carried over the horizon.
Stability margins. For a loop transfer function L(jw) the page computes the Bode plot and reads phase margin (180 deg plus the phase at the 0 dB crossing) and gain margin (how much extra gain reaches phase -180 deg). The model includes the actuator lag, a 15 ms sampling delay and the inner attitude loop inside the position loop. A phase margin under about 30 deg gives ringing; around 0 it is unstable. The Detuned attitude preset shows this live. The step-response plot is a time simulation of the same linearised loop (no saturation).
Honest simplifications. Motion is planar (a vertical plane through the two pads; the 3D scene shows the pad ring on the ground but the vehicle never leaves that plane); atmosphere density is constant; the vehicle is a rigid body with constant inertia; no engine start transient, no ground effect, no landing-leg dynamics; touchdown is judged by speed, tilt and offset only. Tuning numbers are illustrative.
Live checks. (1) rocket equation, (2) terminal speed under quadratic drag, (3) discrete P controller vs closed form, (4) the margin routine vs an analytic phase margin, (5) the disturbance observer, (6) a full calm-air mission lands inside the ring.
Educational model of a hobby-scale landing-control exercise. No payload, no operational procedure; generic hardware.
3D assets: Blender models of the rocket, launch pad, landing pad and windsock, exported as Draco GLB; Three.js r160.