Show an understanding of monitoring and control systems
Monitoring and Control Systems – A‑Level Computer Science (9618)
1. What is a Monitoring & Control System (MCS)?
An MCS continuously monitors a physical process (temperature, pressure, speed, etc.) and, through a controller, acts on that process to keep it within required limits. It links many Cambridge AS/A‑Level concepts – data representation, algorithms, hardware, networking, security and ethics – into a single, real‑world system.
Binary‑Coded Decimal (BCD): each decimal digit stored in 4 bits. Example: decimal 59 → 0101 1001₂.
4.2 Floating‑Point (IEEE‑754 single precision)
32‑bit format: (-1)^S × 1.M × 2^(E‑127) where S = sign, E = 8‑bit exponent, M = 23‑bit mantissa. Important AS topics: normalisation, overflow, underflow, rounding.
4.3 Size Calculations
12‑bit ADC (0‑10 V) → resolution = 10 V / 4095 ≈ 2.44 mV per count.
16‑bit sensor → 0‑65535 range, useful for high‑resolution pressure transducers.
4.4 Simple Compression Techniques for Telemetry
Run‑length encoding – compresses long sequences of identical values.
Delta encoding – transmit only the difference between successive samples; useful when change is small.
5. Control Theory Refresher
5.1 Open‑Loop vs. Closed‑Loop (Feedback)
Loop type
Feedback used?
Typical applications
Advantages
Disadvantages
Open‑Loop
No
Toaster, irrigation timer, simple conveyor
Simple, cheap, fast response
Cannot compensate for disturbances or component drift
Closed‑Loop (Feedback)
Yes
Thermostats, motor speed control, industrial process control
Accurate, robust to disturbances
More complex, requires sensors & computation; possible stability issues if poorly tuned
5.2 PID Controller – The Work‑horse Algorithm
Let y(t) be the process variable and r(t) the set‑point. Error: e(t) = r(t) – y(t).
PID output:
u(t) = KP·e(t) + KI·∫₀ᵗ e(τ)dτ + KD·de(t)/dt
KP – Proportional gain (immediate reaction).
KI – Integral gain (eliminates steady‑state error).
KD – Derivative gain (predicts future error, reduces overshoot).
Algorithmic implementation (sample time Δt):
Read sensor → digital value y.
Compute error e = r – y.
Update integral term I = I + e·Δt.
Compute derivative term D = (e – eprev) / Δt.
Calculate control output u = Kp·e + Ki·I + Kd·D.
Send u to actuator (e.g., PWM duty cycle).
Store e as eprev for the next cycle.
5.3 Computational Thinking in Control
Abstraction: Model the plant as a transfer function or state‑space model.
Decomposition: Split into sensing, computation, actuation.
Algorithm design: Choose PID, fuzzy logic, or model‑predictive control.
PLC ladder‑logic contacts are physical equivalents of these gates. Simplification using Karnaugh maps (K‑maps) is an exam‑relevant skill.
6.2 Register Set (quick reference)
Register
Purpose
PC (Program Counter)
Address of next instruction
MAR (Memory Address Register)
Holds address for memory access
MDR (Memory Data Register)
Data being transferred to/from memory
ACC (Accumulator)
Primary arithmetic/logic operand
IR (Instruction Register)
Current instruction being decoded
FLAGS (Status Register)
Zero, carry, overflow, interrupt enable
General‑purpose (R0‑R7)
Temporary storage for algorithm variables
6.3 CPU, ALU & Bus Architecture
CPU core – Executes the fetch‑decode‑execute cycle.
ALU – Performs integer addition, subtraction, logical operations required for PID calculations.
Data bus – Carries binary data between CPU, memory and I/O.
Address bus – Carries memory addresses (often 16‑ or 32‑bit wide).
Control bus – Carries read/write, interrupt, and clock signals.
7. Processor Fundamentals – Von Neumann Model
7.1 Fetch‑Decode‑Execute Cycle (labelled)
Fetch: PC → MAR; memory read → MDR → IR.
Decode: Instruction decoder analyses IR (opcode, operands).
Execute: ALU performs operation; results may go to ACC or a destination register.
Write‑back: Result stored in RAM, I/O register, or updated PC for next instruction.
7.2 Scan‑Cycle in a PLC
Repeated many times per second (typical 10‑100 ms). Steps:
Read all inputs (sensors).
Execute user program (ladder/Structured Text).
Update outputs (actuators).
Check for high‑priority interrupts.
7.3 Interrupt‑Service Routine (ISR) Flowchart
+-------------------+
| Interrupt occurs |
+--------+----------+
|
v
+--------+----------+
| Save context (PC,|
| FLAGS) |
+--------+----------+
|
v
+--------+----------+
| Jump to ISR code |
+--------+----------+
|
v
+--------+----------+
| Service request |
| (e.g., emergency |
| stop) |
+--------+----------+
|
v
+--------+----------+
| Restore context |
+--------+----------+
|
v
+--------+----------+
| Return to scan‑ |
| cycle (resume) |
+-------------------+
8. Communication – From Fieldbus to the Internet
8.1 Layer‑wise View of the TCP/IP Stack
Application – SCADA, MQTT, Modbus‑TCP, OPC‑UA.
Transport – TCP (reliable) or UDP (low‑latency).
Internet – IP addressing, routing, IPv4/IPv6.
Link – Ethernet, Wi‑Fi, CAN, RS‑485.
8.2 DNS & URL Basics (required for 2.1)
Domain Name System translates a human‑readable name (e.g., plc01.factory.com) into an IP address. In an IIoT deployment the SCADA server may resolve PLC hostnames via DNS, enabling flexible re‑addressing.
8.3 Common Industrial Protocols
Modbus‑RTU – Serial (RS‑485), 8‑bit frames, CRC‑16 error detection.
Modbus‑TCP – Modbus payload encapsulated in TCP/IP.
CANopen – Message‑based, priority‑encoded identifier, used in automotive & motion control.
Profibus – DP (Decentralised Peripherals) for high‑speed I/O.
Ethernet/IP – Standard Ethernet with CIP (Common Industrial Protocol) on top.
8.4 Network Topologies & Switching
Star – Central switch; easy to isolate faults.
Bus – CAN or RS‑485; economical for long runs.
Ring – Ethernet Ring Protection Switching provides redundancy.
8.5 Packet vs. Circuit Switching
Packet switching – Data split into packets; efficient use of bandwidth (used by TCP/IP).
Circuit switching – Dedicated path for the duration of a session; typical of older telephony, rarely used in modern MCS.
9. Software Aspects – From Firmware to HMI
9.1 System Software Overview
Aspect
Description (exam‑relevant)
Memory management
Allocation of RAM for variables, stack for ISR, flash for program storage.
File management
Log files on SD‑card or network share; timestamps, rotation policies.
Process / task scheduling
Round‑robin or priority‑based pre‑emptive scheduling in an RTOS (e.g., FreeRTOS).
Interrupt handling
Vector table, ISR latency, nesting rules.
Device drivers
Abstraction layer for ADC, PWM, UART, Ethernet MAC.
9.2 Language Translators & IDE Features
Translator
Typical role
Example
Compiler
Transforms high‑level source (C, Structured Text) into machine code.
GCC for ARM Cortex‑M
Interpreter
Executes statements directly; used for scripting in SCADA.
Python in data‑analysis modules
Assembler
Converts assembly mnemonics to op‑codes.
Keil µVision assembler
9.3 IDE Capabilities Expected for A‑Level
Code editor with syntax highlighting for ladder, ST, C.
Integrated simulator/emulator for offline testing.
Debugger with breakpoints, watch windows, and real‑time variable inspection.
Version‑control integration (Git) for change tracking.
Project‑wide configuration (CPU type, communication settings, I/O map).
Train regression or classification models (e.g., Random Forest, LSTM) to predict component wear.
Validate models on unseen data; monitor false‑positive/negative rates to avoid unnecessary shutdowns.
11. Example: Temperature Control in an Industrial Oven
Sensor: PT100 RTD → signal conditioner → 0‑10 V → 12‑bit ADC (0‑4095).
Signal Conditioning: Low‑pass filter, offset removal, linear scaling to °C.
Controller: PLC running Structured Text PID (Δt = 100 ms). Set‑point Tsp = 220 °C.
Control Signal: PWM duty cycle (0‑100 %) to a solid‑state relay (SSR) that switches the heating element.
Actuator: SSR rated for 4 kW mains load.
Communication: Modbus‑TCP on Ethernet/IP (IP = 192.168.0.45). SCADA polls Holding Register 40001 for temperature, writes 40002 for manual override.
HMI/SCADA: Real‑time trend plot, alarm when |e| > 5 °C, manual “Open‑Loop” button.
Security: TLS‑encrypted Modbus, user authentication, firewall between plant LAN and corporate network.
Data Logging & AI: 1 Hz temperature log stored in InfluxDB; Python script trains a Gradient‑Boosting model to predict when the heating element temperature exceeds 600 °C, triggering a pre‑emptive maintenance alert.
Block diagram – closed‑loop temperature control (sensor → conditioner → PLC (PID) → actuator → oven) with SCADA overlay.
12. Advantages of Monitoring & Control Systems
Safety: Automatic shutdown, fault detection, emergency‑stop handling.
Efficiency: Optimised resource use, reduced waste, lower energy consumption.
Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources,
past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.