Embedded and systems
Real-time simulation
A real-time simulation is guaranteed to compute every simulation step within a fixed period, so that simulated and real time stay in sync. It is a prerequisite for connecting real hardware to a simulation.
Also known as: real time, real-time system
Why real time?
A real control unit doesn’t wait for the simulation. It reads its inputs in fixed cycles, say every millisecond. If the simulation delivers a value too late, the device sees an outdated state and the test result is worthless. So the simulation has to finish every step within its time slot, every time, not just on average.
Real-time terms
- Step size: the length of one simulation step, often 1 ms, down to microseconds for power electronics
- Overrun: a step takes longer than allowed. A real-time system has to detect and report this
- Jitter: variation in the moments at which steps start or signals are output
- Hard and soft real time: with hard real time every violation is a failure; with soft real time occasional delays are tolerable
How real time is achieved
Depending on the requirements, models run on a real-time operating system, on Linux with a real-time extension, or on FPGAs for very fast signals. Not every HiL test needs hard real time: for slow processes such as temperature control, an ordinary computer with enough headroom is often sufficient.