Control · Robot club · about 15 min
Correct in proportion to the error. Gain, sign, feedback.
[1 mark]What does a proportional controller do?
[1 mark]The gain is 4 and the heading error is 7.5 degrees. What rotation does drive(70, 0, error * 4) ask for?
[1 mark]What does this program print?
def wrapped(h):
return (h + 180) % 360 - 180
for heading in [10, 350]:
error = wrapped(0 - heading)
print(heading, error * 4)[1 mark]You write drive(70, 0, -error * 4) by mistake. What happens?
[1 mark]Why is it called a feedback loop?
for loop[1 mark]Why does the P controller not need bursts and settling like the crude fix?
Drive into the green zone and finish still facing 0, within 6 degrees, on the curving robot.
# the two lines every program starts with: the commands, then the robot from bugbot import * connect() # drive forward at 70 for 70 cm, then stop forward(70, distance=70)
Plan your program here, then type it in and press Run.
wait(0.1) with wait(0.5). What happens, and why?