Applications › Robotics & motor control
Control loops need deadlines that are met every cycle, not on average. STK provides hard real-time scheduling with kernel-monitored deadlines, on a kernel small enough to leave the CPU to your control code.
Servo, current and position loops must finish inside a fixed period. One late cycle can mean a stall, vibration or fault.
Fast control loops share the MCU with communication stacks, logging and diagnostics that must never delay them.
A bug in a non-critical task should not corrupt control data or stop the machine.
KERNEL_HRT mode with kernel-monitored deadlines and miss callbacks, so a missed cycle can trigger your safe-state handler.
Rate Monotonic, Deadline Monotonic and EDF, with worst-case response time analysis for RM and DM.
One STK instance per physical core: for example control on one core and communication on the other, with lock-free performance.
Privileged and user tasks, up to 6 per-task regions reprogrammed on every context switch, plus a hardware stack guard.
BlockMemoryPool and BytePool allocators: no fragmentation and no allocation surprises inside the control loop.
SEGGER SystemView traces show scheduling on real hardware. See our benchmarks for jitter and CPU-time figures.
Run each control loop as a periodic hard real-time task under EDF (or RM/DM if you prefer fixed priorities) in KERNEL_HRT mode.
Register a deadline-miss callback that puts actuators into a safe state.
Run communication, logging and user interface in lower-urgency, unprivileged tasks restricted by the MPU.
On dual-core MCUs, run one STK instance per core to separate control from everything else.
Verify timing on the target with SystemView before release.
STK is a scheduler, not a robotics or motor-control framework: bring your own HAL, drivers and control algorithms.
Porting, real-time tuning, certification support and commercial components are available. See services.