Motors still have velocity, but buffers are set to 128

Questions about using encoders with the Roboclaw product line
Post Reply
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Motors still have velocity, but buffers are set to 128

Post by Basicmicro Support »

Your last distance command should leave the distance values set to 0. When target speed is 0 the command will automatically decelerate to 0 speed no matter what the distance is. It is possible/probable that if you set a distance shorter than that needed to stop under the given decel rate(but not 0 distance) that it will actual end the command at that distance. In that case the motors would still be moving and Roboclaw would add an additional command to stop the motors. That command would calculate a decel rate that would stop the motors in 1 second with whatever the leftover speed is. From the point that added command was added the ReadBuffers would return 128.

Take a look at this post. It explains how to handle point to point moves with speed/distance commands: viewtopic.php?f=2&t=46&p=158&hilit=calculating#p158

After reading through that and changing your distance commands accordingly let me know the results.

Post Reply