Log inStart free
LESSON 20.02 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Model predictive control

Watch MPC plan one second ahead, use one force, then plan again.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 20.02 · CONTROL BAYT 1.00 S · θ −1.5° · X 0.20 M
01
Stage 1 of 5 · The task
The cart-pole fails if the pole tips past 12° or the cart leaves the track.
Explain it simply

You see a cart on a track with a pole standing on it. The cart can push left or right with up to 10 newtons. The pole starts tilted by 5.7 degrees, and a tap hits it at 1 second. Each step costs more when the pole tilts or the cart leaves the centre.

The cart at 0.20 m with the pole at −1.5 degrees, at 1.00 s. The teal lines show the measured angle and position so far.

measured runMPC plan, predictedforce, ±10 N limitpush, fall, limits
2.4 m−2.4 m−12012angle θ (°)−2.402.4cart x (m)−10010force F (N)0 s1 s2 s3 s4 s5 spushrun ends+10.0 Nthe task2.4 m−2.4 m−12012angle θ (°)−2.402.4cart x (m)−10010force F (N)0 s1 s2 s3 s4 s5 spushrun ends+10.0 Nthe task
Toy: the 20.C1 cart-pole, 4 s at 50 steps per second
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
c=x2+0.1 x˙2+10 θ2+0.1 θ˙2+0.01 F2\sy{c}{grad}{c} = \sy{x}{data}{x}^2 + 0.1\,\dot x^2 + 10\,\sy{th}{data}{\theta}^2 + 0.1\,\dot\theta^2 + 0.01\,\sy{F}{param}{F}^2
c=0.202+0.1⋅(−0.01)2+10⋅(−0.025)2+0.1⋅(1.03)2+0.01⋅(−0.3)2≈0.152c = 0.20^2 + 0.1\cdot(-0.01)^2 + 10\cdot(-0.025)^2 + 0.1\cdot(1.03)^2 + 0.01\cdot(-0.3)^2 \approx 0.152

Each step costs the squared position, ten times the squared angle, and force.

Common mix-ups

MYTHA good plan made in advance needs no feedback.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01With the 1 s horizon and no push, does the open-loop replay end differently from MPC?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.