Save offsets on the RoboRIO

Is there a way to save offset information on the roborio?

The reason I would want to do this is because I have a barrel for a t-shirt cannon that requires absolute positioning. I could have the robot zero itself, but it is unnecessary if you don’t move the encoder. If you move the encoder, then you would have to re-zero and find an offset.

However, to avoid unnecessary zero-ing, I would have to save an offset somewhere. How would I save an offset to the roborio? Has anyone done this yet, perhaps with a swerve drive?

Thanks!

Robot preferences could probably be used for what you want.

3 Likes

This looks like it’s exactly what I need. Didn’t know about this!

Thanks!

If you have time to elaborate - I am curious for my own purposes: Is the assumption that the mechanism does not move while the robot is off? If so, how is that accomplished/guaranteed?

So I currently have a design that has a 1:1 belt ratio from a rotating “barrel” to an absolute encoder. I have to do it this way because the barrel is so big and already makes use of the center, so placing an encoder/magnet there wouldn’t be feasible. The barrel can move while it’s off when it’s connected to the encoder, and the absolute encoder will keep track, but If you remove the barrel for any reason (maintenance, transportation), it becomes decoupled from the encoder and therefore loses its zero

1 Like

use case makes sense! I hadn’t thought of that. Thank you!

Definitely not ideal, but gotta make it work somehow

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.