The answersDownload the PDF
Worksheet

U1.5 Seeing the signal

The robot as a system · University · about 20 min

BugBotLab
NameClassDate

What this lesson is about

plot(): reading a control loop as a chart instead of a column of numbers.

Questions 7 marks in all

  1. [1 mark]Which three lines, plotted together, answer most questions about a feedback loop?

    Tick every answer that is true.

    1. AThe measurement
    2. BThe error, target minus measurement
    3. CThe command you sent
    4. DThe battery voltage
    5. EThe loop period
  2. [1 mark]The error stays large while the plotted command sits flat at 100. What is happening?

    1. AThe command is saturated, and no amount of extra gain will fix it
    2. BThe gain is too low and should be raised
    3. CThere is a steady state error, which needs an integral term
    4. DThere is too much delay in the loop
  3. [1 mark]The error settles smoothly, but to a steady value that is not zero. What does that shape mean?

    1. AA steady state error, which needs an integral term
    2. BUnder-damped: the gain is a little high
    3. CThe sign of the correction is wrong
    4. DSensor noise is reaching the motors
  4. [1 mark]The error overshoots zero, comes back, and overshoots again by less each time. What does that shape mean?

    1. AUnder-damped: the gain is a little high, or there is some delay in the loop
    2. BThe correction has the wrong sign
    3. CA steady state error
    4. DThe loop is saturated
  5. [1 mark]The plotted error gets bigger on every tick. What are the likely causes?

    1. AThe correction has the wrong sign, or the gain is far too high
    2. BA steady state error that needs an integral term
    3. CSensor noise reaching the motors
    4. DThe loop is running too fast
  6. [1 mark]A chart shows the error as a fuzzy band around zero, and the rotation command jitters along with it. What is reaching the motors?

  7. [1 mark]A plot of believed y from odometry() and true y from position() shows two lines that start together and slowly separate. What does that picture show?

    1. ADead reckoning drifting away from the truth, which state estimation exists to prevent
    2. BA controller that is oscillating
    3. CA command that has saturated
    4. DThe lag of the drive after a step

The task: plot the error

Drive into the green zone under proportional control, plotting two lines as you go: error and rotation.

from bugbot import *
connect()

def wrapped(a):
    return (a + 180) % 360 - 180

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/u1-5-seeing-the-signal/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Plot heading() and imu()[0] together. What is the gap, and is it constant?
  2. Plot the same error with the gain at 1, 3 and 9, one run each, and describe the three shapes.
  3. Plot the distance to the wall ahead while driving towards it. Where does the noise become a problem?