Book contents
Contents
raw Math
RAW Book Robotics Path Following

Introduction to Path Following for Wheeled Robots

Robert Eisele

Place the midpoint of the rear axle on a painted circle. Point the car along the tangent, set the front wheels straight, and drive forward. Both the lateral error and the heading error are initially zero. Why does the car immediately begin to leave the path? Place it one metre outside the circle and the missing problem becomes more visible: curvature tells the wheels a required turning rate, but feedback is needed to remove the displacement.

This chapter derives a path follower for a wheeled robot from the first geometric quantities available along an oriented curve. It uses the curvature chapter for tangent, signed curvature and osculating-circle calculations. The controller itself answers three separate questions:

Project the Vehicle into the Path Frame

Let \(P\) be the midpoint of the rear axle and let \(\mathbf r(u)\) be the current path branch. Choose the point nearest to the vehicle by minimizing the half-squared distance

\[ D(u)=\tfrac12\|\mathbf r(u)-P\|^2, \qquad D'(u)= (\mathbf r(u)-P)^T\mathbf r'(u). \]

An interior regular minimum \(u_*\) satisfies \(D'(u_*)=0\). The connection \(P-\mathbf r(u_*)\) is therefore perpendicular to the tangent. Define

\[ Q=\mathbf r(u_*), \qquad \mathbf T={\mathbf r'(u_*)\over\|\mathbf r'(u_*)\|}, \qquad \mathbf N=(-T_y,T_x). \]

The signed lateral error and the remaining path distance now have separate meanings:

\[ e_n=(P-Q)^T\mathbf N, \qquad e_t=(P-Q)^T\mathbf T, \qquad S-s=\text{remaining arc length along the path}. \]

At a regular interior projection, \(e_t=0\). The quantity for stopping and look-ahead is \(S-s\), not \(e_t\). At an endpoint, \(e_t\) can additionally report whether the rear axle lies beyond the terminal tangent. A figure-eight path can have two valid projections at the same position, so the controller keeps the previous path branch or parameter instead of choosing an arbitrary crossing. At the interior projection, \(P-Q\) is parallel to \(\mathbf N\); a positive \(e_n\) means that the vehicle is left of the path.

\[ P-Q=e_n\mathbf N+e_t\mathbf T. \]

For steering feedback, the normal component supplies the side and amount of displacement. A figure-eight path can have two valid projections at the same position; the controller must also keep the previous path branch or parameter instead of choosing an arbitrary crossing.

The normal coordinate is not a fixed screen direction. It rotates with the path tangent.

Heading Error and Approach Direction

The recovery geometry follows directly from a fixed exponential error decay. In local coordinates \(\xi\) along the tangent held at \(Q\) and \(\eta\) normal to it, require that a fixed fraction of the remaining lateral error disappear per metre of forward motion:

\[ {d\eta\over d\xi}=-k\eta, \qquad \eta(0)=e_n, \qquad k>0. \]

The differential equation separates into \(d\eta/\eta=-k\,d\xi\). Its solution is \(\eta(\xi)=e_ne^{-k\xi}\). After \(1/k\) metres, \(e_n/e\) remains; thus \(k\) has unit \(\mathrm m^{-1}\).

Let \(\theta_t=\operatorname{atan2}(T_y,T_x)\) be the tangent heading and \(\theta\) the vehicle heading. A lateral error alone does not determine whether the car is facing the path. The controller therefore needs

\[ e_\theta= \operatorname{wrap}(\theta_d-\theta), \qquad \operatorname{wrap}(x)=\operatorname{atan2}(\sin x,\cos x). \]

The wrapping matters near the angle branch cut. If the vehicle heading is \(-179^\circ\) and the desired heading is \(+179^\circ\), for example, the difference is not \(-358^\circ\) but \(+2^\circ\). The shortest correction is therefore to turn right two degrees.

The recovery curve also gives a desired heading in the moving frame:

\[ x_n(x_t)=e_n e^{-kx_t},\qquad k>0. \]

This curve passes through the vehicle's normal coordinate at the path point and decays toward zero. Differentiating at the path position gives

\[ {dx_n\over dx_t}(0)=-ke_n. \]

The tangent of the recovery curve has slope \(-ke_n\). To make the vehicle point along that tangent,

\[ \phi_c=-\arctan(ke_n), \qquad \theta_d=\theta_t+\phi_c. \]

Because \(\tan\phi_c=-ke_n\), the direction is equivalently specified by \(\phi_c=-\arctan(ke_n)\). The exponential construction does not predict tyre motion. It specifies a desired direction in the path frame. A positive \(k\) makes recovery stronger, but it does not prove closed-loop vehicle stability by itself. It must be followed by a vehicle model and a steering saturation limit.

Derive the Bicycle Feedforward

In a top view, the normal to the rear-wheel roll direction and the normal to the front-wheel roll direction meet at the instantaneous centre of curvature. Let \(R\) be the signed rear-axle radius. The right triangle with wheelbase \(L\) and equivalent steering angle \(\delta\) gives

\[ \tan\delta={L\over R}, \qquad \dot\theta={v\over R}={v\over L}\tan\delta. \]

Model the rear axle by position \((x,y)\), heading \(\theta\), wheelbase \(L\), and equivalent steering angle \(\delta\). At forward speed \(v>0\), the kinematic bicycle equations are

\[ \dot x=v\cos\theta, \qquad \dot y=v\sin\theta, \qquad \dot\theta={v\over L}\tan\delta. \]

The equations follow from the rear-axle velocity having magnitude \(v\) and heading \(\theta\). The yaw-rate equation is exactly the triangle result above. This is the geometrical interpretation used in the Ackermann steering model. Ackermann steering allocates the same geometric steering demand to the two front wheels.

If the vehicle is exactly on a reference path, curvature gives the required change of heading per metre:

\[ {d\theta\over ds}=\kappa_s, \qquad {ds\over dt}=v. \]

Applying the chain rule gives

\[ \dot\theta={d\theta\over ds}{ds\over dt}=v\kappa_s. \]

Equate this yaw rate with the bicycle yaw rate and cancel positive speed:

\[ {v\over L}\tan\delta_{ff}=v\kappa_s \quad\Longrightarrow\quad \delta_{ff}=\arctan(L\kappa_s). \]

This term is geometry feedforward. It is already the right steering angle for a perfectly posed vehicle on the reference path. It has no chance to remove lateral displacement or heading mismatch.

Add Feedback Around the Feedforward

The proportional controller uses the same heading error that is available in the moving path frame. For small errors, a length proportional to \(e_\theta\) is a natural steering correction: \(\delta_{fb}=K_Pe_\theta\), where \(K_P\) is chosen by the controller designer. The variable \(\delta_{\max}\) is the largest allowed equivalent steering angle of the bicycle model. Huskić and colleagues used the proportional case \(K_P=1, K_I=K_D=0\) in the cited Ackermann experiments. See their original path-following formulation for the exponential approach geometry. The curvature term added here is feedforward rather than part of the original proportional feedback law.

The proportional controller uses the same heading error that is available in the moving path frame:

\[ \delta =\operatorname{clip}\left( \arctan(L\kappa_s(Q))+K_Pe_\theta, -\delta_{\max},\delta_{\max}\right). \]

Feedforward supplies the path demand, while feedback supplies the correction from the actual pose. The clip is essential: a controller result outside the steering mechanism can never be realized. Integral and derivative terms can address actuator bias or dynamic phase delay, but they do not replace the geometric decomposition.

Parameters: \(L=1\,\mathrm m\), \(v=1.5\,\mathrm{m/s}\), \(\delta_{\max}=35^\circ\).

Blue is the radius-four-metre reference circle. Orange is the rear-axle trace. Start on the circle to isolate feedforward, or one metre outside to expose the need for feedback.

Curvature of a Fixed Cubic Bézier Reference

Reserve \(t\) for time, \(u\in[0,1]\) for the parameter of one segment, and \(s\) for travelled arc length. Let four control points be \(\mathbf P_0,\ldots,\mathbf P_3\), and define \(\Delta\mathbf P_i=\mathbf P_{i+1}-\mathbf P_i\). The segment is \(\mathbf B(u)=(x(u),y(u))\). Differentiating the cubic representation gives

\[ \mathbf B'=3\left[(1-u)^2\Delta P_0+2(1-u)u\Delta P_1+u^2\Delta P_2\right], \] \[ \mathbf B''=6\left[(1-u)(\Delta P_1-\Delta P_0)+u(\Delta P_2-\Delta P_1)\right]. \]

Substituting them in the planar determinant formula gives signed curvature:

\[ \kappa_s(u)= {B'_xB''_y-B'_yB''_x\over\|\mathbf B'(u)\|^3}, \qquad Q=\mathbf B(u_*), \quad \mathbf T={\mathbf B'(u_*)\over\|\mathbf B'(u_*)\|}. \]

The derivatives depend on the parameterization, but the quotient gives the same signed curvature under a regular, orientation-preserving reparametrization. It is undefined where \(\mathbf B'=0\). A segment with a cusp or stationary tangent needs a segment split or an explicit join rule. A sharp set of control points can have no cusp and still demand steering beyond \(\delta_{\max}\).

Nearest-Point Projection

Along a general curve, the controller cannot assume that the nearest path point is found by sampling screen pixels. It minimizes distance from the rear axle to the actual reference segment. For one cubic,

\[ D(u)={1\over2}\|\mathbf B(u)-P\|^2. \]

An interior stationary point satisfies

\[ D'(u)=\left(\mathbf B(u)-P\right)^T\mathbf B'(u)=0. \]

For a cubic, this is normally a fifth-degree equation after differentiation. More than one solution can occur. A robust implementation evaluates both segment endpoints and all roots in the current segment window, then keeps the branch connected to the previous path position. At a figure-eight crossing, an a priori choice is not enough; continuity of the tracked segment supplies the tie-breaker.

The selected point \(Q\) minimizes the cubic distance; \(PQ\) is the perpendicular lot. Move the offset to watch lateral error, tangent and signed curvature change on the same fixed path.

Speed Limits from Geometry and Actuation

Steering and curvature become dynamically important only after speed is known. The steering mechanism gives a geometric minimum turning radius

\[ \rho_{\min}={L\over\tan\delta_{\max}}. \]

The lateral acceleration limit gives another bound. From \(a_\perp=v^2|\kappa_s|\le a_{\perp,\max}\),

\[ a_n=v^2|\kappa_s|, \qquad v\le\sqrt{a_n^{\max}\over|\kappa_s|} \quad\text{for}\quad\kappa_s\ne0. \]

Let \(v_0>0\) be nominal speed, \(a_b>0\) an available deceleration, and \(S\) the total path length. Near the end, braking distance bounds speed. Starting from \(v(S)=0\), constant deceleration obeys \(a=v\,dv/ds=-a_b\). Separation and integration gives

\[ v\le\sqrt{2a_b(S-s)}, \]

where \(S-s\) is remaining arc length. One conservative spatial command is

\[ v(s)=\min\left(v_0, \sqrt{a_n^{\max}/|\kappa_s(s)|}, \sqrt{2a_b(S-s)}\right). \]
start goal local limit braking profile
The blue curve is the local geometric or lateral-acceleration limit. The orange curve starts braking before the curve and reaches the goal at rest. Their minimum is a spatial speed command, not a command at the current point alone.

This formula is intentionally only a first bound. Tyre forces, bank angle, load transfer, slip and control latency require a vehicle-specific model before it is used as a physical speed law.

References