by PedroR » Thu Jun 25, 2009 3:10 pm
by PedroR
Thu Jun 25, 2009 3:10 pm
Hi
Please find bellow some sample code for interfacing the Roboard with the Bioloid or Dynamixel servos.
Please note that for Dynamixel servos you don't need to use a USB2Dynamixel on the Roboard as it already includes COMM ports at TTL level for AX 12 and an RS485 port for the high power servos. (if you really want you can still use USB2Dynamixel as the roboard has USB ports...)
This is the
transcript from the manufacturer instructions on using the Roboard with the Bioloid:
"RoBoard can connect with AX-12 via COM3 (short TX & RX) or COM4.
(for high power servos use COM2 that is RS485)
Using COM3, we will receive every packet that we send, before receiving the return packet of AX-12.
Using COM4, we must switch the RTS state to control the direction of the data line (i.e., TXRX4 pin); in particular, we should first set RTS = 1 to send the command packet, and, after ensuring that the packet has been sent out by H/W, we should set RTS = 0 to receive the return packet of AX-12.
In WinXP, it is not suggested to use COM4. This is due to the following
facts: 1. it is difficult in WinXP to ensure whether all data have been flushed out by H/W using standard Win32 API; 2. it is also difficult to guarantee the correct timing for switching RTS because the timing may be affected by thread/process context-switching. The sample code provides some heuristics to tackle the two issues.
The sample code assumes that AX-12's ID = 01 and its buadrate = 115200."
The sample code can be downloaded here:
http://robosavvy.com/RoboSavvyPages/Rob ... 2_code.zip
It includes sample code to use COM3 and COM4. The code was written for Windows XP and .Net framework 3 and implements some techniques to guaratee correct communication timings.
I'm sure that it can also be ported to Linux (or at least you can learn from it to port it
)
Regards
Pedro.
Hi
Please find bellow some sample code for interfacing the Roboard with the Bioloid or Dynamixel servos.
Please note that for Dynamixel servos you don't need to use a USB2Dynamixel on the Roboard as it already includes COMM ports at TTL level for AX 12 and an RS485 port for the high power servos. (if you really want you can still use USB2Dynamixel as the roboard has USB ports...)
This is the
transcript from the manufacturer instructions on using the Roboard with the Bioloid:
"RoBoard can connect with AX-12 via COM3 (short TX & RX) or COM4.
(for high power servos use COM2 that is RS485)
Using COM3, we will receive every packet that we send, before receiving the return packet of AX-12.
Using COM4, we must switch the RTS state to control the direction of the data line (i.e., TXRX4 pin); in particular, we should first set RTS = 1 to send the command packet, and, after ensuring that the packet has been sent out by H/W, we should set RTS = 0 to receive the return packet of AX-12.
In WinXP, it is not suggested to use COM4. This is due to the following
facts: 1. it is difficult in WinXP to ensure whether all data have been flushed out by H/W using standard Win32 API; 2. it is also difficult to guarantee the correct timing for switching RTS because the timing may be affected by thread/process context-switching. The sample code provides some heuristics to tackle the two issues.
The sample code assumes that AX-12's ID = 01 and its buadrate = 115200."
The sample code can be downloaded here:
http://robosavvy.com/RoboSavvyPages/Rob ... 2_code.zip
It includes sample code to use COM3 and COM4. The code was written for Windows XP and .Net framework 3 and implements some techniques to guaratee correct communication timings.
I'm sure that it can also be ported to Linux (or at least you can learn from it to port it
)
Regards
Pedro.