University of Melbourne · FACULTY OF ENGINEERING

ENGR10006 Chap.9 Feedback Control, Line Following and Gripping

- one subject, every graph, every model, every mark
8 Chapters4-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 9 of 13 · ENGR10006

Feedback Control, Line Following and Gripping

Closing the loop is what lets the robot follow an unknown track. This chapter sets out the closed-loop structure from Workshop 5: process, controller, feedback and a summing junction with a reference, and explains why timed open-loop moves fail on a real track.

It follows the line-following error, the right IR reading minus the left, whose sign gives the direction to turn and whose size gives how far the robot is off centre, then compares coarse threshold control with proportional control, the gain Kp and the Saturation block that keeps pulse widths valid.

It adds PID terms, moving-average smoothing of noisy errors, gripper calibration with a standard servo, and the demonstration task, rules and 15-mark rubric that the final run is judged against. The worked example takes one IR reading pair through a full proportional update, and practice items apply the demonstration rubric to a sample run.

In this chapter

What this chapter covers

  • 01

    Closed-loop structure

  • 02

    Why open-loop timing fails

  • 03

    IR difference error signal

  • 04

    Coarse threshold control

  • 05

    Proportional gain and saturation

  • 06

    PID terms and tuning

  • 07

    Moving-average smoothing

  • 08

    Demonstration task and rubric

Worked example · free

One proportional control update with saturation

Q [4 marks]. IRRight reads 350 and IRLeft reads 610. The controller turns by Kp = 0.4 µs per unit of error, saturates the turn at 100 µs, and drives forward at right 1400 µs and left 1600 µs. Find the error, the turn direction, the turn amount after saturation and the new pulse widths if the controller slows the inner wheel. Marks are AskSia practice weightings, not a University scheme.
The dashed grey steps show coarse control turning by a fixed 80 µs once the error passes 100, while the blue line turns by 0.4 µs per unit of error until it satThe dashed grey steps show coarse control turning by a fixed 80 µs once the error passes 100, while the blue line turns by 0.4 µs per unit of error until it saturates at 100 µs.saturates at 100slope Kp = 0.4coarse: fixed turnthreshold 100errorturn amount in µs
The dashed grey steps show coarse control turning by a fixed 80 µs once the error passes 100, while the blue line turns by 0.4 µs per unit of error until it saturates at 100 µs.
  • +1Error = IRRight - IRLeft = 350 - 610 = -260.
  • +1A negative error means turn right according to the behaviour sheet.
  • +1Requested turn = 0.4 × 260 = 104 µs, above the 100 µs limit, so the Saturation block holds it at 100 µs.
  • +1Turning right slows the right wheel towards 1500 µs: right = 1400 + 100 = 1500 µs; left stays at 1600 µs, the pivot-right style command.
Error -260, turn right, saturated at 100 µs: right wheel 1500 µs, left wheel 1600 µs.
Sia tip — Apply the limit after multiplying by Kp, not before; saturation clips the command, not the error.
Glossary

Key terms

Closed-loop control
Control in which sensor feedback is compared with a reference to choose each new command.
Error signal
The right IR reading minus the left, whose sign and size steer the robot.
Proportional gain
The constant Kp that sets how strongly the turn responds to the error.
Saturation block
A Simulink block that limits a signal between set upper and lower values.
Integral term
The part of a PID controller that grows with how long an error has persisted.
Derivative term
The part of a PID controller that responds to how quickly the error is changing.
Moving average
A filter that replaces each value with the mean of the last N samples.
FAQ

Feedback Control, Line Following and Gripping FAQ

What is wrong with coarse line-following control?

Coarse control turns at one fixed speed whenever the error passes a threshold, so small deviations are ignored and large ones are over-corrected. Workshop 7 replaces it with proportional control, where the turn grows with the error and motor speeds update continuously, giving smoother tracking.

Why is a Saturation block needed?

With a large error or a large gain, the proportional term can request pulse widths outside the range the wheels accept. The Saturation block bounds the signal between set upper and lower limits, so every command sent to the servos stays valid.

What ends a demonstration run early?

A run ends when the task is complete, when a rule is broken, when the robot behaves unusually, or after 300 seconds including initialisation. Each robot has two attempts with no changes in between, and a model using an unlisted toolbox will not compile and scores zero.

How should we choose the PID gains?

The Workshop 8 slides recommend tuning by experiment and documenting the tests for the report rather than using advanced design methods. Any term can be switched off by setting its gain to zero, and changing one gain can change behaviour a lot, so adjust one at a time.

Study strategy

Assessment move

Start by drawing the closed loop for your robot and labelling each block with the actual part: the chart as controller, the robot as process, the IR and ultrasonic readings as feedback. Then practise the sign convention until it is automatic, using pairs of IR readings and deciding the turn direction before calculating anything.

Tune in a fixed order: get coarse control working, switch to proportional control with a conservative gain, add saturation limits taken from your calibrated wheel commands, then add smoothing and only then consider integral or derivative terms. Change one parameter at a time and log the gain, filter length and observed behaviour on each track section.

Calibrate the gripper's open, closed and closed-and-lifted settings on your own robot, since the standard servo gives no angle feedback. Finally, rehearse the demonstration rules, including the 300-second limit and the allowed toolboxes, and test on all three kinds of track section. Keep a short tuning diary in Microsoft Teams so the report can show how each change affected the run.

Record each demonstration-style practice run against the 15-mark rubric so you know which marks are still at risk.

A+Everything unlocked
Unlocks this Bible + all 181 of your University of Melbourne subjects - and 1,000+ Bibles across every Australian university.
Sia - your ENGR10006 tutor, unlimited, worked the way the exam marks it
The full 4-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works