7.2. Open-Loop Control#
An open-loop controller sends commands to an actuator without checking the result. The microcontroller decides what to do and then executes the action. This is simple and cheap because it does not require sensors, which are often relatively expensive.
Open-loop control is used in many everyday objects, such as:
A toaster that runs the heater for 2 minutes regardless of bread thickness.
A timed pump that dispenses for 5 seconds regardless of fluid viscosity.
A robot that drives forward for 1.5 seconds to “go 1 meter,” assuming constant speed.
7.2.1. Programming Open-Loop Control#
Open-loop on a microcontroller is usually just “do X for Y time” or “set duty cycle,” with no feedback.
In the example below, the main loop just repeats the action of setting the actuator to a given level and sleeps to hold that action then resets.
Note
Notice that the program doesn’t measure the state of the environment - it just assumes that setting the actuator has accomplished the task.
while True:
set_actuator(0.60) # e.g., set motor PWM to 60%
sleep(duration) # hold for fixed time
set_actuator(0) # stop
sleep(rest)
7.2.2. Suitability of Open-Loop Control#
In predictable conditions open-loop control can work well. However if the environment or hardware changes (battery voltage, friction, load, wind), an open-loop controller can’t make corrections and it may not be useful.
Open-loop control is suitable when:
The process always behaves the same e.g. a repeatable timing, weight or temperature.
Slight inaccuracy is acceptable e.g. blinking LEDs, “rough” dispensing, timed cleaning cycles in machines.
Of course there are many situations in which the cost of adding sensors forces mechantronic engineers to use open-loop control.
Example#
Suppose you have a collection of simple two wheeled robots that you’ve flashed with the same program to drive forwards. You notice that they drive different distances.
You measure far each robot travels in 1 second and find:
Robot A travels 1.00 m
Robot B travels 0.7 m
Robot C travels 0.85 m
After checking the robots you notice that the batteries of each is at a different voltage: 7.2 V, 5.6V and 6.4V respectively.
The different battery voltage means that the motor spins at different rates for each robot, despite programming them to move for the same amount of time. In this case a solution might be to make sure that the robots are always fully charged before use, or use a voltage regulator to supply a constant voltage to the motors.
Question 1
Give one real-world example of a device that uses open-loop control. Describe why it is open-loop rather than closed-loop.
Solution
A microwave oven set to run for 2 minutes. It does not measure the food temperature, it only runs for the fixed time. This is open-loop because the action (heating) is independent of whether the food is actually hot enough or overcooked.
Question 2
Imagine you program a robot to drive forward for 2 seconds at 50% motor power. On a smooth floor, it travels 1 meter. On carpet, it only travels 0.7 meters. Why does this happen in an open-loop system?
Solution
Solution is locked
Question 3
Suppose a fan is set to run at a constant speed by setting the PWM duty cycle. However over time you notice that over time, dust builds up and the fan spins slower. Why does this happen? What could be done to fix it?
Solution
Solution is locked