What 'real-time' actually means
In everyday language 'real-time' just means 'fast.' In embedded systems it means something much stricter: a task has a deadline, and missing that deadline isn't just slow, it's a failure. A hard real-time system is one where missing a single deadline can be catastrophic, imagine a motor controller that's supposed to update PWM output every millisecond but instead pauses for 20ms because the OS scheduled something else, the wheel keeps spinning at the old command for 20 times longer than intended, which at speed can mean a visible lurch, an overshoot past a target position, or in a legged or balancing robot, a fall. A soft real-time system tolerates occasional missed deadlines with degraded but non-catastrophic results, dropping a video frame during teleop is annoying, not dangerous.
Motor control loops, especially closed-loop PID control reading an encoder and adjusting output many times a second, are hard real-time by nature. The control theory itself assumes a fixed time step: the PID gains (Kp, Ki, Kd) are tuned around an expected loop interval, and if that interval becomes irregular, the derivative and integral terms compute against a moving target and the whole controller can become unstable, oscillating or overshooting in ways that have nothing to do with the physical system and everything to do with jittery timing.
