FXAS12002

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FXAS12002

跳至解决方案
1,427 次查看
richardpayne
Contributor II

Hi

I also have FXAS12002 code sample from Freescale source for which I studied them including the FIFO transfer the code, offset and gain ,In simple term (which apply all axis)

 

(0) Gyroresult = 0

(1) For each FIFO element, collect 6 byte data and convert to X.Y.Z 16 bit raw data, ie GyroRaw. That freescale method.

(2) Do Offset      GyroRaw = GyroRaw - Offset

(3) Do Gain         Gyro = GyroRaw/Gain  (fixed gain = 16, 32, 64 and 128 which in sync with freescale sample code). 

(4) Sum up          Gyroresult = Gyroresult + Gyro

Repeat above for 32 time,

 

Now I spin the board 360 deg within 1 second peroid, where FIFO buffer capture every 80mSec for 32 time which is 2.56 second period, then an interrupt take place and run above operation. Now I get Gyroresult as conclusion but number does not make sense unless I do the final step (from my calculaton)

 

(5) Gyroresult = Gyroresult/128 in order to get degree angle.

 

I now get close to 360deg angle (done rotation angle), I repeated this with different spin rate during 360 and conclusion is the same. I use stepper motor to do rotation for CW and CCW.

 

The step 5 does this puzzle me.....any thought about this, is there something I missing out?, any input?

 

I could not find any bug or issue so it must be working fine in accordance to Freescale spec and code sample but the code sample does not provide post FIFO operation code (ie data handling). 

标签 (1)
0 项奖励
1 解答
1,130 次查看
aswins
NXP Employee
NXP Employee

Hi Richard,

     I have observed your code and emailed you the correct calculation method. Please let me know if you have any questions

Thanks

Aswin

在原帖中查看解决方案

6 回复数
1,130 次查看
aswins
NXP Employee
NXP Employee

Hi Richard,

      Can you please point me/inbox me the sample code you are using?

Thanks

Aswin

0 项奖励
1,130 次查看
richardpayne
Contributor II

Aswin

I can send you my code for this, can I have your email? I do not wish to put this code into forum.

Where is your inbox?

0 项奖励
1,130 次查看
aswins
NXP Employee
NXP Employee

Please inbox me the code at aswin.sivakumar@nxp.com

0 项奖励
1,130 次查看
richardpayne
Contributor II

I have posted the email over the weekend.

0 项奖励
1,131 次查看
aswins
NXP Employee
NXP Employee

Hi Richard,

     I have observed your code and emailed you the correct calculation method. Please let me know if you have any questions

Thanks

Aswin

1,130 次查看
richardpayne
Contributor II

Thank you for your kind assistance and wish you nice summer vacation.

0 项奖励