Open WilliamH07 opened 3 years ago
Hi @WilliamH07
I'm sorry about the delayed response.
Unlike other X series, the range of velocity of XL-320 is 0 ~ 2047, and as described in the Moving Speed(32) section of the XL-320 eManual, the CW rotation is achieved by sending a value between 1024 and 2047.
Please note that the bit 10
in the data represents the direction of the rotation.
For example, 1024 (0x400) is 0 in the CW direction, and 2047 (0x7FF) is the maximum speed in the CW direction.
(max CCW) 1023 <-- 0
(stop) 1024 --> 2047
(max CW)
Thanks you.
Hello @WilliamH07
The following loop() code allow me to control the direction of the DYNAMIXEL with raw values (*Make a simple code change from Dynamixel Shield Example: _velocitymode ) Please feel free to test it.
void loop() {
// put your main code here, to run repeatedly:
// Please refer to e-Manual(http://emanual.robotis.com) for available range of value.
// Set Goal Velocity using RAW unit
dxl.setGoalVelocity(DXL_ID, 1523); // CCW
delay(1000);
// Print present velocity
DEBUG_SERIAL.print("Present Velocity(raw) : ");
DEBUG_SERIAL.println(dxl.getPresentVelocity(DXL_ID));
delay(1000);
dxl.setGoalVelocity(DXL_ID, 500); // CW
delay(1000);
// Print present velocity
DEBUG_SERIAL.print("Present Velocity(raw) : ");
DEBUG_SERIAL.println(dxl.getPresentVelocity(DXL_ID));
delay(1000);
}
Hello, Thanks for your reply, and sorry for the late respond I try something different using percent, and it works pretty well, it need adjustment but it works ! Thanks WilliamH07
Hello, I recently wanted to use a joystick for my robot arm to control a XL320, it's working perfectly but when I modify the code to make it move in reverse nothing is happening. I really don't understand why in velocity mode with RAW UNIT it's not working but with percent it's working. Since I use a joystick I need to use the RAW unit. I post the code I use below. Btw I use a PS5 controller as the joystick in bluetooth with a shield. Even when I put a negative number instead of the input of the ps5 controller nothing is happening
Thanks, WilliamH07