ROBOTIS-GIT / DynamixelSDK

ROBOTIS Dynamixel SDK (Protocol1.0/2.0)
http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_sdk/overview/
Apache License 2.0
464 stars 410 forks source link

Unstable Connection between U2D2 and Raspberry Pi Zero 2 (Ubuntu 20.04) #542

Open JMechW opened 2 years ago

JMechW commented 2 years ago
  1. Which DYNAMIXEL SDK version do you use?

    • 3.7.40
  2. Which programming language/tool do you use?

    • C++ and ROS2 (rclcpp)
  3. Which operating system do you use?

    • Ubuntu Server 20.04 64-bit on Raspberry Pi Zero 2 W
  4. Which USB serial converter do you use?

    • U2D2
  5. Which DYNAMIXEL do you use?

    • XM430-W210-T
  6. Have you searched the issue from the closed issue threads?

    • yes
  7. Please describe the issue in detail --: The connection between the SBC and the U2D2 is unstable. I have the U2D2 connecting to 2 XM430-W210-T without daisy-chaining. The U2D2 is connected to the Raspberry Pi Zero 2 W at its only micro-USB port using an mUSB to mUSB otg cable. The baud rate has been set to 1 Mbs. I have also set the USB latency on the SBC to 1

The ROS2 code is cross-compiled from a linux_64 system to aarch64 using docker. The code worked fine on the linux_64 computer (without cross-compiling), but the cross-compiled version becomes unstable when moved to the SBC. The SBC usually can only connect to one of the motors, and there are constant errors like "there is no status packet" and "wrong CRC". For the connected motors, I am able to set Torque on/off and tune PID gains, but the same process does not work for the other motor.

Since cross-compiling mainly concerns architecture, and the code can run and connect to one motor, I do not think it is likely the cause of the problem. I speculate that the problem is related to the mode/driver of micro-USB of Raspberry Pi Zero 2. However, I did not find any previous cases where a Raspberry Pi Zero 1/2 was connected to the U2D2, so I have no references.

  1. How can we reproduce the issue?

There are many things that can be tried, but due to my limited time, I am sorry but I cannot rule them out one by one. The following are my suggestions (all based on Raspberry Pi Zero 1/2):

  1. Compile the example code locally in a Raspberry Pi OS, and connect the SBC to U2D2 with two motors. Run and check. If it does not work, configure USB driver/mode to see if it works.
  2. If Step 1 works fine without tuning the USB, repeat Step 1 in a Ubuntu Server 20.04 OS. If Step 1 works but requires USB configuration, repeat Step 1 and see if the same configuration works.
  3. If Step 1 and 2 both work with the same/no USB settings, try cross-compiling the code from another system and move it to the SBC.

Also, please kindly let me know if anybody previously succeeded in interfacing a Raspberry Pi Zero 1/2 with U2D2. Thank you!