For the steering motor, I see you added an encoder slice to the gearbox in place of the rev through bore encoder (from your earlier Update). As @dydx stated following that update, the gear ratio between your output gear from the steering gearbox and the module itself is not 1:1. Therefore, that encoder will not give you absolute position of the module.
There are effectively 4 ways to get absolute position of the module using an encoder:
- Have a 1:1 belt or gear drive from the module to a parallel shaft that the encoder is mounted to (this is by far the most common method uses by SDS and many other designs that have taken heavy influence from the 2910/SDS design).
- Mount the lamprey encoder magnet concentric to the axis of rotation of the module itself and mount the lamprey sensor to the top plate (with the motor shaft passing through the center of the ring magnet) as was done on 33’s summer? swerve design. This option really only emerged this year with the release of this new encoder so it is not overly common yet.
- Use the encoder in the steering motor to sense rotation at something other than a 1:1 ratio to the module and then either manually set the initial position of the module to 0, or sense the initial position by rotating until you trigger a sensor (like 3737 has done).
- Mount an additional gear set from the steering output shaft to an encoder shaft that has the same gear ratio as the ratio between the steering gear and the module. This is the solution we used in prior years on our module.
Options 1, 2 and 4 will get you an absolute position sense at the encoder that can be used directly in a control loop. Sensing the current orientation of the module using option 3 relies on knowing the initial orientation and then keeping track of rotations of either the motor or some other part of the steering gearbox system and dividing those rotations by the gear ratio from the sensed location to the module to get the module angle.
I hope this helps.