JTS Calibration

From Wiki for iCub and Friends
Revision as of 17:05, 23 August 2014 by Vpadois (talk | contribs) (→‎Results)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Joint Torque Sensor Calibration Module

This module calibrates the torque sensors located at icub joints. Basically it applies an offset and a gain previously identified. A bias command can be sent over yarp network to refresh offset values which can change along with temperature.

Parameters identification protocol

To identify the calibration parameters of the joint torque sensors, some steps have been followed:

  • The concerned limb is moved to the desired position q0 usually where the JTS sees the whole weight of the limb (easier to attach the additional weight)
  • The distance D between the point of application P of the mass and the joint J is measured
  • Increasing weights Fi = Mi * g are applied at the end of the limb (basically a bag filled with masses Mi - range 0 to 234g, i = 1 to the number of different masses used for calibration )
  • Raw sensor values Vi are saved
  • The process is repeat for different joint angles qi
  • Taui = Fi * D
  • The graph Taui - Tau0 = f(Vi - V0) is plotted and the gain beta is computed by linear regression
  • At each position q0 or qi the torque value returned by iDyn is used as reference Tau0 and the offset is computed : offset = -Tau0 + beta * V0
  • The root mean square value of the different offsets is computed to get the final offset value (the offsets sign is kept, normal averaging is done when offsets have different signs)
  • Calibrated_value = beta * raw_value - offset

Looking at the recordings it can be stated that the sensors does not suffer of hysteresis effect and the linear behavior error is minimal.

A folder in the git repository will contain the experimental data, the scilab program to load it and an excel document describing each test.


cd ~/software/src/iCub/main/src/modules
git clone https://github.com/ghamon88/jtsCalibration.git
cp jtsCalibration/app/conf/jtsCalibration.xml ~/software/src/iCub/app/default/scripts
cp jtsCalibration/app/conf/default.ini ~/software/src/iCub_MACSI/app #there should be better places where to put it
nano CMakeLists #add subfolder jtsCalibration
cd ~/software/src/iCub/main/build
make install

How to run the module

Start Icub :

  • Ensure the icub server machine is powered on
  • Ensure the emergency lane is deactivated
  • Turn on the two power supplies
  • Switch on CPU power then Motor Power
  • In a terminal:

cd ~/Desktop
sh launchapplicationsgui.sh

  • Click run server, check, run selected (macsi01 to 04 & pc104), check
  • In another terminal type "gyarpmanager"
  • Click the blue icon on top of the screen (connect to PC104)
  • Once the initialization ends type "robotInterface"
  • In gyarpmanger select iCubStartup application and run all the modules but the last one, connect
  • In another terminal type "robotMotorGui"

Launch the xml configuration file with the manager:

cd ~/software/src/iCub/app/default/scripts 
./manager.py jtsCalibration.xml

N.B. : Choose jtsCalibrationVerification.xml file to record idyn torque values as well to do the comparison with calibrated joint torque values.

Then click on "run module" and "connect" buttons.

In the xml file dataDumpers can be enabled or disabled. When enabled the results (raw and calibrated values) are saved in the folder "dumpJTS" located in /tmp/ folder.

To give a bias order, do the following:

yarp write /jtsCalibration/order:o (in terminal 1)
yarp connect /jtsCalibration/order:o /jtsCalibration (in terminal 2)
bias (in terminal 1)

The bias order computes the sensor offset values the same way as it has been done offline (see excel results file).

You can do the same with "help" or "quit" commands.

Configuration file

The default.ini file defines the input and output ports names and each joint torque sensor Gain and Offset values.

This file is located in the folder app/conf/ of the package but has to be copy in icub_MACSI/app/ for now (will change along with the environment variables).

Calibration data file

Experimental measurements can be found in the conf/ folder as well as photos, and an excel file which computes the gains and offsets.


The following results correspond to the iCub Year 3 demo module (yoga demo) launched during several tens cycles. Figures show a zoom on a few cycles.

Red plot corresponds to iDyn torque computation, green plot to raw sensor signal, blue plot to calibrated sensor signal.

Time displacements can be observed on the plots, in fact it is simply due to the delay between the start of the different data recorded.

Right arm:

right arm J0
right arm J1
right arm J3

Left arm:

left arm J0
left arm J1
left arm J3

Right leg:

right leg J0
right leg J1
right leg J3
right leg J4

Left leg:

left leg J0
left leg J1
left leg J3
left leg J4


torso J1
torso J2

GUI Module

This module draws the graphs of the calibrated joint torque values for monitoring.


cd ~/software/src/iCub/main/src/tools
git clone https://github.com/ghamon88/jtsCalibrationGUI.git
cp jtsCalibrationGUI/app/conf/jtsCalibrationGUI.xml ~/software/src/iCub/app/default/scripts
nano CMakeLists (add subfolder jtsCalibrationGUI)
cd ~/software/src/iCub/main/build
make install

How to run the module

Once Icub has been started, launch the xml configuration file with the manager:

cd ~/software/src/iCub/app/default/scripts 
./manager.py jtsCalibrationGUI.xml

Then click on "run module" and "connect" buttons.

Git repository