Move until stall, but move if unstalled #2233
-
|
I'm trying to implement a program where it will run a motor until it is mechanically stalled. But would like the ability to continue running if it is unstalled (I hope that's a word). Is there a way to achieve this? Currently, my implementation is something similar to this. if abs(left_motor.load()) > 25:
left_motor.stop()
wait(100)
elif abs(right_motor.load()) > 25:
right_motor.stop()
wait(100)
else:
left_attach.dc(30)
right_attach.dc(30)
wait(20)This method works, but I would like to see if there's a better way to implement it. Because when the motor is mechanically stalled, I can still hear the motors buzzing as if it's still trying to move, but realize it is stalled, then only it will stop. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
Stall and load detection works faster and better when you use
A motor experiences load if it is moving and is being slowed down. If the motor is stopped, there isn't such a thing as load, so how would you measure it? |
Beta Was this translation helpful? Give feedback.
Stall and load detection works faster and better when you use
run()instead ofdc(), so that could be a start.A motor experiences load if it is moving and is being slowed down. If the motor is stopped, there isn't such a thing as load, so how would you measure it?