Offline
Full Member
Karma: 0
Posts: 122
We were born naked, wet and hungry. And then things get worse!!!
|
 |
« on: March 09, 2012, 01:01:15 pm » |
Hi, I just purchased a gyro sensor. I was trying to use the sample code to chk the sensor.. and for some reason I am not able to detect any change in the angle I followed the exact steps given in the following website http://wiring.org.co/learning/basics/gyroixz500.htmlI still am not getting any changes.. Please suggest Thankyou Regards
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6596
Arduino rocks
|
 |
« Reply #1 on: March 09, 2012, 05:58:44 pm » |
I think you are under the misapprehension that these gyros are absolute - they are not, they are "rate gyros" that output a signal proportional to the current rate(s) of rotation. To get an angle signal you have to integrate the rate signal yourself. It's also important to calibrate the zero-point for each axis for best results.
Even with this modification you will still see drift with time, its in the nature of the device.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 122
We were born naked, wet and hungry. And then things get worse!!!
|
 |
« Reply #2 on: March 10, 2012, 12:09:15 am » |
I should atleast get some analog values rite?
I dont get any changes...
Its like, Even without the Gyro, I get the values, maybe those are not the values from the gyro. They are some other floating values!!
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 122
We were born naked, wet and hungry. And then things get worse!!!
|
 |
« Reply #3 on: March 10, 2012, 04:13:44 pm » |
Hi,
I dont think those are floating values. the values vary from 250-285, when I try to rotate them. And when I unplug them, the pins read 0 for a sec and goes back to 145 and again to 272 and from there, I get a constant 270-278 values. Am not really sure if these are the values from gyro. And even if these are the values from this gyro, I can possibly do nothing with this 250-285 range. Please suggest.
Thank you FelixFelicis
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6596
Arduino rocks
|
 |
« Reply #4 on: March 10, 2012, 06:44:06 pm » |
The Sparkfun breakout board uses 2.8V supply to the chip, its internal reference is rated as 1.35V, so I believe it will be outputing 1.35V at zero rates, which is roughly a count of 276 on a 5V Arduino, so those ADC values make sense.
You should see them vary while the unit is turning, either increasing of falling depending on the sense of the rotation in the relevant axis - its not easy to turn something at 500 deg/s by hand unless its on a longish set of leads(!).
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Full Member
Karma: 0
Posts: 122
We were born naked, wet and hungry. And then things get worse!!!
|
 |
« Reply #5 on: March 11, 2012, 02:29:09 am » |
Hmm.. So, supplying an external output rather than connecting it to arduino, will give me a wide range??? Also, I want this board in my car, so that it can detect turns. If I cant turn it with my hand, how else can I makt it work?
Please suggest
Thank you Regards
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6596
Arduino rocks
|
 |
« Reply #6 on: March 11, 2012, 09:07:26 am » |
I don't understand your confusion.
The unit will output a value in the 176 area when stationary and this will increase or decrease if turning in the relevant axis - you have to turn it at 500 deg/s to see full-scale output - that's a very fast turn, so you aren't likely to see a big response to turning it by hand, but that's quite OK, its not a show-stopper like you seem to think.
To measure angle you have to _integrate_ the output, like I said - have a look at the plentiful discussions of this here and elsewhere. To detect a 90 degree turn you'll then have to look at this integrated output over time and see if its varied enough in the timescale of interest.
Or you can look directly at the rate of turn to decide if there is current turning motion - this won't be a big signal with this gyro, a few counts.
Part of the issue is that you are looking at a 1.35V signal with an ADC set to 5V full range. You can get some more precision by using analogReference(EXTERNAL) and feeding 3V3 to AREF pin - then the ADC will have a 3.3V range.
I seem to recall that that breakout has differently-scaled outputs from standard, was it x4.5 or something? Those might help give stronger signal at slower rates-of-turn.
|
|
|
|
|
Logged
|
|
|
|
|
|