I dont quite understand how the through bore encoder on the drive motor shaft can provide the wheel orientation?
Swerve drives use an absolute encode, which always knows position the shaft is in and reports that as an angle from a “starting” position. The code takes that info and an offset so that every encoders’ 0 degrees is pointing the same way, to determine which way all of the wheels are facing.
The throughbore is measuring the rotation of the outside of the cover of the drive shaft - not the drive shaft itself. The part that the thrubore is measuring is actually fixed to the azimuth, and is not rotated by the drive motor.
Not exactly the best view in the world, but you can see here (mostly) that the thrubore is not actually engaging with the NEO - there is a gap around the NEO shaft. The part that the thrubore engages with is this hex segment (image from REV docs):
This hex segment is fixed to the azimuth of the module.
Welcome to CD!
Our team uses CANCoders which use a magnetic field to determine the wheel’s orientation, but basically the same thing. Lets say our wheel is pointing straight forward, but our encoder is mounted in a different orientation, say 45 degrees off. We can apply an offset to correct this, taking the encoder’s absolute position and adding or subtracting 45 degrees.
Another key point is that, if I understand correctly, the absolute encoder is a 1:1 ratio to the wheel’s rotation. Such is the case with our swerve.
Thanks
I just figgured that out