After a long time here is an update in the Library for Dynamixel Sero Motors as the AX-12A.
These servos are pretty awesome, they seem the perfect solution for robotics as they can return several parameters as internal temperature, the voltage of operation, position, speed, torque, and all of this is accomplished as they have an internal microcontroller, the Atmega8 from Atmel which communicates over Half-Duplex UART TTL. This library helps you communicate with the Dynamixel Servos protocol V1.0 in any of the Serial channels of your Arduino.
The voltage of operation of these motors is recommended to be 11.1 volts, but it should work ok from 6V to 14V as the datasheet describes in the electrical ratings. Don’t forget to join the grounds of your motor’s power supply and the one from the microcontroller in other to level the signal voltage between them.
In order for this library to work and to ensure proper usage it is necessary to use a tri-state buffer IC, this can be achieved with a 74HC04 NOT gate and a 74HC126 tri-state buffer ICs ad Robotis suggests. I personally prefer the 74LS241 tri-state buffer with inverted enable pin input as is easy to connect and offers the same configuration in a single IC.
I just tried your library with an old Uptech CDS5516 which is AX-12a compatible and it worked perfectly!
Thanks!
I have serveral XL (2XL430 & XL330) Servos from Dynamixel. The 74LS241 supports the AX and MX Series. The MAX485 the DX, RX, EX Series. How do I use this Lib with the XL Series?
In the same way, the library is independent of the hardware, but you might have to put attention to the firmware version as that does change from servo to servo, depending on how old the motor is.
I tried this library on Arduino Mega 2560 and it work properly!. But now i want to try with another microcontroller. Does this Dynamixel library work on STM32 Blackpill and Teensy 4.0 using Arduino IDE ?
Thanks
Yes, it should work without any problem on any board from the Arduino IDE as the library only uses Arduino instructions to operate, so if your board is compatible with Arduino the library will work just fine.
thank you so much, I have a question. I have one data line but here in diagram there are two data line which are DE and RE. how can I do this connection?
DE and RE are the data flow control and just one must be activated at a time, so one it’s active low and the other it’s active high that means that you will only need one pin for the data flow.
Thank you for your reply. I’m also building a Dynamixel driver using BlackPill’s STM32F4. This driver uses IC 74LS241. The problem is why can the Dynamixel Servo still work even if the specified data pins are not connected ??? (Only the RX and TX pins are connected)
Maybe it’s transmit default, so that means you can control it even when the data flow is not connected. That would mean that you probably cannot read data from the motor until you connect that control pin.
Thanks for your reply Sirπ. I want to ask again, I use STM32f411CE Blackpill as a driver and this driver uses IC 74LS241. When I want to read the servo position, the servo can still move, but why no data goes into the serial monitor??. On the serial monitor it only reads : -1 of 1023 Resolution, even the servo has moved positions
I have connected the data control pin to the desired pin (PA8) which is the digital pin. And im using PA2 and PA3 as TX RX pins. Also im using Dynamixel Library with Hardware Serial Support, here is the source code :
#include
HardwareSerial Serial2 (USART2); //Tx2 pin = PA2, Rx2 pin = PA3
int Position;
void setup(){
Dynamixel.setSerial(&Serial2);
Dynamixel.begin(1000000,PA8); // Inicialize the servo at 1 Mbps and Pin Control PA8
Serial.begin(9600); }
void loop(){
Position = Dynamixel.readPosition(1); // Request and Print the Position
Dynamixel.move(1,random(200,800)); // Move the Servo radomly from 200 to 800
Serial.print(” Volts Position: “);
Serial.print(Position);
Serial.println(” of 1023 resolution”);
delay(500); }
Is there something wrong with my driver or the data control pin that i used??. Here is the STM32F411CE pin out diagram
https://www.mischianti.org/wp-content/uploads/2022/02/STM32-STM32F4-STM32F411-STM32F411CEU6-pinout-high-resolution.png
Im waiting for your reply, Thank You π
Hi Satyanand, perhaps the control pin is not been correctly initialized, instead of using PA8 I recommend trying with “29” which should be the same pin PA8.
Dynamixel.begin(1000000,29); // Inicialize the servo at 1 Mbps and Pin Control PA8
Do you have a logic analyzer in hand? Its very easy to the problem with one of these cheap tools.
Let me know if that solves your problem or if we need to go deeper, there are other things that we can try. Regards
Thanks for your reply sir. I have tried using 29 instead of PA8 for the data control pin, with the same code that I sent before. But the result is the same, On the serial monitor it only reads : -1 of 1023 Resolution, even the servo has moved positions. It means that the servo position data is not entered right?
Is there any other solution sirπ?? Thanks again
The data is correct but I think that the toggle timing for the control pin might be a little bit off, my suggestion is to check with a 5 dollars logic analyzer just to adjust the wait time for the motor to receive data, or it also could be that the microcontroller baud rate config could be an also off and itβs not correctly interpreting the data coming from the motor. Let me check if I can get the same microcontroller and replicate the issue. If you can send me your connections to the motor that would be a great starting point.
Allright Sir, here is the circuit driver that i used :
Circuit & PCB : https://oshwlab.com/ketutaryasuta01/stm-driver
Physical Photo : https://drive.google.com/drive/folders/198cutckenoNdb1_bDICBxkDx0r10TG8x?usp=sharing
– Description : The three USART Tx Rx pins of STM32 (USART1 = PA9 & PA10, USART2 = PA2 & PA3, USART6 = PC6 & PC7) were made an exit line to make it easier if I want to change the Tx Rx pins that i used and also for other purposes. To select the Tx, Rx and Data pins of STM32, three jumper cable is used from those pins to the Tx, Rx, and Data pins that connected to IC 74LS241. In this case I use PA2 and PA3 as the Tx RX pins (USART2) and PA8 as the data pins.
Btw, I’m making a Quadruped Spider Robot using this STM32 driver to control the four legs of the robot that consisting of 12 servo Dynamixel AX 18. And when I moved the four legs of the robot to walk forward, the movement was not fast even I had given a very small delay like 5 ms. Maybe it also the cause of microcontroller baud rate config that could be off which has to do with data pin line, As you said before.
Also I am planning to buy a Logic Analyzer as u suggested, however I am still newbie on how to use it to solve this problem, Thanks π.
Oops sorry there is a mistake, Here is the correct link of my circuit driver :
https://oshwlab.com/ketutaryasuta01/stm-driver
Sorry for the previous message error, I’ll send it again
Allright Sir, here is the circuit driver that i used :
Circuit & PCB : https://oshwlab.com/ketutaryasuta01/stm-driver
Physical Photo : https://drive.google.com/drive/folders/198cutckenoNdb1_bDICBxkDx0r10TG8x?usp=sharing
– Description : The three USART Tx Rx pins of STM32 (USART1 = PA9 & PA10, USART2 = PA2 & PA3, USART6 = PC6 & PC7) were made an exit path to make it easier
if I want to change the Tx Rx pins that i used and also for other purposes. To select the Tx, Rx and Data pins of STM32, three jumper cable is used from
those pins to the Tx, Rx, and Data pins that connected to IC 74LS241. In this case I use PA2 and PA3 as the Tx RX pins (USART2) and PA8 as the data pins.
Btw…, I’m making a Quadruped Spider Robot using this STM32 driver to control the four legs of the robot that consisting of 12 servo Dynamixel AX 18.
And when I moved the four legs of the robot to walk forward, the movement was not fast even I had given a very small delay like 5 ms.
Maybe it also the cause of microcontroller baud rate config that could be off which has to do with data pin line, As you said before.
Also I am planning to buy a Logic Analyzer as u suggested, however I am still newbie on how to use it to solve this problem, Thanks π.
Sorry for the previous message error, Iβll send it again
Allright Sir, here is the circuit driver that i used :
Circuit & PCB : https://oshwlab.com/ketutaryasuta01/stm-driver
Physical Photo : https://drive.google.com/drive/folders/198cutckenoNdb1_bDICBxkDx0r10TG8x?usp=sharing
β Description : The three USART Tx Rx pins of STM32 (USART1 = PA9 & PA10, USART2 = PA2 & PA3, USART6 = PC6 & PC7) were made an exit path to make it easier if I want to change the Tx Rx pins that i used and also for other purposes. To select the Tx, Rx and Data pins of STM32, three jumper cable is used from those pins to the Tx, Rx, and Data pins that connected to IC 74LS241. In this case I use PA2 and PA3 as the Tx RX pins (USART2) and PA8 as the data pins.
Sorry sir, there seems to be an error in the previous message that i send, Ill resend my message gain.
Here is the Physical Photo of my driver sir : https://drive.google.com/drive/folders/198cutckenoNdb1_bDICBxkDx0r10TG8x?usp=sharing
Description of the driver : The three USART Tx Rx pins of STM32 (USART1 = PA9 & PA10, USART2 = PA2 & PA3, USART6 = PC6 & PC7) were made an exit path to make it easier if I want to change the Tx Rx pins that i used and also for other purposes. To select the Tx, Rx and Data pins of STM32, three jumper cable is used from those pins to the Tx, Rx, and Data pins that connected to IC 74LS241. In this case I use PA2 and PA3 as the Tx RX pins (USART2) and PA8 as the data pins.
Btw…, I’m making a Quadruped Spider Robot using that STM32 driver to control the four legs of the robot that consisting of 12 servo Dynamixel AX 18. And when I moved the four legs of the robot to walk forward, the movement was not fast even I had given a very small delay like 5 ms. Maybe it also the cause of microcontroller baud rate config that could be off which has to do with data pin line, As you said before.
Also I am planning to buy a Logic Analyzer as u suggested, however I am still newbie on how to use it to solve this problem, Thanks π.
Hi, the connections of your board are correct, I think I can help you with a video tutorial on how to connect the logic analyzer and what to look up when probing the circuit, meanwhile, I suggest switching the data control pin to some other pin in case there is something interfering with that pin.
Hi there, I’m using the Dynamixel Serial β Support Hardware Serial library file to get my dynamixel RX-64 to move. I’m using an Arduino mega ADK which is connected to an RS485 board which is then connected to my RX-64 dynamixel motor. I have no issues with uploading the code to the Arduino mega, however nothing happens to my motor after a successful upload. Could you kindly advise on what could be the issue thank you!
Hi Renae, for some boards I have seen that a impedance matching resistor should be added for the communication to be succesful as there is no difference from a software perspective between a TTL or RS485 Dynamixel Motor.