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 31.

View category →
NewUniversity / research

3-Link 3D Arm Inverse Kinematics (CCD)

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.

Launch Simulator
NewUniversity / research

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).

Launch Simulator
NewSchool

Stress–Strain & Hooke’s Law

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

Launch Simulator
NewSchool

Quadcopter 2D (Pitch)

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

Launch Simulator
NewSchool

Watt Governor (schematic)

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

Launch Simulator
FeaturedSchool

Logic Gate Simulator

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

Launch Simulator
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/Holonomic 2D Hovercraft MPC (MPPI)

Holonomic 2D Hovercraft MPC (MPPI)

This page extends the sampling-based MPC idea from engineering/mpc-pendulum to a planar holonomic “hovercraft” modeled as a double integrator: ẍ = u_x, ÿ = u_y with a bounded Euclidean thrust ‖(u_x, u_y)‖₂ ≤ u_max. A Model Predictive Path Integral (MPPI) loop draws K noisy open-loop acceleration sequences over a horizon H, rolls each trajectory forward with simple semi-implicit Euler steps plus light velocity damping, and scores rollouts with a quadratic goal attraction to a click-draggable target, velocity regularization, control effort, and soft obstacle costs around fixed circular rocks (exponential “skirt” when outside plus a strong quadratic penalty if the robot disk penetrates the inflated obstacle boundary). The weighted-average control update matches MPPI’s information-theoretic reweighting; the simulator applies the first mean action until the next replan at interval Δt. Purple fan trajectories (optional when K is not huge) visualize the ensemble; the green polyline is the lowest-cost sample path from the last plan. Layout presets create a narrow corridor or an offset pillar field so students can trade horizon, temperature λ, noise σ, and obstacle weights against conservatism and compute budget.

Who it's for: Students who finished the pendulum MPPI demo and want the same sampling intuition on a 2D navigation task before touching full nonholonomic models or QP-based MPC.

Key terms

  • Holonomic robot
  • Double integrator
  • Model Predictive Path Integral (MPPI)
  • Trajectory sampling
  • Soft collision constraints
  • Obstacle avoidance
  • Warm-started control sequence

MPPI (holonomic 2D)

26
96
0.55 m/s²
0.85
0.06 s
2.4 m/s²

Cost

3.2
0.35
0.08
14
2.2
420
0.14 m
0.25
4242

Obstacles are soft costs (exponential skirt + quadratic penetration). Tight gaps need enough q_crash and horizon to “see” the corridor.

Shortcuts

  • •Click anywhere in the arena to move the goal (yellow crosshair).
  • •If the canvas stutters, lower samples K or disable rollout fan.

Measured values

Distance to goal0.000 m
Speed ‖v‖0.000 m/s
Best rollout cost0.0

How it works

Holonomic 2D “hovercraft” with ẍ = u_x, ÿ = u_y and bounded L2 thrust: MPPI rolls K noisy acceleration trajectories over horizon H, adds obstacle skirts around circular rocks, and reweights the mean control each step — same sampling spirit as engineering/mpc-pendulum, now with goal seeking and collision avoidance in the plane.

Key equations

ẍ = u_x, ÿ = u_y, with ‖(u_x,u_y)‖₂ ≤ u_max — holonomic double integrator (hovercraft abstraction).

MPPI: sample noisy accelerations along the horizon, score rollouts with goal, speed, effort, and obstacle soft penalties, then exponential weights update the mean control sequence.

Frequently asked questions

Why soft obstacles instead of hard “if collision discard rollout”?
Hard rejection creates discontinuous costs and brittle gradients for sampling methods—many rollouts die in useless configurations. Smooth penalties keep grad-like information in the exponential weights while still exploding cost on deep penetration.
Is this literally a hovercraft dynamics model?
Only as a cartoon: real hovercraft have attitude–thrust coupling, fan dynamics, and ground effect. The double integrator with ‖u‖₂ cap is the standard holonomic surrogate used in curricula to isolate MPC in the plane.
Why does the robot sometimes scrape obstacles despite MPC?
Soft costs allow trade-offs: if q_pos dominates or horizon is short, the planner may briefly accept small penetration to cut a corner. Raise q_crash, lengthen H, or increase R on control to be more cautious.
Does disabling the rollout fan change the controller?
No—it only hides the purple ensemble for performance. The green best-path preview and applied u are unchanged.