Page 1 of 1

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

Posted: Wed Mar 04, 2020 1:26 am
by didmou
Hello,

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,accel,speedM,pulses_distance_to_go,speedM,pulses_distance_to_go,1);
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

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

Posted: Wed Mar 04, 2020 2:25 pm
by Basicmicro Support
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.