Skip to content

Calibration guide

AnthonyBreton edited this page Apr 11, 2021 · 16 revisions

Calibration of the the robot after assembly

In qd_hw_config.h inside the include folder situated in the Arduino code, there is an array named compensationArrayMec to add small compensations to every joints and calibrate the initial position.

How to calibrate the initial position (mechanical compensations) :

  • Send the code to the Arduino as it is with PlatformIO (this line should be in the setup moveMotor(initPositions);)
  • The robot should be in his initial position but with slight offsets (Hip and Tibia parallel to the body | Femur perpendicular to the body)
  • Play with the values in compensationArrayMec to get rid of these offsets and get a straight initial position

Pt ajouter les sens de rotation

Calibrating the joint limits

This step should be done after the calibration of the initial position. In the same file as the previous step (qd_hw_config.h) there is a two dimensional array named jointLimit where the angle values are in degrees. Each joint as an upper and lower angle limit to set to protect the robot from colliding with itself.

How to calibrate the joint limits :

  • Add these two arrays as global variables in the main.cpp file of the Arduino code :
float configurableJointDefinition[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
float position[12];
  • Replace the setup with this one (keep the previous setup to restore it after the calibration) :
void setup() {
  servoInit();
  computeLimits();
  for (int i = 0; i < 12; i++)
  {
    position[i] = initPositions[i] + configurableJointDefinition[i];
  }
  moveMotor(initPositions);
  moveMotor(position);
  rosInit();
}
  • For each joint, one at a time, change the values in the configurableJointDefinition array to find the maximal and minimal range (you should be careful not to break the robot by starting with small increments). For some joint, the other leg on the same side must be moved out of the way to reach full range.