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

fix(motor-control): do not enable motor when receives a zero-length move #721

Closed

Conversation

ahiuchingau
Copy link
Contributor

We shouldn't need to to engage the motors when we're not planning on moving them.

This might cause a lot of weird motor position errors so... gonna keep this as a draft as i do more testing and add more logic on the python side to handle this better.

@ahiuchingau ahiuchingau marked this pull request as draft September 14, 2023 22:16
@ahiuchingau ahiuchingau marked this pull request as draft September 14, 2023 22:16
@@ -73,7 +73,7 @@ class MotionController {
.seq_id = can_msg.seq_id,
.stop_condition = can_msg.request_stop_condition,
.usage_key = hardware.get_usage_eeprom_config().get_distance_key()};
if (!enabled) {
if (!enabled && velocity_steps != 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would also want to check acceleration_steps != 0, otherwise the motor won't get enabled for a move step that accelerates from 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call!

@sfoster1
Copy link
Member

I don't know that I agree with this. I think the common case is that we do want these motors enabled so that if the machine rocks around or something they won't move.

We do actually have a good way to keep these axes disabled: don't send the moves to them. I think if there's cases where we want the motors to not enable if they're not moving, python should trim out the AddLinearMoveRequests from them.

@ahiuchingau ahiuchingau closed this Nov 7, 2023
@ahiuchingau ahiuchingau deleted the mc_do-not-enable-motor-if-move-has-zero-velocity branch November 7, 2023 16:59
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.

3 participants