8000 Feat/ add scan motors tool for troubleshooting during assembly and calibration by ivelin · Pull Request #657 · huggingface/lerobot · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feat/ add scan motors tool for troubleshooting during assembly and calibration #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ivelin
Copy link
Contributor
@ivelin ivelin commented Jan 27, 2025

What this does

This PR introduces a command line tool that helps troubleshoot arm assembly issues.
Specifically it scans the motor bus and shows status for each discovered motor on a given USB port.

The PR also adds 2 Troubleshooting sub-sections: one the assembly section and another to the calibrate section of the so100 assembly doc.

This originated in problems I had during calibration.

The calibrate tool was throwing error messages that was not documented in the assembly steps:

First issue:

ConnectionError: Read failed due to communication error on port /dev/ttyACM0 for group_key Torque_Enable_shoulder_pan_shoulder_lift_elbow_flex_wrist_flex_wrist_roll_gripper: [TxRxResult] There is no status packet!

The error message did not make it obvious what the root cause of the problem was. Here is the discord discussion.

Second issue:

Calibration is done! Saving calibration file '.cache/calibration/moss/main_leader.json'
Activating torque on main follower arm.
Wrong motor position range detected for gripper. Expected to be in nominal range of [0, 100] % (a full linear translation), with a maximum range of [-10, 110] % to account for some imprecision during calibration, but present value is 143.7950897216797 %. This might be due to a cable connection issue creating an artificial jump in motor values. You need to recalibrate ...

Solution provided by @Gordoa40 in discord help channel.

How it was tested

I tested the tool locally on Ubuntu with my 2 so100 robot arms.

How to checkout & try? (for the reviewer)

Checkout the code and run the script as shown in the example below on a Linux computer that is connected to a so100 robot arm.

Example:

lerobot$ python lerobot/scripts/scan_motors.py   --port /dev/ttyACM1   --brand feetech   --model sts3215 
Connected on port /dev/ttyACM1
Scanning all baudrates and motor indices
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 43.09it/s]
6 motor ID(s) detected for baud rate 1000000. Motor IDs: [1, 2, 3, 4, 5, 6].
Present Position 1940
Offset 0
Present Position 990
Offset 0
Present Position 2094
Offset 0
Present Position 3747
Offset 0
Present Position 2997
Offset 0
Present Position 853
Offset 0
Setting bus baud rate to 128000. Previously 1000000.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.42it/s]
Setting bus baud rate to 500000. Previously 128000.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.60it/s]
Setting bus baud rate to 115200. Previously 500000.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.40it/s]
Setting bus baud rate to 57600. Previously 115200.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.14it/s]
Setting bus baud rate to 38400. Previously 57600.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 13.91it/s]
Setting bus baud rate to 19200. Previously 38400.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 13.24it/s]
Setting bus baud rate to 250000. Previously 19200.
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 14.54it/s]
Scan finished.
Disconnected from motor bus.

Signed-off-by: ivelin <ivelin117@gmail.com>
Signed-off-by: ivelin <ivelin117@gmail.com>
Signed-off-by: ivelin <ivelin117@gmail.com>
Signed-off-by: ivelin <ivelin117@gmail.com>
…tion problem

Signed-off-by: ivelin <ivelin117@gmail.com>
@imstevenpmwork imstevenpmwork added enhancement Suggestions for new features or improvements robots Issues concerning robots HW interfaces documentation Improvements or fixes to the project’s docs labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or fixes to the project’s docs enhancement Suggestions for new features or improvements robots Issues concerning robots HW interfaces
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0