Jump to content
I2Cdevlib Forums

Interpertation of FXAS21002 readout (Gyro)


Recommended Posts

Hi

 

I have Gyro device on board attached to stepper motor, doing 360deg spin and capture data (FIFO method). Below is the FIFO results. NB: The 1st row can be ignored since the Gyro is not continous capture mode. 

 

==================================================================Setup

FXAS21002 is same as MPU-6050, hence the setting is 

G_F_SETUP =            0b10100000  // 32 Count and Circular Mode

G_INT_SRC_FLAG = 0b00000100 // Select SRC_FIFO as source interrupt

G_CTRL_REG2,  =    0b11000010 // Enable FIFO interrupt, mapped to INT1 - PTA5, push-pull, active low interrupt
G_CTRL_REG1,  =    0b00011100  // ODR = 12.5Hz, Standby mode
G_CTRL_REG3,  =    0b00001000 // WRAPTOONE=1 for FIFO method.
G_CTRL_REG0   =    0b00000000 // LPF = 256Hz, HPF disabled, HPF cutoff frequency = N/A, Gain = ±2000 || 62.5 (mdps/LSB)
 
Note the gain is Gain = ±2000 || 62.5 (mdps/LSB) and
Sample Rate is 12.5Hz 
which mean it take 2.56 second for FIFO to be populated and trigger interrupts. Each element of FIFO data is 80mSec capture rate within the IC. 

==================================================================Raw Data to Readout

for (i=0; i<32; i++)
{
index = i*6;
FXASFIFOData.FXAS_GRYODataRaw.X = ((INT16) I2CrxBuffer[index+0] << 8 | I2CrxBuffer[index+1]); // 1LSB = 0.0078125deg/Sec
FXASFIFOData.FXAS_GRYODataRaw.Y = ((INT16) I2CrxBuffer[index+2] << 8 | I2CrxBuffer[index+3]);
FXASFIFOData.FXAS_GRYODataRaw.Z = ((INT16) I2CrxBuffer[index+4] << 8 | I2CrxBuffer[index+5]);
FXASFIFOData.FXAS_GRYOData.X = (((INT32)FXASFIFOData.FXAS_GRYODataRaw.X *1000) /128); //mDeg/Sec
FXASFIFOData.FXAS_GRYOData.Y = (((INT32)FXASFIFOData.FXAS_GRYODataRaw.Y *1000) /128);
FXASFIFOData.FXAS_GRYOData.Z = (((INT32)FXASFIFOData.FXAS_GRYODataRaw.Z *1000) /128);
//-------------------------------------------------------Sum it up as part of integration.
FXASData.iGryoData.X += FXASFIFOData.FXAS_GRYOData.X;
FXASData.iGryoData.Y += FXASFIFOData.FXAS_GRYOData.Y;
FXASData.iGryoData.Z += FXASFIFOData.FXAS_GRYOData.Z;
}

==================================================================FIFO Data

---INFO: FXAS (Gryo) Invoking Capture Process

---INFO: Received FXAS: RIT PREV INT:   820078 || RIT AT INT:   840080

---INFO: Interrupt Period =    20002

----------------------------------------------------------------------

---INFO: FIFO No:  0 | X:      531 | Y:      156 | Z:    -453

---INFO: FIFO No:  1 | X:      -54 | Y:     -304 | Z:     -15

---INFO: FIFO No:  2 | X:      -62 | Y:     -296 | Z:      -7

---INFO: FIFO No:  3 | X:      -70 | Y:     -304 | Z:      -7

---INFO: FIFO No:  4 | X:      -85 | Y:     -312 | Z:     -15

---INFO: FIFO No:  5 | X:      -78 | Y:     -304 | Z:      -7

---INFO: FIFO No:  6 | X:    14507 | Y:     -304 | Z:      23

---INFO: FIFO No:  7 | X:    84304 | Y:     -335 | Z:     234

---INFO: FIFO No:  8 | X:    93226 | Y:     -304 | Z:     304

---INFO: FIFO No:  9 | X:    93335 | Y:     -359 | Z:     375

---INFO: FIFO No: 10 | X:    93351 | Y:     -492 | Z:     421

---INFO: FIFO No: 11 | X:    93320 | Y:     -484 | Z:     281

---INFO: FIFO No: 12 | X:    88078 | Y:     -390 | Z:     195

---INFO: FIFO No: 13 | X:    20671 | Y:     -437 | Z:       7

---INFO: FIFO No: 14 | X:      -39 | Y:     -289 | Z:     -15

---INFO: FIFO No: 15 | X:      -78 | Y:     -289 | Z:     -15

---INFO: FIFO No: 16 | X:      -78 | Y:     -304 | Z:     -15

---INFO: FIFO No: 17 | X:      -85 | Y:     -296 | Z:     -15

---INFO: FIFO No: 18 | X:      -93 | Y:     -312 | Z:      -7

---INFO: FIFO No: 19 | X:      -93 | Y:     -304 | Z:      -7

---INFO: FIFO No: 20 | X:      -85 | Y:     -304 | Z:      -7

---INFO: FIFO No: 21 | X:      -85 | Y:     -289 | Z:     -23

---INFO: FIFO No: 22 | X:      -85 | Y:     -296 | Z:     -23

---INFO: FIFO No: 23 | X:      -93 | Y:     -296 | Z:     -15

---INFO: FIFO No: 24 | X:      -78 | Y:     -304 | Z:     -15

---INFO: FIFO No: 25 | X:      -85 | Y:     -304 | Z:      -7

---INFO: FIFO No: 26 | X:     -101 | Y:     -312 | Z:     -15

---INFO: FIFO No: 27 | X:      -93 | Y:     -304 | Z:     -15

---INFO: FIFO No: 28 | X:     -101 | Y:     -304 | Z:     -15

---INFO: FIFO No: 29 | X:      -93 | Y:     -304 | Z:       0

---INFO: FIFO No: 30 | X:      -93 | Y:     -296 | Z:      -7

---INFO: FIFO No: 31 | X:      -85 | Y:     -296 | Z:     -23

----------------------------------------------------------------------

----------------------------------------------------------------------

---INFO: Offset Zero Parameter:         X:        0 | Y:        0 | Z:       0

---INFO: Integrated Results             :  X:   1097 | Y:   9872 | Z:  579431

---INFO: Results is represented as mDeg/2.56Sec, Depending on RIT.

==================================================================Motor

 

For 360 spin, I get 579431 readout (sum of 32 FIFO data).

 

As for Motor: I have stepper Motor (full step), operating 2.5mSec/Step and 200 Step. This transulate to 

 

2.5mSec/Step => 60 / (2.5mSec/Step * 200 Step) = 120 rpm         or 2 rps.

 

=================================================================Query

I trying to figure out what the Gyro really mean in relationship to Motor spin?

 

Should I expect 360deg result?

 

Can anyone offer meaningful interpertation of the results here?

 

 

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...