Post Go back to editing

Unable to calculate gyro and accel angles with ADIS16497 burst data samples.

Hi all,

I wrote a formula as per data sheet:

xgyro_value = ((float)x_gyro*0.25)/2^16;

xgyro_value = ((float)x_gyro*0.25)/2^15;

x_gyro is 32 bit value from adis burst data as shown in figure.....

kindly help me regarding this....

Thank you


Parents Reply Children
  • Dear Kshekar264,

    Ok. The angular rate of rotation is more straightforward.

    The first step is to determine the correct value of Kg, which you indicate is 0.25 deg/sec/LSB.

    First, you must determine if you have a positive or negative value of X-gyro. Do this by:

    SIGN_X_GYRO=AND(X_gyro, 0x80000000);  // will be "1" if negative

    if(SIGN_X_GYRO) {

           ABS_X_GYRO=AND(XOR(x_gyro)+1),0x7FFFFFFF); // computes 2's comp absolute value if neg 


    else {



    X_GYRO_RATE= kg*x_gyro;

    Note that I didn't include any type casting, nor did I decide how to handle the negative sign, but in principle, the gyro already has the angular rate, so you don't need to divide by 2^16 or 2^31.

    Now, in order to calculate angle, you must first either read the DC value of the accelerometers, or just decide that the angle =0 deg when you start integrating the angular rate in order to get compute the angle from the angular rate.

    -Paul Kern