Skip to content

Conversation

@GrayHoang
Copy link
Contributor

@GrayHoang GrayHoang commented Feb 8, 2025

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

  • 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.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

@GrayHoang GrayHoang changed the title [WIP] Handle motor faults Better handling of motor faults Mar 2, 2025
@GrayHoang GrayHoang requested review from a team, ericlim0329 and suchirss and removed request for a team March 2, 2025 02:43
@GrayHoang
Copy link
Contributor Author

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).

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some more comments

GrayHoang and others added 7 commits July 15, 2025 08:59
Co-authored-by: itsarune <42703774+itsarune@users.noreply.github.com>
Scan all motors per call to poll, rather than one per call
Co-authored-by: itsarune <42703774+itsarune@users.noreply.github.com>
@GrayHoang
Copy link
Contributor Author

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

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few comments

Copy link
Contributor

@itsarune itsarune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Let me know when you've field tested it and I'll approve!

@williamckha
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make motor fault handling safer

4 participants