High Frequency Control Loops on RIO



I mentor teams utilizing Java and I have read on CD many times recently that people have been successful in running control loops/PID loops on the RIO anywhere from 100-200hz for more than one system on their robot… I’m interested in learning how this is done. From what I understand the loop frequency for the TimedRobot periodic methods is something like 50hz. How are teams running their control loops faster? Is it just creating a new thread that runs a loop at different frequency or is this there another way to do this with a WPILIB object? Is there any example code anyone could share with me to show me how they achieved the faster loop frequency?

1 Like

WPILib has an inbuilt structure for this kind of thing - the Notifier. It runs a tight loop and you can specify its running frequency.