The Hopper lift during the 2020 season relied on PWM output from a CTRE Mag encoder. This setup worked wonderfully as long as
the encoder was not bumped or shifted
The hopper lift started close to the down position every time (or else the sensor became offset by 4096 points)
Ideally, we should add some physical limit switches to the lift, but a useful software workaround is a calibration sequence which automatically runs on boot and can be triggered manually. This process would involve:
Use the encoder in quadrature mode rather than PWM, and 0 it out
Run the hopper lift down until velocity is low and error is high (we hit the bottom stopper)
Set the encoder to 0
Run the hopper lift up to whatever value the top stopper should be
Increment the top set point up or down depending on motor output (should be close to 0 when set point is correct)
The Hopper lift during the 2020 season relied on PWM output from a CTRE Mag encoder. This setup worked wonderfully as long as
Ideally, we should add some physical limit switches to the lift, but a useful software workaround is a calibration sequence which automatically runs on boot and can be triggered manually. This process would involve: