As the position control loop of the joint Q1 and Q2 are using relative encoders, there are two different calibration procedure.
- The runtime calibration, that is runned each time the motordriver board are reseted. Its purpose is to match the current relative encoder position with an absolute recorded position. Since the relative position is lost at each electronic reset, this procedure has to be re-runned. The driver from liboncilla ensure this task is done every-time the robot is started.
- The factory or mechanical calibration, whose purpose is to record in the motordriver memory the absolute position needed by the runtime calibration. This procedure should be performed every time:
- a mechanical part as been repaired or changed
- a leg is re-assembled,
- the corresponding leg motordriver board is replaced or its firmware updated.
- every few hours of robot use because of mechanical wearing. Sessions up to 5 or 6 hours are usually fine
In order to use the robot in a proper way, we have to calibrate the robot. You can find Tools to calibrate and debug oncilla here : Oncilla - Software Utilities for Hardware Management
The runtime calibration state and start of the procedure is automatically checked and handled by the liboncilla driver.
During runtime calibration, the robot should not touch the ground. The knee will be first completely extended and then flexed a little bit to retrieve the exact point of full extension. If the legs are flexed during that procedure, the corresponding points will be miscalculated and thus the legs will always remains flexed until the next electronic reset.
First of all you should test, if the magnetic encoders working correctly by reading them out.
$ sudo oncilla-motor-reader
The calibration of the L1 and L2 motor is done using the oncilla-motor-calibrator program.
Before going into the calibration procedure, check if the knee cables are in the right setup (( Oncilla - Start Up Checklist )
Calibration of the motors connected to each motor board is done separately.
From the ssh terminal, go to ~/devel/oncilla-motor-calibrator and run:
$ sudo build/src/oncilla-motor-calibrator -h
This gives you a reminder of all required option needed by the calibration program. You need to provide :
- the motor board ID
- the leg calibration template, which can be left_fore, right_fore, left_hind or right_hind.
Once you are ready to calibrate a leg, run the command:
$ sudo build/src/oncilla-motor-calibrator -i <BOARD_ID> -t <LEG_TEMPLATE>
and the calibration procedure begins for the corresponding motorboard/leg.
- The program will first ask you to move the L1 joint. move the leg (sample video here ).
- Now put the leg back in the vertical standing posture, and proceed as the program says.
- Next you have to move the L2 motor. Flex the leg freely (sample video here).
- Put the leg back in the vertical standing posture. Make sure the cable is not loose and it can start to pull. Continue as the program says.
You should repeat this procedure for all motorboards/legs.
If the program stopped on an exception when calibrating (as for example the legs wasn't moved enough during the sampling period), just redo the whole calibration again for that join.
A full video of the calibration of one leg can be found here
The calibration of the hip servo motors can be done with the program rbio-servo-calibrator. Please notice that the program does not provide a -h option. Before you start the calibration procedure, be sure to be in the right directory Oncilla - Software Utilities for Hardware Management
Now run the program and provide a new file to store the calibration values (e.g. here: servo-example-calibration.config):
$ sudo rbio-servo-calibrator servo-example-calibration.config
A new terminal with a grey background is opened. This program has its own prompt and command. Press TAB several times to get an overview of the existing commands.
In the beginning you have to check that the servos are connected to the right channel of the RB-110 (see Oncilla - Part Description . If it's not, select the servo motor (e.g left_fore servo):
$ select left_fore
and assign the new Channelnumber. (*Note:* You can only assign free channels!)
$ channel = x
where x denotes a number = [1 ... 15]
Now you can start to calibrate the servo.
Start with the max_position of the servo.
Press + or ' to adjust the current position of the servo motor. You can increase/decrease the stepsize of the motor by setting the pulse length.
$ set_pulse_increment <value>
$ reversed = true
After setting the calibrating position, you have to use the command stop_moving, to save the new position value.
Now repeat the procedure for the minimum position of the servo with start_min_position
After calibrating the motor, stop moving to save the calibration value.
When you have placed the minimal reachable position for the leg, unselect the servomotor, and proceed with the remaining servos like above.
$ unselect $ select [left-fore | right-fore | left-hind | right-hind]