-
Notifications
You must be signed in to change notification settings - Fork 2
Calibration guide
AnthonyBreton edited this page Apr 11, 2021
·
16 revisions
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.
- 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
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.
- 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 joints, the other leg on the same side must be moved out of the way to reach full range.
- Once a limit is found, copy it in the two dimensional array jointLimit (qd_hw_config.h) at the right place :
int jointLimit[12][2] = { {J0 min, J0 max}, {J1 min, J1 max}, {J2 min, J2 max},
{J3 min, J3 max}, {J4 min, J4 max}, {J5 min, J5 max},
{J6 min, J6 max}, {J7 min, J7 max}, {J8 min, J8 max},
{J9 min, J9 max}, {J10 min, J10 max}, {J11 min, J11 max} };
The calibration is now done, restore the code back to normal.
S4H2021-QuadrUS