-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat(motion-control): handle motor driver errors #716
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Structure's looking really good, a last couple tweaks and I think we'll be there!
include/motor-control/firmware/stepper_motor/motor_hardware.hpp
Outdated
Show resolved
Hide resolved
include/motor-control/firmware/brushed_motor/brushed_motor_hardware.hpp
Outdated
Show resolved
Hide resolved
include/motor-control/core/stepper_motor/motor_interrupt_handler.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good and almost there, couple things to clean up. Please also update the description of the PR to have more about the flow of information and control through the tasks and describe the high points of the changes you made.
include/motor-control/core/brushed_motor/brushed_motor_interrupt_handler.hpp
Outdated
Show resolved
Hide resolved
include/motor-control/firmware/stepper_motor/motor_hardware.hpp
Outdated
Show resolved
Hide resolved
include/motor-control/core/stepper_motor/motor_interrupt_handler.hpp
Outdated
Show resolved
Hide resolved
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #716 +/- ##
==========================================
- Coverage 83.28% 83.05% -0.24%
==========================================
Files 101 103 +2
Lines 4063 4102 +39
==========================================
+ Hits 3384 3407 +23
- Misses 679 695 +16 |
…, cleaned up motion controller code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking really good, just a couple small changes I think we should see. This is gonna be a huge step forward!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent! Really great work, I'm happy to see this merged. But, let's hold off on actually clicking the button until
- the monorepo side is ready to merge
- we have 7.2 out and know we won't need any other little firmware fixes.
This reverts commit 762d6d5.
This reverts commit 762d6d5.
Overview
This PR enables Flex motor drivers (tmc2130/2160) to report when they are in error state due to over-temperature, short circuit, or open circuit. A driver's diag0 pin will now go active when the driver is in error state, and will trigger an interrupt for the specific motion subsystem that will:
- produce a MotionControllerTask message that will stop the subsystem motion controller
- set a CancelRequest for the motor interrupt handler, which will produce an ErrorMessage on the CAN bus
- spawn a SPI message to retrieve the specific error from the motor driver, which will surface as a ReadMotorDriverErrorStatusResponse message on the CAN bus
This PR also produces an ErrorMessage when a motor driver is in error state and an EnableMotorRequest,
AddLinearMoveRequest, or HomeRequest message is sent to that motion subsystem.
Test Plan
Changelog
Review requests
Risk assessment
This PR introduces the detection of motor driver errors for each motion subsystem. It will effect each motion subsystem in the ways described above, specifically stopping the subsystem's motion controller and motor interrupt handler and producing an ErrorMessage and ReadMotorDriverErrorStatusResponse message when an error is detected.