我在这里使用dynamixel XL和XM电机:
http://support.robotis.com/en/product/actuator/dynamixel_x/xl_series/xl430-w250.htm http://support.robotis.com/en/product/actuator/dynamixel_x/xm_series/xm430-w350.htm
其中有8个串行连接。我正在使用OpenCM9.04板。
由于某些原因,我无法移动伺服器或更改其速度/速度。但是,我能够准确读取位置并打开/关闭扭矩。
这是行不通的:
SerialUSB.print("min positions "); PrintAttribute(52, NUMBER_SERVOS); SerialUSB.println("");
SerialUSB.print("max positions "); PrintAttribute(48, NUMBER_SERVOS); SerialUSB.println("");
SerialUSB.print("operating mode "); PrintAttribute(11, NUMBER_SERVOS); SerialUSB.println("");
SerialUSB.print("goal velocity "); PrintAttribute(104, NUMBER_SERVOS); SerialUSB.println("");
SerialUSB.print("profile acceleration "); PrintAttribute(108, NUMBER_SERVOS); SerialUSB.println("");
SerialUSB.print("profile velocity "); PrintAttribute(112, NUMBER_SERVOS); SerialUSB.println("");
SerialUSB.print("goal position "); PrintAttribute(116, NUMBER_SERVOS); SerialUSB.println("");
for (int j = 1; j <= NUMBER_SERVOS; j++) {
Dxl.writeWord(j, 104, 0x100); int test_result = Dxl.getResult();
Dxl.writeWord(j, 108, 0x100);
Dxl.writeWord(j, 112, 0x100);
Dxl.writeWord(j, 116, 0x0);
SerialUSB.println("");
SerialUSB.print("Dxl.getResult() :: "); SerialUSB.print(test_result);
}
我的打印功能运行良好,并且Dxl.getResult实际上给出了成功值。但是,即使尝试编写单词,输出也不会改变(如果我在关闭扭矩的情况下手动移动位置,则位置读数除外):
min positions
Attribute: 52: 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 /
max positions
Attribute: 48: 4095 / 4095 / 4095 / 4095 / 4095 / 4095 / 4095 / 4095 /
operating mode
Attribute: 11: 65283 / 65283 / 65283 / 65283 / 65283 / 65283 / 65283 / 65283 /
goal velocity
Attribute: 104: 350 / 350 / 350 / 350 / 350 / 350 / 415 / 415 /
profile acceleration
Attribute: 108: 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 /
profile velocity
Attribute: 112: 0 / 0 / 0 / 0 / 0 / 0 / 0 / 0 /
goal position
Attribute: 116: 1608 / 1776 / 2333 / 1956 / 2143 / 925 / 2056 / 2045 /
无论我尝试向它们写入什么,属性104,108,112,116的值都不会改变。当然,伺服器不会物理移动。 但是,以下代码在下面可以正常工作,并且可以打开/关闭电动机的转矩:
torque_toggle = torque_toggle * -1;
SerialUSB.print("torque_toggle: "); SerialUSB.print(torque_toggle);
int toggle = torque_toggle;
if (toggle == -1) toggle = 0;
// a - ID of dynamixel/servo
// b - register/address to write
// c - new value
//Dxl.writeByte(a, b, c);
// Ex: turn torque ON (addr 64 for our servos)
SerialUSB.println("");
SerialUSB.print("toggle: "); SerialUSB.print(toggle);
for (int j = 1; j <= NUMBER_SERVOS; j++) {
Dxl.writeByte(j, TORQUE_ENABLE, toggle);
Dxl.writeByte(j, LED_ENABLE, toggle);
int test_result = Dxl.getResult();
SerialUSB.println("");
SerialUSB.print("Dxl.getResult() :: "); SerialUSB.print(test_result);
}
非常沮丧,因为尽管要使用其他功能并遵循我发现的教程页面,但是我无法移动XL和XM动力混合器。希望我做错了什么并且容易修复?
感谢您的帮助。