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

Related simulators

Continue with similar topics in this category — or all 48 in Engineering.

View category →
NewUniversity / research

3-Link 3D Arm Inverse Kinematics (CCD)

Launch Simulator

Continuation of two-link-arm-ik into 3D: 3 revolute joints (yaw + 2 pitches) solved with constrained Cyclic Coordinate Descent. Drag target in 3D or follow a helix / lemniscate / figure-8 trajectory.

NewUniversity / research

PID Controller (1D)

Launch Simulator

Cart on a track: Kp, Ki, Kd and random velocity impulses toward set-point x = 0.

NewUniversity / research

Fatigue S-N Curve + Miner Rule

Launch Simulator

Basquin S-N curve with optional endurance limit, three cyclic load blocks, and Palmgren-Miner cumulative damage D = Σ n_i/N_i.

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.

NewUniversity / research

Holonomic 2D Hovercraft MPC (MPPI)

Launch Simulator

Planar double integrator with ‖u‖₂ thrust cap: sampling-based MPPI steers to a draggable goal while soft-penalizing circular obstacles — rollout fan and best predicted path drawn live.

NewSchool

RRT Path Planner (grid)

Launch Simulator

Same 40×28 wall map as A*: random samples, nearest-neighbor steer, goal bias, collision-checked edges; grow an RRT and compare summary stats with one-click Manhattan A* baseline.

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.