Tilt correction matrix in accelerometer calibration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Tilt correction matrix in accelerometer calibration

5,343 Views
j_perezdelarray
Contributor III

Hello,

The tilt correction matrix is a rotation matrix to align the pitch and roll angles to the perpendicular plane of gravity so it can be considered as a change of basis or alignment matrix if, for example, the sensor frame is not aligned with the body frame.

I haven't been able to find in the sensor fusion documentation "when" and "where" in the filter this rotation matrix is computed. Does anybody have the answer?

thank you,

Labels (1)
0 Kudos
5 Replies

4,785 Views
shubhadippaul-b
NXP Employee
NXP Employee

Hi,

Please refer to Chapter 3 of Application Note AN4246 available @NXP - Calibrating an eCompass.

The NXP SF Algorithm is based on the method described in the document.

0 Kudos

4,785 Views
j_perezdelarray
Contributor III

Hi Paul,

Thanks for your reply. I'm referring to the tilt compensation matrix in the calibration tab. It's not related to the compass

0 Kudos

4,785 Views
shubhadippaul-b
NXP Employee
NXP Employee

Hi,

Can you please elaborate and send a snapshot of the Calibration Tab you are referring to?
In NXP SF GUI, the calibration Tab only has options to write and erase calibration parameters to and from FLASH.

I hope your have already referred to Chapter 4 of Application Note AN4248 available @ NXP - Implementing a Tilt-Compensated. Though the documents talk about eCompass (Accelerometer + Magmetometer), you may find the equations for Accelerometer useful.

Now if you are simply looking for mounting offset correction - correction of offsets due to Plane of Sensor not being aligned to gravitational plane, please refer to AN4399 available @ NXP - High-Precision Calibration of a Three-Axis Accelerometer. This offset is corrected in the Accelerometer counts output before using it for SF Algorithms.

0 Kudos

4,785 Views
j_perezdelarray
Contributor III

I'm referring to the "0 flat" button in the "Precision Accelerometer" tab. The funtion of this button is described in section 4 of document AN5021 (Accelrometer tilt orientation matrix). When pressing this button, a tilt correction matrix is stored in memory and applied to orientation data. I would like to know when is this tilt correction matrix applied in the filter.

thank you,

Captura.JPG

0 Kudos

4,785 Views
shubhadippaul-b
NXP Employee
NXP Employee

Hi,

Precision Accelerometer Calibration compensates for mounting offsets - correction of offsets due to Plane of Sensor not being aligned to gravitational plane, for details you may refer to chapter 7 in AN4399 available @ NXP - High-Precision Calibration of a Three-Axis Accelerometer. 

In the SF Application, the sequence of steps involved to apply Precision Accelerometer Calibration to Accelerometer Measurements is as follows:

  • First, using the Precision Accelerometer tab, 12 point accelerometer data measurements can be carried out and used to compute Calibration parameters.
  • Then, using options form Menu item Calibration, the computed calibration parameters can be written to the MCU board Flash.
  • Subsequently, from the next board reset, the written parameters are read and used by the SF Application.
  • The Calibration parameters are applied to every new accelerometer measurements after it is acquired. This is done inside the processAccelData() function in sensor_fusion.c file in the SF code.
  • The resulting measurement is then used in all Filter Algorithms by the SF Application.
