Dynamixel AX-12A and AX-18A

Viewed 47 times

I have a project to make mobile robot with Dynamixel AX-12A as the wheel, so i changes the AX-12A to Wheel Mode with CM-530 and it works well.

I follow the guide from http://www.oppedijk.com/robotics/control-dynamixel-with-raspberrypi

I already check my serial communication (UART) on Raspi using Terminal Minicom with only wiring up GPIO14 and GPIO15 together and it works well

Here is my /boot/config.txt at the end of code:


Here is my /boot/cmdline.txt:

dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait splash plymouth.ignore-serial-consoles

Here is my Python3 Code:

import serial
import time
import RPi.GPIO as GPIO

GPIO.setup(18, GPIO.OUT)

port = serial.Serial("/dev/ttyAMA0", baudrate=1000000, timeout=3.0)

while True:
    GPIO.output(18, GPIO.HIGH)
    port.write(bytearray.fromhex("FF FF 00 04 03 20 FF D8"))
    GPIO.output(18, GPIO.LOW)

The problem is dynamixel ax-12a not responding to my hexa which should move with value 255. And there is no error feedback from program.

Btw i’m working this project with VNC through wifi in PC, did this cause problems with the communication?

If someone could help me, i thank you.

*sorry if i have bad english

 New contributor
  • Hi @Ryan Fikri, Welcome and nice to meet you. (1) Your use of English is better than mine. Your question is clear and gives all the necessary info and references. Your procedure is described detailed enough for me to follow, and convinced that I am following your direction. (2) Rpi miniCom is not a good choice. I would suggest to use Rpi CuteCom (need to install yourself), or Win10 RealTerm (google SparkFun for more details) (3) Not sure what does the clock 16MHz mean. I would suggest to make sure, or set to 9600 baud, N81, and set the same for Rpi TxD, RxD, / to continue, … – tlfong01 Nov 19 at 3:09   
  • (4) I have been playing with more than 20+ UART interfaced devices for more than 10 hobbyist years. I do use Arduino C++ and Rpi python, BUT I NEVER START with poython. I always suggest newbies to start with the following: (a) Use the terminal emulator RealTerm, CuteTerm (or TeraTerm, or if you insist, miniTerm, miniCom) to do “loop back” test, to make sure the hardware wiring is OK, (5) please reply if you are reading my comments, before I move on, … – tlfong01 Nov 19 at 3:12   
  • If you are not too sure what I am talking about, you might like to skim the following Q&A, especially the CHAT record, to get a rough idea: raspberrypi.stackexchange.com/questions/105223/…. Nice UART learning and cheers. – tlfong01 Nov 19 at 3:15    
  • One more thing: Your config procedure seems a bit out of date. There is no need to mess around the newbie scary /boot/cmdline.txt file. Instead, use the newbie friendly Rpi GUI desktop Rpi Config menu to do the job: imgur.com/gallery/wNGTxyy. – tlfong01 Nov 19 at 3:44   
  • @tlfong01 Hi, nice to meet u too. (1) I can’t use 9600 baud cause i set up my AX-12A with 1000000 baud, i look in their manual pdf file. (2) i will try your suggestion for UART example ASAP. (3) i’ve been following all guide about UART communication problem in every website and mostly they’re using out of date procedure, so i just following with the old ones. But yeah i’ve tried it like in your image. (3) sorry for late replay i’m kinda tired and take a rest before. – Ryan Fikri Nov 19 at 5:47
  • @tlfong01 the problem is many people followed guide from oppedijk.com/robotics/control-dynamixel-with-raspberrypi and succeeded. I think that’s a simple guide but i don’t know what mistake i made – Ryan Fikri Nov 19 at 5:50
  • Questions: (1) Were they using 2015 Rpi2 wheezy, and you 2019 Rpi4 buster? (2) Are you sure your LS241 wiring is OK? – tlfong01 Nov 19 at 6:40   
  • I read the manual which says you can set 9600 baud: AX-12A User Manual emanual.robotis.com/docs/en/dxl/ax/ax-12a, 7843 bps ~ 1 Mbps, Value 207 = 9600 (-0.160%). 9.6kbps is usually the standard for testing. Your 1M baud ~= 1,000kbaud is 10 times too fast for Rpi testing. If you find 9.6k baud good, then you can speed up to 1MHz or higher. – tlfong01 Nov 19 at 6:51   
  • @tlfong01 (1) yes i’m sure the wiring of LS241 works well. (2) But how i send the hex code for changes the baud in AX-12A? Cause the default baud of AX-12A after i calibrating with CM-530 is 1M – Ryan Fikri 2 days ago
  • (1) I think you can use a terminal emulator such as Win10RealTerm, Rpi CuteCom or MiniCom to send the change baudrate command. (2) You better test loopback first: medium.com/@amitasinghchauhan/… – tlfong01 2 days ago   
  • So, first thing first is to do miniTerm or cuteCom loopback: imgur.com/gallery/ePADqZV. – tlfong01 2 days ago   
  • @tlfong01 (1) as i mention first, i already checked my uart with minicom and i’ve follow the guide from the website you mentioned (medium.com/@amitasinghchauhan/…). (2) so the next step maybe i can check my wiring with 74HC241N and Raspi, but how do i do this? – Ryan Fikri 10 hours ago
  • @tlfong01 here is my minicom loopback, here is another information in case i need to show – Ryan Fikri 9 hours ago
  • Good. (1) Now confirm if my wiring diagram matches your actual wiring: imgur.com/gallery/iK8yyir,. (2) Show me your hardware wiring photo, just to make sure no misunderstanding both sides. – tlfong01 9 hours ago   
  • (1) I read the manuals but could not find the default uart speed. If it is 1000kHz (1MHz) then we have a problem, because MiniCom/MiniTerm/CuteCom/RealTerm can only set to highest 115.2kHz. (2) So the problem is you need to first set DynaMixel to 9.6k or 115.2k first. (3) Unless Dynamix can “AutoDetect” baudrate then there is not problem. (4) I could not find any python program for DynaMixel Half Duplex. Please let know any user guide that explain the use of Half Duplex. It is my jogging time, so see you late this evening or tomorrow. Cheers. – tlfong01 4 hours ago   
  • @tlfong01 here is my schematic and here is my hardware, that’s a robot from my senior in college, he’s using labview before and works well but my lecturer want me to use python – Ryan Fikri 1 hour ago
  • Many thanks for your schematics and hardware photo. (1) I fully agree with your lecturer of using Python instead of LabView. (2) I am glad to see that you are using HC241 instead of LS241. My image shows LS241 but also HC241 because LS is outdated and nowadays HC and HCT are always preferred. (3) I googled and found that the reason of DanaMixel using HalfDuplex is for daisy chaining many servos at the same time. (4) I think you should try duplex to play with one servo first, at low speed of 9k6 baud. Only if you find everything OK for one motor, then scale up 4 servos and 15k2 baud. – tlfong01 42 mins ago   
  • Now the remaining problems for your to search your manuals now are (1) What is default DynaMixel UART speed, and (2) Can DyanMixel auto detect and adjust speed of other side? (3) If yes, you can use minicom to send full duplex commands now to servo (To repeat, forget the following now; (a) python, (b) duplex. Good luck and cheers. – tlfong01 38 mins ago   
  • And later (NOT NOW!) when you are ready to play half-duplex, you may like to consider “SeeedStudio USB2AX”, seeedstudio.com/USB2AX-v3-2a-p-1816.html – tlfong01 31 mins ago   
  • And when you search for AX12A stuff, you might like to also search AX18A which is better than AX12A, which is phasing out, I think. Dynamixel AX-18A Actuator – €99 generationrobots.com/en/… – tlfong01 26 mins ago   
  • Just now I did a casual google search and found one guy saying that AX12’s default 57.6k baud. So I would suggest you to set miniCom to 57.6k baud and try to say Hello to your AX12A: Re: Dynamixel Servo Library #4 Sep 23, 2012, 10:56 pm forum.arduino.cc/index.php?topic=116011.0 changing my baud rate to 57600 read that it’s the default for a brand new the MX-28. AX12::init (57600); Instead of using Pablo’s autoDetect function, hard coding the servo ID to 1, but no luck – tlfong01 13 mins ago   
  • I also googled that (1) both AX-12A and AX-18A are good for newbies, (2) All the knowledge and skills acquired from AX-12A can readily transfer to AX-18A. In other words, if AX-12A is cheaper, or your already have AX-12A in hand, then it is a good idea to start with AX-12A: imgur.com/gallery/Ye8ct5O. – tlfong01 1 min ago    Edit   Delete

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: