Main components MEMS motion sensor: low power high g 3-axis digital accelerometer inemo inertial module: 3D accelerometer and 3D gyroscope

Similar documents
This design tip applies to all accelerometers, ecompass modules, and inemo inertial IMUs from STMicroelectronics.

Computing tilt measurement and tilt-compensated e-compass

This design tip applies to all accelerometers, ecompass modules, and inemo inertial IMUs from STMicroelectronics.

Exploiting the gyroscope to update tilt measure and e-compass. Main components. inemo inertial module: 3D accelerometer and 3D

Getting started with MotionPM real-time pedometer library in X CUBE-MEMS1 expansion for STM32Cube

Getting started with osxmotiongc gyroscope calibration library for X-CUBE-MEMS1 expansion for STM32Cube

Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube

DT0095 Design tip. Datalogging the SensorTile through a PC. Purpose and benefits. Description

Getting started with osxmotionmc magnetometer calibration library for X-CUBE-MEMS1 expansion for STM32Cube

UM2216 User manual. Getting started with MotionFA fitness activity library in X CUBE MEMS1 expansion for STM32Cube. Introduction

Running a simple 6LowPAN network consisting of one receiver node and one or more sensor nodes in a Sub-1GHz RF band

IoT node with BLE connectivity, digital microphone, environmental and motion sensors, motion and audio middleware libraries.

Getting started with MotionPM real-time pedometer library in X-CUBE-MEMS1 expansion for STM32Cube

UM2350. Getting started with MotionPW real-time pedometer for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

UM2194. Getting started with MotionAW activity recognition for wrist library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

UM2192. Getting started with MotionMC magnetometer calibration library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

UM2276. Getting started with MotionSD standing vs sitting desk detection library in X-CUBE-MEMS1 expansion for STM32Cube. User manual.

Bluetooth low energy profiles for the X-CUBE-BLE1 expansion for STM32Cube. Description

Getting started with MotionAR activity recognition library in X-CUBE-MEMS1 expansion for STM32Cube

Getting started with MotionAR activity recognition library in X-CUBE-MEMS1 expansion for STM32Cube

X-NUCLEO-53L0A1. Ranging and gesture detection sensor expansion board based on VL53L0X for STM32 Nucleo. Description. Features

DT0063 Design tip. Bluetooth Low Energy network: time-stamping and sample-rate-conversion. Purpose and benefits. BLE wireless link overview

Getting started with the FP-SNS-ALLMEMS1 Bluetooth low energy and sensors software expansion for STM32Cube

STEVAL-STLKT01V1. SensorTile development kit. Description. Features

X-NUCLEO-53L1A1. Long distance ranging Time-of-Flight sensor expansion board based on VL53L1X for STM32 Nucleo. Description.

STSW-BLUENRG1-DK. BlueNRG-1, BlueNRG-2 DK SW package

32L476GDISCOVERY. Discovery kit with STM32L476VG MCU. Features. Description

STEVAL-STLKT01V1. SensorTile development kit. Description. Features

Main components MEMS digital output motion sensor: high-performance ultra-low-power 3-axis "femto" accelerometer

ST Payment Secure Solution Java Card platform with up to 100 Kbytes of user NVM for AMEX payment applications

UM2220. Getting started with MotionFX sensor fusion library in X-CUBE-MEMS1 expansion for STM32Cube. User manual. Introduction

How to configure the BlueNRG-1 and BlueNRG-2 devices in network coprocessor mode. Main components Bluetooth Low Energy wireless system-on-chip

Dynamic Electro-Thermal simulator for VIPower products. Description

STSW-BNRG-Mesh. Mesh over Bluetooth low energy. Features. Description. Applications

STSW-BNRGUI. BlueNRG GUI SW package. Data brief. Features. Description

Description. January 2019 DB2381 Rev 3 1/5

Motor control power board based on the SLLIMM-nano 2 nd series

Getting started with STEVAL-IDB007V1 and STEVAL-IDB008V1 evaluation boards

P-NUCLEO-IKA02A1. STM32 Nucleo pack: electrochemical toxic gas sensor expansion board with CO sensor. Description. Features

Getting started with the FP-NET-6LPBLE1 function pack for 6LoWPAN IoT node connection to a smartphone via BLE interface

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery. Features. Description

NUCLEO-L433RC-P NUCLEO-L452RE-P

STSW-STWBCFWDT. STWBC firmware downloader tool. Description. Features

Getting started with the X-CUBE-IKA02A1 multifunctional software expansion for STM32Cube

UM2167 User manual. OrCAD PSpice model usage instructions

Description. July 2016 DocID Rev 2 1/6

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on STUSB1602. Description

LIS25BA: low-noise, high-bandwidth 3-axis digital output accelerometer with TDM interface

