Motor Position based on Serial Command

Questions about using encoders with the Roboclaw product line
Ellimc
Posts: 5
Joined: Thu May 16, 2019 3:54 am
Re: Motor Position based on Serial Command

Post by Ellimc »

Good morning
Thank you very much for your answer
So to be sure
if I write this :
roboclaw.SpeedAccelDeccelPositionM1(address,3200,12000,32000,posX1,0);
roboclaw.SpeedAccelDeccelPositionM1(address,3200,12000,32000,posX2,1);
roboclaw.SpeedAccelDeccelPositionM1(address,3200,12000,32000,posX3,2);
Wich case is the right one
Case 1 My robot will go to the position posX3 and then stop?
Case 2 after the posX3 it will go to posX2 and finally to posX1? in this second case I have to say that I really need to forget posX2 and posX1 if I receive posX3. So how can I cancel the first two command?
Case 3 When I write several roboclaw.SpeedAccelDeccelPositionM1(address,3200,12000,32000,posX1,0); It is making a list of command that will be done one after one
Case 4 whenI write several roboclaw.SpeedAccelDeccelPositionM1(address,3200,12000,32000,posX1,1); It will always do the last command and forget the command before. (this is the case that i would like to have)

I am sorry for all these question but I need to be sure before starting working with this driver :D

And also I saw that, the function 67 command the position of 2 motors in one command. As there is no exemple with this function is it the right command?
roboclaw.SpeedAccelDeccelPositionM1M2(address,32000,12000,32000,posX,32000,12000,32000,posY,1);
User avatar
Basicmicro Support
Posts: 1594
Joined: Thu Feb 26, 2015 9:45 pm
Re: Motor Position based on Serial Command

Post by Basicmicro Support »

As I said, the buffer argument(the last argument in the command is either 0 or 1. 1 Means any running commands are stopped and that command runs immediately. 0 means that command will run when any commands previously executed finish for that motor.

Yes, the M1M2 position command looks correct, but I always recommend checking the syntax in the Arduino library header file if you are uncertain.
Ellimc
Posts: 5
Joined: Thu May 16, 2019 3:54 am
Re: Motor Position based on Serial Command

Post by Ellimc »

Thank you very much!!
I got every information i needed :D :D

Post Reply