SparkFun Forums 

Where electronics enthusiasts find answers.

Have a good idea for a new product for SFE or Olimex? Let us know!
By ravindersingh1986
#87277
Hi

I am using IDG500 breakout board and have applied 10 bit ADC using Arduino Pro Mini 3.3V 8HhZ (Atmega 328).

I am finding the ZRO by averaging the data for first 2 seconds. and then using the following formula :

rate = (RawADCval - ZRO)*3.3/1024/Senstivity;

(I am using the Gyro in 500 deg/sec 2mV/deg/sec mode)

Then I applied simple integrator
Theta(i) = Theta(i-1) + rate(i)*dt;
where dt is the delay in the loop() function in Arduino code.
( i have also used 4th order Runge kutta)

The first issue I face is that the angle turn I finally get is scaled down by three, i.e. when I rotate the gyro by 90 degree I get the theta as 30 deg and when I rotate the gyro by 180 deg I get 90 as my theta.

Second issue I face is the temperature dependence of ZRO and the temperature Drift.


Please help me to correct the temperature problem. This effect is heavily affecting my project.
By monstrum
#87290
About the temperature problem. If you measure the average zero-value at several temperatures you could implement a simple linear model such as
rate = (RawADCval - ZRO + (Temp - TempAmbient)*TempGain)*3.3/1024/Senstivity

About the first problem. I can't see anything wrong. Are you sure about the gyro sensitivity? Also, have you double checked the dt-value so that it reflects the correct time difference in seconds? A final thought, could you perhaps be using a Vref for the ADC other than 3.3V?
By ravindersingh1986
#87305
I have just now collected the data for 1 hr for ZRO
For x axis zro I got this eqn

Xzro_adc = 1.038*Temp_adc + 8.976

( this is eqn between the raw adc value)

Well I dont face much issue in the scaling of the final data.

My main problem is the temperature compensation.

Regarding Vref I have not connected that pin. I am only using the GND, VIN, XOUT and PTAT pins

Please help me in this matter -> Temperature Compensation
By monstrum
#87308
About Vref, I meant the voltage reference on the ADC. What microcontroller are you using? Maybe the Vref is not 3.3V?

About the temperature compensation. I'm not really sure what you mean. If you have the equation, then it's just a matter of programming.
By ravindersingh1986
#87310
I am using Arduino Pro Mini (3.3V 8Mhz, Atmega 328)

and by temperature compensation I mean to minimise the Thermal Drift

[/img]
By monstrum
#87321
The internal bandgap voltage reference on the mega328 is 1.1V, if you're using this (and not 3.3V) the rate would appear to be three time higher.

About the temperature problem. You need to know how the temperature affects the rate of the gyro. If you can't get this from the datasheet, you'll have to measure it. The easiest way I can think of is to put the gyro on a rotating wheel (with a known rotation speed) and measure the rate output at different temperatures.
By pizzachan
#102526
monstrum wrote:The internal bandgap voltage reference on the mega328 is 1.1V, if you're using this (and not 3.3V) the rate would appear to be three time higher.

About the temperature problem. You need to know how the temperature affects the rate of the gyro. If you can't get this from the datasheet, you'll have to measure it. The easiest way I can think of is to put the gyro on a rotating wheel (with a known rotation speed) and measure the rate output at different temperatures.
how about just putting it into the chamber without rotating wheel/rate table? what's the difference of doing the test this way? thanks
#115379
Hey!
Have you gotten your gyro to work?? I'm trying to currently get mine up and running, and I haven't been able to. How did you write your program to work with the integration equation (Theta(i) = Theta(i-1) + rate(i) * dt) ??
Thanks so much!
Sam