# Worksheet: Introduction to feedback control

*Tactiverge Academy · Robotics Foundations, module 5 · https://tactiverge.win/academy/robotics-foundations/#introduction-to-feedback-control*

Name: ______________________    Date: ____________

## Learning objectives

Tick each one when you can do it without looking at your notes.

- [ ] Distinguish open-loop from closed-loop control using everyday examples.
- [ ] Identify the set point, measurement, error and control action in a feedback loop.
- [ ] Predict how changing a proportional gain affects speed, overshoot and stability.
- [ ] Explain steady-state error and why integral action can remove it.

## Lesson 1: Open loop and closed loop

Why measuring the result changes everything: the parts of a feedback loop and the simplest controller of all, on–off control.

Read online: https://tactiverge.win/academy/robotics-foundations/introduction-to-feedback-control/open-and-closed-loop/

### Check your understanding

1. Which of these is an example of open-loop control?
   A) A garden sprinkler that runs for 20 minutes every evening, whatever the weather
   B) A thermostat switching a heater based on room temperature
   C) A cruise-control system that adjusts the throttle to hold a speed
   D) A person steering a bicycle to stay on a path

2. The set point is 50 and the measurement is 62. What is the error?
   A) −12
   B) +12
   C) 112
   D) 0

3. Why does a simple on–off heater cause the temperature to oscillate around the set point?
   A) Because the heater is broken
   B) Because thermometers cannot read decimals
   C) Because the set point keeps changing
   D) Because the system responds with a delay, so it keeps rising after switch-off and keeps falling after switch-on

4. What is the main purpose of adding hysteresis to an on–off controller?
   A) To make the controller open-loop
   B) To remove the need for a sensor
   C) To stop rapid on–off switching caused by noise near the set point
   D) To make the temperature exactly equal the set point

### My notes

______________________________________________

______________________________________________

## Lesson 2: Proportional control and its limits

Act in proportion to the error: how the gain trades speed for stability, why a steady error can remain, and the ideas behind integral and derivative action.

Read online: https://tactiverge.win/academy/robotics-foundations/introduction-to-feedback-control/proportional-control/

#### Project: Paper or spreadsheet project: tune a controller

Using the model `position_next = position + Kp · (100 − position) − d`, explore by hand, with a spreadsheet, or with a short program:

1. With d = 0, compute ten steps for Kp = 0.3, 0.8, 1.2 and 1.9. Plot all four on one graph.
2. Repeat with d = 5. For each gain, predict the final position using error = d / Kp, then check your prediction against the computed values.
3. Write a short paragraph recommending a gain, and explain the trade-off you made between speed, overshoot and steady-state error.

No hardware is needed for this project.

**Deliverables**

- A table or plot of ten steps for each gain, with and without disturbance
- Predicted versus computed steady-state values
- A justified gain recommendation in one paragraph

### Check your understanding

1. In the model position_next = position + Kp · (100 − position), starting from 0, where is the robot after one step with Kp = 0.4?
   A) 4
   B) 40
   C) 60
   D) 100

2. As you steadily increase a proportional gain on a real system with some delay, what typically happens?
   A) The response gets slower and smoother
   B) The response gets faster, then starts to overshoot, and eventually becomes unstable
   C) Nothing changes
   D) The steady-state error grows

3. With a constant disturbance d = 6 and Kp = 0.3, what steady-state error does the simple model predict?
   A) 1.8
   B) 6
   C) 20
   D) 0

4. Why can a proportional controller alone not eliminate steady-state error against a constant disturbance?
   A) Because proportional controllers are open-loop
   B) Because sensors cannot measure small errors
   C) Because the gain is always less than 1
   D) Because its action is zero when the error is zero, so some error must remain to push against the disturbance

5. What does integral action contribute to a PID controller?
   A) It accumulates past error so that persistent error keeps increasing the push until it is removed
   B) It predicts future error to reduce overshoot
   C) It filters sensor noise
   D) It replaces the sensor

### My notes

______________________________________________

______________________________________________

## Lesson 3: Integral action and steady-state error

