Material Insights · Understanding the Material World

Control and systems: feedback, stability and how machines are made to behave: Sensors, actuators and on-off control: the hardware of a loop

All courses / Understanding Engineering / Module 11: Control and systems: feedback, stability and how machines are made to behave Part 2 of 5

Sensors, actuators and on-off control: the hardware of a loop

A loop is only as good as its two ends: the sensor that reports the world and the actuator that changes it. Between them sits a decision rule, which can be as crude as a switch. This part looks at the hardware, at the simplest rule (on or off) through a room air conditioner, and at what happens when the decision-maker is a computer that sees the world only in snapshots.

2.1 A sensor turns a physical quantity into a signal and an actuator turns a decision into force or heat, and each limits the loop

Every controller needs eyes and hands. The eyes are sensors. A thermistor is a small bead whose electrical resistance changes steeply with temperature. A toothed wheel passing a magnetic pickup gives one pulse per tooth, so pulse rate tells speed. A thin silicon diaphragm, as in the MEMS sensors inside a phone or a car, bends under pressure or acceleration and changes a circuit's output. A shunt resistor turns current into a small voltage. Each converts something physical into something a circuit can read.

The hands are actuators: a relay or contactor that switches a heater, a solenoid valve, a motor with its drive electronics (see Transformer and power converter), a hydraulic cylinder, a pump. They turn a small signal into a large force or flow.

Both ends have limits that the controller cannot talk its way around. A sensor has a range, an accuracy, a speed of response and noise. A thermometer buried in a thick steel pocket reads the process late. An actuator has a maximum: a valve cannot open beyond 100 per cent, a motor cannot give more than its rated torque. When the controller asks for more than that, the actuator is saturated, and the loop is briefly open in effect, because extra asking changes nothing. Part 3 shows why that causes trouble.

Placement is part of the design. The table lists the pieces for machines met in this module. Kosky and colleagues give a car's fuel system as an example: a small embedded computer reads the measured airflow many times a second and tells the injectors how much fuel to add.

Data Sensor, controller and actuator in five machines
MachineWhat is sensedDecision unitWhat is moved
Geysertank water temperature (thermistor or bimetal)thermostat switchheater element, through a relay
Anti-lock brakingspeed of each wheel (toothed ring and pickup)brake control computervalves that release and reapply brake pressure
Solar pumparray voltage and current; motor currentpump controllermotor speed, through an inverter
Industrial robot jointshaft angle (encoder), motor currentservo drivemotor torque
Autopilotattitude and rate (gyroscopes), altitude and speed (air data)flight computercontrol surfaces, through servo actuators

Every row has the same skeleton: a sensor, a decision rule and an actuator. They differ in how fast the loop must run and what happens when a part fails.

  • Kosky et al., Exploring Engineering (Academic Press, 2013) · ch. 8, 'Computer Engineering', section 8.8 (computer, airflow sensor and fuel-injection actuator) and section 8.10 (embedded computers)
  • Kosky et al., Exploring Engineering (Academic Press, 2013) · ch. 9, 'Electrical Engineering', section 9.6, 'Switches', relays

2.2 On-off control is the simplest closed loop, and it cycles by design

The geyser switch, the refrigerator thermostat, the iron and the fixed-speed room air conditioner all use on-off control. Below a lower limit the output is fully on; above an upper limit it is fully off. The gap between the limits is the hysteresis. Without it the switch would flick on and off hundreds of times a second as the reading jittered around one value, which would destroy a relay or a compressor in days.

The cost of the gap is that the temperature never stays still. It saws up and down inside the band, and the machine starts and stops. The estimate below shows the size of this for a room. The thermal ideas, heat capacity and a refrigeration cycle that moves heat uphill, are those of Heat and thermodynamics: engines, heat pumps and their limits.

Three things follow. The fraction of time the unit runs equals the heat leaking in divided by the unit's cooling capacity, here 2 kW in and 5 kW capacity, so 40 per cent. A wider band means fewer starts but a wider temperature swing. And the compressor has a protection delay, often three minutes or more between stopping and restarting, so in a light room the real band is set partly by hardware, not the dial.

The remedy is to stop switching and start modulating. An inverter air conditioner changes compressor speed to match the load, running continuously at low output. Temperature holds within a fraction of a degree, there are no hard starts, and part-load efficiency improves. The price is drive electronics, extra cost and one more component that can fail. The same shift from on-off to proportional control appears in Heat pump designs and in every modern Refrigerator with a variable-speed compressor.

