Problem interfacing arbotix-m robocontroller

352 views
Skip to first unread message

Daniel Melia

unread,
Jul 22, 2016, 9:40:49 AM7/22/16
to Robotics & Machine Vision Toolboxes
Hi,

I'm new using the robotics toolbox. I am using the Arbotix.m function to interface with a physical prototype from Matlab. The robot has an Arbotix-M controller and Dynamixel AX-18 servos. 

I use a code example in Matlab like this to read/write data from/to the servos:

arb=Arbotix('port','COM5', 'nservos',1);         % Establishes a connection with the arbotix-m board

arb.readdata(1,Arbotix.ADDR_POS,2);         % Reads 2-byte current position from servo 1
arb.writedata2(1,Arbotix.ADDR_SPEED,i);   % Sets speed register of servo 1
arb.flush();                                                 % Flash receive buffer

I can implement this instructions one by one using the Matlab command window and I can execute the sequence read/write/flush several times and it works fine. The problem comes when I try to implement this code in an m-file to run it into a loop like this:

for i=100:120

     arb.readdata(1,Arbotix.ADDR_POS,2);        % Reads 2-byte current position from servo 1
     arb.writedata2(1,Arbotix.ADDR_SPEED,i);   % Sets speed register of servo 1
     arb.flush();                                                 % Flash receive buffer

end

In this case Matlab crashes every time I try to run the code and it shows the error message: "Unsuccessful read: the specified amount of data was not returned within the timeout period". The error is found in the code lines:

Arbotix/readdata
     retval=arb.receive();

Arbotix/receive
     c=fread(arb.serPort,1,'uint8');

serial/fread
     Unsuccessful read:

I tried to introduce pauses between instructions and it works better but still crashes from time to time and makes the code slower.
Did anyone have the same problem or know where can it be the error? 

Thanks very much!

Peter Corke

unread,
Jul 25, 2016, 7:10:43 PM7/25/16
to Robotics & Machine Vision Toolboxes
It's a long time since I looked at this.  The comms protocol is rather brittle as I recall.  Do you need to do the flush?  Do these commands actually return any information?

Also you should pace the commands to the Arbotix, it will have a finite capacity to process them and send them on to the Dynamixels.

To get smooth paths I recall that I had to load them into the memory of the Arbotix and execute them from there.

Finally, not sure anybody else has ever looked at or used this code.  Maybe this will flush out some other users and we can collectively make something that works.

peter

Dave Hylands

unread,
Jul 25, 2016, 10:33:36 PM7/25/16
to robotics...@googlegroups.com
In my case I wasn't using the Arbotix at all, just a USB-to-Bioloid bus adapter. Mine was one of my own design, but this would also work:
http://www.trossenrobotics.com/robotis-bioloid-usb2dynamixel.aspx
along with this to power the servos:
http://www.trossenrobotics.com/store/p/5886-SMPS2Dynamixel-Adapter.aspx and of course a power supply.

Of course, you can also use the Arbotix.

I also have a full set of python code for controlling the bioloid servos.

Dave Hylands



--
You received this message because you are subscribed to the Google Groups "Robotics & Machine Vision Toolboxes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotics-tool-...@googlegroups.com.
To post to this group, send email to robotics...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotics-tool-box.
For more options, visit https://groups.google.com/d/optout.



--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

ashwin.ar...@gmail.com

unread,
Mar 12, 2019, 3:25:59 AM3/12/19
to Robotics & Machine Vision Toolboxes
Hi there,

I've been having similar issues with the Arbotix class. Doesn't seem to like running things like getpos/setpos/etc within a script but will happily run them through the command window?

Peter Corke

unread,
Mar 16, 2019, 6:56:06 PM3/16/19
to Robotics & Machine Vision Toolboxes
I can't fix "doesn't seem to like".  Send me code and error messages.

ashwin.ar...@gmail.com

unread,
Mar 18, 2019, 6:58:18 PM3/18/19
to Robotics & Machine Vision Toolboxes
Hi there,

I'm trying to set up a controller for the WidowXL robot arm from Trossen Robotics which uses the Arbotix-M board. 

My code is as simple as:

arb = Arbotix('port','COM4','nservos',5) % Set up a connection

q = arb.getpos() ; % Check position

Which doesn't get results and just times out to this error (whether I run it as a script or in the command line):-
error1.PNG

Any ideas what is causing this?

Thanks, Ashwin.

Peter Corke

unread,
Mar 19, 2019, 7:36:17 AM3/19/19
to Robotics & Machine Vision Toolboxes
I have zero windows experience, sorry. I have found that the Fddi serial chip takes a while to configure, so try a pause of 10 seconds between open and getpos.
Reply all
Reply to author
Forward
0 new messages