lock motor when idle?

General discussion of using Roboclaw motor controllers
Post Reply
gannicus
Posts: 28
Joined: Sat Aug 06, 2016 4:33 am
lock motor when idle?

Post by gannicus »

Hi, I'm wondering if it is possible to lock the motor when idle using the motor controller board.

The robot is sliding on a slope, even I set motor speed to 0, is there a way to lock the motor?

Thank you very much.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: lock motor when idle?

Post by Basicmicro Support »

On power up the motors are in freewheel, but after being used and then stopped the motors are in braking mode(eg the motor leads are basically shorted together which provides a significant amount of friction). If your motors are still sliding you will need to actively hold the position. To properly do this you will need motors with encoders and use speed or position control modes.
gannicus
Posts: 28
Joined: Sat Aug 06, 2016 4:33 am
Re: lock motor when idle?

Post by gannicus »

Thanks for the reply, the motor I'm using doesn't have a encoder, is there any workarounds if possible?

Thanks.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: lock motor when idle?

Post by Basicmicro Support »

If having the motor in braking mode isnt holding the motor in place when stopped, then you have no choice but to add power to prevent it from turning. To do that you need to know it is turning or not. There is no garunteed workaround. You could just add some power in the direction up the slope but you would need to know what that direction is and you'd need to know the slope of the slope to set the power needed to keep it from moving. If you have a gps on your bot you could use that information to answer those questions so you wouldnt need encoders on the motors themselves. Same goes if you have a level sensor(3 axis acclerometer to read the current direction of gravity when stopped), but it would need to have a reasonable resolution. You could then determine if you are leaning forward or backward and apply an appropriate amount of power to prevent moving.

Luckily you have friction helping you out so adding a range of power should prevent the bot from rolling with out actually moving under power(Ie accuracy of the power setting isnt absolutely critical).

Post Reply