0 Kudos
%3CLINGO-SUB%20id%3D%22lingo-sub-753899%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ETilt%20correction%20matrix%20in%20accelerometer%20calibration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-753899%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EThe%20tilt%20correction%20matrix%20is%20a%20rotation%20matrix%20to%20align%20the%20pitch%20and%20roll%20angles%20to%20the%20perpendicular%20plane%20of%20gravity%20so%20it%20can%20be%20considered%20as%20a%20change%20of%20basis%20or%20alignment%20matrix%20if%2C%20for%20example%2C%20the%20sensor%20frame%20is%20not%20aligned%20with%20the%20body%20frame.%3C%2FP%3E%3CP%3EI%20haven't%20been%20able%20to%20find%20in%20the%20sensor%20fusion%20documentation%20%22when%22%20and%20%22where%22%20in%20the%20filter%20this%20rotation%20matrix%20is%26nbsp%3Bcomputed.%20Does%20anybody%20have%20the%20answer%3F%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Ethank%20you%2C%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-753899%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ESensorFusion%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-753904%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Tilt%20correction%20matrix%20in%20accelerometer%20calibration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-753904%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%233d3d3d%3B%20font-family%3A%20Helvetica%20Neue%2CHelvetica%2CArial%2CLucida%20Grande%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3EPrecision%20Accelerometer%20Calibration%20compensates%20for%20%3CSPAN%20style%3D%22background-color%3A%20transparent%3B%20border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20color%3A%20%2351626f%3B%20display%3A%20inline%3B%20float%3A%20none%3B%20font-family%3A%20%26quot%3B%20helvetica%20neue%26quot%3B%2Chelvetica%2Carial%2C%26quot%3Blucida%20grande%26quot%3B%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20vertical-align%3A%20baseline%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20padding%3A%200px%3B%20margin%3A%200px%3B%20border%3A%200px%20none%20%2351626f%3B%22%3Emounting%20offsets%20-%20correction%20of%20offsets%20due%20to%20Plane%20of%20Sensor%20not%20being%20aligned%20to%20gravitational%20plane%2C%20for%20details%20you%20may%20refer%20to%20%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20Helvetica%20Neue%2CHelvetica%2CArial%2CLucida%20Grande%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3Echapter%207%20in%3C%2FSPAN%3E%20AN4399%20available%20%40%26nbsp%3B%3CA%20data-content-finding%3D%22Community%22%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fexternal-link.jspa%3Furl%3Dhttps%253A%252F%252Fwww.nxp.com%252Fdocs%252Fen%252Fapplication-note%252FAN3397.pdf%22%20style%3D%22background-attachment%3A%20scroll%3B%20background-clip%3A%20border-box%3B%20background-color%3A%20transparent%3B%20background-image%3A%20none%3B%20background-origin%3A%20padding-box%3B%20background-position-x%3A%200%25%3B%20background-position-y%3A%200%25%3B%20background-repeat%3A%20repeat%3B%20background-size%3A%20auto%3B%20border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20color%3A%20%235e89c1%3B%20display%3A%20inline%3B%20fill%3A%20%235e89c1%3B%20font-family%3A%20%26quot%3B%20helvetica%20neue%26quot%3B%2Chelvetica%2Carial%2C%26quot%3Blucida%20grande%26quot%3B%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-weight%3A%20400%3B%20height%3A%20auto%3B%20text-decoration%3A%20none%3B%20transition-delay%3A%200s%3B%20transition-duration%3A%200.1s%3B%20transition-property%3A%20color%3B%20transition-timing-function%3A%20cubic-bezier(0%2C%200%2C%201%2C%201)%3B%20vertical-align%3A%20baseline%3B%20width%3A%20auto%3B%20padding%3A%200px%20calc(0.35ex%20%2B%2012px)%200px%200px%3B%20margin%3A%200px%3B%20border%3A%200px%20none%20%235e89c1%3B%22%20target%3D%22_blank%22%3ENXP%20-%20High-Precision%20Calibration%20of%20a%20Three-Axis%20Accelerometer.%26nbsp%3B%3C%2FA%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EIn%20the%20SF%20Application%2C%20the%20sequence%20of%20steps%20involved%20to%20apply%20Precision%20Accelerometer%20Calibration%20to%20Accelerometer%20Measurements%20is%20as%20follows%3A%3C%2FP%3E%3CUL%3E%3CLI%3EFirst%2C%20using%20the%20Precision%20Accelerometer%20tab%2C%2012%20point%20%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%233d3d3d%3B%20font-family%3A%20Helvetica%20Neue%2CHelvetica%2CArial%2CLucida%20Grande%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3Eaccelerometer%20data%20%3C%2FSPAN%3Emeasurements%20can%20be%20carried%20out%20and%20used%20to%20compute%20Calibration%20parameters.%3C%2FLI%3E%3CLI%3EThen%2C%20using%20options%20form%20Menu%20item%20Calibration%2C%20the%20computed%20calibration%20parameters%20can%20be%20written%20to%20the%20MCU%20board%20Flash.%3C%2FLI%3E%3CLI%3ESubsequently%2C%20from%20the%20next%20board%20reset%2C%20the%20written%20parameters%20are%20read%20and%20used%20by%20the%20SF%20Application.%3C%2FLI%3E%3CLI%3EThe%20Calibration%20parameters%20are%20applied%20to%20%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%233d3d3d%3B%20font-family%3A%20Helvetica%20Neue%2CHelvetica%2CArial%2CLucida%20Grande%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20word-wrap%3A%20break-word%3B%22%3Eevery%20new%20%3C%2FSPAN%3Eaccelerometer%20measurements%20after%20it%20is%20acquired.%20This%20is%20done%20inside%20the%20processAccelData()%20function%20in%20sensor_fusion.c%20file%20in%20the%20SF%20code.%3C%2FLI%3E%3CLI%3EThe%20resulting%20measurement%20is%20then%20used%20in%20all%20Filter%20Algorithms%20by%20the%20SF%20Application.%3C%2FLI%3E%3C%2FUL%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-753903%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Tilt%20correction%20matrix%20in%20accelerometer%20calibration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-753903%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI'm%20referring%20to%20the%20%220%20flat%22%20button%20in%20the%20%22Precision%20Accelerometer%22%20tab.%20The%20funtion%20of%20this%20button%26nbsp%3Bis%20described%20in%20section%204%20of%20document%20AN5021%20(Accelrometer%20tilt%20orientation%20matrix).%20When%20pressing%20this%20button%2C%20a%20tilt%20correction%20matrix%20is%20stored%20in%20memory%20and%20applied%20to%20orientation%20data.%20I%20would%20like%20to%20know%20when%20is%20this%20tilt%20correction%20matrix%20applied%20in%20the%20filter.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3Ethank%20you%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Captura.JPG%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Captura.JPG%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F21259i9E265E9A4AE28977%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Captura.JPG%22%20alt%3D%22Captura.JPG%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-753902%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Tilt%20correction%20matrix%20in%20accelerometer%20calibration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-753902%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3ECan%20you%20please%20elaborate%20and%20send%20a%20snapshot%20of%20the%20Calibration%20Tab%20you%20are%20referring%20to%3F%3CBR%20%2F%3EIn%20NXP%20SF%20GUI%2C%20the%20calibration%20Tab%20only%20has%20options%20to%20write%20and%20erase%20calibration%20parameters%20to%20and%20from%20FLASH.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EI%20hope%20your%20have%20already%20referred%20to%20%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20'Helvetica%20Neue'%2CHelvetica%2CArial%2C'Lucida%20Grande'%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EChapter%204%20of%20Application%20Note%20AN4248%20available%20%40%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcache.freescale.com%2Ffiles%2Fsensors%2Fdoc%2Fapp_note%2FAN4248.pdf%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ENXP%20-%20Implementing%20a%20Tilt-Compensated.%3CSPAN%20style%3D%22color%3A%20%23001000%3B%22%3E%20%3C%2FSPAN%3E%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20'Helvetica%20Neue'%2CHelvetica%2CArial%2C'Lucida%20Grande'%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EThough%20the%20documents%20talk%20about%20eCompass%20(Accelerometer%20%2B%20Magmetometer)%2C%20you%20may%20find%20the%20equations%20for%20Accelerometer%20useful.%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20'Helvetica%20Neue'%2CHelvetica%2CArial%2C'Lucida%20Grande'%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3ENow%20if%20you%20are%20simply%20looking%20for%20mounting%20offset%20correction%20-%20correction%20of%20offsets%20due%20to%20Plane%20of%20Sensor%20not%20being%20aligned%20to%20gravitational%20plane%2C%20please%20refer%20to%20AN4399%20available%20%40%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN3397.pdf%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ENXP%20-%20High-Precision%20Calibration%20of%20a%20Three-Axis%20Accelerometer%3C%2FA%3E.%20%3C%2FSPAN%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20transparent%3B%20color%3A%20%2351626f%3B%20font-family%3A%20'Helvetica%20Neue'%2CHelvetica%2CArial%2C'Lucida%20Grande'%2Csans-serif%3B%20font-size%3A%2015px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20400%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EThis%20offset%20is%20corrected%20in%20the%20Accelerometer%20counts%20output%20before%20using%20it%20for%20SF%20Algorithms.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-753901%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Tilt%20correction%20matrix%20in%20accelerometer%20calibration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-753901%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20Paul%2C%3C%2FP%3E%3CP%3EThanks%20for%20your%20reply.%20I'm%20referring%20to%20the%20tilt%20compensation%20matrix%20in%20the%20calibration%20tab.%20It's%20not%20related%20to%20the%20compass%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-753900%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Tilt%20correction%20matrix%20in%20accelerometer%20calibration%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-753900%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3EPlease%20refer%20to%20Chapter%203%20of%20Application%20Note%20AN4246%20available%20%40%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN4246.pdf%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ENXP%20-%20Calibrating%20an%20eCompass%3C%2FA%3E.%3C%2FP%3E%3CP%3EThe%20NXP%20SF%20Algorithm%20is%20based%20on%20the%20method%20described%20in%20the%20document.%3C%2FP%3E%3C%2FLINGO-BODY%3E