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?
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.
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.
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.