STEVAL-IPMnM2N. Motor control power board based on the SLLIMM-nano 2 nd series. Description. Features. RoHS compliant

STEVAL-BCNKT01V1. BlueCoin Starter kit. Features. Description

How to upgrade the firmware on the STEVAL-USBC2DP USB Type-C to DisplayPort adapter

USB Type-C and Power Delivery Nucleo pack with NUCLEO-F072RB expansion board based on the STUSB1602

Getting started with the digital MEMS microphone expansion board based on MP34DT01-M for STM32 Nucleo

EVALKITSTKNX. Miniature transceiver STKNX evaluation and development kit. Features

Using the GPIOs and interrupt controller to drive LEDs on STM8 Nucleo-64 boards

P-NUCLEO-USB001. STM32 Nucleo pack for USB Type-C and Power Delivery Data brief. Features. Description

STEVAL-STLKT01V1. SensorTile development kit. Description. Features

Getting started with X-NUCLEO-53L1A1 long distance ranging ToF sensor expansion board based on VL53L1X for STM32 Nucleo

Getting started with X-CUBE-LED channel LED driver software expansion based on LED1642GW for STM32Cube

UM2361. Getting started with the ST BlueNRG-Mesh ios application. User manual. Introduction

L9958 Evaluation board for high current (8.6A) DC and Stepper Motors. Description

ASM330LHH. Automotive 6-axis inertial module: 3D accelerometer and 3D gyroscope. Data brief. Features. Applications. Description

NUCLEO-L496ZG. STM32 Nucleo-144 board. Features. Description

Getting started with the X-CUBE-MEMS1 motion MEMS and environmental sensor software expansion for STM32Cube

ST Payment Secure Solution - Java Card platform with up to 90 Kbytes of user NVM for Visa, MasterCard, AMEX, Discover and Interac applications

TN1235 Technical note

RN0084 Release note. ST-LINK/V2 firmware upgrade. About this release note

STM32H7x3I-EVAL. Evaluation board with STM32H7x3XI MCUs. Data brief. Features

P-NUCLEO-53L1A1. VL53L1X nucleo pack with X-NUCLEO-53L1A1 expansion board and STM32F401RE nucleo board. Description. Features

300 ma triple DC-DC converter for powering AMOLED displays. Description. Table 1: Device summary Negative voltage. Auxiliary positive voltage

Getting started with the FP-IND-PLCWIFI1 function pack for PLC management via Wi-Fi

P-NUCLEO-53L0A1. VL53L0X Nucleo pack with ranging, gesture detection sensor expansion board and STM32F401RE. Description. Features

AN4624 Application note

X-NUCLEO-53L0A1 ranging and gesture detection sensor expansion board based on VL53L0X for STM32 Nucleo

Wi-Fi expansion board based on SPWF01SA module for STM32 Nucleo. Description

Getting started with the ultra-low-power STM32 and LoRa Nucleo pack

Getting started with FP-SNS-6LPNODE1 software for IoT sensor node connection to 6LoWPAN networks using sub-1ghz RF

Getting started with the high power stepper motor driver expansion board based on powerstep01 for STM32 Nucleo

UM2051 User manual. Getting started with the STM32 Nucleo pack for USB Type-C and Power Delivery. Introduction

UM2084 User manual. Getting started with the ultra-low-power STM32 and LoRa Nucleo pack. Introduction

P-NUCLEO-6180X2. Proximity, gesture, ambient light sensor expansion board based on VL6180X for STM32L053R8. Description. Features

ST25DV-DISCOVERY. Discovery kit for the ST25DV04K dynamic NFC/RFID tag. Features

EVLKSTCOMET10-1. STCOMET smart meter system-on-chip development kit. Features

AN4782 Application note

AN4491 Application note

BNO055 USB Stick user guide

UM1844 User manual. EVAL-L9958 Graphical user interface (GUI) Introduction

Sub-1 GHz RF expansion board based on the SPSGRF-868 module for STM32 Nucleo. Description

EVAL6494L. Demonstration board for L6494L gate driver. Description. Features

STEVAL-CCM002V1. TFT-LCD panel demonstration board based on the STM32 as LCD controller. Features. Description

AN4045 Application note

32F412GDISCOVERY. Discovery kit with STM32F412ZG MCU. Features. Description

STM32L4R9I-EVAL. Evaluation board with STM32L4R9AI MCU. Features

AN2667 Application note

Power line communication expansion board based on ST7580 for STM32 Nucleo. Description

AN2676 Application note

X-NUCLEO-NFC04A1. Dynamic NFC/RFID tag IC expansion board based on ST25DV04K for STM32 Nucleo. Description. Features

AN4113 Application note

UM2495. High performance HF reader / NFC initiator IC software expansion for NUCLEO-8S208RB. User manual. Introduction

