Question about command 46 (buffered drive)

Questions about using encoders with the Roboclaw product line
Post Reply
jwatte
Posts: 45
Joined: Thu Apr 02, 2015 11:55 am
Question about command 46 (buffered drive)

Post by jwatte »

Is the "distance" value in command 46 interpreted as a "relative distance from where you are now," or an "absolute distance in total encoder counts since reset" ?
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Question about command 46 (buffered drive)

Post by Basicmicro Support »

All the distance commands are relative from the current encoder reading. Also if you send a distance command and done send another command before it finishes and the speed at the finish of that command is not zero then the roboclaw will add another distance command that will decelerate the motor to 0 in 1 second(whatever that distance is.

So for accurate distance control you should always send atleast two distance commands to a motor. One to accelerate and run at some speed for some distance and another to decelerate back to 0 speed over some distance.
jwatte
Posts: 45
Joined: Thu Apr 02, 2015 11:55 am
Re: Question about command 46 (buffered drive)

Post by jwatte »

Thank you for the answer!

I actually send buffered commands at a fairly high rate, using the "overwrite" mode, so the commands never complete.

The reason I use acceleration/distance is as a failsafe -- if my controller crashes, and stops sending commands, the robot will pretty quickly run out of distance to go and stop on its own.
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Question about command 46 (buffered drive)

Post by Basicmicro Support »

Yes, thats one of the uses it was made for. The distance acts like a physical timeout.

Post Reply