Building Real-Time Robot Applications with Linux PREEMPT_RT A developer from V-Modal explains how Linux PREEMPT_RT can be used to build real-time robot applications, emphasizing predictable timing over raw speed. The post covers kernel configuration, scheduling policies like SCHED_FIFO, CPU affinity, and latency measurement with cyclictest, noting that a real-time kernel alone does not guarantee determinism. Robot control software often needs to react to sensor input and generate actuator commands within predictable time limits. A general-purpose Linux kernel is optimized for throughput and fairness, but it does not guarantee that a high-priority control task will run exactly when expected. PREEMPT RT is a set of Linux kernel patches and upstreamed real-time capabilities designed to reduce scheduling latency and make Linux more suitable for deterministic workloads. For Physical AI, PREEMPT RT can be useful when software must coordinate sensors, perception pipelines, and actuator control with predictable timing. Consider a motor controller that should execute every 1 millisecond. A normal Linux system might occasionally delay the control task because of: Even small timing variations can affect robot stability. A real-time system instead prioritizes predictable response time. The important distinction is: Real-time computing is primarily about predictable timing, not simply running code faster. A robot application can be structured like this: Sensors | v Sensor Drivers | v Real-Time Control Loop | v Actuator Drivers | v Motors / Servos Higher-level perception and AI workloads can run alongside the control loop: +----------------------+ | AI / Perception | | GPU workloads | +----------+-----------+ | v Sensors --- Real-Time Control --- Actuators PREEMPT RT The control loop should remain isolated from unpredictable workloads whenever possible. The exact installation process depends on the Linux distribution and kernel version. On supported distributions, start by checking the current kernel: uname -a Check whether the running kernel exposes real-time configuration: cat /sys/kernel/realtime If the file exists and reports 1 , the running kernel has real-time support enabled. Always use the real-time kernel packages or instructions appropriate for your distribution rather than assuming package names from another release. Linux provides scheduling policies such as SCHED FIFO and SCHED RR . A simple C example using SCHED FIFO looks like: include