Guidance, Navigation and Control · Theory · M8
M8-T1 — Path-Following Guidance for Vehicles That Cannot Stop
A vehicle that cannot stop or turn on the spot follows a line by steering toward a point ahead of it. How far ahead is a design choice with a closed-form consequence for how fast and how well it converges.
A fixed-wing survey aircraft, a boat or Hopper in its downrange translation moves at a speed that cannot be reduced to zero, and a path-following law must work at that speed. This lesson derives the cross-track dynamics of the standard look-ahead law, which turn out to be a second-order system with a damping ratio of 0.707 and a natural frequency set by the ratio of speed to look-ahead distance. It then adds an autopilot lag, which erodes the damping, a vector-field law that has first-order dynamics, and the overshoot of a corner in wind.
Learning objectives
After this lesson, you should be able to:
- Derive the cross-track dynamics of the look-ahead law and obtain its natural frequency and damping ratio.
- Choose the look-ahead distance from a desired convergence time.
- Predict the loss of damping caused by an autopilot lag.
- Compare the vector-field law with the look-ahead law and predict overshoot at a corner, with and without wind.
The intuition
Navigation M5-T4: Pure Pursuit and Navigation M5-T5: Stanley and Cross-Track Control track a path with a ground robot that can slow down, stop and turn at its own pace. The vehicles of this lesson cannot: they fly at close to constant speed and turn with a limited lateral acceleration. What the earlier pages give is a recipe; this lesson gives the cross-track dynamics of the recipe, so the look-ahead can be chosen from a requirement instead of by trial.
Steer toward a point ahead
Draw the path and pick the point on it a distance ahead of the vehicle's position along the path. The vehicle's velocity makes an angle with the line to that point. The nonlinear look-ahead law commands the lateral acceleration that would put the vehicle on a circle through the point: . If the vehicle is on the path and aimed along it, and no command is made. If it is off to one side, points back toward the path and the command is proportional to it.
What it does to the cross-track error
For small angles the geometry is simple. Let be the distance from the path. The angle to the look-ahead point is the sum of two parts: the velocity direction relative to the path, , and the angle at which the vehicle sees the path, . So the commanded acceleration is a position term plus a velocity term, and the cross-track error obeys a second-order linear equation. Its natural frequency is and its damping ratio is , independent of speed and look-ahead. At 20 m/s a look-ahead of 80 m gives a period of 17.8 s and a 4.3% overshoot. The simulation of the full nonlinear law agrees with the linear solution to 0.014 m.
The price of a lag
The law assumes the vehicle turns exactly as commanded. A real autopilot has a time constant between the commanded and the achieved lateral acceleration, and that lag is exactly what damping is made of. With s the damping ratio falls from 0.707 to 0.285 with a look-ahead of 40 m, and to 0.605 with 80 m. With a lag of 1.5 s the 40 m look-ahead has a damping ratio of 0.074, almost undamped. The look-ahead has to be long enough that the cross-track loop is slower than the autopilot, not just fast enough for the survey line.
A vector field instead
The vector-field law gives a commanded course as a function of distance from the line, : aim along the path far away at an angle toward it, and align with it near it. Near the line the cross-track error decays as a first-order system with rate : no overshoot in the ideal case. A gain of 0.03 per metre and an approach angle of 60° gives a time constant of 2.5 s. The cost is that the heading loop must be fast enough to follow the course command, which brings the autopilot lag back in.
The look-ahead law is a PD controller on the cross-track error with a fixed damping ratio of 0.707, and its natural frequency is √2 V/L. Choose L from the convergence time wanted, and check it against the autopilot lag: the loop must be slower than the autopilot.
Definitions
- Cross-track error
- The signed distance from the vehicle to the path, perpendicular to it.
- Look-ahead distance
- The distance along the path from the vehicle's projection to the reference point it steers toward.
- Angle
- The angle between the vehicle's ground velocity and the line from the vehicle to the reference point.
- Vector field
- A course command defined at every point of the plane by the path and the distance from it, converging to the path.
- Autopilot lag
- The time constant of the lateral-acceleration loop that realizes the guidance command.
Derivation: the cross-track dynamics, and what an autopilot lag does
The linearization of the look-ahead law about a straight path.
The path is the x axis. The velocity direction is for small angles; the line to the reference point at (x + L, 0) points down by .
Subtract. Both terms push the vehicle back toward the path: the position term and the velocity term.
For an ideal autopilot the lateral acceleration is the cross-track acceleration for small angles.
Substitute. Compare with : and .
The damping ratio is fixed at 0.707 by the form of the law: the position and velocity gains are tied together by the single parameter L.
With an autopilot lag
Put a first-order lag between the commanded and the achieved lateral acceleration.
With , the cross-track error obeys a third-order equation.
The characteristic polynomial. For it reduces to the ideal pair; for finite the dominant pair loses damping, as the table in the example shows.
The vector field
The cross-track rate is the speed times the sine of the course relative to the path. If the vehicle follows the course command exactly, .
Linearize the arctangent. A first-order decay with a rate .
The look-ahead law is a PD loop on the cross-track error whose two gains are both set by L, so the damping is fixed at 0.707 and only the speed of convergence is chosen. An autopilot lag reduces the damping, and the cure is a longer look-ahead.
A worked example
A survey vehicle at an air speed of 20 m/s.
- Natural frequency and period. L = 20, 40, 80 and 160 m give = 1.414, 0.707, 0.354 and 0.177 rad/s, periods 4.4, 8.9, 17.8 and 35.5 s, all with .
- Check the linearization. From a 10 m offset with L = 80 m the nonlinear simulation differs from the closed-form linear response by at most 0.014 m; the overshoot is 0.43 m, 4.3% of the offset, as the formula says.
- An autopilot lag. With s the damping ratio is 0.676 (L = 40 m) and 0.704 (L = 80 m). With s it is 0.285 and 0.605. With s it is 0.074 and 0.311: the 40 m look-ahead is almost undamped. All the cases are still stable.
- The vector field. With an approach angle of 60°, the gains k = 0.01, 0.03 and 0.10 per metre give decay rates of 0.133, 0.40 and 1.33 per second, time constants 7.5, 2.5 and 0.8 s. The course command saturates beyond about 100, 33 and 10 m.
- A corner. A 90° left turn with the switch made within L of the corner overshoots the second leg by 1.8 m (L = 20), 3.5 (40), 7.0 (80) and 13.8 m (160): proportional to L. With an 8 m/s crosswind on the first leg the overshoots become 2.0, 4.0, 7.9 and 17.4 m, 13% to 26% larger.
- A fillet. With a bank limit of 30° the smallest turn radius at 20 m/s is 70.6 m, so a fillet for a 90° corner starts 70.6 m before the corner: a look-ahead shorter than that cannot hold a corner at all.
import math
import gnckit as g
D2R = math.pi / 180
V = 20.0 # airspeed of the survey vehicle, m/s
print('Linearized cross-track dynamics of the look-ahead law a = 2 V^2 sin(eta) / L: y_ddot + (2V/L) y_dot + (2V^2/L^2) y = 0')
for L in (20.0, 40.0, 80.0, 160.0):
wn = math.sqrt(2) * V / L
print(f' L = {L:5.0f} m: natural frequency {wn:.3f} rad/s (period {2 * math.pi / wn:5.1f} s), damping ratio {(V / L) / wn:.3f}')
def look_ahead_run(L, y0=10.0, T=60.0, dt=0.01):
"""Straight line along x. The vehicle starts 10 m off with its heading along the line. Ideal autopilot: heading rate = a / V."""
x, y, psi = 0.0, y0, 0.0
out = []
for k in range(int(T / dt)):
refx, refy = x + L, 0.0
eta = math.atan2(refy - y, refx - x) - psi
a = 2 * V * V / L * math.sin(eta)
psi += a / V * dt
x += V * math.cos(psi) * dt; y += V * math.sin(psi) * dt
out.append((k * dt, y))
return out
L = 80.0
out = look_ahead_run(L)
wn = math.sqrt(2) * V / L; z = 1 / math.sqrt(2)
wd = wn * math.sqrt(1 - z * z)
errs = [abs(y - 10.0 * math.exp(-z * wn * t) * (math.cos(wd * t) + z / math.sqrt(1 - z * z) * math.sin(wd * t))) for t, y in out]
print(f'simulation against the linear solution (L = 80 m, 10 m offset): largest difference {max(errs):.3f} m; largest overshoot {-min(y for t, y in out):.2f} m')
print(f' linear overshoot for zeta = 0.707: {math.exp(-math.pi * z / math.sqrt(1 - z * z)) * 100:.1f}% of the offset')
print('A first-order autopilot with time constant tau in the loop: poles of (y, y_dot, a) with a_cmd = -(2V^2/L^2) y - (2V/L) y_dot')
for tau in (0.0, 0.3, 0.8, 1.5):
for L in (40.0, 80.0):
if tau == 0.0:
wn = math.sqrt(2) * V / L
print(f' tau = 0.0 s, L = {L:4.0f} m: damping ratio 0.707, natural frequency {wn:.3f} rad/s')
continue
A = [[0, 1, 0], [0, 0, 1], [-2 * V * V / L / L / tau, -2 * V / L / tau, -1 / tau]]
ev = g.mat_eigvals(A)
cplx = [complex(e) for e in ev if abs(complex(e).imag) > 1e-9]
if cplx:
p = cplx[0]; zeta = -p.real / abs(p)
print(f' tau = {tau:3.1f} s, L = {L:4.0f} m: dominant pair {p.real:.3f} +- {abs(p.imag):.3f}j, damping ratio {zeta:.3f}, stable {all(complex(e).real < 0 for e in ev)}')
else:
print(f' tau = {tau:3.1f} s, L = {L:4.0f} m: real poles {[round(complex(e).real, 3) for e in ev]}')
print('Vector field law: course command = -chi_inf (2/pi) atan(k y); near the line y_dot = V chi: first-order decay with rate 2 V chi_inf k / pi')
chi_inf = 60 * D2R
for k in (0.01, 0.03, 0.1):
rate = 2 * V * chi_inf * k / math.pi
print(f' k = {k:5.2f} per m: decay rate {rate:.3f} /s, time constant {1 / rate:5.1f} s; the course command saturates at {chi_inf / D2R:.0f} deg beyond about {math.tan(math.pi / 4) / k:5.0f} m')
def corner_run(L, wind, T=140.0, dt=0.02):
"""Leg 1 along +x to the corner at the origin, leg 2 along +y. Wind from the south at wind m/s (blowing toward +y). Air-relative speed V."""
x, y, psi = -400.0, 0.0, 0.0
leg = 1
peak = 0.0
wx, wy = 0.0, wind
for k in range(int(T / dt)):
gx, gy = V * math.cos(psi) + wx, V * math.sin(psi) + wy
Vg = math.hypot(gx, gy)
if leg == 1:
if math.hypot(x, y) < L:
leg = 2
refx, refy = x + L, 0.0
refx = min(refx, 0.0) if leg == 1 else refx
if leg == 2:
refx, refy = 0.0, y + L
chi = math.atan2(gy, gx)
eta = math.atan2(refy - y, refx - x) - chi
eta = (eta + math.pi) % (2 * math.pi) - math.pi
a = 2 * Vg * Vg / L * math.sin(eta)
psi += a / V * dt
x += gx * dt; y += gy * dt
if leg == 2:
peak = max(peak, x) # x > 0 is beyond the line of the second leg: an overshoot
return peak, (x, y)
print('90 degree left turn at a corner, overshoot beyond the second leg (m); the switch is made within L of the corner:')
print(' L (m) no wind wind 8 m/s from the south (head-on component 0, crosswind on leg 1)')
for L in (20.0, 40.0, 80.0, 160.0):
p0, _ = corner_run(L, 0.0)
p8, _ = corner_run(L, 8.0)
print(f' {L:5.0f} {p0:8.2f} {p8:8.2f}')
R = V * V / (9.81 * math.tan(30 * D2R))
print(f'a fillet for a 90 degree turn at {V:.0f} m/s and a bank limit of 30 deg has radius {R:.1f} m and starts {R * math.tan(45 * D2R):.1f} m before the corner')Linearized cross-track dynamics of the look-ahead law a = 2 V^2 sin(eta) / L: y_ddot + (2V/L) y_dot + (2V^2/L^2) y = 0
L = 20 m: natural frequency 1.414 rad/s (period 4.4 s), damping ratio 0.707
L = 40 m: natural frequency 0.707 rad/s (period 8.9 s), damping ratio 0.707
L = 80 m: natural frequency 0.354 rad/s (period 17.8 s), damping ratio 0.707
L = 160 m: natural frequency 0.177 rad/s (period 35.5 s), damping ratio 0.707
simulation against the linear solution (L = 80 m, 10 m offset): largest difference 0.014 m; largest overshoot 0.43 m
linear overshoot for zeta = 0.707: 4.3% of the offset
A first-order autopilot with time constant tau in the loop: poles of (y, y_dot, a) with a_cmd = -(2V^2/L^2) y - (2V/L) y_dot
tau = 0.0 s, L = 40 m: damping ratio 0.707, natural frequency 0.707 rad/s
tau = 0.0 s, L = 80 m: damping ratio 0.707, natural frequency 0.354 rad/s
tau = 0.3 s, L = 40 m: dominant pair -0.597 +- 0.650j, damping ratio 0.676, stable True
tau = 0.3 s, L = 80 m: dominant pair -0.272 +- 0.275j, damping ratio 0.704, stable True
tau = 0.8 s, L = 40 m: dominant pair -0.265 +- 0.893j, damping ratio 0.285, stable True
tau = 0.8 s, L = 80 m: dominant pair -0.294 +- 0.387j, damping ratio 0.605, stable True
tau = 1.5 s, L = 40 m: dominant pair -0.057 +- 0.775j, damping ratio 0.074, stable True
tau = 1.5 s, L = 80 m: dominant pair -0.147 +- 0.450j, damping ratio 0.311, stable True
Vector field law: course command = -chi_inf (2/pi) atan(k y); near the line y_dot = V chi: first-order decay with rate 2 V chi_inf k / pi
k = 0.01 per m: decay rate 0.133 /s, time constant 7.5 s; the course command saturates at 60 deg beyond about 100 m
k = 0.03 per m: decay rate 0.400 /s, time constant 2.5 s; the course command saturates at 60 deg beyond about 33 m
k = 0.10 per m: decay rate 1.333 /s, time constant 0.8 s; the course command saturates at 60 deg beyond about 10 m
90 degree left turn at a corner, overshoot beyond the second leg (m); the switch is made within L of the corner:
L (m) no wind wind 8 m/s from the south (head-on component 0, crosswind on leg 1)
20 1.82 2.04
40 3.53 4.01
80 6.97 7.89
160 13.84 17.41
a fillet for a 90 degree turn at 20 m/s and a bank limit of 30 deg has radius 70.6 m and starts 70.6 m before the cornerIn robotics
These two laws are the path followers inside most fixed-wing and marine autopilots.
- Fixed-wing autopilots. The nonlinear look-ahead law (often called L1 guidance) is the default path follower in common open-source flight stacks, with the look-ahead distance computed from a period and a damping parameter. The speed-independent damping of 0.707 is its main property.
- Choosing the look-ahead. From a convergence time use , then check that the cross-track loop is at least three to five times slower than the lateral-acceleration loop. The table above shows what happens when it is not.
- Corners. Overshoot at a waypoint grows with the look-ahead and with wind, so the turn is best flown as a fillet (an arc inside the corner, started early), which the mission guidance lesson of this module treats. A short look-ahead gives a tight turn and a high load on the autopilot.
- Wind. The law should use the ground velocity in the angle η, so that a crosswind is seen as a drift and corrected. The vehicle then flies with a crab angle, and the transient at a corner is larger because the ground speed changes as it turns.
- Vector fields. They have no overshoot in the ideal case, define a command everywhere (so the vehicle can start anywhere), and extend to curved paths and loiter circles; they need a heading loop that tracks a course command.
The lab M8-L1: Hold the Survey Line in Wind asks for a survey line held to 2 m in a crosswind. Pure pursuit for ground robots is covered at Navigation M5-T4: Pure Pursuit; the lateral-acceleration autopilot is the subject of M5-T3: Dynamic Inversion and Its Incremental Form's inversion loops.
Common misconceptions
“A shorter look-ahead is always better because it follows the path more tightly.”
It raises the natural frequency and, with a real autopilot, lowers the damping: at τ = 0.8 s the damping ratio of a 40 m look-ahead is 0.285. The look-ahead must match the autopilot as well as the path.
“The look-ahead law has an adjustable damping ratio.”
It has one parameter, L, and the damping is fixed at 0.707 whatever its value. A different damping needs a different law, such as a PD law with separate gains, or a lag compensation.
“Wind needs an integrator.”
If the law uses the ground velocity direction the crosswind is seen as a drift and corrected by the same loop, with no steady error. The wind shows up in the transient at a corner and in the heading, not in a steady offset.
“Overshoot at a corner is a tuning fault.”
It comes from switching to a leg whose line is off the vehicle's course by up to a look-ahead distance. It scales with L (1.8 m at 20 m, 13.8 m at 160 m), so a fillet or a shorter look-ahead is the only cure, not different gains.
“The vector field and the look-ahead law are the same.”
The look-ahead law is second-order in the cross-track error with fixed damping; the vector field is first-order with an adjustable rate, but it assumes the heading loop follows the course command, and when it does not, the dynamics are those of the heading loop.
Key takeaways
- The look-ahead law has linearized cross-track dynamics with and .
- The look-ahead for a period T is ; the overshoot is 4.3% of the offset.
- An autopilot lag reduces the damping: with τ = 0.8 s, 0.285 for L = 40 m and 0.605 for L = 80 m.
- The vector-field law gives a first-order decay with rate and needs a fast heading loop.
- Corner overshoot is proportional to L (1.8 m to 13.8 m) and rises 13% to 26% in an 8 m/s crosswind.
- A fillet for a 90° corner at 20 m/s and a 30° bank starts 70.6 m before the corner.
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.
- S. Park, J. Deyst and J. P. How, "A new nonlinear guidance logic for trajectory tracking", AIAA Guidance, Navigation, and Control Conference, 2004, the origin of the look-ahead (L1) law. Paid (AIAA); the authors' copy is on the MIT dspace repository.
- D. R. Nelson, D. B. Barber, T. W. McLain and R. W. Beard, "Vector field path following for miniature air vehicles", IEEE Transactions on Robotics 23(3), 2007. Paid (IEEE).
- R. W. Beard and T. W. McLain, Small Unmanned Aircraft: Theory and Practice, Princeton University Press, 2012, the chapter on path following. Paid.
- ArduPilot documentation, plane navigation tuning , for how the look-ahead period and damping are exposed to a user. Free to read; licence CC BY-SA 3.0.
Knowledge check
Three questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
A vehicle flies at 25 m/s. What look-ahead gives a cross-track period of 20 s, and what is the damping ratio?
Explanation
The period T = 2π/ωn with ωn = √2 V/L gives L = √2 V T/(2π) = 1.414 × 25 × 20/6.283 = 112.5 m. The damping ratio is 1/√2 = 0.707 whatever the look-ahead or the speed, so the response overshoots by about 4.3%. To change the damping the law itself must be changed, since L does not enter it.
Question 2
With an autopilot lag of 0.8 s the damping ratio of a 40 m look-ahead is 0.285. Why does a longer look-ahead help, and what is the cost?
Explanation
A longer look-ahead lowers the natural frequency of the cross-track loop, √2 V/L, relative to the autopilot bandwidth 1/τ, so the phase lag of the autopilot at the crossover is smaller and the damping recovers: 0.605 at L = 80 m for the same lag. The cost is a slower convergence (a period of 17.8 s against 8.9 s) and a larger corner overshoot (7 m against 3.5 m), so L is a compromise between the autopilot margin and the path-following accuracy.
Question 3
Why does the corner overshoot grow in proportion to the look-ahead distance?
Explanation
The vehicle switches to the second leg when within L of the corner, with its velocity still along the first leg, so it is up to L away from the line of the second leg and must turn to it. The law converges with a damping of 0.707 and overshoots by about 4.3% of the offset it starts with, but the offset itself is of the order of L, and the turn takes time during which it keeps its speed. Both effects scale with L, which is why the simulated overshoot goes from 1.8 m to 13.8 m as L goes from 20 m to 160 m.
What’s next
Related content
Nothing below is required to finish this lesson.
- LabM8-L1: Hold the Survey Line in Wind
A survey aircraft overshoots every turn in a crosswind. Implement look-ahead path guidance, choose the look-ahead from the cross-track dynamics, and hold the line within 2 m.
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.