Having motor controllers on CAN is great and simplifies both programming and wiring while allowing a lot of added functionality, but one thing that’s always bothered me from my 4 years of using these motor controllers in FRC is that the status and control frames from these motor controllers are sent out periodically asynchronously. This means that if I want to run a 100 Hz control loop on the RIO, in order to guarantee that I don’t get stale data each loop cycle from a CAN device, I essentially need to set that device’s status frame to 200 Hz, and even this only guarantees me data that is accurate to within 5 ms. Control frames being transmitted asynchronously from user code only adds to this “end-to-end” latency. Does this amount of latency matter for controlling FRC mechanisms? Probably not, although I have seen more and more teams running increasingly complex control algorithms RIO side. However, CAN utilization does matter. Having to set status frames to 5 ms periods on several motor controllers and sensors on the robot adds up, and would be entirely unnecessary if user code could request a device or a list of devices to send a specific status frame on demand.
My question is this: is it feasible for CAN device manufacturers (CTRE, REV, etc.) to add a feature to their API and firmware where periodic status frames could be disabled on specific devices, and instead could be requested on-demand by the user code? The default behavior out of the box could and should still be periodic status frames (the same as it is now), and this feature could be enabled optionally by teams wishing to have tighter control of their timings. For what it’s worth, REV already partly solved this issue by making control frames send on demand (when a “set” function is called) by default (instead of periodically). I am not sure if CTRE’s latest API behaves in the same way, but I’d like to see this added to theirs as well if it’s not already the case.
I’d like to know if other teams are interested in having this feature available on CAN based products in FRC, or if this is even possible (perhaps there’s some technical barrier that I’m not aware of that prevents this). Thanks!