PDA

View Full Version : OpenCM9.04 and Dynamixel AX-12A



ritzdank
09-09-2015, 04:11 PM
I am having a hard time setting up a brand-new OpenCM9.04 board with one Dynamixel AX-12A actuator. The board is working great and i can upload new code, communicate with serial (even via bluetooth on UART2, etc.) but I can't get the board to control the motor.

Here's the example code



#define DXL_BUS_SERIAL1 1 //Dynamixel on Serial1(USART1) <-OpenCM9.04


Dynamixel Dxl(DXL_BUS_SERIAL1);


void setup() {
Dxl.begin(3);
}


void loop() {
Dxl.writeWord(1, 30, 100); //set ID
digitalWrite(BOARD_LED_PIN, LOW);
delay(1000);
Dxl.writeWord(1, 30, 1000);//set ID
digitalWrite(BOARD_LED_PIN, HIGH);
delay(1000);
}


The board is externally powered through a 11.1V battery and I strictly followed the wiring diagram as indicated by Robotis.

http://support.robotis.com/en/images/product/auxdevice/controller/opencm/opencm9.04_15.jpg

I can't get the motor to turn. Just to make sure. The motor is completely new and should by default have the ID 1 and 1Mbps baudrate.

Am I overseeing an obvious mistake? Thanks for any help!

tician
09-09-2015, 06:20 PM
Default baudrate of AX series dynamixels is 1Mbps (http://support.robotis.com/en/techsupport_eng.htm#product/dynamixel/ax_series/dxl_ax_actuator.htm), but you are trying to use Dxl.begin(3) when it should be Dxl.begin(1).

ritzdank
09-10-2015, 04:43 AM
Changed the code, but still nothing happens. I've checked the V+ and GND and the voltage is at around 12V.

Using the buspirate and a Logicsniffer software, I tried to listen to the TTL port.

http://oi60.tinypic.com/157zpcz.jpg

The little peaks in the picture have a period width of 200us. The time range of the entire screenshot is about 800ms (just to give you an idea). When hitting refresh, I am getting the peaks at different positions, so I would guess that the TTL communication is working, but the motor is still not responding/turning?

ritzdank
09-10-2015, 04:48 AM
In the screenshot above my sampling frequency was too low. Here's a zoom onto one data package sent through TTL. The period width seems to be 10us which equates to 100kHz. But shouldn't the baudrate be 1000kHz?

http://oi62.tinypic.com/16bk7ba.jpg

tician
09-10-2015, 07:26 PM
If you are actually sampling at a sufficiently high rate to actually capture the packets, then - assuming I did the math correctly - the two packets you send should be:
writeWord(1, 30, 100)


0xFF 0xFF 0x01 0x05 0x03 0x1E 0x64 0x00 0x74

writeWord(1, 30, 1000)


0xFF 0xFF 0x01 0x05 0x03 0x1E 0xE8 0x03 0xED

ritzdank
09-11-2015, 05:26 PM
I did manage to get it work. I had to use Dxl.begin(3) though since I noticed with the logic analyser that anything below was giving less baudrate than 1Mbps.

6160

jwatte
09-12-2015, 12:47 AM
A few things:

The "Dxl" object uses protocol version 2, which is only recognized by XL-320 and Dynamixel Pro servos.
The "Dxl" object uses a different baud rate numbering -- "3" means 1 Mbps.
If you don't see the wire being high (positive) on the logic analyzer when nothing is sending, something is wrong. The board should idle the wire high.
You can change the "Dxl" object to version 1 protocol with setPacketType(DXL_PACKET_TYPE1) but the baud mapping is still the same.
// Dynamixel 2.0 Protocol -> 0: 9600, 1: 57600, 2: 115200, 3: 1Mbps

The t_AX_XL320_Mixed sample sketch in the ROBOTIS_OpenCM install shows you how to talk to the AX servos.

tician
09-12-2015, 02:13 AM
A few things:

The "Dxl" object uses protocol version 2, which is only recognized by XL-320 and Dynamixel Pro servos.
The "Dxl" object uses a different baud rate numbering -- "3" means 1 Mbps.
If you don't see the wire being high (positive) on the logic analyzer when nothing is sending, something is wrong. The board should idle the wire high.
You can change the "Dxl" object to version 1 protocol with setPacketType(DXL_PACKET_TYPE1) but the baud mapping is still the same.
// Dynamixel 2.0 Protocol -> 0: 9600, 1: 57600, 2: 115200, 3: 1Mbps

The t_AX_XL320_Mixed sample sketch in the ROBOTIS_OpenCM install shows you how to talk to the AX servos.

...great... So, v1.0.2 is not actually built from the github repo. Yep, such open.

vehemens
09-13-2015, 12:40 AM
...great... So, v1.0.2 is not actually built from the github repo. Yep, such open.

Last time I looked, all the example and library source code was in the robotis zip file except for the libcs3 chunk.

What part of OpenCM are you looking for in a github repository?

tician
09-13-2015, 02:17 AM
I was expecting at least one of the github repos (https://github.com/robotis-pandora/) that I'd been working from exclusively since the v0.9.8 release to have been synced to contain the most recent versions of the core, libraries, examples, and bootloader.