FXAS12002

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
2,094件の閲覧回数
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,797件の閲覧回数
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,797件の閲覧回数
aswins
NXP Employee
NXP Employee

Hi Richard,

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

Thanks

Aswin

0 件の賞賛
返信
1,797件の閲覧回数
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,797件の閲覧回数
aswins
NXP Employee
NXP Employee

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

0 件の賞賛
返信
1,797件の閲覧回数
richardpayne
Contributor II

I have posted the email over the weekend.

0 件の賞賛
返信
1,798件の閲覧回数
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,797件の閲覧回数
richardpayne
Contributor II

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

0 件の賞賛
返信