Define closed loop control system
Many real-time embedded systems make control decisions. These decisions are usually made by software and based on feedback from the hardware under its control (termed the plant). Such feedback commonly takes the form of an analog sensor that can be read via an A/D converter. A sample from the sensor may represent position, voltage, temperature, or any other appropriate parameter. Each sample provides the software with additional information upon which to base its control decisions.
Closing the loop
Systems that utilize feedback are called closed-loop control systems. The feedback is used to make decisions about changes to the control signal that drives the plant. An open-loop control system doesn't have or doesn't use feedback.
Figure 1: A closed-loop control system
A basic closed-loop control system is shown in Figure 1. This figure can describe a variety of control systems, including those driving elevators, thermostats, and cruise control.
Closed-loop control systems typically operate at a fixed frequency. The frequency of changes to the drive signal is usually the same as the sampling rate, and certainly not any faster. After reading each new sample from the sensor, the software reacts to the plant's changed state by recalculating and adjusting the drive signal. The plant responds to this change, another sample is taken, and the cycle repeats. Eventually, the plant should reach the desired state and the software will cease making changes.
If feedback indicates that the temperature in your home is below your desired setpoint, the thermostat will turn the heater on until the room is at least that temperature. Similarly, if your car is going too quickly, the cruise control system can temporarily reduce the amount of fuel fed to the engine.
How much should the software increase or decrease the drive signal? One option is to just set the drive signal to its minimum value when you want the plant to decrease its activity and to its maximum value when you want the plant to increase its activity. This strategy is called on-off control, and it is how many thermostats work.
On-off control doesn't work well in all systems. If the thermostat waits until the desired temperature is achieved to turn off the heater, the temperature may overshoot. See Figure 2. The same amount of overshoot and ripple probably isn't acceptable in an elevator.
Figure 2: Control example