4.4 Rear wheel feedback
The rear wheel feedback controller for path tracking explained, with its equations, its Lyapunov stability argument and a Python simulation. Rear wheel feedback steers a vehicle along a course by looking at the lateral error and the heading error at the rear axle, and at the course’s curvature there. After this section, you can derive its yaw rate law from the motion of the vehicle relative to the course, and compare it with Pure Pursuit and Stanley.
Problem and intuition
Pure Pursuit (4.2) and Stanley (4.3) are geometric: they steer toward the course without knowing where it bends next. Rear wheel feedback adds that knowledge. Its yaw rate has two parts:
Follow the curve. If the vehicle were exactly on the course, it would have to turn at the rate the course turns, \(v\kappa\). This feedforward term comes from the course’s curvature (equation (8) of 4.1), not from an error.
Correct the errors. On top of it, the controller turns back by the heading error and toward the course by the lateral error, with two gains.
The errors are measured at the rear axle, the point whose motion the kinematic bicycle model describes most simply: it moves along the vehicle’s heading and never sideways (Chapter 3). This makes it possible to write how the errors change in time exactly, and to choose the law so that the errors are guaranteed to shrink, with a Lyapunov function [1], [2].
![]()
Run it from the repository root: python src/simulations/path_tracking/rear_wheel_feedback_tracking/rear_wheel_feedback_tracking.py (code on GitHub)
Theory
The symbols follow Notation and Units. The vehicle’s state \((x, y, \theta, v)\) is given at the rear axle.
The errors at the rear axle
Let \((x_r, y_r)\) be the course point nearest to the rear axle, and \(\theta_r\) and \(\kappa\) the course’s yaw and curvature there. The heading error \(\theta_e\) and the lateral error \(e\) are
These are the errors of the Stanley controller, measured at the rear axle instead of the front axle. \(e\) is positive when the rear axle is on the left of the course, \(\theta_e\) when the vehicle points to the left of it.
The errors of rear wheel feedback, at the rear axle. Here the rear axle is on the left of the course and the vehicle points to the left of it, so both \(e\) and \(\theta_e\) are positive.
How the errors change
Describe the rear axle’s position by the distance \(s\) along the course to its nearest point, and by the lateral error \(e\). Here \(s\) is the true distance driven along the course (the \(\sigma\) of 4.1), not the spline’s chord-length parameter, which is only close to it. The rear axle moves with speed \(v\) along the heading, which is turned by \(\theta_e\) from the course, so it moves sideways at \(v\sin\theta_e\) and along the course direction at \(v\cos\theta_e\).
Along the course, the nearest point doesn’t move at the same speed as the rear axle. The course turns around its center of curvature, at the distance \(1/\kappa\) on the left of the course. The rear axle is \(e\) to the left, so it is at the distance \(1/\kappa - e\) from that center, and a motion of \(v\cos\theta_e\) there moves the nearest point by a factor \((1/\kappa) / (1/\kappa - e) = 1 / (1 - \kappa e)\) more. The heading error changes as the vehicle turns, minus as the course turns under it. Together:
where \(\omega\) is the vehicle’s yaw rate, the input of the vehicle model. These are the equations of motion in the course’s frame, also called the Frenet frame [1].
The control law
The yaw rate of rear wheel feedback is [1], [2]
with the heading error gain \(k_\theta > 0\) in 1/m and the lateral error gain \(k_e > 0\) in 1/m².
The first term is the feedforward: by (2), it is exactly the yaw rate that keeps \(\theta_e\) constant. On the course with \(e = \theta_e = 0\), it is \(v\kappa\), the yaw rate of driving the course.
The second term turns back by the heading error. It uses \(|v|\), so it still turns back when the vehicle drives backward.
The third term turns toward the course. For a small heading error, \(\sin\theta_e / \theta_e \approx 1\) and the term is about \(-k_e v e\). The factor \(\sin\theta_e / \theta_e\) is there to make the Lyapunov argument below work; it tends to 1 as \(\theta_e \to 0\).
Why the errors shrink
Take the Lyapunov function, a measure of how far the vehicle is from the course that is zero only on the course:
With (2) and (3), the first term of (3) cancels the course’s turning in \(\dot\theta_e\), which leaves \(\dot\theta_e = -k_\theta|v|\theta_e - k_e v (\sin\theta_e/\theta_e)\,e\). Then
The third term of (3) was chosen so that the two \(2ev\sin\theta_e\) terms cancel. \(V\) never grows, so the errors stay bounded, and it decreases whenever \(\theta_e \ne 0\). It can’t get stuck with \(\theta_e = 0\) and \(e \ne 0\), because then \(\dot\theta_e = -k_e v e \ne 0\) and the heading error grows again. So while the vehicle moves (\(v \ne 0\)) and stays close enough to the course for the nearest point to be well defined, both errors go to zero [1].
Steering angle. The vehicle model takes \(\omega\) directly. The steering angle that drives it follows from equation (3) of Chapter 3:
and \(\delta = 0\) when the vehicle stands still.
Speed. The speed follows the course’s target speed \(v_r\) at the nearest point with a proportional controller, \(a = k_v (v_r - v)\).
Behavior near the course
For small errors on a straight course (\(\kappa = 0\)) and \(v > 0\), (2) and (3) become \(\dot e \approx v\theta_e\) and \(\dot\theta_e \approx -k_\theta v\,\theta_e - k_e v\,e\). Written per meter driven (\(d/dt = v\,d/ds\)):
The speed has dropped out: the vehicle comes back to the course over the same distance at any speed, and with the natural frequency \(\sqrt{k_e}\) per meter and the damping ratio \(\zeta = k_\theta / (2\sqrt{k_e})\). The simulation uses \(k_\theta = 1\) 1/m and \(k_e = 0.5\) 1/m², so \(\zeta \approx 0.71\).
(7) is the same equation as (7) of 4.2 written per meter, with \(k_\theta = 2/l_d\) and \(k_e = 2/l_d^2\). Near a straight course, rear wheel feedback behaves like Pure Pursuit with a fixed look-ahead distance; the gains of the simulation match \(l_d = 2\) m. What rear wheel feedback adds is the feedforward term, which makes it follow a curve without waiting for an error to build up.
Algorithm
At every time step, given the state (x, y, theta, v) at the rear axle:
1. Find the course point nearest to the rear axle, and its yaw, curvature and target speed
2. Compute the heading error and the lateral error with (1)
3. Compute the yaw rate with (3)
4. Compute the steering angle with (6), using 0 when v = 0
5. Compute the acceleration from the target speed
Pure Pursuit vs Stanley vs rear wheel feedback
Pure Pursuit (4.2) |
Stanley (4.3) |
Rear wheel feedback (4.4) |
|
|---|---|---|---|
Point on the vehicle |
Rear axle |
Front axle |
Rear axle |
Point on the course |
One point \(l_d\) ahead |
Nearest to the front axle |
Nearest to the rear axle |
What it uses |
The direction to the look-ahead point, \(\alpha\) |
Heading error \(\theta_e\), lateral error \(e\) |
\(\theta_e\), \(e\) and the curvature \(\kappa\) |
Looks ahead |
Yes, by \(l_d\) |
No |
No, but knows how the course bends where the vehicle is |
Output |
Steering angle \(\delta\) |
Steering angle \(\delta\) |
Yaw rate \(\omega\) |
Parameters |
\(l_d\), or \(k\) and \(l_{d,\min}\) |
\(k\) |
\(k_\theta\), \(k_e\) |
Coming back to the course |
Reaches the course after about \(2.4\,l_d\): a fixed distance with a fixed \(l_d\), a fixed time with \(l_d \propto v\) |
At the rate \(k\) per second: over a distance that grows with \(v\) |
Over a fixed distance, set by \(k_\theta\) and \(k_e\) |
At high speed |
Needs a longer \(l_d\), otherwise it corrects too fast |
Its correction \(k e / v\) softens by itself |
Corrects as fast per meter as at low speed, so the gains must be lowered |
Needs from the course |
Positions only |
Positions and yaw |
Positions, yaw and a smooth curvature |
All three use the kinematic bicycle model, so all three lose accuracy when the tires slip at high speed. Chapter 10 replaces them with controllers that optimize over a horizon.
Limits
Far from the course. (2) and (3) divide by \(1 - \kappa e\), which is zero when the rear axle is at the course’s center of curvature, \(e = 1/\kappa\). The law is meant for a vehicle near the course; far from it, the nearest point can also jump from one part of the course to another [1].
A smooth curvature. The curvature goes straight into the yaw rate through the feedforward term, so the course needs a continuous curvature. The cubic spline of 4.1 has one; a polyline or a course with noisy curvature would make the steering jump.
Speed and gains. By (7), the vehicle corrects an error over the same distance at any speed, so at high speed it corrects in less time, with large yaw rates. \(k_\theta\) and \(k_e\) have to be lowered for fast driving, or scaled with the speed. At low speed, (6) turns even a small \(\omega\) into a large steering angle, and the code doesn’t limit it.
Zero heading error in the code. \(\sin\theta_e / \theta_e\) can’t be computed when \(\theta_e\) is exactly 0, so the implementation uses its limit, 1, at that step. The feedforward and the lateral error terms are kept, so a vehicle beside the course and heading along it still steers back.
Lateral error in the vehicle’s frame. (1) measures the offset along the vehicle’s left direction, as for Stanley, while (2) uses the distance perpendicular to the course. The two agree when the heading error is small.
Sign convention of the reference. [1] gives the same law (3) and the same equations (2); its figure draws \(e\) with the opposite sign. The signs of this page follow Notation and Units.
Kinematic model only. The law ignores tire slip and actuator delay, like the other controllers of this chapter.
Check your understanding
The vehicle drives exactly on a circular course of radius 20 m (\(e = \theta_e = 0\)) at 5 m/s. What yaw rate does (3) give, and which of its terms gives it?
Answer
\(\omega = v\kappa = 5 \cdot 0.05 = 0.25\) rad/s, all from the first term, the feedforward. The other two terms are 0 because both errors are 0. This is why rear wheel feedback follows a curve without waiting for an error to build up.
Why does the third term of (3) contain the factor \(\sin\theta_e / \theta_e\), when a plain \(-k_e v e\) would also steer toward the course?
Answer
So that the Lyapunov function (4) never grows. With the factor, the third term contributes \(-2ev\sin\theta_e\) to \(\dot V\) in (5), which cancels the \(+2ev\sin\theta_e\) coming from \(\dot e\), and \(\dot V \le 0\) is left. Without it, the two terms don’t cancel for a large heading error, and the argument fails.
Near a straight course, (7) of rear wheel feedback is the same equation as Pure Pursuit’s (7) with \(k_\theta = 2/l_d\) and \(k_e = 2/l_d^2\). Which behavior can rear wheel feedback choose that Pure Pursuit with a fixed \(l_d\) can’t?
Answer
The damping. Pure Pursuit has one parameter, so both coefficients come from \(l_d\), and its damping ratio is always \(1/\sqrt{2}\). Rear wheel feedback has two gains, and its damping ratio \(k_\theta / (2\sqrt{k_e})\) can be set apart from how fast it comes back. For example \(k_\theta = 1\) 1/m and \(k_e = 1\) 1/m² give \(\zeta = 0.5\), which no \(l_d\) gives.
Note
This section has its theory. The code walkthrough, experiments and exercises are added after the code roadmap’s Phase 1 (#131), when the interfaces they show are stable.
References
B. Paden, M. Čáp, S. Z. Yong, D. Yershov and E. Frazzoli, “A Survey of Motion Planning and Control Techniques for Self-Driving Urban Vehicles”, IEEE Transactions on Intelligent Vehicles, vol. 1, no. 1, pp. 33–55, 2016. Section V-A2. DOI, arXiv
C. Samson, “Path following and time-varying feedback stabilization of a wheeled mobile robot”, International Conference on Automation, Robotics and Computer Vision, 1992. The original of the law, as cited by [1].