I’ve been struggling to understand Phoenix 6’s units, and I think it’s because of my general lack of understanding of motors. Phoenix 5 would give us the motor’s position using TalonFX.getSelectedSensorPosition()
, which would return “encoder ticks” or “raw sensor units”, which I understood as so:
- the internal rotor has binary-like “markings” on it
- when the rotor rotates, a light sensor can sense how many markings have been viewed
- every new marking seen is the same as an encoder tick
I understood that from this explanation. So the way that we would measure wheel rotations dividing the total number of encoder ticks by the ticks-per-rotation ratio.
Now, Phoenix 6 uses TalonFX.getPosition()
which returns the “position of the device in mechanism rotations.” I was explained that “mechanism rotations” means rotor rotations / SensorToMechanismRatio
. I’m assuming a mechanism rotation is more of an abstract term, so for example, in my case, it would be the wheel making a full rotation. So is a rotor rotation the same as an encoder tick, and the SensorToMechanismRatio is the same as the number of ticks in one mechanism rotation?
Or is a rotor rotation one full motor shaft rotation, and SensorToMechanismRatio measures how many shaft rotations it takes for one mechanism rotation?