← All articles DE

Real-time & software

Linux real-time on the test bench: determinism without expensive special hardware

Key facts

  • A test bench needs deterministic timing: the controller must finish in every single cycle, not just be fast on average.
  • Linux with PREEMPT_RT reliably achieves 1 ms cycle times on industrial PCs, with latencies well below 100 µs.
  • Safety functions never belong in the real-time software; they belong in a dedicated safety PLC.

Why real-time is not a luxury on a test bench

A test bench controller lives on reliability in its cycle: if the torque controller is supposed to deliver new setpoints every 1 ms, it must do so in every single cycle. A normal operating system is fast enough on average, but occasional stalls of several milliseconds (updates, drivers, background processes) ruin control quality and make measurements incomparable. Real-time therefore does not mean “fast” but “on time, guaranteed”.

What PREEMPT_RT turns Linux into

PREEMPT_RT is the real-time extension of the Linux kernel and has largely been merged into the mainline kernel. It makes the kernel almost fully preemptible: a process with real-time priority (SCHED_FIFO) displaces everything else, including kernel work. On an ordinary industrial PC this yields reliable latencies well below 100 µs, plenty of headroom for a clean 1 ms control cycle.

In practice a few steps belong to it: reserving individual CPU cores for the real-time tasks (CPU isolation), pinning interrupts deliberately, and measuring the actual latencies under full load with tools like cyclictest instead of assuming them.

EtherCAT as the clock of the measurement chain

Real-time control needs a fieldbus that keeps up. EtherCAT delivers hard 1 ms cycles (and faster), synchronizes all participants via distributed clocks and transports setpoints and measurements in a single frame across the whole bench. Torque sensors, inverters and I/O sit on one line, and every measurement carries the same timestamp, the basis for synchronous logging of all channels.

Linux RT or specialist systems like Speedgoat and dSPACE?

Commercial real-time systems are excellent tools, but they quickly cost five-figure sums plus recurring licence fees, and the code lives in a closed ecosystem. A Linux RT stack on industrial hardware costs a fraction, is fully owned by you and can be extended at will. The price: you have to master the system yourself, from kernel tuning to the EtherCAT master.

One clear limit applies to both worlds: functional safety (emergency stop, guard monitoring, safe speed shutdown) never belongs in the test bench software, however real-time capable it is, but in a certified safety PLC. More on that in the article on safety concepts.

And at ENGtron?

Both ENGtron in-house test benches run on Linux real-time and EtherCAT at 1 ms cycle time. Control, actuation and automation are fully developed in-house, exactly the know-how we bring into customer projects, including migration from cost-intensive licence models to your own software.

Let's talk about your measurement task

ENGtron supports testing services, test bench engineering and test bench software, directly from the development engineer, without detours. Describe your task in two or three sentences and you will get an honest assessment.

Request a project