Guidance, Navigation and Control · Theory · M8
M8-T3 — Explicit Guidance to a Terminal State
Explicit guidance solves for the whole remaining trajectory in closed form and flies the first instant of it. Done again every cycle, it becomes feedback.
Hopper must go from 200 m altitude at 20 m/s downward to a soft touchdown, and the question is what thrust to command now. Explicit guidance answers with a polynomial: among all accelerations that reach the target position and velocity at a chosen time, the one of least energy is a straight line in time, with coefficients in closed form. This lesson derives it, adds a terminal acceleration condition to get the quadratic law that flew the Apollo lunar module, recomputes the law at each step, and finds the shortest descent time that keeps the thrust inside the engine limit.
Learning objectives
After this lesson, you should be able to:
- Derive the linear acceleration law that reaches a terminal position and velocity in a given time with least energy.
- Extend it to a terminal acceleration condition and give the quadratic law.
- Explain why recomputing the law at each step makes it feedback and compare it with an open-loop programme.
- Find the shortest time-to-go that the thrust limit allows.
The intuition
UAV M5-T14: Trajectory tracking follows a reference trajectory with feedback on the error. Explicit guidance goes the other way: there is no stored reference, and the command is computed from the current state and the target by a formula. The formula is the solution of a small optimal control problem, which the second module of this part of the course sets out in general.
Choose the arrival, and the rest follows
Let the net acceleration be (thrust acceleration plus the acceleration of gravity), so that position obeys . Suppose we require the vehicle to arrive at position with velocity after a time , and to use as little acceleration energy as possible. The solution has a surprising form: the acceleration is a straight line in time, , with two coefficients fixed by the two terminal conditions. The command to send now is the value at the current time:
This is the linear (E-guidance) law: , where r and v are the current position and velocity and T the time-to-go. For Hopper the thrust is along the vertical, with g = 9.81 m/s² the size of gravity and up positive.
Hopper's descent
From 200 m at −20 m/s with a descent time of 16 s the law commands a net acceleration of 0.31 m/s² now and then a rising upward acceleration, so the thrust starts near the weight (1177 N) and rises to about 1280 N. A shorter time asks for a stiffer deceleration: 10 s needs 1860 N, 8 s needs more than the engine's 2400 N. The shortest time-to-go the thrust limit allows is 8.4 s in the full simulation, with mass depletion included.
Programme or feedback
The acceleration line computed at the start is an open-loop programme: apply it blindly for 16 s and the vehicle arrives where it said it would, if everything is exactly as assumed. With 5 m/s of extra initial speed it hits at 17.3 m/s at 9 s; with a thrust 8% low it hits at 19.8 m/s. Recompute the law at every step from the current state and the remaining time, and the same disturbances give touchdown speeds of 0.45 and 1.95 m/s. The law has become a feedback law, with gains that grow as the time-to-go shrinks.
The least-energy acceleration to a terminal position and velocity is a straight line in time, with closed-form coefficients. Recomputed every cycle with the remaining time, it is a feedback law; flown once, it is an open-loop programme that errors grow in.
Definitions
- Time-to-go
- The time remaining until the terminal conditions are to be met; it decreases by one each second of flight.
- Net acceleration
- Thrust acceleration plus gravity, up positive: with g = 9.81 m/s². The guidance law commands and the thrust is .
- Terminal conditions
- The desired position, velocity (and, for the quadratic law, acceleration) at touchdown.
- Open-loop programme
- An acceleration history computed once and applied without feedback.
Derivation: the linear law and the quadratic law
Minimize subject to , and .
The calculus of variations (or the minimum principle of the next lesson) gives a straight line in time as the minimizer: the costate of a double integrator is linear in time and the acceleration is proportional to it.
Integrate once for the velocity at the end.
Integrate twice for the position at the end.
Rearrange the two conditions (the second multiplied by 2).
Solve the two linear equations for . The value at the present time, , is the command.
The quadratic law
Add a term so that a third condition can be met: the acceleration at the end, .
The three terminal conditions in normalized form (the same integrals as before, plus ).
The exact solution of the system (computed with rational arithmetic in the example: the coefficients of , and are 1, −6 and 12).
Collect the terms in v: . This is the quadratic command.
Least energy to two terminal conditions gives a linear acceleration profile; a third condition adds a quadratic term. Evaluated at the present time with the remaining time, the coefficient formula is a feedback law whose gains grow as 1/T and 1/T².
A worked example
Hopper descending vertically from 200 m at −20 m/s to 0 m and 0 m/s, with the mass falling as propellant is burned (specific impulse 150 s) and a thrust limit of 2400 N.
- Check the formula. For T = 16 s a direct solve of the two terminal conditions gives m/s² and a jerk of 0.1172 m/s³, identical to the closed form; the position and velocity at T are zero to rounding. The exact rational coefficients of the quadratic law are 1, −6 and 12, as derived.
- Time-to-go and thrust. Peak demanded thrust: 3760 N (T = 8 s), 1939 N (10 s), 1605 N (12 s), 1405 N (14 s), 1276 N (16 s), 1297 N (20 s). The demand is not monotonic: a very long descent costs gravity loss and mass.
- Shortest time. The smallest time-to-go with the demanded thrust within 2400 N is 8.39 s. Below it the engine cannot follow the law.
- Touchdown speed. The law is singular at , so the last 0.3 s is flown at constant speed. The touchdown speeds are 4.28 m/s (T = 8 s), 2.26 (10), 1.42 (12), 0.93 (14), 0.63 (16) and 0.30 m/s (20): a longer time leaves a gentler arrival.
- Programme against feedback (T = 16 s). With no disturbance both touch down at 0.64 m/s. With 5 m/s extra initial speed: the programme at 17.3 m/s, the recomputed law at 0.45 m/s. With a thrust 8% low: 19.8 against 1.95 m/s. With both: 25.6 against 2.73 m/s.
import math
from fractions import Fraction as Fr
import gnckit as g
G0, ISP = 9.81, 150.0
# the linear acceleration law: a = 6 (rf - r) / T^2 - 2 (2 v + vf) / T (net acceleration, r'' = a)
def a_linear(r, v, rf, vf, T):
return 6 * (rf - r) / T ** 2 - 2 * (2 * v + vf) / T
# check against a direct solve of the two terminal conditions for a(t) = c0 + c1 t
r0, v0, rf, vf, T = 200.0, -20.0, 0.0, 0.0, 16.0
M = [[T, T * T / 2], [T * T / 2, T ** 3 / 6]]
c0, c1 = g.mat_solve(M, [vf - v0, rf - r0 - v0 * T])
print(f'direct solve of the terminal conditions: a(0) = {c0:.5f} m/s2, jerk {c1:.5f} m/s3; formula a(0) = {a_linear(r0, v0, rf, vf, T):.5f}')
print(f'check: position at T {r0 + v0 * T + c0 * T * T / 2 + c1 * T ** 3 / 6:.2e}, velocity at T {v0 + c0 * T + c1 * T * T / 2:.2e}')
# quadratic acceleration profile with a terminal acceleration condition: exact coefficients by fractions
def solve_frac(A, b):
n = len(A); M_ = [[Fr(x) for x in row] + [Fr(bb)] for row, bb in zip(A, b)]
for i in range(n):
p = next(r for r in range(i, n) if M_[r][i] != 0); M_[i], M_[p] = M_[p], M_[i]
M_[i] = [x / M_[i][i] for x in M_[i]]
for r in range(n):
if r != i: M_[r] = [x - M_[r][i] * y for x, y in zip(M_[r], M_[i])]
return [row[-1] for row in M_]
# unknowns c0 c1 c2 with T = 1; right-hand sides: terminal acceleration, velocity change, position change
A3 = [[1, 1, 1], [1, Fr(1, 2), Fr(1, 3)], [Fr(1, 2), Fr(1, 6), Fr(1, 12)]]
for name, rhs in (('af', [1, 0, 0]), ('dv / T', [0, 1, 0]), ('dr / T^2', [0, 0, 1])):
sol = solve_frac(A3, rhs)
print(f' a(0) coefficient of {name:9s}: {sol[0]}')
print('so a(0) = af + 12 (rf - r - v T) / T^2 - 6 (vf - v) / T, which is af - 6 (v + vf) / T + 12 (rf - r) / T^2')
# Hopper descent, vertical, with real mass depletion
def descend(Tgo0, closed=True, v0e=0.0, thrust_scale=1.0, Tmax=2400.0, z0=200.0, vz0=-20.0, dt=0.01):
z, v, m = z0, vz0 + v0e, 120.0
t = 0.0
a_open = None
prog = None
peak = 0.0
frozen = None
while t < Tgo0 + 8.0:
tg = Tgo0 - t
if tg > 0.3:
if closed:
a_net = a_linear(z, v, 0.0, 0.0, tg)
else:
if prog is None: # the programme: a(t) = c0 + c1 t computed once at the start
Tt = Tgo0
M_ = [[Tt, Tt * Tt / 2], [Tt * Tt / 2, Tt ** 3 / 6]]
prog = g.mat_solve(M_, [0.0 - vz0, 0.0 - z0 - vz0 * Tt]) # computed from the nominal initial state
a_net = prog[0] + prog[1] * t
frozen = a_net
else:
a_net = 0.0 # the last 0.3 s: hold the descent speed, the law is singular at T_go = 0
thrust = min(Tmax, max(0.0, m * (a_net + G0)))
peak = max(peak, m * (a_net + G0))
thr_act = thrust * thrust_scale
acc = thr_act / m - G0
z += v * dt + 0.5 * acc * dt * dt
v += acc * dt
m -= thr_act / (ISP * G0) * dt
t += dt
if z <= 0.0:
return z, v, m, peak, t
return z, v, m, peak, t
print('Hopper from 200 m at -20 m/s to 0 m and 0 m/s, thrust m (a + g) limited to 2400 N:')
for Tg in (8.0, 10.0, 12.0, 14.0, 16.0, 20.0):
z, v, m, peak, t = descend(Tg)
print(f' time-to-go {Tg:4.1f} s: peak thrust demanded {peak:7.1f} N, touchdown at {t:5.2f} s with speed {v:+6.2f} m/s, mass left {m:6.2f} kg')
lo, hi = 5.0, 30.0
for _ in range(40):
mid = (lo + hi) / 2
pk = descend(mid)[3]
lo, hi = (mid, hi) if pk > 2400.0 else (lo, mid)
print(f'smallest time-to-go that keeps the demanded thrust within the engine limit: {hi:.2f} s')
print('time-to-go 16 s, three disturbances; the programme is computed once, the law is recomputed at every step:')
for label, kw in (('no disturbance', {}), ('5 m/s extra initial speed', {'v0e': -5.0}), ('thrust 8% below command', {'thrust_scale': 0.92}), ('both', {'v0e': -5.0, 'thrust_scale': 0.92})):
r_ = []
for closed in (False, True):
z, v, m, peak, t = descend(16.0, closed=closed, **kw)
r_.append(f'{v:+7.2f} m/s at {t:5.2f} s')
print(f' {label:26s} programme: {r_[0]}, recomputed: {r_[1]}')direct solve of the terminal conditions: a(0) = 0.31250 m/s2, jerk 0.11719 m/s3; formula a(0) = 0.31250 check: position at T 0.00e+00, velocity at T 0.00e+00 a(0) coefficient of af : 1 a(0) coefficient of dv / T : -6 a(0) coefficient of dr / T^2 : 12 so a(0) = af + 12 (rf - r - v T) / T^2 - 6 (vf - v) / T, which is af - 6 (v + vf) / T + 12 (rf - r) / T^2 Hopper from 200 m at -20 m/s to 0 m and 0 m/s, thrust m (a + g) limited to 2400 N: time-to-go 8.0 s: peak thrust demanded 3760.3 N, touchdown at 7.83 s with speed -4.28 m/s, mass left 112.69 kg time-to-go 10.0 s: peak thrust demanded 1938.6 N, touchdown at 9.86 s with speed -2.26 m/s, mass left 111.02 kg time-to-go 12.0 s: peak thrust demanded 1604.5 N, touchdown at 11.86 s with speed -1.42 m/s, mass left 109.49 kg time-to-go 14.0 s: peak thrust demanded 1404.9 N, touchdown at 13.86 s with speed -0.93 m/s, mass left 108.00 kg time-to-go 16.0 s: peak thrust demanded 1275.8 N, touchdown at 15.86 s with speed -0.63 m/s, mass left 106.55 kg time-to-go 20.0 s: peak thrust demanded 1297.2 N, touchdown at 19.85 s with speed -0.30 m/s, mass left 103.73 kg smallest time-to-go that keeps the demanded thrust within the engine limit: 8.39 s time-to-go 16 s, three disturbances; the programme is computed once, the law is recomputed at every step: no disturbance programme: -0.64 m/s at 15.75 s, recomputed: -0.63 m/s at 15.86 s 5 m/s extra initial speed programme: -17.30 m/s at 9.11 s, recomputed: -0.45 m/s at 15.86 s thrust 8% below command programme: -19.78 m/s at 9.65 s, recomputed: -1.95 m/s at 13.66 s both programme: -25.62 m/s at 7.74 s, recomputed: -2.73 m/s at 12.66 s
In robotics
Explicit guidance flew the Apollo lunar module and is the model for the onboard descent guidance of many landers.
- Apollo. The lunar descent used a quadratic acceleration law with specified terminal position, velocity and acceleration, recomputed each cycle, with the commanded acceleration converted to thrust and attitude. The feature that matters is the same as here: the law needs no stored trajectory and corrects whatever disturbance it meets.
- Choosing the time. The time-to-go is a design choice, constrained from below by the engine and from above by propellant (a long descent loses to gravity). For Hopper the window is between 8.4 s and about 16 s, and the constraint analysis is a single bisection.
- The singularity. The law contains 1/T and 1/T², and a small error in T near the end gives a large command. Real systems stop updating the law some time before touchdown and hold the descent rate, as in the example, or they add a terminal phase with another law.
- Constraints are not in the law. The formula knows nothing of thrust limits, a glide slope or a thrust floor, which a rocket engine that cannot be throttled to zero also has. A guidance that must respect them is computed by optimization, as in the convex powered-descent lessons of module 9.
- Attitude coupling. In two or three dimensions the commanded acceleration vector sets the thrust direction, which the attitude loop must realize: the guidance and attitude loops are nested with the bandwidth separation of module 1.
The lab M8-L2: Fly the Polynomial Descent guides Hopper down this descent and finds the minimum time-to-go for a given thrust limit. The more general version of this lesson's least-energy solution is the minimum principle of M9-T1: The Optimal Control Problem and the Minimum Principle.
Common misconceptions
“Explicit guidance follows a precomputed trajectory.”
It computes the command from the current state and time-to-go by a formula. Flown once it is a programme, but recomputed each cycle it replaces the reference with feedback.
“A shorter descent is always better.”
It is limited by the engine: below 8.4 s the thrust demanded exceeds 2400 N. A very long one wastes propellant on gravity loss (mass left 103.7 kg at 20 s against 106.6 kg at 16 s).
“The law keeps the thrust inside the limits.”
It has no knowledge of limits: at T = 8 s it demands 3760 N. Limits must be checked by choosing T, or handled by an optimizing guidance.
“The programme is as good as feedback if there are no big errors.”
Without disturbances they are the same (0.64 m/s both). A 5 m/s speed error or an 8% thrust error turns the programme into a crash at 17 to 20 m/s while the recomputed law lands at 0.45 to 1.95 m/s.
“The command is computed all the way to touchdown.”
The gains grow as 1/T and 1/T², so the last fraction of a second must be handled differently. The example holds the descent speed in the last 0.3 s.
Key takeaways
- The least-energy acceleration to a terminal position and velocity is linear in time; the command is .
- Adding a terminal acceleration gives the quadratic law , the Apollo form.
- Recomputed at every step with the remaining time it is a feedback law with gains growing as 1/T and 1/T².
- For Hopper from 200 m at −20 m/s the shortest descent the engine allows is 8.39 s; at 16 s the peak thrust is 1276 N.
- Against 5 m/s extra speed and an 8% thrust loss the programme crashes (25.6 m/s) while the recomputed law lands at 2.73 m/s.
- The law has a singularity at T = 0 and ignores constraints; both are handled outside it.
References and further reading
Each source is marked free or paid. Free to read does not mean free to reuse: the course resources page lists every source with its licence.
- R. H. Battin, An Introduction to the Mathematics and Methods of Astrodynamics, revised edition, AIAA, 1999, the chapters on lunar descent guidance. Paid.
- A. R. Klumpp, "Apollo lunar descent guidance", Automatica 10(2), 1974, the description of the quadratic law as flown. Paid (Elsevier); NASA technical reports on the same guidance are free.
- G. W. Cherry, "A general explicit optimizing guidance law for rocket-propelled spaceflight", AIAA/ION Astrodynamics Guidance and Control Conference, 1964, the E-guidance law. Paid (AIAA).
- MIT 16.323 Principles of Optimal Control (OpenCourseWare) , the least-energy double-integrator problem. Free; licence CC BY-NC-SA 4.0.
Knowledge check
Three questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
Hopper is at 100 m with a velocity of −10 m/s and 10 s to go. What net acceleration does the linear law command for a soft touchdown (rf = 0, vf = 0)?
Explanation
Using a = 6(rf − r)/T² − 2(2v + vf)/T = 6(−100)/100 − 2(−20)/10 = −6 + 4 = −2 m/s². The net acceleration is −2 m/s², so the thrust acceleration is F/m = a + g = −2 + 9.81 = 7.81 m/s², a thrust of 937 N for 120 kg, below the hover thrust of 1177 N. That is right: the vehicle is high and slow enough to continue to fall, and the law lets it.
Question 2
Why does the open-loop programme fail with a 5 m/s extra initial speed while the recomputed law does not?
Explanation
The programme is the acceleration history that works from the nominal state; from a different state it brings the vehicle to a different place, and nothing corrects the difference: the extra 5 m/s of speed grows into a miss of tens of metres and a 17 m/s impact at 9 s. The recomputed law takes the actual position, velocity and remaining time at each step and solves again, so the error is part of the next command: the gains on position and velocity error are 6/T² and 4/T, and they increase as the end nears.
Question 3
What limits how short the descent time can be, and what happens as T tends to zero?
Explanation
The thrust the law demands rises as the time shrinks, since the deceleration needed is about v/T, and the engine caps it at 2400 N, which for Hopper from 200 m at 20 m/s is reached at a time of about 8.4 s. As the remaining time T tends to zero during any descent, the gains 6/T² and 4/T become infinite, so tiny errors become huge commands; this is why the law is frozen or replaced in the last fraction of a second.
What’s next
Related content
Nothing below is required to finish this lesson.
- BeforeM8-T2: Mission Guidance: Legs, Loiters and Energy
Switch between straight and circular legs, hold a loiter, and control altitude and airspeed together through total energy and its distribution.
- LabM8-L2: Fly the Polynomial Descent
Guide Hopper from 200 m to a soft touchdown with a polynomial law, then find the time-to-go below which the commanded thrust exceeds the engine limit.
- LabM12-L2: Capstone: Land Hopper
Write the navigation filter, the guidance law and the controller of Hopper, and pass an acceptance campaign of dispersed flights with wind, sensor errors, mass uncertainty and one beacon fault.
Other courses on this site treat neighbouring topics from their own angle:
- Navigation M5-T4: Pure Pursuit
- Navigation M5-T5: Stanley and Cross-Track Control
- Navigation M4-T5: Dubins and Reeds-Shepp Curves
- Navigation M8-T1: Waypoint Missions and Route Ordering
- Navigation M6-T4: Time to Collision and Predicting Moving Obstacles
- Navigation M8-T6: Docking, Charging and Fleet Operations
- UAV M5-T10: Waypoint navigation
- UAV M5-T14: Trajectory tracking
- UAV M5-T15: Guidance and control integration
This course leaves the following to the pages that already teach them:
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.