I have been struggling with this issue all day.
I cannot write to the control table of my XL330-M288-T motors. I am using writeControlTableItem from the Dynamixel2Arduino library. My setup is an OpenRB-150 powered from my laptops USB.
I am trying to change goal_current or current_limit on the control table. I am able to change those values from Dynamixel Wizzard.
Here is the snippet of code that I am using to figure this out:
int torque_success1 = dxl.torqueOff(SERVO_ID_1); int torque_success2 = dxl.torqueOff(SERVO_ID_2); int write_success1 = dxl.writeControlTableItem((uint8_t)38, (uint8_t)1, (uint32_t)3, (uint32_t)2000); int write_success2 = dxl.writeControlTableItem((uint8_t)38, (uint8_t)2, (uint32_t)3, (uint32_t)2000); dxl.torqueOn(SERVO_ID_1); dxl.torqueOn(SERVO_ID_2); // Print the results to USB USB.print("ADDR: "); USB.println(ADDR); // Print the address in decimal format USB.print("Value: "); USB.println(value); USB.print("Torque Off Success Servo 1: "); USB.println(torque_success1); USB.print("Torque Off Success Servo 2: "); USB.println(torque_success2); USB.print("Write Success Servo 1: "); USB.println(write_success1); USB.print("Write Success Servo 2: "); USB.println(write_success2);
dxl.writeControlTableItem returns 0 no matter what I try. I can’t even write to address 64 (torque_enable) to turn on or off torque. However, dxl.torqueOn, dxl.torqueOff, dxl.setGoalPosition, and dxl.getPresentPosition all work just fine and I can control the positions of my motors.
The documentation of the dxl.writeControlTableItem specifies these inputs, which I have ensured match the datatypes I am using:
- item_index : DYNAMIXEL control table item index. Data type : unsigned int8
- id : ID of a specific DYNAMIXEL. Data type : unsigned int8
- data : Data to write on the DYNAMIXEL control table. Data type : unsigned int32
- timeout : Timeout for a response to a data transfer. (default : 100ms) Data type : unsigned int32
Does anybody have any idea why this might be happening? I am completely stumped by this.
Thanks for any help,