🔍🔩 Parts bench
19 lessons

Feedback: Why On/Off Must Wobble

The simplest controller has two settings and no shame: full power below the target, none above. It works — thermostats prove it daily — and it can never, ever hold still.

lesson 1 of 3 in this unit

Builds on: 0.1 Sense, Think, Act: What Makes a Robot0.2 PWM: How a Computer Whispers to a Motor

Same idea, other course:Spark: feedback in circuits

Error: the one number that matters

Every controller in this unit lives on a single quantity — the gap between wanted and measured:

e = setpoint − measuredthe error — control is the art of spending effort to shrink this number

The setpoint is the wish (22 °C, 50 cm/s, the line’s centre); the measurement is Unit 2’s hard-won truth. Everything a controller does, it does by looking at e.

Bang-bang: two settings, no shame

The simplest possible policy: error positive → full power; error negative → off. This is bang-bang control, and it runs your home: thermostats, ovens, kettles, fridges. It is robust, needs no tuning, and has one structural signature — it can never rest. Full effort overshoots the target; zero effort undershoots; the system saws forever between the two. The oscillation is not a bug to be fixed; it is the shape of the policy.

Worse, a naive bang-bang chatters: near the setpoint, the tiniest sensor noise flips it on-off-on-off many times a second — relays click themselves to death. The practical patch is hysteresis: switch on below 21.5°, off above 22.5°. The one-degree gap sets a calm, honest rhythm — wider gap, slower and deeper swings; narrower, faster and shallower, until noise takes over again.

The missing idea: proportion

The deep flaw is that bang-bang cannot answer “how wrong am I?” — only “am I wrong?”. Ten degrees below target and half a degree below get the same full blast. The obvious refinement — push proportionally to the size of the error — is next lesson, and it changes the game so much it earns three letters of its own. But do not condescend to bang-bang: where the actuator only has two settings (a heater relay, a valve), it is not the naive choice — it is the only one.

You bang-bang, too

Steer a shopping trolley with your eyes closed, opening them once a second, and you will correct in over-large jerks — sense rarely, act coarsely, oscillate. The lab lets you feel exactly this with a fan-driven cart, and the wobble you cannot remove is this lesson’s entire point.

⚗️ Lab — The Thermostat Cart

A fan-driven cart chasing a target line under bang-bang control — with a hysteresis knob and a noise knob.

  • Zero hysteresis: watch the fan chatter madly near the target as noise flips the decision.
  • Widen the hysteresis band: chattering stops, replaced by a calm, deep sawtooth. Measure its amplitude — it tracks the band width.
  • Try to make the cart sit still on the line. Report your best oscillation amplitude; zero is not on the menu.
40 cm
±5 cm
Switching
calm
Oscillation
±2 cm — never zero
Rule
two settings can bracket a target, never hold it

Check your understanding

1. A bang-bang controller can never hold its target steadily because…

2. Hysteresis fixes which specific problem?

3. Widening the hysteresis band makes the oscillation…

4. The structural blindness of bang-bang control is that it cannot sense…