generated from DeepBlueRobotics/EmptyProject2024
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
Right before Calgames 2023, the arm broke because the encoder got disconnected and the arm moved wildly. If the encoder is disconnected, there should be no voltage supplied to the motor.
In RobotCode2023, this is how it was implemented:
https://github.com/DeepBlueRobotics/RobotCode2023/blob/780bfeb5a3037553a4a0fd9319b45b0c33d8f15f/src/main/java/org/carlmontrobotics/robotcode2023/subsystems/Arm.java#L106-L169
Basically, we detect when an encoder is disconnected when there is no encoder "noise". When an encoder is connected, it will output a variety of values. When its disconnected, it will output the same exact value. We detect when there are no other values being outputted and after a set period of time will disable the motor.