Quote:
Originally Posted by Oblarg
I know the WPILib implementation runs in its own thread and the loop frequency can be set manually - do you know what the fastest speed it can run is?
|
If you want to run it much faster than 100 hz, you should start looking at monitoring the between-loop timing, and improve it. By default, WPILib threads don't run with SCHED_FIFO priority, so they can have a bit of timing jitter. We write our own to get full control, and can reliably hit +- 280 uS with a 5 ms loop. Without that, we've seen it miss cycles.
As you get faster and faster, you'll start to see noise show up in the velocity measurement due to the discrete differentiation. When that starts to happen, you'll need to add complexity to filter it out.