Uncategorized

Dvnamixel AX-12A notes

Asked 
Viewed 38 times
1

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:

dtoverlay=pi3-disable-bt
hdmi_force_hotplug=1
enable_uart=1
init_uart_clock=16000000

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.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
GPIO.setwarnings(False)

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"))
    time.sleep(0.1)
    GPIO.output(18, GPIO.LOW)
    time.sleep(3)

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 2 days ago
  • @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 2 days ago
  • Questions: (1) Were they using 2015 Rpi2 wheezy, and you 2019 Rpi4 buster? (2) Are you sure your LS241 wiring is OK? – tlfong01 2 days ago   
  • 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 2 days ago   
  • @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 2 hours ago
  • @tlfong01 here is my minicom loopback, here is another information in case i need to show – Ryan Fikri 1 hour 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 1 hour ago

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

%d bloggers like this: