Your Equation

Library / Guidance and trajectory following / GUI-03

Guidance and trajectory following

Course command for straight-path following

Course to fly to rejoin a straight path: the path course turned towards the line by an intercept angle that grows with the cross-track error and shrinks with the lookahead distance Δ.

Ref
GUI-03
Rev
v1
Field
Guidance and trajectory following
Result
χcmd [°]

To rejoin a straight path the vehicle steers towards a point a distance Δ ahead along the path. For a cross-track error e⊥ that point is at an angle arctan(e⊥/Δ) to the path, so the command is χcmd = χp − arctan(e⊥/Δ). A vehicle to the right (positive e⊥) is told to point to the left of the path course. The intercept angle never exceeds 90°. The command is shown between 0° and 360°.

Course to fly to rejoin a straight path: the path course turned towards the line by an intercept angle that grows with the cross-track error and shrinks with the lookahead distance Δ.

Calculator

Solve for
°
°
0360
m
−300300
m
501,000
  • Intercept angle, arctan(e⊥/Δ)19.29 °
  • Ratio e⊥/Δ0.35
  • Time constant of the approach, Δ/V (at V = 20 m/s)10 s

What drives the result

Each variable is moved across its typical range while the others stay at the values above. The longest bar is the key driver.

Commanded course (°) current value 70.71 °
χpPath course (clockwise from north)Key driver
4.71353
e⊥Cross-track error (right positive)
33.7146
ΔLookahead distance
35.586
  • A vehicle 70 m to the right of a path heading 90° is told to steer 70.71°, turned 19.3° towards the line. As the error falls, the angle shrinks and the vehicle settles smoothly on to the path.
  • A lookahead of 500 m instead of 200 m reduces the angle to 7.97°, a gentler approach that takes longer. For small errors the error decays with a time constant of about Δ/V, 10 s at 20 m/s, if the course is tracked well.
Chart data as tables

Ranked variables

VariableTypical rangeLowest resultHighest resultSwing (°)Local stepChange in result
χp Path course (clockwise from north)0 to 360 °4.71352.7348+10%+9 °
e⊥ Cross-track error (right positive)−300 to 300 m33.69146.3112.6+12 m−3 °
Δ Lookahead distance50 to 1,000 m35.548650.46+10%+1.64 °

Sweep of Cross-track error (right positive)

Cross-track error (right positive) (m)Commanded course (°)
−300146.3
−225138.4
−150126.9
−75110.6
090
7569.44
15053.13
22541.63
30033.69

Sweep one variable

Commanded course (°)Hover, touch, or use the arrow keys on the chart
406080100120140 −300−200−1000100200300 Cross-track error (right positive) (m) now 70.71

Variables and how each one contributes

χcmd

Commanded course

Result · °

What the equation gives you. Everything else feeds it.

χp

Path course (clockwise from north)

° · typical 0 to 360

The course of the path in degrees, clockwise from north. The command follows the path course one for one. Raising it by 10° (to 100°) moves the result by +14.1 %, from 70.71 to 80.71 °.

e⊥

Cross-track error (right positive)

m · typical −300 to 300

The cross-track error in m. Positive is to the right of the path. A larger error to the right turns the command further left of the path course. Raising it by 30 m (to 100 m) moves the result by −10.3 %, from 70.71 to 63.43 °.

Δ

Lookahead distance

m · typical 50 to 1,000

The lookahead distance Δ in m: how far ahead along the path the vehicle aims. A longer lookahead gives a gentler intercept angle, so the command stays closer to the path course. Raising it by 10 % (to 220) moves the result by +2.32 %, from 70.71 to 72.35 °.

Worked example with the values above

  1. Ratio: e⊥/Δ = 70 / 200 = 0.35.
  2. Intercept angle: arctan(0.35) = 19.29°.
  3. χcmd = 90° − 19.29° = 70.71°.

Assumptions and limits

  • A straight path, and a vehicle that tracks its commanded course well compared with the lookahead time.
  • A fixed lookahead distance Δ > 0, with courses in degrees clockwise from north.

Common mistakes

  • Using a very small lookahead. It gives violent turns and chatter, and ignores the turn dynamics of the vehicle.
  • Using a very large lookahead, which cuts corners and responds slowly to a real offset.

Statistics and uncertainty

The lookahead trades response for noise: a small Δ gives a sharp intercept that amplifies position noise into course commands, since the angle is about e⊥/Δ radians. A cross-track error that is wrong by 5 m produces about 1.4° of command error with Δ = 200 m, but 5.7° with Δ = 50 m.

Where it is used

  • Waypoint-leg following for aircraft, ships and ground vehicles.
  • Choosing the lookahead distance to set how aggressively a path is rejoined.

Maths you need

  • Arctangent: the angle whose tangent is the given ratio
  • Cross-track error: sideways distance from the path

Related formulas

Practise this formula