Skip to main content

Step 5: Motor Configuration

info

Prerequisites: Before proceeding, ensure you have:

  • ✅ Motor IDs configured (Step 1)
  • ✅ CAN interface configured (Step 2)
  • ✅ Basic communication tested (Step 3)
  • ✅ OpenArm CAN library built (Step 4)

Overview

We now need to complete the motor setup sprocess. This involves three key tasks:

  1. Set Motor Baudrate
  2. Set Zero Position
  3. Verify Motor Communication

Step 1: Set Motor Baudrate

warning
  • Be sure to use the CAN interface on 2.0 during the baudrate setup regardless of your target baudrate. Configure it back to your target baudrate after this step is finished.
  • Motor parameters has a 10000 time write limits, it should not be run frequently in scripts.

Set the baudrate for each motor (replace 1 with your motor CAN ID and 5000000 with desired baudrate):

Set temporarily:

python3 change_baudrate.py --baudrate 5000000 --canid 1 --socketcan can0

Save permanently:

python3 change_baudrate.py --baudrate 5000000 --canid 1 --socketcan can0 --flash

Important: After completing the baudrate configuration, reconfigure your CAN interface to match the motor's new baudrate setting for proper communication if necessary.

Supported Baudrates:

OptionBaudrateDescription
0125000125 kbps
1200000200 kbps
2250000250 kbps
3500000500 kbps
410000001 mbps
520000002 mbps
625000002.5 mbps
732000003.2 mbps
840000004 mbps
950000005 mbps

Step 2: Zero Position Calibration

info

Physically position the arms to roughly match the zero position shown below before running calibration.
For grippers, the closed position is used as zero by default.

zeropos
warning

Safety First! The robot will move automatically when calibration starts. Wear safety gear, clear the workspace, and be ready to emergency stop.

Prerequisites: Ensure you have completed the Python binding installation before proceeding with calibration.

The zero position calibration runs one arm at a time.
Run the zero position calibration (this defaults to can 0, right arm):

python3 setup/zero_position_calibration.py

For specific arms, run:

# Leader-side Left
python3 setup/zero_position_calibration.py --canport can1 --arm_side left_arm
# Follower-side Right
python3 setup/zero_position_calibration.py --canport can2 --arm_side right_arm
# Follower-side Left
python3 setup/zero_position_calibration.py --canport can3 --arm_side left_arm

Step 3: Verify Motor Communication

Run the motor check executable, replace 1 and 17 with your motor's send and receive CAN IDs. The motor-check executable should be available in the build directory from the library compilation. If it's missing, rebuild the project. Note: CAN ID 17 is the decimal representation of 0x11

For CAN 2.0

cd openarm_can/build
./motor-check 1 17 can0

For CAN FD mode:

./motor-check 1 17 can0 -fd

The output should display the motor's receiver ID, baudrate, and status information.

Verification steps:

  1. Check baudrate: Verify the displayed baudrate matches what you configured earlier
  2. Test permanent settings: If you used --flash, power cycle the motor and run the check again to confirm the settings persisted
  3. Troubleshoot: If the baudrate doesn't match, switch your CAN interface to 2.0 and re-run the baudrate change script
warning

It is important to get the motor-check working before running the demo.

Troubleshooting

  • Check CAN interface is UP
  • Verify motor is physically connected and powered, set with the correct ID
  • Verify can connection is stable (important!)
  • Use candump to monitor the traffic
  • Check CAN interface baudrate matches motor's current baudrate
  • Verify send/receive CAN IDs are correct. Common pairs: 1→17, 2→18, 3→19, etc.