Why a proportional controller always leaves a gap against a steady load, how adding up past error closes that gap, and the overshoot you pay for it.

Read online: https://tactiverge.win/academy/robotics-foundations/introduction-to-feedback-control/integral-action/

#### Project: Simulation project: find a good integral gain

Use the Python listing in this lesson, a spreadsheet, or a calculator.

1. With Kp = 0.5 and a slope of 5, run Ki = 0.02, 0.05, 0.1, 0.2 and 0.4 for 60 steps. For each, record the peak position and the first step after which the position stays between 98 and 102.
2. Print the running total at the end of each run and check that Ki × total ≈ 5. Explain in one sentence why this must be true.
3. Change the slope to 10 and repeat for your favourite Ki. Does the final position change? Does the overshoot?
4. Recommend one Ki and justify it in a short paragraph, naming what you gave up.

No hardware is needed for this project.

**Deliverables**

- A table of peak position and settling step for five values of Ki
- The final running totals, with a one-sentence explanation of Ki × total ≈ slope
- A justified recommendation for Ki

### Check your understanding

1. A first-order plant with K = 1 is under P control with Kp = 4 and set point 1. What steady-state error do you expect?
   A) 0.25
   B) 0.2
   C) 0
   D) 0.8

2. Why does a settled PI controller end with zero error?
   A) Because the integral gain is always larger than the proportional gain
   B) Because the running total only stops changing when the error is zero, so the loop can only come to rest there
   C) Because the integral term switches the proportional term off
   D) Because integral action removes the need for a sensor

3. In a settled PI loop holding a robot arm against gravity, which term supplies the steady push?
   A) The proportional term, because it acts on the error
   B) Both terms equally
   C) Neither: gravity is cancelled by the sensor
   D) The integral term, because the error, and so the proportional term, is zero

4. You raise Ki from 4 to 20 on the explorer's first-order plant. What is the most likely change?
   A) Faster rise but much larger overshoot
   B) Slower rise and no overshoot
   C) A larger steady-state error
   D) No change, because Ki only affects disturbances

5. What causes integrator windup?
   A) Sensor noise being amplified by the integral term
   B) Choosing Ki smaller than Kp
   C) The running total growing while the actuator is already at its limit and cannot deliver more push
   D) Using a first-order plant instead of a second-order one

### My notes

______________________________________________

______________________________________________

## Lesson 4: Derivative action and damping

How reacting to the rate of change lets a controller brake before it overshoots, what under-, over- and critically damped responses look like, and why derivative action hates noise.

Read online: https://tactiverge.win/academy/robotics-foundations/introduction-to-feedback-control/derivative-action-and-damping/

### Check your understanding

1. A step response rises, overshoots by 30 % and rings a few times before settling. How would you describe it?
   A) Overdamped
   B) Critically damped
   C) Underdamped
   D) Unstable

2. The set point is fixed and a joint is moving quickly towards it. What does the derivative term do?
   A) Pushes against the motion, braking the joint before it arrives
   B) Pushes harder in the direction of motion to arrive sooner
   C) Nothing, because the error is not zero
   D) Removes the steady-state error

3. A sensor has noise with standard deviation 0.02 and the controller samples every 0.01 s. Roughly how large is the noise in a raw, unfiltered rate estimate?
   A) About 0.02 per second
   B) About 2.8 per second
   C) About 0.0002 per second
   D) About 200 per second

4. Why do many controllers take the derivative of the measured output rather than of the error?
   A) It makes the controller open-loop
   B) It removes sensor noise completely
   C) It is the only way to get zero steady-state error
   D) It avoids a violent kick to the actuator whenever the set point jumps

5. On a lightly damped plant under P control with steady-state error 0.333, you add derivative action. What happens to the steady-state error?
   A) It falls to zero
   B) It stays the same, because derivative action only responds to change
   C) It doubles
   D) It becomes negative

### My notes

______________________________________________

______________________________________________

## Lesson 5: Tuning a PID controller systematically

How to measure a step response, a step-by-step manual tuning procedure for P, D and I, and how to keep a tuning log that someone else could repeat.

