Topic 6 · Control Systems (HL)
Computer Science · Cheatsheet

Topic 6 · Control Systems (HL)

Chapter 3 · Embedded systems

📋 Reference · always available
Embedded system
Computer built INTO a larger device, doing ONE job. Constrained memory + power, often real-time, no reboots.
vs general-purpose
GP = many user programs, full OS, abundant resources. Embedded = fixed firmware, often bare-metal or RTOS.
Hard real-time
Missing the deadline = FAILURE. Airbag (30 ms), pacemaker, ABS, industrial robotics.
Soft real-time
Late = degraded, not catastrophic. Video frame drop, audio jitter, online gaming.
Main loop
1) SENSE (read ADC/GPIO) → 2) DECIDE → 3) ACTUATE → 4) SLEEP → repeat FOREVER. No exit condition.
Interrupts in embedded
Handle urgent events that cannot wait for next loop iteration (button, packet, overcurrent).
Why no Python
GC + dynamic types + megabyte RAM = incompatible with tiny KB-RAM hard-real-time microcontrollers. C dominates.
RTOS
Real-Time Operating System (FreeRTOS, Zephyr). Tiny + predictable + priority scheduling. Common in serious embedded.
WCET
Worst-Case Execution Time analysis. Required for hard-real-time to prove deadline is met under ALL conditions.
Examples
Pacemaker · car ECUs (~50/car) · drone flight controller · microwave · smart thermostat · 3D printer.