32F469IDISCOVERY. Discovery kit with STM32F469NI MCU. Features. Description

Transcription:

DT0053 Design tip 6-point tumble sensor calibration By Andrea Vitali H3LIS331DL LSM6DS3 Main components MEMS motion sensor: low power high g 3-axis digital accelerometer inemo inertial module: 3D accelerometer and 3D gyroscope Purpose and benefits This design tip explains how to compute offsets, gains, and cross-axis gains for a 3-axis sensor (usually an accelerometer) by performing a 6-point tumble calibration. A generalization of the algorithm is also described. Benefits: Added functionality with respect to calibration provided by the osxmotionfx library which only provides Magnetometer and Gyroscope calibration and not Accelerometer calibration. Short and essential implementation, which enables easy customization and enhancement by the end-user (osxmotionfx is available only in binary format, not as source code) Easy to use on every microcontroller (osxmotionfx can only be run on STM32 and only when the proper license has been issued by Open.MEMS license server). Specification Algorithm specification: Input from 3-axis sensor: [x,y,z] data triplets for each position (minimum 4, usually 6, N using the generalized algorithm) Output: offsets for each axis (Xofs, Yofs, Zofs), gains for each axis (Xgain, Ygain, Zgain) and cross-gains (YtoX, ZtoX, XtoY, ZtoY, XtoZ, YtoZ) December 2015 DT0053 Rev 1 1/6

Algorithm description The algorithm is described for the particular case of an accelerometer. However, it can also be used with other sensors, e.g. a magnetometer. See notes at the end of this document. How true acceleration is related to measured acceleration: AccX Xgain YtoX ZtoX trueaccx Xofs [ AccY] = [ XtoY Ygain ZtoY ] [ trueaccy] + [ Yofs]. AccZ XtoZ YtoZ Zgain trueaccz Zofs True [x,y,z] acceleration for each position in a 6-point tumble calibration (see figure 1): 1. Gravity vector along +X axis: trueacc = [+1, 0, 0] 2. Gravity vector along -X axis: trueacc = [ -1, 0, 0] 3. Gravity vector along +Y axis: trueacc = [ 0, +1, 0] 4. Gravity vector along -Y axis: trueacc = [ 0, -1, 0 ] 5. Gravity vector along +Z axis: trueacc = [ 0, 0, +1] 6. Gravity vector along -Z axis: trueacc = [ 0, 0, -1] Figure 1. Reference for sensor orientation while performing 6-point tumble calibration. December 2015 DT0053 Rev 1 2/6

Measured acceleration for each position in a 6-point tumble calibration, derived from the equation shown at the beginning, by plugging-in the values listed above for true acceleration: 1. AccX1 = Xgain+Xofs, AccY1 = XtoY+Yofs, AccZ1 = XtoZ+Zofs 2. AccX2 = -Xgain+Xofs, AccY2 = -XtoY+Yofs, AccZ2 = -XtoZ+Zofs 3. AccX3 = YtoX+Xofs, AccY3 = Ygain+Yofs, AccZ3 = YtoZ+Zofs 4. AccX4 = -YtoX+Xofs, AccY4 = -Ygain+Yofs, AccZ4 = -YtoZ+Zofs 5. AccX5 = ZtoX+Xofs, AccY5 = ZtoY+Yofs, AccZ5 = Zgain+Zofs 6. AccX6 = -ZtoX+Xofs, AccY6 = -ZtoY+Yofs, AccZ6 = -Zgain+Zofs Offsets can be computed in several ways by summing two out of six measures listed above, carefully chosen so that gains and cross-gains cancel out: AccX1+AccX2 = 2 Xofs, AccX3+AccX4 = 2 Xofs, AccX5+AccX6 = 2 Xofs AccY1+AccY2 = 2 Yofs, AccY3+AccY4 = 2 Yofs, AccY5+AccY6 = 2 Yofs AccZ1+AccZ2 = 2 Zofs, AccZ3+AccZ4 = 2 Zofs, AccZ5+AccZ6 = 2 Zofs Depending on available measures, more than one estimate may be available for each offset. In this case, averaging can be used to improve the quality of the final estimate. Once offsets are computed, gains and cross-axis gains can be computed as follows; again averaging can be used if more than one estimate is available: Xgain = AccX1-Xofs, Xgain = -AccX2+Xofs XtoY = AccY1-Yofs, XtoY = -AccY2+Yofs XtoZ = AccZ2-Zofs, XtoZ = -AccZ2+Zofs YtoX = AccX3-Xofs, YtoX = -AccX4+Xofs Ygain = AccY3-Yofs, Ygain = -AccY4+Yofs YtoZ = AccZ3-Zofs, YtoZ = -AccZ4+Zofs ZtoX = AccX5-Xofs, ZtoX = -AccX6+Xofs ZtoY = AccY5-Yofs, ZtoY = -AccY6+Yofs Zgain = AccZ5-Zofs, Zgain = -AccZ6+Zofs Now offsets can be subtracted, and multiplication by the inverse matrix can be done to go from measured acceleration to true acceleration. December 2015 DT0053 Rev 1 3/6

