POST No. 2406805
Arduino how to use protocol2.0?
2018-05-14 16:43:56 sevenyears

I have a robot arm, before use dynamixel MX-28 and AX-12, but AX-12 Degree of Precision is to low, I want use XL430-W250

but it is protocol V2.0 .

now I want to use arduino mega2560 control Dynamixel X how?

2018-05-14 16:43:56
2018-05-14 21:50:21 Kurt

How do you control AX-12 servos?  i.e. what library are you using? 

One option is to tell the new servos to use protocol 1... http://emanual.robotis.com/docs/en/dxl/x/xl430-w250/#protocol-version

But I am assuming you wish to use protocol 2

I have a version of my BioloidSerial library which is based on the Trossen Robotics Bioloid library that I have added Protocol 2 support for those servos.  I have not migrated it yet to the master branch:

But it is in the branch: https://github.com/KurtE/BioloidSerial/tree/DXL-Protocol-2-Test

I was also working on a version of the DynamixelSDK to work with Teensy and I don't remember if I added the AVR part in, but so far it looks like Robotis does not want that support migrated back into their code base...  I will at some point, I will migrate this into on project, bur right now, it is up in different branch of: the DynamixelSDK github project.  https://github.com/KurtE/DynamixelSDK/tree/Support_Teensy 

If you are using a different library, than you need to add in the extra support.  This includes adding the extra stuff at the start of the packets, plus how the checksum is calculated, plus understand that all of the register numbers are different.

2018-05-15 10:49:05 sevenyears
Thankyou Kurt
protocol2.0 use crc16 field checks and control table is different.
2018-05-15 10:49:05
2018-05-14 21:50:21
2018-05-15 10:30:03 Will Son

Dynamixel Shield library is being prepared for Arduino compatible boards, but it is not officially released yet.

Just in case it might help your project, you can take a look at it.

You can download it from Sketch > Include Library > Manage Libraries...  and search for DynamixelShield.

It'll use Arduino 0(RX) and 1(TX) pins for communication with Dynamixel.


2018-05-15 11:48:02 sevenyears
TK,Will Son,I find it, but I want use serial2 ,because serial0 need connect PC ,How to do?
2018-05-15 11:48:02
2018-05-16 09:57:14 willson
In order to change the serial port for Dynamixel, you'll need to modify the pins(Arduino 0 and 1).
This will require you to enable desired UART port which will be connected to RS-485 or TTL communication IC.
Also, you need to assign data flow control pin.
2018-05-16 09:57:14
2018-05-16 14:45:18 sevenyears
Thank you reply,I change this file "dxl_def.h" '#define DXL_PORT Serial' >> '#define DXL_PORT Serial2' , Now is work!
2018-05-16 14:45:18
2018-05-17 09:07:11 willson
Thank you for the feedback :)
2018-05-17 09:07:11
2018-05-15 10:30:03
2018-05-15 22:45:01 Kurt

Looks like it is hard coded to Serial.  Although that part would not be hard to change.  It is defined in a header depending on which board type it finds.  But it also looks like pin numbers are hard coded and it looks like it assumes that there is external hardware using direction pin, which I think is currently hard coded to 2...

Wondering: As I mentioned in other threads and Dynamixel SDK issue.  I wanted to add support for other boards to sdk... Would it make sense for me to adapt this to other boards, again like Teensy?

You would probably want either some additional optional parameters on the constructor or a new API to set the Port, RX, TX and DIR pins... Maybe have DIR pin optional and add in the support like many use on AVR boards where they simply Tie RX to TX pin...

Still wish SDK had the support for other boards as it allows you to have mixed usage (some Protocol 1 and some protocol 2...) but for most maybe does not matter.

2018-05-16 08:57:36 willson
Hi Kurt,
The Dynamixel Shield library is written specifically for Arduino Dynamixel Shield that we're going to release later so I guess that's why those pins are hard coded.
It is only 0.0.3 version and still need to be improved a lot, but we appreciate for any suggestions that can develop our code for better compatibility.
Please feel free to post an issue or pull request on DynamixelShield repository.
Thank you.
2018-05-16 08:57:36
2018-05-18 11:12:29 sevenyears
emmm, I change DIR pin 2 to other,because of this pin connect to button.
2018-05-18 11:12:29
2018-05-15 22:45:01
웹에디터 시작 웹 에디터 끝