Phoenix Tuner library gives the CTRE Mag Encoder position and velocity as sensor units and sensor units/100ms respectively (the documentation is really confusing about that). Is this RPM, CPR, etc? And how can I convert this to meters and meters per second btw?
Sensor units are “counts” (or sometimes “ticks”), and there’s a set number per rotation. The manual for that encoder states that it’s 4096 counts per rotation (CPR).
To convert velocity to RPM, remember RPM=revolutions (rotations) per minute, and the given units are in counts per 100ms.
x counts/100ms * 1000ms/1s * 60s/1min * 1 rotation/4096 counts
To convert counts to a position in meters it depends on the system you’re trying to drive. But generally, for driving a wheel, remember the circumference of a circle (one rotation) is 2Piradius, where the radius is the radius of the wheel in meters.
x counts * 1 rotation/4096 counts * (2Piradius)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.