Algorithm generalization A more general approach can be used: measures are taken in any number of positions (N) and combined to find the unknowns (offsets, gains and cross-axis gains). For each position, there is the need to know the true acceleration together with the measure taken by the sensor. It is convenient to combine all the unknowns in one matrix: AccX Xgain YtoX ZtoX [ AccY] = [ XtoY Ygain ZtoY AccZ XtoZ YtoZ Zgain trueaccx Xofs Yofs] [ trueaccy ] Zofs trueaccz 1 Then all acceleration triplets and corresponding true reference acceleration triplets are stacked up to form N-lines matrixes [rows x N-lines]: Acc[3xN] = Unknowns[3x4] trueacc[4xn] Now, the least-square error approximation can be computed for the unknowns, by using the pseudo-inverse of the non-square matrix trueacc[]. First, both sides are multiplied by the transpose trueacc T []. Second, both sides are multiplied by the inverse of the 4x4 matrix. Acc[3xN] trueacc T [Nx4] = Unknowns[3x4] trueacc[4xn] trueacc T [Nx4] Acc[3xN] trueacc T [Nx4] inv(trueacc[4xn] trueacc T [Nx4]) = Unknowns[3x4] Notes Hints for a compact real-time implementation on a microcontroller: Only the product Acc[3xN] trueacc T [Nx4] needs to be maintained in memory, this is a 3x4 matrix made of 12 numbers. Only the product trueacc[4xn] trueacc T [Nx4] needs to be maintained in memory, this is a 4x4 matrix made of 16 numbers. Gaussian elimination can be implemented to compute the inverse of the aforementioned 4x4 matrix when enough triplets have been collected. Application to other sensors: While it may be easy to exploit the known gravity vector to impose the wanted true reference on the accelerometer, it may not be possible to achieve perfect accuracy when switching from one position to another during the 6-point tumble calibration An alternative way to perform the calibration is to use a gold reference sensor which has the same orientation of the sensor to be calibrated, so that the wanted true reference can be measured and fed to the generalized algorithm. December 2015 DT0053 Rev 1 4/6

Special equipment, arrangement or procedure may be needed to impose or measure the wanted true reference on other sensors such as magnetometers or gyroscopes For the case of the magnetometer: Helmholtz coils can be used to impose the wanted true reference; alternatively the earth magnetic field vector can be used together with a gold reference sensor. For the case of the gyroscope: a single axis turn table or a step motor spin table can be used to impose the wanted true reference; alternatively a gold reference sensor can be used as described above. Other algorithms: sphere-fitting can be used to estimate offsets based on a set of triplets from the sensor, ellipsoid-fitting can be used to estimate offsets and gains, and rotated ellipsoid fitting can be used to estimate offsets, gains and cross-axis gains (in this latter case, cross-axis gains are usually symmetrical: XtoY = YtoX, XtoZ = ZtoX, YtoZ = ZtoY). See relevant document. December 2015 DT0053 Rev 1 5/6

Support material Related design support material BlueMicrosystem1, Bluetooth low energy and sensors software expansion for STM32Cube Open.MEMS, MotionFX, Real-time motion-sensor data fusion software expansion for STM32Cube Documentation Application note, AN4508, Parameters and calibration of a low-g 3-axis accelerometer Application note, AN4615, Fusion and compass calibration APIs for the STM32 Nucleo with the X-NUCLEO-IKS01A1 sensors expansion board Revision history Date Version Changes 25-Nov-2015 1 Initial release IMPORTANT NOTICE PLEASE READ CAREFULLY STMicroelectronics NV and its subsidiaries ( ST ) reserve the right to make changes, corrections, enhancements, modifications, and improvements to ST products and/or to this document at any time without notice. Purchasers should obtain the latest relevant information on ST products before placing orders. ST products are sold pursuant to ST s terms and conditions of sale in place at the time of order acknowledgement. Purchasers are solely responsible for the choice, selection, and use of ST products and ST assumes no liability for application assistance or the design of Purchasers products. No license, express or implied, to any intellectual property right is granted by ST herein. Resale of ST products with provisions different from the information set forth herein shall void any warranty granted by ST f or such product. ST and the ST logo are trademarks of ST. All other product or service names are the property of their respective owners. Information in this document supersedes and replaces information previously supplied in any prior versions of this document. 2015 STMicroelectronics All rights reserved December 2015 DT0053 Rev 1 6/6