Calibration: Difference between revisions

From STorM32-BGC Wiki
Jump to navigation Jump to search
Line 76: Line 76:
The calibration consists of two steps. In a first step, the calibration constants are determined for the particular NT IMU module under consideration. In the second step, the calibration constants are made effective by storing them permanently into the NT IMU module or the STorM32 board.
The calibration consists of two steps. In a first step, the calibration constants are determined for the particular NT IMU module under consideration. In the second step, the calibration constants are made effective by storing them permanently into the NT IMU module or the STorM32 board.


{{COMMENT|Whether the calibration constants are stored into the NT IMU module or the STorM32 board depends on the firmware of the NT IMU module: For NT IMU modules which are running the original firmware, the calibration constants are stored into the NT IMU module itself. Otherwise the calibration constants are stored into the STorM32 controller.}}
{{COMMENT|Whether the calibration constants are stored into the NT IMU module or into the STorM32 board depends on the firmware of the NT IMU module: For NT IMU modules which are running the original firmware, the calibration constants are stored into the NT IMU module itself. Otherwise the calibration constants are stored into the STorM32 controller.}}


{{COMMENT|Having the calibration constants stored into the NT IMU module is very convenient. The NT IMU modules can then be swapped out without having to recalibrate. NT IMU modules which have their calibration constants stored in the STorM32 board need to be recalibrated.}}
{{COMMENT|Having the calibration constants stored into the NT IMU module is very convenient. The NT IMU modules can then be swapped out without having to recalibrate. NT IMU modules which have their calibration constants stored in the STorM32 board need to be recalibrated.}}

Revision as of 01:48, 15 January 2020

descriptions refer to firmware v2.50e and later

The gimbal will work without calibration, but the camera wouldn't be leveled well. For optimal performance the accelerometers within the IMU modules need to be calibrated. Several calibration techniques are existing, and two are implemented in the STorM32 project, namely the "1-point" and "6-point" calibration techniques.

Unfortunately, it is not absolutely clear which of them is the best. The firmware author doesn't have the resources for undertaking the extensive research project which would be needed for clarifying this. However, from the experience so far, this rule of thumb seems to provide good advice:

No calibration is a no go, but a simple 1-point calibration is nearly always sufficient.

Comment: One may wonder why the accelerometers need to be calibrated, but not the gyros. In principle, also the gyros should be calibrated for best performance. However, the calibration techniques are so complicated that a proper calibration of the gyros is beyond our reach.

The STorM32 determines the offsets for the gyros of the IMU modules during startup of the gimbal, and this is by far the best option and should be generally used. However, in some special cases this is impractical and can be avoided by a "gyro calibration".

In the following "calibration" generally refers to the calibration of the accelerometers. Gyro calibration is described in the respective sub chapter.

General

For users of a T-STorM32 gimbal holds:

  • T-STorM32 gimbals don't need or make use of a 2nd IMU, and the comments below related to it are thus irrelevant.
  • All comments as regards the camera IMU do however equally apply to T-STorM32 setups.

Reasons and Goals


It might be helpful to first understand better why a calibration of the accelerometers is done at all.

One obvious reason is of course to account for the inaccuracies of the accelerometers, which are individual to each device. The goal is to get data which correctly reflect the actual accelerations. In the case of the camera IMU this e.g. implies that the camera is indeed level.

However, there are additional important reasons for doing the calibration, and these are in fact different for the camera IMU and the 2nd IMU:

Camera IMU

The accuracy of the calibration of the camera IMU also strongly influences the "horizon tilt", i.e., the accuracy with which the horizon is held in e.g. quick yaw turns. The horizon tilt is minimal then the accelerometer Z axis is parallel to the gimbal Z axis, which can be realized by calibrating the accelerometer well, and by a square gimbal and square mounting of the accelerometer (similar statements hold for the X and Y axes, but the Z axis is most important). Thus, an additional main goal for calibrating the camera IMU is to optimize the "horizon tilt" performance.

The alignment of the axes is more important for this than the numerical accuracy of the calibration. Therefore, a simple 1-point calibration often does an excellent job. Unless undertaken carefully, a nominally more precise 6-point calibration can result in a worse alignment of the axes and hence worse "horizon tilt" behavior.

Comment: Improperly aligned IMU sensor and gimbal axes is only one of the reasons for horizon tilt (which can be minimized by calibration). A second effect, which is of totally different physical origin, and which cannot be overcome by calibration, are accelerations of the gimbal during e.g. high-g maneuvers. In such maneuvers tthe measured accelerations do not coincide with the gravity, and the AHRS loses its horizon, leading to a tilt of the camera. Unfortunately, both effects are easily confused, but should be clearly distinguished.

Second IMU

The measurement accuracy of the 2nd IMU is by itself not really important. For the operation of the STorM32 gimbal controller it is however important that the data of the 2nd IMU are consistent with the data of the camera IMU, since otherwise the internal math would go wrong, which can lead to all sorts of weird problems. Luckily, some tolerance is acceptable, which however depends also on the number of poles of the motors. For motors with 14 poles or less, the calibration of the 2nd IMU doesn't need to be super accurate, and a quick 1-point calibration usually does it. The higher the pole count of the motors, the better the calibration needs to be.

Rules of Thumb


Calibration Accuracy

