Control: closing the loop
420-302-VA · WEEK 10 · FALL 2026

Stage 6 of 6 · Lab session · Monday, November 9

Lab & hand-in

Assignment 2 is due at the start of class, submitted per the brief on Omnivox, demonstrations caught up in the first minutes for anyone scheduled. Then the lab climbs from a P-only local loop to supervisory control over the network, with a tuning log growing the whole way.

The two-hour plan

MinutesBlockDone means
0–10A2 in; station up: both boards, broker from Week 9 confirmed alive, repo pulledSubmission confirmed; mosquitto_sub firehose running in a spare terminal
10–30The controller: pid.py on the node, fixed-period loop, P-only runLoop runs at 10 Hz; the P-only offset observed and matched against the formula
30–55PI, then windup: offset dies; provoke windup, restore the cureess ≈ 0; the windup tail seen once and never again
55–80Tuning: the recipe with CSV logs; D only if earned; verification testsdocs/tuning.md has the trial rows and final gains; flashlight test passes
80–105The big loop: supervisory setpoints over MQTT, then the fully central versionRungs 3–4 demonstrated; local vs central graded with log numbers
105–115Ladder stretch or Ziegler–Nichols detour, station's choiceOne more log section with a two-sentence verdict
115–120Evidence committed and pushed; bench packed, full kit travelsBoth boards home: the project phase starts next Monday

Evidence to hand in

  • Controller code: pid.py and the control-loop main.py, plus the Pi-side LightController if you reached rung 4, each runnable.
  • docs/tuning.md: the trial table (gains, observation, change and why), final gains with a one-line justification each, and the verification-test grades. This file is the week's centrepiece: it proves method, not luck.
  • At least one step-test CSV from the logger, committed under data/, with the curve's grades (rise, overshoot, settling) noted in the tuning log.
  • Journal entry in station.txt: the worst behaviour you saw this afternoon (ringing, windup, shimmer), how the curve named it, and the knob that fixed it.

Exit ticket

Say or write, without notes:

  1. The closed-loop diagram's signals, on a napkin sketch, mapped to your bench.
  2. Why P alone parks short of the setpoint, with the ess formula's shape.
  3. What windup is, what provokes it, and the one-line cure your class ships.
  4. Your final gains, and which trial in your log earned each of them.
  5. Where control should live on your bench and in your project, in the fast-local, supervisory-central sentence.

Before next Monday

  • Rest on A2; it is in. The post-mortem habit is still worth ten minutes: one journal paragraph on what the brief taught you that the hubs had not.
  • Think project. Week 11 opens the LIA phase (40 % of the course) and deliverable D1 lands that same week: arrive Monday with one or two project ideas that your bench could plausibly sense, decide, act and report on. The best ideas name a quantity to hold or watch, which after this week you know how to do properly.
  • Keep the bench runnable at home: the project phase assumes the Week 9–10 stack starts on demand, broker to loop, in minutes.

Next week: the project begins

Week 11 · Monday, November 16

Flask & the project begins

The Pi grows a web dashboard with Flask, the browser joins the architecture's last box, and the LIA project brief opens the build that carries to the final presentation. D1 (5 %) is due this week.

What you now have

A complete control stack

Sense, network, decide, act, tune: the full industrial pattern, at desk scale, in your own code. From here the course stops adding fundamentals and starts asking what you will build with them.