7. HL Extension — Control

Feedback Loops

Feedback Loops

students, imagine a smart thermostat in a home 🏠. It checks the room temperature, compares it with the target setting, and turns the heater on or off to keep the room comfortable. That simple idea is the heart of a feedback loop: a system measures what is happening, compares it to what should be happening, and then changes its output to reduce the difference. In IB Computer Science HL, feedback loops are important because they are used in monitoring, automation, and control systems everywhere, from aircraft autopilots to factory robots.

By the end of this lesson, you should be able to:

  • explain the main ideas and terminology behind feedback loops,
  • apply IB Computer Science HL reasoning to examples of feedback control,
  • connect feedback loops to the broader topic of control systems,
  • and describe how feedback loops help real-world computing systems behave reliably.

What Is a Feedback Loop?

A feedback loop is a control process in which the output of a system is measured and used to influence future input. In other words, the system does not just act once and stop. It keeps checking the result and adjusting again and again. This repeated checking makes the system more accurate and stable.

A basic feedback loop has four main parts:

  • Set point: the desired value, such as $22^\circ\text{C}$ in a room.
  • Sensor: the device that measures the current value, such as a temperature sensor.
  • Comparator: the part that compares the measured value with the set point.
  • Actuator: the part that makes a change, such as a heater, motor, or valve.

The difference between the set point and the measured value is called the error. In simple terms, if the target temperature is $22^\circ\text{C}$ and the room is $19^\circ\text{C}$, then the error is $3^\circ\text{C}$. The control system uses that error to decide what action to take.

This idea appears in many computing systems. For example, a drone uses sensors to measure its position and tilt, then adjusts its motors to stay balanced in the air. Without feedback, the drone would drift or crash much more easily.

How Feedback Loops Work

Feedback loops are often described as a cycle. First, the system measures the output. Next, it compares the measurement to the goal. Then, it calculates the error and applies a correction. Finally, the output changes, and the cycle repeats. 🔄

A common way to think about this is:

$$\text{error} = \text{set point} - \text{measured value}$$

If the error is large, the system may make a stronger correction. If the error is small, the correction may be smaller. This is why feedback loops are useful: they help systems respond to changes in the environment.

Example: Thermostat in a House

Suppose a thermostat is set to $22^\circ\text{C}$. The current temperature is $20^\circ\text{C}$. The sensor sends the measured value to the controller. The controller calculates the error:

$$22 - 20 = 2$$

Because the room is too cold, the heater turns on. Later, when the temperature reaches $22^\circ\text{C}$, the heater may turn off. If the temperature rises too high, the system may cool the room instead. This constant adjustment prevents the temperature from staying far away from the target.

Example: Automatic Cruise Control

In a car, cruise control uses feedback to keep the speed near a chosen value. If the set speed is $100\text{ km/h}$ and the car slows down on a hill, the system detects the difference and increases engine power. If the car goes too fast downhill, the system reduces power or applies braking. This helps the vehicle maintain a steadier speed without constant driver input.

Feedback Loops in Control Systems

In IB Computer Science HL, feedback loops are part of control systems, which are systems that monitor and manage devices or processes automatically. Control systems are widely used in industry, transport, healthcare, and smart homes.

Feedback loops are especially important in closed-loop control systems. A closed-loop system is one where the output is measured and fed back into the control process. This is different from an open-loop system, where the system acts without checking the result.

Open-Loop vs Closed-Loop

An open-loop system gives a fixed output based on input, but it does not correct itself. A toaster that heats bread for a set time is a simple example. If the bread is thicker than usual, it may not toast properly because the toaster does not measure how brown the bread is.

A closed-loop system measures the result and adjusts. A smart toaster with a browning sensor would be closer to closed-loop control because it can stop heating when the bread reaches the desired level.

Closed-loop systems are usually better when conditions change often. However, they are also more complex because they require sensors, processing, and careful design.

Sensors, Noise, and Accuracy

Sensors are essential in feedback loops because they provide the data that the controller uses. Common sensors include temperature sensors, light sensors, pressure sensors, speed sensors, and proximity sensors.

