AnsweredAssumed Answered

FXAS21000 Zero-Rate Offset Compensation not working correctly.

Question asked by John Wolfe on Jan 15, 2015
Latest reply on Jan 16, 2015 by John Wolfe

Hello,

               I am seeking help/advice on initializing the FXAS21000 gyro chip.  I am using the FRDMK64 board and the Xtrinsic board. The WHO_AM_I response from this chip is $D1 indicating this is a FXAS21000 chip.

               It seems that only on cold power on does the gyro chip come up with offset compensations that appear somewhat reasonable.   This results in gyro values of -4.0 to +4.0 dps for each axis when later retrieving data via polling (I have interrupts turned off)…although this still seems a little high to me.  I have it configured for +/-1600 range with ODR=200Hz, and the K64 is sampling and retrieving data every 12ms.  I keep the FXAS21000 in Active state at all times when running.

               However, when doing a K64 running reset or FRDM64 reset (push reset button),  the FW will run through the init code for the FXAS21000 chip but the offset compensation does not  appear to work.  I can show this by first purposely moving the device during power up to establish bad offset compensation values. Lets say after I do this that subsequent polling of data shows  X/Y/Z = +50.0/-20.0/2.0 when the device is not moving.  Then keeping device steady (unmoving), when I do a K64 micro reset (press reset button on FRDM board),  after FW initialization and when polling I now get  values of X/Y/Z = -50.0/+20.0/-2.0, plus or minus say 4dps on each.  NOTICE the sign of the values have changed. If I do reset again they signs invert again.

I have tried 3 different algorithms shown below, but they all give me the same results.
It appears that after initialization, when polling I get reasonable values from the device as it is moved…it is just that the offset may not be correct.

Can anyone identify the common problem on these init steps, or suggest what steps I should try instead.  Any help would be greatly appreciated. For example, in Algo 1 it purposely moves the device to Active mod and waits for first data to be acquired because the Spec suggests that ZR_cond should not be set unless there are first samples available??

Thanks in advance.
John Wolfe

Algo #1:

-        Repeatedly read INT_SOURCE_FLAG($0B)  until BOOTEND flag is SET

o   Because if Power on cycle Gyro could be going through boot

-        Write CTRL_REG1($13)=$40 to do Soft Reset (RST=1)

o   Because if only K64 running reset want to force gyro with init values

-        Repeatedly read INT_SOURCE_FLAG($0B)  until  BOOTEND flag is SET

o   Because Soft Reset causes gyro to go through boot

-        Write CTRL_REG0($0D)=$00 for range of +/- 1600 and hi-pass filter disabled

-        Write CTRL_REG1($13)=$02 to move to Active Mode

o   Because FXAS21000 spec says “ZR_cond may be written only after the first sample is available, as it uses the current sample for calibrations.

-        Repeatedly read DR_STATUS until ZDR, YDR, XDR are set (we have valid data)

-        Write CTRL_REG1($13)=$82 to start Offset compensation (ZR_Comp=1)

-        Repeatedly read CTRL_REG1($13) until ZR_Comp=0

 

Algo #2:

-        Write CTRL_REG1($13)=$40 to do Soft Reset (RST=1)

-        Delay a short time

-        Write CTRL_REG0($0D)=$00 for range of +/- 1600 and hi-pass filter disabled

-        Write CTRL_REG1($13)=$82 to force into ACTIVE mode and initiate Zero Compenstation

 

Algo #3: Similar to init algo at “FXAS21000 Bare metal Example project” at  https://community.freescale.com/docs/DOC-100869

-        Repeatedly read INT_SOURCE_FLAG($0B)  until BOOTEND flag is SET

o   Because whole device powered Gyro could be going through boot

-        Write CTRL_REG1($13)=$40 to do Soft Reset (RST=1)

-        Repeatedly read CTRL_REG1 until  RST is CLEARed

-        Write CTRL_REG1($13)=$80 to start Offset compensation (ZR_Comp=1)

-        Repeatedly read CTRL_REG1($13) until ZR_Comp=0

-        Write CTRL_REG0($0D)=$00 for range of +/- 1600 and hi-pass filter disabled

-        Write CTRL_REG1($13)=$02 to put into ACTIVE mode.

Outcomes