Difference between revisions of "User Manual/4. Sensor calibration"

From Chordata documentation
Jump to: navigation, search
(Test the calibration: Change -r flag)
(Tags: Mobile edit, Mobile web edit)
(Test the calibration: Improve testbox description)
(Tags: Mobile edit, Mobile web edit)
Line 75: Line 75:
Run the notochord without the <code>--calibration</code> flag.
Run the notochord with the commands above.
On your computer load the [https://chordata.cc/downloads testcube.blend file], and hit the [Receive] button. Rotate your sensor around: the virtual K-Ceptor should reflect the movements of the physical one.
On your computer load the [https://chordata.cc/downloads testcube.blend file], and hit the [Receive] button. Rotate your sensor around: the virtual K-Ceptor should reflect the movements of the physical one.

Latest revision as of 06:27, 26 October 2019

This whole system is based on an amazing technology called MEMS. It stands for Micro Electro Mechanical Systems. What it means is that inside a chip that is usually smaller than 1mm2 the manufacturers are able to squash not only the logic ICs, but also microscopic moving parts. Otherwise they wouldn’t be able to detect physical properties like acceleration, wouldn’t they?

Inertial sensors based on this technology are inexpensive, and they deliver amazing results, but they have the drawback of having some inherent noise and offset on the delivered values. In addition, magnetometers are easily disturbed by the presence of metallic masses on the surroundings generating large distortions of the perceived magnetic field.

The good news is that most of these problems can be resolved with a proper calibration. On top of this, all that it takes to do it is your hands, some patience and a special cardboard box that you can download from our website. This calibration should only be done before the first time you use the system, or when you move to a drastically different place in terms of global latitude and electromagnetic distortion.

Build the cardboard calibration box[edit]

Start by downloading the printable unfolded calibration box, print it on a large paper, glue it to some piece of cardboard, cut it following the solid lines, fold it following the dotted lines. The result should be something like this:

KC calibration box.jpg

the cardboard box is just a visual guide to be sure you position the sensors in all possible directions during the magnetometer procedure. It has no actual influence on the calibration itself. If this is the first time you do it, it’s strongly advised to use the box. Once you get more comfortable with the procedure, you can skip this step. Just imagine the box around the K-Ceptor and move it accordingly .

Calibration procedure[edit]

Pick the right place to calibrate your sensors[edit]

The quality of the sensor calibration will greatly influence the accuracy of your captures. So take all possible precautions to do this step right. What we want during calibration is to be in an environment as free of magnetic disturbances as possible.
Sources of magnetic disturbances include electronic devices, like your laptop. So try to stay as far away as possible from it.
Another, more subtle, source of magnetic disturbances are big metallic masses on the surroundings. Many buildings have metallic structures on the walls or in the floor. If you find yourself recalibrating over and over without achieving good results, try moving to a different spot, or even doing the calibration outdoors.
Keep in mind that even a metallic bolt might be perceived as a big mass by the sensor if it is close enough. While calibrating make sure to place you sensor on wooden or plastic surfaces without metal parts.

Preparing the hardware[edit]

In order to perform the calibration, you will need the hub and SBC to be connected and working (as described in §2 of this manual).
You also need to have access to the terminal environment on the SBC (as described in §2.1 of this manual).

Insert one K-Ceptor in the socket formed by the cardboard on the inside, make sure the K-Ceptor stays fixed in a stable position' and plug the K-Ceptor to the Hub (using the Gate #1, labeled J1)

Run the software[edit]

Now you can run the notochord, using the --calibrate flag.

cd bin
./notochord --calibrate <YOUR COMPUTER'S IP ADDRESS>

You will be guided through the steps below.

This procedure works with only with the recently released 0.1.1b version of the notochord.

If you recently installed the software using one of the scripts provided on §1.1.2 of this manual you should be good to go. If you an error about the --calibrate flag, then pull the new version and recompile with:

git pull
git checkout develop
scons -j3 debug=1

Step A[edit]

You will be asked to place the calibration box on flat surface facing upwards. This means that the big number 1 should be upwards. Be sure to let the box completely still (sometimes the tension of the wire might move it a little) and press a key.

In this step the program gathers a few samples from the accelerometer and gyroscope from which it then finds the inherent offsets that these sensors deliver.

Step B[edit]

Then you will be asked to perform the magnetometer calibration procedure. This procedure consists of grabbing the box with your hands and repeating the following steps for each face:

  • Hold the box in front of you and make sure to keep the current face as parallel to the ground as possible.
  • Put the letter “a” of the current face on the same direction you are looking to.
  • While holding the box parallel to the ground, turn it 90º in order to put the letter “b” on the direction you are looking to. Repeat for all 4 letters of the face.
  • Starting with the letter "a" in front of you, make some additional random movements. A good technique is drawing some "8" in mid-air.
  • Go to the next face, and repeat these steps.

Once you are done with the last face, place the box on the table and press a key. The program will take some seconds to process the information, just wait and press a key when you are asked to. That’s it, now you have a calibrated and much more accurate sensor. You can keep using it like this for some time (the calibration data will be stored on the K-Ceptor's EEPROM memory.

Magnetometer calibration.gif

In this step, the program gathers lots of samples, and performs a somehow complex procedure to calculate errors on the measurements. If you want to learn some more about this procedure you can visit this guide.

Test the calibration[edit]

cd bin
./notochord --scan <YOUR COMPUTER'S IP ADDRESS>

Run the notochord with the commands above. On your computer load the testcube.blend file, and hit the [Receive] button. Rotate your sensor around: the virtual K-Ceptor should reflect the movements of the physical one.

After some random rotations, it is advisable to turn it 90° on some axis and hold it there for a while.
Pay attention to any possible drifts of the virtual K-Ceptor from the real position. That would mean that the calibration should be repeated.