Using a Cancoder as Relative Encoder

Is it possible to use a CANcoder as a relative encoder? if so, what changes do we need to make in terms of wiring and code? We currently don’t have any other encoder available, and were wondering if we can use a CANcoder instead.

Yes CANcoders can be relative no wiring changes, just set it to boot to relative in Phoenix tuner or in your code.

You need to use encoder.getPosition() , if you are in relative mode it will return a relative result.
To set to relative mode you need
encoder.configSensorInitializationStrategy(SensorInitializationStrategy.BootToZero)

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.