Feedback control · University · about 30 min
One gain, the whole trade-off, and the steady state error it cannot remove.
[1 mark]A proportional controller has Kp = 1.5 percent per cm. What command, in percent, does an error of 12 cm produce?
[1 mark]The error is in centimetres and the command in percent. What are the units of Kp?
[1 mark]This drive does not move below 15 percent. With Kp = 2, what is the largest error in cm that proportional control alone leaves uncorrected?
[1 mark]In the lesson's turning cell at Kp = 4, the error trace falls fast, crosses zero, comes back and crosses again before settling. What does that say?
[1 mark]Why does a low-gain proportional controller stop short of the target and stay there?
[1 mark]Put the lesson's hand-tuning recipe for Kp in order.
Number the lines 1 to 3 to put them in the right order.
Halve that valueStart low, around 1Double it until the robot overshoots or wobblesStart low, around 1 Double it until the robot overshoots or wobbles Halve that value
Find the gain where trouble starts, then back off by half.
Settle 30 cm from the wall, within 5 cm, and stay there from ten seconds onwards. Print the kp: you chose.
from bugbot import * connect() KP = 1.0 TARGET = 30.0
The hint students can ask for: Too little gain and it stops short: once the command falls under 15 percent the drive does nothing. More gain gets it closer; far too much and it shuffles back and forth on the sensor noise. Start at 1, double until it misbehaves, then come back down.
from bugbot import *
connect()
KP = 2.5
TARGET = 30.0
for tick in range(350):
error = distance() - TARGET
plot("error", error)
drive(max(-60.0, min(60.0, KP * error)), 0, 0)
wait(0.1)
stop()
print("kp:", KP)
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.