Read online: https://tactiverge.win/academy/robotics-foundations/introduction-to-feedback-control/tuning-a-pid-controller/

#### Project: Simulation project: tune to a specification

Use the feedback explorer or the Python listing in this lesson.

1. Choose the **2nd-order** plant and set ζ = 0.2, a much bouncier plant than the worked example.
2. Write a requirement: overshoot under 10 %, settling time under 4 s, steady-state error below 0.01.
3. Follow the manual procedure (P, then D, then I), changing one gain per run. Record every run in a log with the same columns as the worked example.
4. When you meet the requirement, test your gains with the load disturbance on and with sensor noise of 0.01. Note any problems.
5. Write a short paragraph summarising what you learned about this plant compared with the ζ = 0.4 example.

No hardware is needed for this project.

**Deliverables**

- A written requirement with three numerical limits
- A tuning log with at least six runs, one change per run
- Results of disturbance and noise tests on the final gains
- A one-paragraph summary comparing the two plants

### Check your understanding

1. A step response settles at 2.00 and peaks at 2.30. What is the overshoot?
   A) 30 %
   B) 0.30 %
   C) 13 %
   D) 15 %

2. Why should you change only one gain between tuning runs?
   A) So that any change in the response can be attributed to that one gain
   B) Because controllers can only store one gain at a time
   C) Because changing two gains always causes instability
   D) To make the tuning take longer

3. After adding derivative action, a response has 0.5 % overshoot but a steady-state error of 0.17. What is the usual next step?
   A) Raise Kd further
   B) Add a small amount of integral gain and increase it gradually
   C) Set Kp to zero
   D) Accept the error, because it cannot be removed

4. Which statement about the Ziegler–Nichols method is most accurate?
   A) It always gives the best possible gains
   B) It works without ever making the system oscillate
   C) It gives quick starting gains, but drives the loop to the edge of instability and the results usually need refining
   D) It only applies to integral gain

5. In the worked log, run 7 (Ki = 1) had no overshoot but a longer settling time than run 8 (Ki = 1.5). Why?
   A) The derivative gain was too high in run 7
   B) With too little integral gain, the output creeps slowly towards the set point and takes a long time to enter the 2 % band
   C) Run 7 was unstable
   D) Settling time is unrelated to the gains

### My notes

______________________________________________

______________________________________________

## Lesson 6: Practical control: saturation, windup, noise and delay

The four problems that separate a controller that works in a simulation from one that works on a real robot, and the standard fixes for each.

Read online: https://tactiverge.win/academy/robotics-foundations/introduction-to-feedback-control/practical-control-issues/

### Check your understanding

1. A PI controller's actuator is limited to ±1.5. After a large step the output overshoots far more than it did with an unlimited actuator. What is the most likely cause?
   A) Sensor noise
   B) The derivative gain is too high
   C) Integrator windup: the integral kept growing while the actuator was pinned at its limit
   D) The sample rate is too fast

2. What does conditional integration do?
   A) Stops adding to the integral while the actuator is saturated and the error pushes further into the limit
   B) Doubles the integral gain when the error is large
   C) Removes the proportional term during saturation
   D) Filters noise out of the derivative term

3. Which PID term is least sensitive to random sensor noise?
   A) Proportional
   B) Derivative
   C) All are equally sensitive
   D) Integral

4. In the toy model, adding one step of measurement delay made Kp = 1 oscillate forever. What general lesson does this illustrate?
   A) Delay has no effect on stability
   B) Delay lowers the gain at which a loop becomes unstable, so it limits how fast the loop can safely respond
   C) Delay only matters for integral action
   D) Delay can be removed by raising the gain

5. A robot joint should settle in about 0.2 s. Which loop rate is the most sensible starting choice?
   A) 1 update per second
   B) 5 updates per second
   C) About 100 updates per second or more, at a steady rate
   D) Whatever rate the code happens to run at

### My notes

______________________________________________

______________________________________________

---

## Answer key (for self-checking after you try)

**Lesson 1: Open loop and closed loop**

