Very short distance ((accel + deccel distance) > distance_to_go)

Questions about using encoders with the Roboclaw product line
Post Reply
Posts: 3
Joined: Mon Sep 30, 2019 1:46 pm

Very short distance ((accel + deccel distance) > distance_to_go)

Post by didmou » Wed Mar 04, 2020 1:26 am


I use the robotclaw 2x7A for a robot. What's the best command if I want my robot do a very short distance.

Very short distance I mean, it's not possible to reach the speed value with the acceleration rate, by my target is to stay accuracy with the position.

I use these commands :
roboclaw.SpeedAccelDistanceM1M2(address,deccel,0,1,0,1); // Deccel

but the position accuracy is not very good for the short distances…. (accel+deccel>distance to go)…

What do you recommend ?

- Drive M1 & M2 with signed Speed, Accel, Deccel and Position ?
- Drive M1 / M2 With Signed Speed And Distance

Thanks for your answer

User avatar
Basicmicro Support
Posts: 1404
Joined: Thu Feb 26, 2015 9:45 pm

Re: Very short distance ((accel + deccel distance) > distance_to_go)

Post by Basicmicro Support » Wed Mar 04, 2020 2:25 pm

Properly calculating distance for the first distance command is tricky. It is documented in this sticky: viewtopic.php?f=2&t=46

Position commands do all that work for you so If you are doing nothing but small movements I'd recommend using position commands.

Post Reply