Software icon indicating copy to clipboard operation
Software copied to clipboard

Better handling of motor faults

Open GrayHoang opened this issue 10 months ago • 3 comments

Please fill out the following before requesting review on this PR

Description

See #3408 https://github.com/user-attachments/assets/a77848b3-ee4a-4df8-ad6d-0fa36bc76db8

Changes motor fault handling to a per motor control. Allows for faulty motors to be disabled without crashing thunderloop. Disabled motors freewheel and are no longer checked for further issues. They will not be given commands to run.

Testing Done

Tested on robot. When fault is detected, movement halts and motors attempt to restart three times before disabling the affected motor and reinitializing all other motors.

Resolved Issues

Resolves #3408

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • [x] Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • [x] Remove all commented out code
  • [x] Remove extra print statements: for example, those just used for testing
  • [x] Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

GrayHoang avatar Feb 08 '25 21:02 GrayHoang

Need to do some final cleanup. I think I left some debugging stuff and I need to make sure all motors restart 3 times before failing (in the video you can see the affected motor only attempt restart twice).

GrayHoang avatar Mar 05 '25 04:03 GrayHoang

Oh I just realized a lot of the files changed are from arun changing the toolchain. Uh, not really sure what to do about that but I think if Arun's gets passed in everything should be fine.

GrayHoang avatar Mar 30 '25 03:03 GrayHoang

This PR is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 29 '25 03:04 github-actions[bot]

I'm going to need someone to test this in the mezz, or I can do it in about 2 weeks.

GrayHoang avatar Jul 15 '25 16:07 GrayHoang

Spoke with Grayson and we're going to close this PR for now in favour of #3458 which will have similar functionality (enabling/disabling individual motors). We can port over the remaining changes in this PR (disabling motors after X number of faults) after #3458 has been merged into master.

williamckha avatar Aug 22 '25 00:08 williamckha