1. A — The sprinkler never measures how wet the soil is. It follows a fixed plan, which is the definition of open-loop control.
2. A — Error = set point − measurement = 50 − 62 = −12. The negative sign means the value is too high.
3. D — Lag between action and measured response makes the temperature overshoot in both directions.
4. C — A small band around the set point means noise alone cannot flip the output back and forth, which protects switches and motors.

**Lesson 2: Proportional control and its limits**

1. B — Error is 100, so the robot moves 0.4 · 100 = 40 units.
2. B — More gain means a stronger reaction. With delay and inertia, a strong reaction arrives too late, causing overshoot and eventually instability.
3. C — The robot settles when Kp · error = d, so error = 6 / 0.3 = 20.
4. D — Action = Kp · error. To produce the push needed to cancel the disturbance, the error cannot be zero.
5. A — Because the running total keeps growing while any error remains, integral action can remove steady-state error. The derivative term is the one that reacts to the rate of change.

**Lesson 3: Integral action and steady-state error**

1. B — Steady-state error = r / (1 + Kp · K) = 1 / (1 + 4) = 0.2. The output settles at 0.8, not 1; 0.8 is the output, not the error.
2. B — Each step adds the error to the total. If the error were not zero, the total, and therefore the action, would keep changing and the loop would not be at rest.
3. D — At rest the error is zero, so Kp · error is zero. The integral term's stored total holds exactly the push that cancels the load.
4. A — More integral gain builds the stored push faster, so the output rises faster but carries more push past the set point. In the explorer overshoot grows from about 8 % to about 39 %.
5. C — When the actuator is maxed out, the error persists and the total keeps growing uselessly. Unwinding it later causes large overshoot. Noise amplification is the derivative term's weakness.

**Lesson 4: Derivative action and damping**

1. C — Overshoot and ringing that dies away is the signature of an underdamped system (ζ < 1). An unstable system's swings would grow instead.
2. A — The error is shrinking fast, so its rate of change is strongly negative, and Kd times that rate opposes the motion. That braking is damping.
3. B — The difference of two readings has standard deviation √2 × 0.02 ≈ 0.028. Dividing by 0.01 s gives about 2.8 per second. Small noise over a small time step becomes a large fake velocity.
4. D — A set point step makes the error jump, giving a huge momentary rate of change. The measurement does not jump, so differentiating it gives the same braking without the kick. Noise is still present and still needs filtering.
5. B — At rest nothing is changing, so the derivative term is zero and contributes no steady push. Removing steady error needs integral action.

**Lesson 5: Tuning a PID controller systematically**

1. D — Overshoot = (peak − final) / final = (2.30 − 2.00) / 2.00 = 0.15, or 15 %. It is measured relative to the final value, not as a raw difference.
2. A — If two gains change at once and the response improves, you cannot tell which change helped. One change per run makes each run an experiment with a clear result.
3. B — Derivative action cannot remove steady error. Integral action can, but it adds overshoot, so start small and stop before the overshoot breaks your requirement.
4. C — The method finds the gain at which the loop oscillates steadily, which can be risky on hardware, and its gains tend to be aggressive. They are a starting point, not a finished design.
5. B — Too little integral gain removes the error only slowly. The response never overshoots, but the slow creep delays the moment it stays within ±2 %.

**Lesson 6: Practical control: saturation, windup, noise and delay**

1. C — While saturated, the error stayed large and the integral total grew far beyond what was needed. That stored push carries the output past the set point. Anti-windup prevents it.
2. A — It pauses the integrator only when extra integral could not be delivered anyway, so the total stays close to what the plant will need at rest.
3. D — Summing random positive and negative errors largely cancels them, so the integral averages noise out. The derivative term is the most sensitive.
4. B — The controller corrects for where the system was, so strong corrections arrive too late and overshoot. Raising the gain makes this worse, not better.
5. C — A response of 0.2 s needs samples much more often than every 0.2 s. A steady 100 Hz or faster gives many samples during the motion. An irregular rate breaks the integral and derivative calculations.

---

This work is licensed under the Creative Commons Attribution 4.0 International licence (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/. Attribute as: Tactiverge Academy, https://tactiverge.win.