However, sensor data is not always perfect. A sensor may be affected by noise, which is unwanted variation in a measurement. For example, a temperature sensor near a fan may briefly read lower values because moving air changes the local temperature. A robot sensor might detect false signals if sunlight interferes with infrared measurements.

To make feedback systems more reliable, programmers and engineers may use filtering, repeated measurements, or calibration. Calibration means adjusting a sensor so that its readings match known values more closely. This improves the accuracy of the feedback loop.

Real-World Example: Automatic Doors 🚪

Automatic sliding doors use motion or proximity sensors. When a person approaches, the sensor detects movement and sends a signal to the controller. The controller activates the motor, and the doors open. If the sensor no longer detects movement, the door closes. This is a practical example of monitoring and control using feedback-like behavior.

In advanced systems, the door may also detect whether something is blocking the path. If an object is in the way, the controller can stop or reverse the door to prevent injury. That safety response is also part of the control process.

Negative Feedback and Stability

Most control systems in computing use negative feedback. This does not mean bad feedback. It means the system acts to reduce the error.

If the measured value is too low, the system increases the output. If the measured value is too high, the system decreases the output. The purpose is to bring the system back toward the set point.

Negative feedback usually improves stability, which means the system stays close to the desired condition instead of changing wildly. This is important in machines and software-controlled devices because unstable systems can behave unpredictably.

Example: Room Temperature Control

If a room is too cold, the heater turns on. When the temperature rises enough, the heater turns off. If the room becomes too warm, cooling may begin. The system keeps correcting itself so the temperature stays near the target.

This is very different from a system that keeps heating without checking the temperature. Without feedback, the room could become uncomfortably hot or waste energy.

Applying Feedback Loop Reasoning in IB Computer Science HL

When answering exam questions about feedback loops, students, focus on the control process step by step. Examiners often want clear terminology and accurate reasoning.

A strong explanation usually includes:

  1. the input or set point,
  2. the sensor that measures the output,
  3. the comparison between actual and desired values,
  4. the error signal,
  5. the controller decision,
  6. the actuator action,
  7. and the fact that the cycle repeats.

Example Answer Structure

If asked how a greenhouse uses feedback, you could explain:

  • The desired temperature is set.
  • A temperature sensor measures the current temperature.
  • The controller compares the measured temperature with the target.
  • If the temperature is below the set point, the heating system is switched on.
  • If the temperature is above the set point, ventilation may be activated.
  • The process repeats continuously to keep conditions suitable for plant growth. 🌱

This kind of answer shows understanding of both control and automation.

Common Mistakes to Avoid

Students sometimes confuse feedback with simple input-output behavior. Remember: feedback always involves measuring the result and using it to change future action. Another common mistake is forgetting the role of the sensor or the comparison step. In IB terms, it is not enough to say a machine “adjusts itself”; you should describe how and why.

Conclusion

Feedback loops are a central idea in HL Extension — Control because they allow systems to monitor themselves and respond to change. By using sensors, comparing measured values with set points, and making corrections, closed-loop systems can remain accurate, efficient, and safe. students, understanding feedback loops helps you explain many real-world technologies, including thermostats, cruise control, automatic doors, drones, and factory automation. In IB Computer Science HL, this knowledge connects directly to monitoring, automation, and the design of reliable computing systems.

Study Notes

  • A feedback loop measures a system’s output and uses it to adjust future input.
  • The main parts are the set point, sensor, comparator, error, and actuator.
  • The error can be described as $\text{error} = \text{set point} - \text{measured value}$.
  • Closed-loop systems use feedback; open-loop systems do not.
  • Negative feedback reduces error and usually improves stability.
  • Sensors can be affected by noise, so calibration and filtering may be needed.
  • Real-world examples include thermostats, cruise control, automatic doors, drones, and greenhouse systems.
  • In exam answers, explain the cycle clearly: measure, compare, correct, repeat.

Practice Quiz

5 questions to test your understanding

Feedback Loops — IB Computer Science HL | A-Warded