1Kp = 1 # V per m/s2e = r - y3u = Kp * e1Kp = 4 # V per m/s2e = r - y3u = Kp * e1Kp = 20 # V per m/s2e = r - y3u = Kp * e1Kp, u0 = 4, 0.52e = r - y3u = Kp * e + u01.0 m/s0.00 V—0.00 m/s+−e = +1.00needs 0.50 Vy 0.00
setpoint 1.0offset 0.11100.511.522.500.511.5time (s)m/sBELT SPEED y(t), THREE GAINSKp = 1Kp = 4Kp = 20setpoint 1.0box lands →01234500.51time (s)m/sBELT SPEED, BOX AT 2.5 s (Kp = 4)P onlyP + 0.5 V bias
Lit wire with moving dashes: a signal or drive is flowing along itBlocks: setpoint, junction, motor, belt, sensor and box; the controller is the code cardPlots: belt speed over time, computed from the modelThe pill travelling back to the junction is the measured speed y: feedbackA belt-speed loop with a proportional controller: setpoint, summing junction, the rule u = Kp · e, the motor (actuator), the belt (plant) and a speed sensor; later a box lands on the belt as a load. The plots below are simulated from the belt model as the steps play: with P control alone the speed always settles short of the setpoint, by less as Kp grows, but with more overshoot. The figure ignores the drive's voltage limit. Kp = 20 asks for 20 V at the first instant; a real 24 V drive would just manage it, but a bigger step would saturate.

The loop

  1. A motor drives a conveyor belt, and we want it at r = 1.0 m/s, the setpoint. The belt is the plant; its speed y is the output. It starts at rest.

The offset

Turning Kp

Loads and bias

What is happening

# step 1/11 · goal
# about: Setpoint r, Belt (plant)

setpoint   r = 1.0 m/s
output     y = belt speed, 0 now
plant      motor + belt

The whole loop is unity feedback:
r → Σ → controller → motor → belt → sensor → Σ

The belt is an illustrative model, G(s) = 10/((s+1)(s+5)) with a load of 0.25 V from 2.5 s. Every curve and number in the figure is simulated from it (Runge-Kutta, 1 ms steps). The Python on each step is plain Python 3. It steps the belt forward every millisecond (Euler's method); the figure uses Runge-Kutta, and both agree to three decimal places.