Skip to content

Add safety feature for if encoder gets disconnected #35

Description

@ProfessorAtomicManiac

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions