← Labs 15

PID Motor Speed Control

Control systems

A speed loop around a DC motor with inertia JJ, friction bb, and a driver that saturates at ±12 V\pm12\ \mathrm V. The controller sums KpeK_pe, Ki∫e dtK_i\int e\,dt, and Kde˙K_d\dot e with conditional-integration anti-windup; each change re-simulates the full step response, including a load step halfway through.

live circuit · mode=full steady-state offset 12.2 %
PID Motor Speed Control9 components and 11 connections.shaft ωfeedbackSETωsetspfbeΣERRΣeuKpKPKpeuKi/sKIKi/seuKd·sKDKd·spiduΣSUMΣuvdriverDRVdriverMMmotorfbshafttachoTACHtacho
PID Motor Speed Control

Drag a value tag to change that part. Click a wire to clip a probe on.

Probes
Try
causal signal trace paused

Form the error The summing junction subtracts the measured speed from the setpoint; everything downstream reacts to this error.

step 1 / 5 Form the error

Notebook · 9 parts · 11 wires · discrete PID + first-order DC motor with saturation

recommended lab 16 of 18

Tune P, I, and D for a fast, offset-free step response without windup.

Builds on: Closed-Loop Buck Converter

predict · then test

With only proportional control (Ki=Kd=0K_i = K_d = 0), the motor must overcome friction. Where does its speed settle?

Commit before the explanation appears. This is a prediction, not a quiz score.

governing model
u=Kpe+Ki ⁣∫e dt+Kd dedt  ⋅  Jω˙=Ku−b ω−τLu = K_p e + K_i\!\int e\,dt + K_d\,\dfrac{de}{dt} \;\cdot\; J\dot\omega = K u - b\,\omega - \tau_L
structural inventory
  • setpoint ωset\omega_{set}
  • parallel Kp, Ki/s, KdsK_p,\ K_i/s,\ K_d s paths
  • saturating driver
  • motor + tachometer
boundaries
  • Kp:0K_p: 0–1010
  • Ki:0K_i: 0–2020
  • Kd:0K_d: 0–0.50.5
  • driver limit ±12 V\pm12\ \mathrm V
diagnosis challenge Fault identity withheld: infer it from the changed outputs first.