PDA

View Full Version : [Question(s)] AX-12A Control Problem(function dxl_write_word problem)



sorcun
06-14-2013, 05:12 AM
Hello,
I'm trying to control AX-12A through USB2Dynamixel using Dynamixel SDK. Code below tries to turn servo motor with some increments in a while loop.


GoalPos = 205;
if res == 1
disp('Succeed to open USB2Dynamixel!');
t = 0;
while(t<3)
calllib('dynamixel','dxl_write_word',id,P_GOAL_POS ITION,GoalPos);
check = int32(calllib('dynamixel','dxl_get_result'));
PrintCommStatus(check);
pause(1);
GoalPos = GoalPos + 30;
t = t+1;
end
end

Code was working properly for first 2 days, but in third day it started not to work. Problem is that when it enters while loop, it moves motor to declared GolPos. But, after first loop it cannot move it. I also add check code to see the result of communication and this is what I get.

Succeed to open USB2Dynamixel!
COMM_RXTIMEOUT: There is no status packet!
COMM_TXFAIL : Failed transmit instruction packet!
COMM_TXFAIL : Failed transmit instruction packet!
Is there anyone who can help me with this?
-Orcun

jwatte
06-14-2013, 11:04 AM
Do you have an oscilloscope or logic analyzer available? The first thing I would do would be to hook a pigtail (cut-in-half cable) into the servo bus, and look at the data being sent and received on the bus.

However, from the symptoms, I would guess that you have a servo that has "changed IDs." Apparently, they do this sometimes, especially when they see a low-voltage input. Try scanning each servo, and set them back to the ID and baud rate you expect, and see if it works better. If that doesn't work, it's time to look at the actual bus for clues.