Move the encoder's mechanism to the desired home position
Reset the magnet offset of the CANcoder to 0 in phoenix tuner
Apply config (hit the button with the down arrow next to CANcoder Configs)
Hit the green refresh button
Check the absolute position of the CANcoder
This will appear in a table under Self Test
Set the magnet offset to the absolute position multiplied by -1
Apply config
Hit the green refresh button
Confirm that the absolute position now reads 0
If it is still significantly far off from 0, adjust the magnet offset number until the absolute position gets as close to 0 as possible. Remember to hit apply config and the green refresh button every time you change the magnet offset
Set this new value in the code
Reboot the robot
This is needed so the updated values in the CANcoder are properly distributed to the other CAN devices
Confirm that the absolute position still reads 0 at the desired position
No Comments