The worksheetDownload the PDF
Answers

U1.2 A command is a request

The robot as a system · University · about 25 min

BugBotLab

What this lesson is about

Open loop on real hardware: gain that is not 1, a dead band, a lag, and a robot that curves.

Questions 6 marks in all

  1. [1 mark]What does forward(60) actually ask for?

    1. AThe motors driven at 60 percent
    2. BA speed of 60 cm/s
    3. CExactly 60 percent of the catalogue top speed of 20 cm/s, which is 12 cm/s
    4. DA move of 60 cm
    Answer: A. A command is a request to the motors. The speed that results is a fact about this robot's gain, dead band, lag and coupling, and has to be measured.
  2. [1 mark]Asked to drive 60 cm forward, the robot finishes to one side of where it started and a few degrees off heading. Which of the four effects in the lesson explains that?

    1. ACoupling
    2. BDead band
    3. CLag
    4. DGain
    Answer: A. Coupling means driving one axis leaks into the others: a little sideways and a little rotation, so the robot curves. Gain, dead band and lag change how fast, not which way.
  3. [1 mark]A robot's measured forward speed is 7 cm/s at command 40 and 17 cm/s at command 80. Using the straight line through those two points, what command gives 12 cm/s?

    Answer: 60. The slope is (17 - 7) / (80 - 40) = 0.25 cm/s per percent. 12 cm/s is 5 cm/s above 7, which is 5 / 0.25 = 20 percent above 40, so 60.
  4. [1 mark]For the same line (7 cm/s at command 40, 17 cm/s at command 80), at what command does the line predict zero speed?

    Answer: 12. Speed = 0.25 × command - 3, which is zero at 3 / 0.25 = 12. That is only where the straight line crosses zero. Below the dead band, about 15 on this drive, the real robot gives nothing at all, so the line is only good for commands above it.
  5. [1 mark]The measurement program waits 1.0 s after each forward() before it starts averaging flow(). Why?

    1. AThe speed rises over about a quarter of a second, so readings taken during the rise would underestimate the settled speed
    2. Bflow() only produces a new reading once a second
    3. CThe deadman needs a second to reset before readings are valid
    4. DIt lets the battery voltage recover after the previous step
    Answer: A. That is the lag. Speed does not step, it rises, so you wait past the transient and then measure the level.
  6. [1 mark]Which description of open loop control matches the lesson?

    1. AActing on the command and hoping, which only works on a stiff, repeatable, unloaded machine
    2. BMeasuring the result and correcting as you go
    3. CKeeping an estimate of the state rather than a commanded position
    4. DRunning the loop without any wait() so it goes as fast as possible
    Answer: A. Open loop trusts the command to be the result. Measuring, feedback and state estimation all exist because on a real machine it is not.

The task: how fast is this robot?

Measure this robot's top forward speed in centimetres per second and print it as top speed: 18.4. Measure it, do not look it up.

from bugbot import *
connect()

forward(100)
wait(1.0)

The hint students can ask for: It takes about a quarter of a second to reach full speed, so ignore the beginning. Either read flow() several times and average, or time a known distance with position().

A solution

from bugbot import *
connect()

forward(100)
wait(1.0)
readings = []
for i in range(20):
    readings.append(flow()[1])
    wait(0.1)
stop()
print("top speed:", round(sum(readings) / len(readings), 1))

Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.