Open ZhengYi0310 opened 3 years ago
Hi @ZhengYi0310
Please do not paste the screen capture of the source code as it will make difficult to read the code and point important keywords.
It seems you are using an incorrect byte length for setting up an initial values.
Please refer to the control table of the XM430-W350 and use the correct function depending on the length of the item.
For example, the Operating Mode(11)
is a 1 byte data which requires write1ByteTxRx
instead of write2ByteTxRx
.
Similiary, the Velocity Limit(48)
, Max Position Limit(48)
, Min Position Limit(52)
needs write4ByteTxRx
.
Address | Size(Byte) | Data Name | Access | InitialValue | Range | Unit |
---|---|---|---|---|---|---|
11 | 1 | Operating Mode | RW | 3 | 0 ~ 16 | - |
44 | 4 | Velocity Limit | RW | 200 | 0 ~ 1,023 | 0.229 [rev/min] |
48 | 4 | Max Position Limit | RW | 4,095 | 0 ~ 4,095 | 1 [pulse] |
52 | 4 | Min Position Limit | RW | 0 | 0 ~ 4,095 | 1 [pulse] |
Thank you.
Hi @ROBOTIS-Will
Thanks very much for the reply !
I've updated the code based on control table, and I believe I've corrected all initialization: https://github.com/ZhengYi0310/dynamixel_current_controller/blob/main/gripper_current_controller.py
However the error still exists. Also this error always happens at line 279, at line 195 there is another call of packetHandler.read4ByteTxRx(portHandler, DXL_ID, ADDR_MX_PRESENT_POSITION), but the error never happens at line 195.
Any further suggestions ? Thanks in advance.
Hi @ROBOTIS-Will More updates, when I run the read_write.py script in DynamixelSDK/python/tests/protocol2_0/ the same issue happens, as can be seen in the following
But when I use Dynamixel Wizards 2, the issue never happens, hence I don't think it's a cable issue, and I suspect it is related with the read and write frequency.
Thanks
:
Hi @ZhengYi0310 If you are getting similar issues with the example code that we provide, I think your environment may cause unstable communication. Since you are getting an intermittent "no status packet" error, I'd check your communication cables. If possible, try testing with a shorter USB cables as extended USB cables that are longer than 1m(3 feet) could affect stable communication. Thank you.
Hello,
When I run the script, it seems the communication stops randomly after the script starts running, sometimes less than 1 minute, sometimes about 5 to 10 minutes, and the error is the following:
it seems the readTxRx function receives empty data. Also, the LED changes to static red, another indicator that the communication stops.
I've already changed to the baud rate (default is 57600) to a lower and higher number, but it seems not relevant.
the latency_timer of the usb port is shown as the following:
The 3pin cables connect u2d2 to motor is the standard ones comes with the kit, however I used a very long usb extension cable to connect the u2d2 to my pc, would that cause the issue ?
Thanks in advance !