Welcome to DOFBOT-Ultra repository
2. Calibrate the Robotic Arm
Calibrate The Robotic Arm
It is recommended to use the calibration method from the Mobile APP Control chapter.
1. API Overview
- Enable or disable the bus servo torque.
Arm_serial_set_torque(enable)
Parameters:
- enable: enable=0 disables torque. The arm joints can be moved manually and do not accept level signals. enable=1 enables torque. The servos maintain their current angle using level signals and can only change angles upon receiving commands.
- Return value: None.
- Confirm and calibrate the servo offset.
xxxxxxxxxxArm_serial_servo_write_offset_switch(id)
Parameters:
- id: id=0 clears all servo calibration values and restores defaults. id=1~6 corresponds to the six servo IDs. When the underlying microcontroller receives this command, it reads the angle data of the corresponding servo. If within a reasonable range, it saves the data. If out of range or the servo ID is not found, it does not save.
- Return value: None.
- Read the calibration offset status.
xxxxxxxxxxArm_serial_servo_write_offset_state()
Parameters:
- Return value: Returns the center offset setting state. state=0 indicates the servo was not detected. state=1 indicates the center was set successfully. state=2 indicates the value exceeded the center setting range.
2. Code Content
Note: This program should only be used when servo calibration is actually needed. Do not use it casually, as it may cause inaccurate servo control and affect grasping performance.
Raspberry Pi code path:
xxxxxxxxxx/home/yahboom/dofbot_ultra/dofbot_ctrl/scripts/Dofbot_Calibration.ipynb
RDK X5 code path:
xxxxxxxxxx/home/sunrise/dofbot_ultra_ws/src/2d/dofbot_ctrl/scripts/Dofbot_Calibration.ipynb
This code must be executed step by step. Ensure that after starting calibration, each servo angle is correctly adjusted before confirming the calibration.
The goal of adjustment is to keep the robotic arm upright and close the gripper tightly.
