fix(motor-control): catch falling 96 channel #810
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So from the various logs I have found 2 different cases where the 96 channel can fall down to the deck
During the first home after a boot up, the 96 sometimes falls, it's a little unclear on why this happens, there could be some static friction condition that happens when things are powered off.
If there is a Stop Request sent while the 96 is moving faster than the discontinuity speed in the downward direction, the steps immediately stop without acceleration and the momentum of the 96 overcomes the head motor, creates a resonate condition and falls.
This PR makes it a bit better by "catching" the pipette when this happens. First of all when a "stop request" is sent we will automatically call disable motor from the motion controller. This will activate the brake if there is one on that axis.
Second, specifically to address the first cause, this PR adds a new way of detecting when a fall is happening during a home by seeing if the axis starts moving in the wrong direction and triggering a collision detected. Since the python side already spits out a stop request immediately upon receipt of a collision detected this will trigger the brake.