Data Worked estimate 2: how often does a 1.5 tonne room air conditioner cycle?
QuantityWorkingResult
Heat stored per degree in the room, its furniture and the surface layers of its wallsassumed round value300 kJ per K (assumed; the air alone is 45 m3 x 1.2 kg/m3 x 1.0 kJ/kg K = 54 kJ/K)
Cooling capacity and heat leaking in1.5 tonnes of refrigeration is 1.5 x 3.52 kW = 5.3 kW at rated conditions; take 5.0 kW on a hot day. Sun, people and lights add 2.0 kW5.0 kW out, 2.0 kW in
Run time to cool through a 2 K band (switch at 1 K either side of the setting)300 kJ/K x 2 K / (5.0 - 2.0 kW)200 s
Idle time to warm back through the band300 kJ/K x 2 K / 2.0 kW300 s
Cycle length and starts per hour200 + 300 s; 3,600 s / 500 s500 s; about 7 starts
Fraction of time running200 / 50040 per cent, equal to 2.0 / 5.0
If the band is narrowed to 1 Kidle time would be 150 s, shorter than a 3 minute restart delay, so the delay sets it: 2.0 kW x 180 s / 300 kJ/Koff for 180 s, and the room drifts 1.2 K above the lower limit, not 1 K

Every result is calculated from the assumed inputs. The heat capacity is the least certain of them: it counts only the parts of the room that warm and cool within a few minutes, and a heavier, brick-walled room cycles more slowly. Check: a fixed-speed room unit on a warm day typically runs for a few minutes and rests for a few, so the order is right.

Source: Bloomfield, How Things Work (Wiley, 2015), ch. 8, 'Thermodynamics', section 8.1, 'Air Conditioners'
  • Bloomfield, How Things Work (Wiley, 2015) · ch. 7, 'Heat and Phase Transitions', section 7.1, 'Woodstoves', heat capacity
  • Bloomfield, How Things Work (Wiley, 2015) · ch. 8, 'Thermodynamics', section 8.1, 'Air Conditioners'
  • Kosky et al., Exploring Engineering (Academic Press, 2013) · ch. 9, 'Electrical Engineering', section 9.6, 'Switches', relays

2.3 A digital controller reads the world in snapshots, and a robot joint shows why inner loops must run faster than outer ones

Most modern controllers are small computers. A Programmable logic controller works in a cycle called the scan. It reads all its inputs, runs its program once, writes all its outputs, and repeats, typically in a few milliseconds to tens of milliseconds. The controller therefore sees the world in snapshots, and anything that begins and ends between two scans is invisible to it. The scan is also a delay built into every loop.

A quick estimate shows the size of the effect. Parts ride a conveyor at 0.5 m/s past a photo-sensor, and the controller scans every 10 ms. In one scan a part moves 0.5 m/s x 0.010 s = 5 mm. A 3 mm gap between two parts can fall entirely between snapshots and go unseen, and a stop command for a part may fire up to 5 mm late. A faster scan, a slower conveyor or a sensor wired to a hardware input that triggers instantly are the cures. As a rule of thumb, a controller should sample at least ten times faster than the process it controls changes.

The Industrial robot adds the idea of nesting. Each joint has a motor and an encoder reporting its angle. The innermost loop controls motor current, which sets torque, and runs many thousands of times a second. Around it sits a speed loop running a few thousand times a second, and around that a position loop, slower again, driven by the path the robot is told to follow. Each loop treats the faster one inside it as an actuator that answers at once. The rule is general: inner loops fast, outer loops slow, so that each can be tuned on its own.

The trade-off is cost and complexity against precision. A cheap controller with a slow scan is fine for a lift or a lamp, and unsafe for a press or a robot that works beside people, which is why Collaborative robots add separate safety-rated monitoring loops.

  • Kosky et al., Exploring Engineering (Academic Press, 2013) · ch. 8, 'Computer Engineering', sections 8.8 and 8.10, computers that read sensors many times a second and embedded control computers

See it in the table

St SteelSi Silicon

Check your understanding

A fixed-speed air conditioner needs to remove 2 kW of heat leaking in and has a 5 kW capacity. About what fraction of the time does it run?

Over time the heat removed must equal the heat leaking in, so run fraction = 2 / 5 = 40 per cent. The thermostat only decides how that time is split into starts and stops.

What does hysteresis in a thermostat prevent?

A gap between switch-on and switch-off values stops tiny fluctuations from toggling the output, which would wear out relays and compressors. The price is a wider temperature swing.

A conveyor runs at 0.5 m/s and a controller scans every 20 ms. How far does a part move between scans?

Distance = speed x time = 0.5 m/s x 0.020 s = 0.010 m, which is 10 mm. Anything shorter than that could pass unseen.
← Part 1: Open loop and closed loop: measure, compare, correctMark read · Part 3: Proportional, integral, derivative: what each action fixes and what it costs →