SDK Version: Dynamixel SDK 3.6.1
Code: read write example
I am attempting to run the C++ Protocol 2.0 read-write example. I have only made the following modifications:
#define ADDR_TORQUE_ENABLE 24
#define ADDR_GOAL_POSITION 30
#define ADDR_PRESENT_POSITION 36
// Default settings
#define DXL_ID 0 //was set to 1 but the dynamixel ax-12 manual has id's starting at 0; I have tried both!
#define BAUDRATE 1000000 //ax-12 manual states this as default...
#define DEVICENAME "/dev/ttyAMA4" //my port
As far as I know, AX-12 servos do NOT support protocol 2, they only support protocol 1. That is unless I missed some major firmware update.
But as their internal processor (I believe AVR) is far more limited than the ARM chips in the newer servos.
Try using the Packet handler for protocol 1...
As Kurt mentioned above, AX series does not support Protocol 2.0, therefore you should use examples based on Protocol 1.0.
Here's the list of Protocol 2.0 supported products.
Thanks for the quick replies. I guess I missed that in my search.
I switched to Protocol 1.0 yesterday and that solved my initial issue. Thank you!
But now I face a different problem.
The output of the Protocol 1.0 C++ read-write example is:
Succeeded to open the port!
Succeeded to change the baudrate!
[RxPacketError] Input voltage error! <- when setting the enable torque bit in the code
I have checked my voltage supply with a voltmeter and I am at 11.1 V, .05 A at standby which should be fine based on what I have read.
I have checked the wiring harness to the AX-12 with a voltmeter and that is fine too - I read 11.1 at the connector to the AX-12.
I have tried varying the supply over what i saw recommended as the range (9-12 V) but with the same Voltage error.
The actual return error in the code is a 3, which indicate both Input Voltage Error and Angle limit errors, if that helps.
I also don't understand the angle limit error since I haven't sent it any Goal Position commands.
I tried searching the forum for Input voltage error but came up relatively empty.
Again, any help would be appreciated.
Hopefully @will son - will be able to give you a better answer, but I believe it is already the weekend there...
Might help to know more of the details, like what is the actual setup? Is this a Linux machine connected to some servo controller or are you talking OpenCM9.04 or OpenCR...
Are you using the standard read_write example? Any modifications?
How many servos do you have hooked up? Do you have one (and hopefully only one) servo with ID #1 hooked up? When you plug it in and apply power does the servo blink once? If you have multiple servos try with just one servo connected and see if that works.
Sorry not much more help.
1. Voltage Error : Please make sure that your Min/Max Voltage setting is covering 11.1V range. Default settings are 60(6V) ~ 140(14V).
2. If you used read_write.cpp example, the code is written for MX-series which allows 0~4095 position range.
But, AX-series supports 0~1023 so you should modify the position value(line 58) within this range as shown below.
Please let us know if this doesn't resolve your issue.