The computer that keeps a tank from overflowing
An industrial control system is the set of computers, sensors and pumps that runs a plant, such as a water works or a factory. When it fails, water stops, or a tank overflows.
This module teaches how these systems work and how they are defended. Everything happens in your own simulated lab, never on a real plant.
By the end of this lesson
Note
I can trace how a PLC turns a sensor reading into a pump command.
Key words
| Word | What it means | Example |
|---|---|---|
| Sensor | a device that measures something | a level sensor |
| Actuator | a device that acts on the plant | a pump |
| PLC | a programmable logic controller, the computer that runs a machine | |
| Scan cycle | read inputs, run the logic, write outputs, then again | |
| HMI | the human-machine interface, the operator's screen | |
| Purdue model | a map of a plant's computers in levels, from the floor up |
The cells students fill in are left blank in this preview.
The one rule
Warning
Work only in your own lab copy, and only with permission. Never send a command, a scan or a probe to a real plant or a device that is not yours. In the UK that can be a crime under the Computer Misuse Act 1990, and on a real plant it can hurt people.
Sensors, a PLC and actuators form a loop
A sensor measures the plant. In the lab, a level sensor reports how full a water tank is, from 0 to 100 per cent.
A PLC reads that number and decides what to do. An actuator carries it out. Here the actuator is a pump that fills the tank, while an outlet always drains it.
The rule in the lab is simple. The pump starts at 20 per cent and stops at 80. Those two numbers are the setpoints.
A PLC works in scans
A PLC does not wait for events. It repeats one scan cycle for ever: read every input, run the logic, write every output.
The lab's PLC scans every 0.1 seconds. A change that happens just after the inputs are read waits for the next scan. So the worst reaction time is two scans.
Work seven scans by hand
docker exec work python3 steps/scancycle.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
Worked example: what the lab printed
| Scan | Level read | Logic says | Level after |
|---|---|---|---|
| 1 | 23 | pump off | 22 |
| 3 | 21 | pump off | 20 |
| 4 | 20 | pump on | 21 |
| 7 | 23 | pump on | 24 |
The cells students fill in are left blank in this preview.
Try it: add up one scan
parts = {"read inputs": 2, "run logic": 5, "write outputs": 2, "talk to the HMI": 1}
total = 0
for name in parts:
total = total + parts[name]
print(name, parts[name], "ms")
print("scan time:", total, "ms")
print("worst reaction:", 2 * total, "ms")
# Change "run logic" to 45. Does the scan still fit inside 50 ms?
The HMI shows the plant to a person
An operator cannot read a PLC's memory. They watch an HMI, a screen that asks the PLC for its values and draws them.
The lab has one. Open HMI from the bar to see the level, the pump and the mode. It refreshes every second and it only reads.
Read the PLC without changing it
docker exec work python3 steps/plant.pyShown here, not run. Press Start lab to type it into your own lab’s terminal.
A common mistake
Warning
Many people think the HMI controls the plant. The PLC does. The HMI only shows what the PLC reports and passes on what an operator asks. If the HMI stops, the PLC keeps running the tank. So protecting the HMI alone does not protect the plant.
The Purdue model: a level per computer
| Level | What lives there | In the lab |
|---|---|---|
| 0 | Sensors and actuators | The level sensor and the pump |
| 1 | Controllers such as PLCs | plc |
| 2 | Supervisory screens such as HMIs | hmi |
| 3 | Site operations, historians, engineering | work |
| 4 and 5 | The business network and the internet | Not in the lab |
The cells students fill in are left blank in this preview.
Levels become zones with doors between them
The levels are not only a map. Each level is a zone, a group of machines trusted the same.
Traffic between zones should pass through a controlled door, called a conduit. The lab has one, the gateway, which you meet in lesson 5. The network security module taught zones for offices, and the idea is the same.