PLC: How Machines Control Themselves
What is a PLC?
A Programmable Logic Controller is an industrial computer designed for harsh environments: heat, vibration, dust, and unstable power. It automates industrial processes by reading sensors, executing logic, and controlling actuators.
Why Not a Regular PC?
A desktop PC fails in factories because it cannot withstand vibration, heat, and power fluctuations, and its operating system is not real-time — it cannot guarantee executing an instruction within a precise millisecond. PLCs are designed for deterministic timing.
Brief History
Before PLCs, machines were controlled by relay panels — thousands of electromechanical relays wired together. Changing logic meant rewiring — expensive and slow. In 1968, General Motors requested a programmable alternative. Dick Morley at Modicon delivered the first PLC.
PLC Components
- CPU: executes the program in a repeating scan cycle
- Digital Input modules: switches, proximity sensors — on or off
- Analog Input modules: temperature, pressure, flow — continuous values (4-20 mA)
- Digital Output modules: start/stop motors, valves, lights
- Analog Output modules: control VFD speed, proportional valve position
- Power Supply: converts 220V AC to 24V DC for the PLC
The Scan Cycle
[1] Read all inputs → store in image memory
[2] Execute program from top to bottom
[3] Write output results to output modules
[4] Return to step 1
Typical scan time: 5–50 ms, meaning the PLC checks sensors 20–200 times per second.
Ladder Diagram Language
The most common PLC programming language — visually resembles the old relay panels:
- NO Contact: condition — active when input = 1
- NC Contact: inverted condition — active when input = 0
- Coil: action — activates an output when conditions are met
Simple pump control:
|--[Start_Button]--[/Stop_Button]--[/High_Temp]--( Pump )--|
Pump runs if: Start pressed AND Stop not pressed AND temperature normal.
Timers and Counters
Timer: waits a set duration before activating output. Example: after valve opens, wait 5 seconds then start compressor.
Counter: counts events (parts on conveyor, machine cycles). Example: after 1000 parts, stop line and send maintenance alert.
Real Example: Bottle Filling Line
1. Conveyor moves until sensor detects bottle under filling head
2. Conveyor stops
3. Pump runs for 3 seconds (calibrated fill volume)
4. Pump stops
5. Conveyor moves again
6. Repeat
Protection: if pump pressure exceeds limit → stop all + alarm
if conveyor stops 10s without bottle detected → jam alarm
SCADA and HMI
SCADA (Supervisory Control and Data Acquisition): central screen showing all machine states, logging historical data, managing alarms, and enabling remote control.
HMI (Human Machine Interface): the screen operators interact with — showing real-time values, allowing setpoint changes, and responding to alarms.
Summary
The PLC is the automated brain of the modern factory. It eliminates the need for operators to watch every machine, reduces human error, speeds production, and logs every moment of data. Understanding how it works is the key to automating any industrial process.