Absolute Encoders
Last updated
Was this helpful?
Last updated
Was this helpful?
YAGSL supports most common FRC absolute encoders. Absolute encoders are required if you are using a brushed motor .
The absolute encoder value will show up in your driver dashboard under swerve/modules/.../Raw Absolute Encoder
and can be used to tune the absoluteEncoderOffset
in module JSON configuration files under most circumstances.
YAGSL created wrappers over all supported Absolute Encoders to uniformly fetch and set data that is needed for a Swerve Module to operate. This wrapper is called . All 's can be fetched via the configuration object absolute encoder attribute . The is able to be fetched by easily.
YAGSL created wrappers over all supported Motor Controllers to uniformly fetch and set data that is needed for a Swerve Drive to operate. This wrapper is called . All 's can be fetched via the configuration object motor definitions and . The is able to be fetched by easily.
Only CTRE devices currently support the canbus
option, if your device is using the roboRIO canbus
you must use the value of null
or "rio"
for supported CTRE devices. If you are using a CANivore, and the device is on the CANivore bus, the name must match the CANivore name.
Inside any module JSON such as frontleft.json
,frontright.json
,backleft.json
,backright.json
this is what you would see to configure a absolute encoder.
Try inverting your steering/angle/azimuth motor if your module keeps spinning around.
None
none
PWM DutyCycle
dutycycle
Analog Encoder
analog
If your absolute encoder is attached to your SparkMAX, use the function for the best performance. This sets the onboard PID sensor to the attached encoder!
(via SparkMAX DutyCycle)
(via SparkMAX Analog Pin)
(via SparkMAX Analog Pin with 5V power)
(via SparkMAX)
(via CAN)
(via DIO)
(via Analog Input)
(via Analog Input)
(via PWM)
(via PWM)