Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Problems with the Gyro (http://www.chiefdelphi.com/forums/showthread.php?t=50173)

Kevin Watson 02-12-2006 13:09

Re: Problems with the Gyro
 
Quote:

Originally Posted by Guy_E
I'm such a fool. I forgot that there was code executed in the Process_Data_From_Master_uP function, and I worked with the gyro with the RC turned off...

When I did work with the RC switched on, the gyro's bias was indeed calculated, but its value was 2040.... As a consequence, I believe, the angle and the angular rate were not calculated correctly.

Any idea how can I correct it?

If you use the oversampling feature of the analog-to-digital code, the bias value will likely be larger than 512. If you're averaging sixteen samples, 2040 would be a reasonable value for the bias as it is very close to being halfway between 0 and 4096. This feature is documented in adc.h and adc_readme.txt.

-Kevin

Guy_E 03-12-2006 09:53

Re: Problems with the Gyro
 
I changed the update rate to 2 and the bias was 512. I don't know why, but it still not measuring the angle correctly. The anglular rate is not stable, and the angle just keeps incrementing without any sense.
gyro_rate jumps from negative to positive numbers as I turn the gyro, is doesnt become 0 when I stop turning it.

Im using the default code, without any modifications. It is really a weird. Im starting to become frustrated....

EricS-Team180 03-12-2006 22:42

Re: Problems with the Gyro
 
Quote:

Originally Posted by Guy_E
...Im using the default code, without any modifications. It is really a weird. Im starting to become frustrated....

Hang in there Guy_E...we've all been in your shoes with frustrating problems!

Looking back through the thread, I was wondering what kind of gyro chip you are using? If it's an Analog Devices, are you using it in conjunction with it's evaluation board? Or have you created your own custom installation?

In the past we've used the 150 and 300 deg/sec chips and simply sampled them with a Get_Analog_Value function in the Default_Routine. With the chip sitting still we've often seen the value jump around. So, even though it introduces an error, we'd create a small deadband. As long as the value jumped around inside the deadband, we'd declare the value to be neutral. Outside we'd use it. It would be one way to keep your integration from running away, while you try to figure out why it is jumping around.

I don't have a lot of experience with Kevin's code, but I do believe that the methods he uses would greatly reduce this effect.

Thanks,
Eric

Guy_E 04-12-2006 00:02

Re: Problems with the Gyro
 
Quote:

Originally Posted by EricS-Team180
Hang in there Guy_E...we've all been in your shoes with frustrating problems!

Looking back through the thread, I was wondering what kind of gyro chip you are using? If it's an Analog Devices, are you using it in conjunction with it's evaluation board? Or have you created your own custom installation?

In the past we've used the 150 and 300 deg/sec chips and simply sampled them with a Get_Analog_Value function in the Default_Routine. With the chip sitting still we've often seen the value jump around. So, even though it introduces an error, we'd create a small deadband. As long as the value jumped around inside the deadband, we'd declare the value to be neutral. Outside we'd use it. It would be one way to keep your integration from running away, while you try to figure out why it is jumping around.

I don't have a lot of experience with Kevin's code, but I do believe that the methods he uses would greatly reduce this effect.

Thanks,
Eric

Im using AD22304, the gyro that is supplied in the 2006 kit of parts (and can be purchased in the IFI robotics website)

EricS-Team180 04-12-2006 13:11

Re: Problems with the Gyro
 
Oh yeah....should have guessed that. Well the K.O.P gyro is only 80deg/sec, which is REALLY slow for an FRC chassis. That might explain gyro_rate jumping around like you observed.

So the chip will swamp at something like 0.22 rev/sec... I was going to suggest bench testing it by taping it to an old LP record player turntable- to get a reasonably steady rotation- but even that will swamp the gyro. ...hmmmm

I'll have to take a closer look at Kevin's code at this point. Perhaps someone whose used his code in competition could jump in?

Eric

Donut 04-12-2006 15:53

Re: Problems with the Gyro
 
Make sure your gyro.h file is completely correct. If you haven't chosen the ADXRS150 (equivalent to yours) as your gyro, you will naturally have problems (I think it's the default, but I can't remember).

Since you said the gyro is having issues with the rate, you might want to try adjusting the gyro deadband as well. Ours worked fine at the default 8, but we were using the ADXRS300, which has less than half the sensitivity of the gyro you're using.

Other than that, keep trying the instructions in gyro.h and the gyro readme for calibrating it. I'm hoping this helps some.

chris31 04-12-2006 17:23

Re: Problems with the Gyro
 
Quote:

Originally Posted by Donut
Make sure your gyro.h file is completely correct. If you haven't chosen the ADXRS150 (equivalent to yours) as your gyro, you will naturally have problems (I think it's the default, but I can't remember).

Since you said the gyro is having issues with the rate, you might want to try adjusting the gyro deadband as well. Ours worked fine at the default 8, but we were using the ADXRS300, which has less than half the sensitivity of the gyro you're using.

Other than that, keep trying the instructions in gyro.h and the gyro readme for calibrating it. I'm hoping this helps some.

Yes, the ADXRS150 is the default in the code.


All times are GMT -5. The time now is 20:48.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi