ระบบอัตโนมัติอุตสาหกรรมและ PLC
Control logic, PLCs, actuators, pneumatics and an introduction to SCADA
Why it matters
Industrial automation lets machines run a defined sequence without a person commanding every step: a sorting conveyor, a bottling line, or an automated drone dock (drone-in-a-box) that opens its lid, centres the aircraft, swaps the battery and closes again. At the heart of these systems is the PLC (programmable logic controller), a computer built to survive dust, heat and electrical noise, and to repeat the same control cycle reliably for years.
Drone engineers need this background because drones in real operations work alongside factories, warehouses and docking stations, and those systems speak the language of PLCs and SCADA. This page lays out the building blocks. Programming and hands-on work are in the lessons.
Building blocks and control loops
Every automated system has three parts: sensors that perceive the state, a controller that decides, and actuators that move something or change the state.
- Open loop: command without checking the result, for example opening a valve for 5 seconds and assuming the tank is full.
- Closed loop (feedback): measure the actual result and correct the command. The error e = r − y is the setpoint (r) minus the measured value (y).
Signals come in two kinds. Discrete signals have two states, such as a limit switch or a proximity sensor. They are wired as PNP (sourcing, switching the positive supply) or NPN (sinking, switching to ground), and the type must match the input card. Analog signals such as 4–20 mA are popular because they tolerate noise on long cables, and zero current means a broken wire rather than a zero reading. Scaling to engineering units uses x = xmin + (I − 4) / 16 × (xmax − xmin).
Common actuators are electric motors (driving belts or shafts), solenoid valves and pneumatic cylinders, where compressed air pushes a piston. Theoretical force is F = p × A, with p the gauge pressure and A the piston area. Pneumatics suit fast, robust push, lift and grip tasks, but cannot stop precisely mid-stroke because air is compressible.
The PLC and its scan cycle
A PLC runs a continuous scan cycle:
- Read all inputs into an input image.
- Execute the program from top to bottom using that image.
- Write all outputs at once.
- Do housekeeping such as communication, then start again.
Because inputs are read at the start of the scan, a change just after that moment waits for the next scan. Worst-case response is therefore roughly two scan times plus I/O module delays, and a pulse shorter than one scan can be missed entirely.
IEC 61131-3 Edition 4 (2025) defines the PLC programming languages: Ladder Diagram (LD), which looks like relay wiring; Function Block Diagram (FBD); Structured Text (ST), which resembles Pascal; and Sequential Function Chart (SFC) for step-by-step sequences. Two patterns every beginner meets are the seal-in circuit, where one press of START keeps a motor running until STOP is pressed, and the on-delay timer (TON), whose output turns on only after its input has stayed on for the preset time.
Machine safety is not left to the program. An emergency stop must remove energy through a hardware safety circuit in line with IEC 60204-1, using normally closed (NC) contacts so that a broken wire stops the machine instead of letting it run.
SCADA and the plant hierarchy
SCADA (supervisory control and data acquisition) collects data from many PLCs, displays it in a control room, stores history and raises alarms. An HMI (human-machine interface) is the touch panel at the machine where operators give commands and see status. SCADA supervises. Fast, deterministic control stays in the PLC.
ISA-95 (IEC 62264) divides a plant into levels: level 0 the physical process, level 1 sensors and actuators, level 2 control and supervision (PLC, SCADA, HMI), level 3 manufacturing operations management (MES) and level 4 business planning (ERP). Data moves between levels over protocols such as Modbus, which is simple and long established, or OPC UA, which carries an information model and built-in security. A drone that feeds inspection results into a plant maintenance system usually connects at level 3 or 4. A drone dock with a moving lid and mechanisms is itself a level 1 and 2 device.
Example: the battery tray pusher in a drone dock
Assume the dock pushes its battery tray with a pneumatic cylinder of 32 mm bore and 12 mm rod at 6 bar (6 × 105 Pa).
- Piston area A = π × 0.0162 ≈ 8.04 × 10-4 m2. Theoretical extend force F = 6 × 105 × 8.04 × 10-4 ≈ 483 N.
- On retraction the rod takes up part of the area: A = π / 4 × (0.0322 − 0.0122) ≈ 6.91 × 10-4 m2, giving about 415 N, less than on extension.
- Real force is lower than theory because of friction. With an assumed 85% efficiency, the extend force is about 410 N.
A pressure transmitter sends 4–20 mA for 0–10 bar. A reading of 12 mA means (12 − 4) / 16 × 10 = 5 bar. If the program should warn below 3.5 bar, the alarm point is 4 + 16 × 0.35 = 9.6 mA.
With a 10 ms scan, worst-case response is about 20 ms plus I/O delays. If the controller must see a 5 mm edge on the tray moving past a sensor at 0.5 m/s, the signal lasts only 10 ms, the same as one scan, so it may be missed. Use a high-speed input or interrupt, or give the sensor a longer target.
Common pitfalls
- Wiring a PNP sensor to an NPN input card. The input never turns on or works inverted. Check both datasheets.
- Treating 4 mA as a fault. 4 mA is the bottom of the measuring range. A reading below about 3.6 mA indicates a broken wire or failed sensor.
- Implementing the emergency stop only in software. If the PLC hangs, a stop that relies on the program will not work.
- Forgetting scan effects. Short pulses are missed, and writing the same output in two places means only the last rung wins.
- Connecting SCADA to outside networks without segmentation. Control networks should be separated and access restricted.
- Sizing a cylinder from the extend force only. Retraction is weaker because the rod reduces the effective area.
Continue in the lessons
- UAT 202 Module 1: Overview of automation (four-year programme)
- UAT 202 Module 2: Industrial sensors and actuators (four-year programme)
- UAT 202 Module 3: PLCs and control logic (four-year programme)
- UAT 308 Module 1: Robotics and automation (four-year programme)
- UAT 314 Module 1: Automation system architecture (continuing programme)
Key references
- Groover, M. P. (2018). Automation, production systems, and computer-integrated manufacturing (5th ed.). Pearson. link
- Bolton, W. (2015). Programmable logic controllers (6th ed.). Newnes.
- International Electrotechnical Commission. (2025). Programmable controllers – Part 3: Programming languages (IEC 61131-3:2025, Ed. 4.0). link
- International Society of Automation. ISA-95 standard: Enterprise-control system integration (ANSI/ISA-95, IEC 62264). link
- International Electrotechnical Commission. (2025). OPC unified architecture – Part 1: Overview and concepts (IEC 62541-1:2025). link
- International Electrotechnical Commission. (2021). Safety of machinery – Electrical equipment of machines – Part 1: General requirements (IEC 60204-1:2016+AMD1:2021 CSV). link