MOONMCL motion control

Showcase

Ten algorithms, one page

Each panel calls the library compiled to JavaScript. Move a control and the curve is recomputed in MoonBit, not in the page: the browser only draws the columns it receives.

drag a slider to recompute click the grid to build walls hover a chart to read it

01 / Trajectory

Jerk-limited move

A rest-to-rest move between two limits on velocity, acceleration and jerk. The profile is the shortest one that respects all three, which is why the acceleration ramps rather than steps.

velocity and acceleration on the left, position on the right

02 / Planning

Shortest route

Unit-cost edges on a four-connected grid. A* and Dijkstra return the same route when they both find one; A* reaches it after looking at fewer cells. Click a free cell to wall it off.

click to toggle a wall · the route is recomputed

03 / Control

PID on a first-order plant

The controller drives a plant with a gain and a time constant. The integrator is held while the output is saturated and the error would push it further out, so a long call does not wind up.

dashed line: the setpoint

04 / Estimation

Kalman filter

A constant observed through noise. Process noise and measurement noise set how much the estimate trusts the model against the sensor; the band is two standard deviations of the filter's own covariance.

band: ±2 σ of the covariance

05 / Modern control

LQR against receding horizon

The same double integrator under an infinite-horizon gain and under a finite-horizon plan re-solved every step. The two agree on the shape and differ on how hard they push at the start.

solid: position · dashed: control

06 / Path following

Pure pursuit against Stanley

Both start off the path and drive a bicycle model. Pure pursuit aims at a point ahead on the circle; Stanley corrects heading and lateral offset. On a curve their steady behaviour differs.

top view · dashed circle is the reference

07 / Kinematics

Differential drive

A body twist is turned into wheel speeds, then back into a twist, then integrated into a pose. The wheels run straight, then turn in place, then straight again.

top view · ticks show heading

08 / Trajectory

Two axes, one clock

Two jerk-limited moves of different lengths, given the same limits, arrive together: the longer one sets the clock and the shorter one is stretched to it. Both keep their own shape, so the faster axis simply accelerates less.

solid: position · dashed: velocity

09 / Planning

A car's own space

The same state space the car uses to join two poses is the one a sampling planner searches, so the route is made of arcs and reversals rather than straight lines. The two shortest-path modes ignore the wall, as a shortest path does; the tree threads the gap.

start low left · the gap is at the origin · ticks show heading

10 / Kinematics

Delta cell

Three parallel arms hold one platform, so a platform position has three arm angles and no single closed form per arm. The cell solves them by iterating on its own forward map, then reports where the platform actually landed.

three-quarter view · the ring is where the platform travels