PDA

View Full Version : Obtaining direction of present speed of Dynamixel AX-12+ actuators



ngom52
03-11-2010, 03:43 AM
Hello everyone,

I need help in understanding the present speed feedback (adresses 38 and 39 in the control table) of the Dynamixel AX-12+ actuators. Basically I'm not entirely sure what the numbers that I get from the feedback mean, if they contain information regarding the direction of rotation and if they do, how to make sense of it.

Thanks in advance

JonHylands
03-11-2010, 06:43 AM
http://www.bioloid.info/tiki/tiki-index.php?page=Present+Speed

- Jon

MikeG
03-11-2010, 06:44 AM
If bit 10 is a 1 then rotation is in the clockwise direction; otherwise rotation is counter clockwise. Bits 0-9 are the speed value. If you made a mask, call it directionMask, and made it equal to 1024 (0x400 or 0x10000000000) the you could use conditional statements and logical operators.


if(directionMask & present speed)
moving clockwise
else
moving counter clockwiseTo get the magnitude of speed take the inverse of the mask then do a logical AND with present speed.

In continuous rotation mode (from your other posts), the moving speed fluctuates +/-20 units in the 0-300 degree range and is useless in the 300-360 range. You need to make sure that the AX-12 is positioned in the sweet spot (0 to 300) before querying the goal speed registers. Mark the starting goal position before entering continuous rotation mode. I usually set a buffered range around the goal position so I can count turns. Start up a counter (clock) and start pinging for goal position every so many ticks. Pinging has to be a function of the moving speed to work correctly. If the goal position is within 0 to 300, it is safe to take a speed reading. If the goal position is within the buffered goal position range add/decrement one to the number of rotations.

This will work ok with one or two AX-12s any more and this will be a timing nightmare.

ngom52
03-13-2010, 04:51 AM
Hi,
Is it correct to say that a value greater than 2^10 signifies a negative rotation?

JonHylands
03-13-2010, 06:00 AM
No, that is not correct. There are a large number of values that are greater than 1023 (which is 2^10 - 1, btw) that are not negative rotation.

It is correct to say that values from 0-1023 specify one direction, and values from 1024-2047 specify values in the other direction.

I prefer to think of it as 0-1023 specifies the magnitude of the speed, and bit 10 specifies the direction.

- Jon

MikeG
03-13-2010, 06:37 AM
@ngom52, ask your professor about about encoding negative numbers in binary; signed-magnitude, 1's complement, and 2's complement. These concepts are generally taught in entry level studies of CE and EE.