The answersDownload the PDF
Worksheet

U5.4 The integral term

Feedback control · University · about 30 min

BugBotLab
NameClassDate

What this lesson is about

Removing the error that P leaves behind, and the windup that comes with it.

Questions 7 marks in all

  1. [1 mark]A PI controller has settled exactly on target. Which term is supplying the command?

    1. AThe integral term
    2. BThe proportional term
    3. CBoth equally
    4. DNeither, the command is zero
  2. [1 mark]A constant 4 cm error is held for five ticks. What does this print?

    KP, KI, DT = 1.6, 0.5, 0.1
    integral = 0.0
    for tick in range(5):
        error = 4.0
        integral += error * DT
        print(round(KP * error + KI * integral, 2))
  3. [1 mark]Using the lesson's rule of thumb, how many seconds does the integral take to contribute as much as the proportional term when Kp = 1.6 and Ki = 0.5? Give one decimal place.

  4. [1 mark]Which of these are the standard defences against integral windup given in the lesson?

    Tick every answer that is true.

    1. AClamp the integral to a sensible range
    2. BStop integrating while the output is saturated
    3. CSubtract the clipped amount, scaled, from the integral
    4. DRaise Kp so the error shrinks faster
    5. EFilter the error before integrating it
  5. [1 mark]An obstacle holds the robot at 40 cm while the target is 25 cm. Ten seconds later it is removed and the robot charges far past the target. Why?

    1. AThe integral grew the whole time and must be unwound by an error in the other direction
    2. BKp is too high
    3. CThe D term amplified the removal of the obstacle
    4. DThe sensor was biased by the obstacle
  6. [1 mark]The error is in cm, the command in percent, and time in seconds. What are the units of Ki?

  7. [1 mark]The robot sails slowly past the target, turns round, and sails past again with large, slow swings. Which gain is the likely cause?

    1. AKi too large
    2. BKd too large
    3. CKp too small
    4. DThe dead band too small

The task: no offset left

Settle exactly 25 cm from the wall, within 3 cm, from fourteen seconds onwards. Proportional control alone at a gentle gain will not do it: at Kp = 1.5 it stops about 8 cm short, because this drive does nothing below about 15 percent. Plot error and i term.

from bugbot import *
connect()

KP, KI = 1.5, 0.8
TARGET = 25.0
DT = 0.1
integral = 0.0

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

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

Challenges

  1. Set Ki = 0 and report the offset the robot settles at.
  2. Remove the clamp and hold the robot back by hand for a few seconds. Describe the result.
  3. Plot the P term and the I term separately and watch which one is carrying the command at the end.