Hello all,
I recently purchased a Dynamixel AX-12A to build a robot arm with my Raspberry Pi V4. Unfortunately I am unable to move the motor and I am a bit lost at how to debug further.
I have currently wired up a circuit as below:
https://github.com/jeremiedecock/pyax12/raw/master/docs/images/breadboard.png
I have followed the instructions on this blog (Configuring The GPIO Serial Port On Raspbian Jessie and Stretch Including Pi 3 and 4 - Spell Foundry) to make sure I can communicate through ttyAMA0 serial port. This is needed because on Raspberry Pi V3 onwards, bluetooth takes over the ttyAMA0. (Note I am not entirely sure what this means so hopefully someone here does.)
I then use the following Python code to send an instruction to the motor but I receive no response.
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)
As far as I know there are three areas to confirm are working:
1- signals are being sent out through Raspberry Pi
2- the circuit is wired correctly and working
3- the motor is able to recieve signals and react
I have tested 1) by connecting the RX pin straight onto the TX pin (like some feedback loop) and I notice that I can send and recieve messages.
I then tried to wire the TX from the raspberry Pi (as in the below image) straight into the Dynamixel DATA port to see if the motor will response but that doesn’t work either.
https://forum.arduino.cc/index.php?topic=384104.0
I am at a lost at what to do - can anyone advise?
Thank you