PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Engineering

Other simulators in this category — or see all 48.

View category →
NewSchool

Stress–Strain & Hooke’s Law

Launch Simulator

Qualitative σ–ε curve: elastic Hooke region, yield, strain hardening, necking, and fracture. Drag strain and tune E, σ_y, σ_u.

NewSchool

Quadcopter 2D (Pitch)

Launch Simulator

Side view: two rotors, PD on thrust split vs pitch — whiteboard quad slice.

NewSchool

Watt Governor (schematic)

Launch Simulator

Flyballs and sleeve vs RPM; steam throttle gap — speed feedback cartoon.

FeaturedSchool

Logic Gate Simulator

Launch Simulator

AND, OR, NOT, NAND, XOR. Drag, drop, connect, see output.

School

Truth Table Generator

Launch Simulator

Build a circuit, auto-generate the truth table.

NewSchool

Bridge Builder

Launch Simulator

Place beams and joints. Apply load. See stress distribution.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Engineering/Bicycle Model & Stanley Controller

Bicycle Model & Stanley Controller

Kinematic bicycle (rear-axle): δ = θ_e + atan2(k_e·e, v) Stanley path-following law. Pick oval, race-track, lemniscate, sine-road or S-curve and tune k_e, v, L; live cross-track e(t) and steering δ(t).

Stanley controller

2
8m/s
2.5m
35°
0°

Path preset

Shortcuts

  • •Pause / Play to inspect; tweak k_e and v while running

Measured values

cross-track e0.00m
heading error θ_e0.0°
steering δ0.0°
turn radius v/(δ·L)∞m
pos (x,y)0.0, 0.0m

About this model

The kinematic bicycle model places the state at the rear axle with wheelbase L and steering angle δ, approximating car-like nonholonomic motion without tire slip. Path following here uses the Stanley controller: δ = θ_e + atan2(k_e · e, v), combining heading error θ_e with a speed-scheduled correction of cross-track error e. Pick oval, race-track, lemniscate, sine-road, or S-curve references and tune gain k_e, speed v, and L while plotting e(t) and δ(t). Assumptions include pure rolling (no sideslip), instantaneous steering, flat ground, and no dynamics of inertia or actuators. Vary k_e and v to see overcut corners versus sluggish convergence to the path.

Who it's for: Vehicle dynamics, autonomous driving, mobile robotics, and advanced control courses.

Key terms

  • Kinematic bicycle model
  • Stanley controller
  • Cross-track error
  • Path following
  • Wheelbase
  • Nonholonomic vehicle

How it works

Kinematic bicycle model with the Stanley path-following controller used by Stanford's eponymous DARPA Grand Challenge winner. The control law combines two terms: align with the path heading (θ_e) and pull toward the path proportionally to cross-track error e measured at the front axle, scaled by 1/v: δ = θ_e + atan2(k_e · e, v). Increase k_e for tighter tracking on tight curves; decrease it to avoid oscillations. Try changing speed v with a fixed k_e to see why the atan2 normalization keeps tracking stable across speeds. Bottom panel plots the cross-track error e(t) in pink and the steering δ(t) in yellow.

Key equations

Bicycle: ẋ = v cosθ, ẏ = v sinθ, θ̇ = (v/L) tanδ
Stanley: δ = θ_e + atan2(k_e · e, v_x), δ ∈ [−δ_max, δ_max]

Frequently asked questions

What does the atan2(k_e·e, v) term do?
It converts cross-track error into a steering correction that shrinks as speed v rises, so the same lateral error commands less aggressive δ at high speed. k_e sets how strongly the controller hunts the path.
Why use a kinematic bicycle instead of a dynamic model?
At moderate speeds and teaching fidelity, geometry of L and δ already captures nonholonomic path constraints. Tire force dynamics, load transfer, and slip angles are omitted so the Stanley law stays transparent.
What if k_e is too large?
The vehicle overcorrects, weaving about the reference with large δ swings. Too small k_e leaves a persistent lag in e(t), especially on tight curves where heading error alone is not enough.