Noise and filtering · University · about 40 min
Sit 25 cm from a wall, steadily, on a depth sensor that is 3 cm noisy.
[1 mark]The gap controller runs for three ticks with no robot. What does it print?
TARGET, ALPHA = 25.0, 0.3
gap = 40.0
for raw in (37, 34, 31):
gap = ALPHA * raw + (1 - ALPHA) * gap
error = gap - TARGET
if abs(error) < 1.0:
cmd = 0
else:
cmd = max(-45, min(45, 2.2 * error))
print(round(gap, 2), round(cmd, 1))[1 mark]With TARGET = 25, a dead band of 1 cm and gain 2.2, what drive command is sent when the filtered gap is 25.6 cm?
[1 mark]The plot of the gap shows a slow sine wave around 25 cm. What does the lesson say to change?
[1 mark]The robot settles at 27 cm and stays there. What is this, and where is the proper fix?
[1 mark]The chart holds 25 cm, but a ruler shows the robot is nearer the wall. What does the lesson say is happening?
[1 mark]Why is a 1 cm dead band not really a cost on this robot?
Settle 25 cm from the wall and stay there. The checker watches the last part of the run as well as the end, so hunting fails even if the final position is right.
from bugbot import * connect() TARGET = 25.0
Plan your program here, then type it in and press Run.