A 6-point calibration is meaningful only if it is done very accurately. A poorly undertaken 6-point calibration can easily result in poorer performance than a supposedly less accurate 1-point calibration. The resulting quality factor for the 6-point calibration option can give a good indication as to the results (a value of 80 is very good, 150 average, 250 not so good).

A 1-point calibration is meaningful only if it is done for a level IMU module.

Rules of thumb

  • The calibration only needs to be as good as you need it to be. If you are happy with the way your gimbal performs, you don't need to spend time on a (better) calibration.
  • It has been found that the Z axis is usually more wrong than the X and Y axes. IMU orientations with the Z axis pointing up or down thus appear to be preferable. To avoid confusion: Equally good results can be obtained for any orientation; some of the best videos out there were in fact recorded with the IMU's Z axis in a horizontal orientation. The comment just means that with the Z axis pointing up or down it typically requires less effort to obtain a good calibration.
  • The calibration of the camera IMU is more important than that for the 2nd IMU, i.e., for the 2nd IMU a "less accurate" calibration is usually acceptable.
  • The calibration of the 2nd IMU becomes more important as the motor pole count increases (e.g. 14 pole versus 22 pole). Using 22 pole motors, or higher, will definitely need a good calibration of both IMUs.

Recommendations

  • A 1-point calibration is fairly simple, and is hence the minimum for both the camera and the 2nd IMU.
  • When possible choose IMU orientations with the Z axis pointing up or down, but that's not a must as explained before.
  • Don't do a 6-point calibration unless you plan to do it really accurately (check out the rcgroups thread).
  • If motors with 12 or 14 poles are used, a 1-point calibration of the 2nd IMU is most likely sufficient. Higher-pole motors require more careful 2nd IMU calibrations.

Lastly, some advice:

Save your calibration data to a file! 

Ideally save it from within the [GUI:Acc Calibration] dialog window, as this stores the most detailed information. Consider also posting your calibration files in the rcgroups discussion thread, so that the firmware author and others can enhance their knowledge and hopefully develop better calibration schemes.

Calibration Procedure

The calibration consists of two steps. In a first step, the calibration constants are determined for the particular NT IMU module under consideration. In the second step, the calibration constants are made effective by storing them permanently into the NT IMU module or the STorM32 board.

Comment: Whether the calibration constants are stored into the NT IMU module or into the STorM32 board depends on the firmware of the NT IMU module: For NT IMU modules which are running the original firmware, the calibration constants are stored into the NT IMU module itself. Otherwise the calibration constants are stored into the STorM32 controller.

Comment: Having the calibration constants stored into the NT IMU module is very convenient. The NT IMU modules can then be swapped out without having to recalibrate. NT IMU modules which have their calibration constants stored in the STorM32 board need to be recalibrated.

The [GUI:Calibration] tab is the central place for all calibration related tasks. It provides the means to select the IMU which shall be calibrated, to enter calibration values, and to store them. The [Zero] and [Scale] fields holding the calibration constants can be populated in various ways:

  • Values can be edited or entered directly into the text fields.
  • The values can be set to the default values by hitting the [Reset to Default] button.
  • The values currently stored in the NT IMU module/STorM32 board can be read out by hitting the [Read from Board] button.
  • The fields can be populated with calibration values stored in a calibration file via the [Load from File] button.
  • The fields can be set to the values obtained from a 1-point or 6-point calibration via the [Run 1-Point Calibration] and [Run 6-Point Calibration] buttons.

The calibration constants are send to and permanently stored into the NT IMU module/STorM32 board by hitting the [Store Calibration] button.

It is recommended to restart the STorM32 controller after having changed calibration constants (go to the [GUI:Tools] menu and press the [GUI:Restart Controller] option).

The 1-point and 6-point calibration procedures are better explained by videos. The next chapter offers one video, but you can find further ones on the Video Tutorials page.

Tstorm32-gui-acc-calibration.jpg

Tutorial Videos

Rcgroups user mackar made a great videos on how to do a 6-point calibration (see also here and here).

Calibration Tools

bruce356's 3D printed calibration cube: http://www.rcgroups.com/forums/showpost.php?p=29983118&postcount=2346
stl files: http://www.rcgroups.com/forums/showpost.php?p=29983275&postcount=2351

GekoCH's wooden board calibration tool: http://www.rcgroups.com/forums/showpost.php?p=30034517&postcount=2439

larsm's calibration technique: http://www.rcgroups.com/forums/showpost.php?p=29649741&postcount=1897

OlliW's lego calibration tool: http://www.rcgroups.com/forums/showpost.php?p=29646349&postcount=1890

Gyro Calibration

Normally, the offsets of the gyros are determined during startup of the gimbal, few seconds after power up. Therefore, the gimbal has to be kept at rest during this period of time. This is by far the best option available and should be used whenever possible. In some cases this is however impractical, and the following method provides a means to skip the startup gyro calibration. In view of its drawback it is stressed that it really should be considered only in the special cases there it is absolutely unavoidable.

The method consists of storing gyro offsets internally, by means of an explicit gyro calibration, and use them at startup.

The determination of the gyro offsets and their storage into internal memory is possible via the [GUI:Calibration] tab.

The use of these offsets is enabled by setting the parameter Startup Gyro Calibration to “skip”.