by PedroR » Fri Jul 27, 2012 4:42 pm
by PedroR
Fri Jul 27, 2012 4:42 pm
Hi all
We've been contacted by an animatronics company who was looking to use MX servos on their Robots for exhibitions and museums.
Their aim is to
control the MX servos using either Arduino or mbed.
As you may know there is the excellent Arbotix library for Arduino for controlling AX servos and, since MX-xxTs use the same bus (slightly different memory mapping though), they should - theoretically - work with library.
We've sent the eval material and the software resources to the company and after a number of emails - and great work on their end - they
managed to port the code to a normal Arduino (ie not MEGA, with only 1 UART) and have it running on the latest Arudino IDE.
Their work has been posted here
http://arduino.cc/forum/index.php/topic,116011.0.html
In short these are the steps to use MX servos with Arduino:
a) The Arbotix library is designed for an Arduino MEGA and expects the servos to be on UART1.
If you're using a normal Arduino, you'll want to check out Pablo Gindel's modified Arbotix library available here:
http://www.pablogindel.com/informacion/ ... urce-page/
b) Pablo's library was written for an older Arudino IDE version so the information on that page is partly outdated.
In order
to get the library to work with the latest new Arduino IDE (v1) the following steps must be taken:
1) In the ax12.cpp file the "wiring.h" include must be renamed to "Arduino.h".
2) In the HardwareSerial.cpp file, which is now in hardware/arduino/cores/arduino/, the change described no longer works.
You now have to comment out everything after the store_char function up to the serialEventRun function. For the current version this is lines 88 - 160.
3) If you are using anything other than the Arduino Mega, all serial communications must either be commented out or removed as they interfere, due to there only being one serial port.
4) And finally, make sure the Arduino ground is commoned with the servo ground.
This is very easy to forget because plugging the Arduino into a computer provides the board with power, and this connection is often missed on diagrams.
c) If you're using Arduino MEGA, the procedure for step 2 is slightly different:
you only need to comment out the following:
SIGNAL(USART1_RX_vect)
{
unsigned char c = UDR1;
store_char(c, &rx_buffer1);
}
For the latest information you may want to check out the thread on the Arduino forum
http://arduino.cc/forum/index.php/topic,116011.0.html which where the developer is maintaining the information.
Please note that while this was endorsed by RoboSavvy the Credit for software development must go to the developers of Arbotix, Pablo Gindel (for modifying it to work with normal Arduino) and finally to Crawley Creatures who have updated the code to work with the latest Arduino IDE and have successfully tested it with MX-xxT servos.
The code should also work with AX servos as well.
Regards
Pedro.
tags: arduino library, dynamixel, mx-28, mx-28t, mx-64t, mx-106t, robotis
Hi all
We've been contacted by an animatronics company who was looking to use MX servos on their Robots for exhibitions and museums.
Their aim is to
control the MX servos using either Arduino or mbed.
As you may know there is the excellent Arbotix library for Arduino for controlling AX servos and, since MX-xxTs use the same bus (slightly different memory mapping though), they should - theoretically - work with library.
We've sent the eval material and the software resources to the company and after a number of emails - and great work on their end - they
managed to port the code to a normal Arduino (ie not MEGA, with only 1 UART) and have it running on the latest Arudino IDE.
Their work has been posted here
http://arduino.cc/forum/index.php/topic,116011.0.html
In short these are the steps to use MX servos with Arduino:
a) The Arbotix library is designed for an Arduino MEGA and expects the servos to be on UART1.
If you're using a normal Arduino, you'll want to check out Pablo Gindel's modified Arbotix library available here:
http://www.pablogindel.com/informacion/ ... urce-page/
b) Pablo's library was written for an older Arudino IDE version so the information on that page is partly outdated.
In order
to get the library to work with the latest new Arduino IDE (v1) the following steps must be taken:
1) In the ax12.cpp file the "wiring.h" include must be renamed to "Arduino.h".
2) In the HardwareSerial.cpp file, which is now in hardware/arduino/cores/arduino/, the change described no longer works.
You now have to comment out everything after the store_char function up to the serialEventRun function. For the current version this is lines 88 - 160.
3) If you are using anything other than the Arduino Mega, all serial communications must either be commented out or removed as they interfere, due to there only being one serial port.
4) And finally, make sure the Arduino ground is commoned with the servo ground.
This is very easy to forget because plugging the Arduino into a computer provides the board with power, and this connection is often missed on diagrams.
c) If you're using Arduino MEGA, the procedure for step 2 is slightly different:
you only need to comment out the following:
SIGNAL(USART1_RX_vect)
{
unsigned char c = UDR1;
store_char(c, &rx_buffer1);
}
For the latest information you may want to check out the thread on the Arduino forum
http://arduino.cc/forum/index.php/topic,116011.0.html which where the developer is maintaining the information.
Please note that while this was endorsed by RoboSavvy the Credit for software development must go to the developers of Arbotix, Pablo Gindel (for modifying it to work with normal Arduino) and finally to Crawley Creatures who have updated the code to work with the latest Arduino IDE and have successfully tested it with MX-xxT servos.
The code should also work with AX servos as well.
Regards
Pedro.
tags: arduino library, dynamixel, mx-28, mx-28t, mx-64t, mx-106t, robotis