Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add safety feature for if encoder gets disconnected #35

Open
ProfessorAtomicManiac opened this issue Mar 10, 2024 · 2 comments
Open

Add safety feature for if encoder gets disconnected #35

ProfessorAtomicManiac opened this issue Mar 10, 2024 · 2 comments
Labels
enhancement New feature or request IMPORTANT

Comments

@ProfessorAtomicManiac
Copy link
Contributor

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.

@stwiggy
Copy link
Contributor

stwiggy commented Mar 11, 2024

fixed in f04cb46 and e5f7182

@ProfessorAtomicManiac
Copy link
Contributor Author

whenever you have time, test the code by hooking up a motor to the practice board and see if it stops. Overall, it looks pretty good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request IMPORTANT
Projects
None yet
Development

No branches or pull requests

2 participants