Getting TILT angle from ADXL202
blueice
Posts: 12
Hello,
Ive wired my BS2 to an ADXL202 and getting values by using PULSIN..
However,none of the app notes have an example of converting the PWM values to TILT angle..
Can anyone please helpout..
Thankyou
..ice
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->·**ice**
http://www.machinegrid.com : Robots at Work!!
Parallel Port Tutorials,
Autonomous Robots,
PIC16F84a Temperature Controller.
Ive wired my BS2 to an ADXL202 and getting values by using PULSIN..
However,none of the app notes have an example of converting the PWM values to TILT angle..
Can anyone please helpout..
Thankyou
..ice
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->·**ice**
http://www.machinegrid.com : Robots at Work!!
Parallel Port Tutorials,
Autonomous Robots,
PIC16F84a Temperature Controller.
Comments
I've used the ADXL210, but not for tilt measurements.· We use it as a vibration sensor so our code is slightly different.
I've just brought up my old datasheet and it's the same sheet for the ADXL202.
So here it is attached.
Page 9 tells you about tilt measurements/calculations.
Basically it requires some math.· ArcSin is what the datasheet requires....this isn't support in the stamp (although ArcTan is)....
Not sure if you can do some magic with math to get where you want to be!
Depending on the resolution you want....you might try a lookup table or some trial and error math.
eg: hold the sensor at a given angle and measure it's input and step it through each angle to see if there's any linearity to it that might make for a constant or easy formula.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Further Investigation:
2003 Parallax Product Catalog
Stamp Applications column·in the November 2004 issue of Nuts & Volts.
Post Edited (Andy Lindsay (Parallax)) : 1/17/2005 8:47:15 PM GMT
But i need to measure only one axis not 360degrees[noparse][[/noparse]which uses vales from x and y]
My values from the PULSIN on yaxis is as follows:
15600.......90deg
20300.......0 degree
25200........-90degree
now how do i go about calibrating it in degrees?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
**·ice**
Gerard Sequeira
Machinegrid.com·:: Robots at Work!!
Post Edited (blueice) : 1/19/2005 6:08:04 AM GMT
then you have 20300-15600 = 4700.· So 4700counts per 90 deg.· So you end up with 52.2 counts per deg.
Do the same for the other direction!
that's the easy way....not sure how linear it actually is though!· is 45deg REALLY 17950?· Don't know!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
haaaaaaaaa
It actually worked..and its pretty accurate too...a bit give and take....i'll keep this thread posted ..post the code later...
Thanks...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
**·ice**
Gerard Sequeira
Machinegrid.com·:: Robots at Work!!
·
Also, they've just started up a 'PROJECTS' forum on this board.· When you are done (or done enough that it's working) then post your project in there....· Include pics, diagrams and code (if you like).·
I think the idea there is to allow people of similar minds to build it themselves!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
How are you attaching this sensor to the board? I have a few of these sensors as well, but I just can't figure out how to solder something that small. I wish they came with pins [noparse]:([/noparse].
actually i have the adxl202Jqc...the adxl202e is even tinier..
The adxl202jqc is a bit bigger and u can solder them ,though it takes some effort...
My work place had the PCB ready..so it jst needed soldering...
but u may even do this...
u can solder very thin wires directly to the pins and then stick the whole setup o a DIP socket..
..
i'll be posting some pics and documenting the project here and on my website
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
**·ice**
Gerard Sequeira
Machinegrid.com·:: Robots at Work!!
Parallel Port Tutorials,
Autonomous Robots,
PIC16F84a Temperature Controller
·
I finally put up a page on how to solder the accelerometer.Ok for testing purposes..
I put a· few images ,to help get an idea of how i went about it...
have a look here
http://www.machinegrid.com/content/view/59/114/
suggestions welcome..
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
**·ice**
Gerard Sequeira
Machinegrid.com·:: Robots at Work!!
Parallel Port Tutorials,
Autonomous Robots,
PIC16F84a Temperature Controller
·
http://www.sparkfun.com/tutorial/ADXL/ADXL-0Tut.htm
And here you can buy PCBs for them, pay a bit more and they will solder it for you.
http://www.sparkfun.com/shop/index.php?shop=1&cart=201396&cat=71&
I'm working with the ADXL 213AE. It's a newer version, but it's the same package. By the way, you can get free ADXLs straight from Analogs Devices on:
http://www.analog.com/