Skip to main content

5.2 Configuration of motors

The Kikobot C1 is delivered fully assembled and pre-calibrated, ensuring that you can get started with your robotics project right away. However, if you ever need to recalibrate the robot to fine-tune its performance or adjust it for specific tasks, you can easily do so by following these steps. This guide will walk you through the process of configuring the motors, assigning IDs, and ensuring the correct setup for both the leader arm and follower arm.

Let’s dive into the steps, designed to make motor calibration and configuration smooth and efficient. If you're ready to explore, follow the detailed instructions below!

Step 1: Identifying the USB Ports for the Motors

Before configuring the motors, the correct USB ports for each motor bus must be identified. This step is essential for making sure each motor is connected to the right bus adapter.

i. Designating Motors and Bus Servo Adapters

The KikoBot C1 uses two bus servo adapters:

  • One for the leader arm (6 motors)
  • Another for the follower arm (6 motors)

ii. Run the Port Identification Script

To find the USB ports for each bus servo adapter, run the script that detects all connected motors:

python lerobot/scripts/find_motors_bus_port.py

This script will search for available motor ports and display them in the terminal.

iii. Example Output

After running the script, you will see an output that looks like this:

Finding all available ports for the MotorBus.    
['/dev/tty.usbmodem123456', '/dev/tty.usbmodem654321']
Remove the USB cable from your DynamixelMotorsBus and press Enter when done.

In this example:

  • Leader arm's port: /dev/tty.usbmodem123456
  • Follower arm's port: /dev/tty.usbmodem654321

Once these ports are identified, make sure to note them for the next steps.

Step 2: Configuring the Motors

i. Setting the Motor IDs

Each motor needs a unique ID, which is used for identification in the system. The KikoBot C1 has 12 motors in total (6 for the leader arm and 6 for the follower arm).

To configure the motors:

  1. Connect the first motor to the bus servo adapter.
  2. Run the motor configuration script with the following command:
  python lerobot/scripts/configure_motor.py 
--port /dev/tty.usbmodem123456
--brand waveshare
--model st3215
--baudrate 1000000
--ID 1
  1. Replace /dev/tty.usbmodem123456 with the correct port you identified earlier.
    Set --ID 1 to assign the motor a unique ID (start with 1 for the first motor).

  2. The script will also set the motor’s present position to 2048, which is the neutral middle point. The motor will rotate to this position during the process.

ii. Repeat for All Motors

Unplug the first motor and plug in the second motor. Set its ID to 2 and run the script again. Repeat this for all 12 motors, assigning IDs sequentially from 1 to 12.

Once the IDs have been set for all motors, each one will be ready for use.

iii. Update YAML file

Now that you have the ports, and all the motor ID’s, modify the port sections in kikobot.yaml Link to the offical kikobot.yaml : (To be added after official integration)

Troubleshooting Tips

i. USB Port Access Issues (Linux)

If you're using Linux and encounter problems accessing the USB ports, use the following commands to change permissions:

sudo chmod 666 /dev/ttyACM0  
sudo chmod 666 /dev/ttyACM1

This ensures the system has the necessary permissions to interact with the motors.

ii. Misaligned Arms or Incorrect Motor Positioning

In case the arms do not align correctly after assembly, you can always adjust the homing offset to fine-tune the motor positions without reassembling the entire system.

Now that you've calibrated the KikoBot C1, you're ready to take full control of your robot! Whether you're using it for testing, development, or custom tasks, these steps provide flexibility and precision for an optimal robotic experience. Explore, experiment, and enjoy the endless possibilities of robotics with KikoBot C1!