Shop OBEX P1 Docs P2 Docs Learn Events
Dual and Tri Axis Accelerometers HELP — Parallax Forums

Dual and Tri Axis Accelerometers HELP

Pablo  MartosPablo Martos Posts: 14
edited 2009-05-08 09:28 in General Discussion
An accelerometer is an electromechanical device that measures acceleration forces. These forces may be static, like the constant force of gravity pulling at your feet, or they could be dynamic that is caused by moving or vibrating the accelerometer. I want to get measurement of pitch and roll in angles, how would i or what kind of source codes can i use? i also want to check which acceleremoter is more percise, what test can i do, or what can i do?? i have already have a BS2 IC, the hitachi tri axis and the memsic dual axis. i am still new at this, so i am completely LOST... [noparse]:([/noparse]


confused.gif

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-05-05 05:00
    There is lots of source code on the forums for measuring angles on the forums. A little searching will help you out here.

    To compare the accelerometers, I'd suggest two tests. Both tests require that the accelerometers are mounted as close together as possible, and that readings are taken simultaneously. The first test is to put them on the table (or ground or bed) with no movement, and compare their outputs. They should both be outputting identical values, somewhere around 1 g (9.8 m/s^2 or 32 ft/s^2). The next test is to mount them on a long arm that rotates (preferably somewhat fast), and to measure the acceleration at specific moments in time (aka, specific parts of the rotation). With a few physics equations, you can figure out the ideal acceleration, and compare that to your measured accelerations. If you want to be really accurate, you'll repeat each test for each axis on the accelerometers.
  • Pablo  MartosPablo Martos Posts: 14
    edited 2009-05-05 05:10
    your answer is very helpful SRLM, now i would definetly work on that, now is it possible to use just one BS2 chip to run both acceleremoters simultaneously? or do i have to run one programm first, then the other?
  • SRLMSRLM Posts: 5,045
    edited 2009-05-05 06:24
    It's a design choice that you'll have to make. If you don't take the samples at the same time, then you'll be losing precision. The acceleration could potentially change in the amount of time between each unit's sample. Ideally, it would be simultaneous, but you may be able to get by otherwise. A Propeller would be good for this... You cannot, however, run one accelerometer through the tests then the other. Your setup could change in subtle ways that would invalidate the results.
  • Pablo  MartosPablo Martos Posts: 14
    edited 2009-05-05 06:34
    Very True, now lets say i just want to to use either or, most likely the Memsic Dual Accelerometer, would it make it more simple to just test just one, and get an average by getting a couple of readings and dividing by the amount of test done?? how would i know at what certain degree they are? i mean my simple method is mounting the acceleromter on a breadboard with the BS2-IC, and just moving it around the x and y axis?
  • SRLMSRLM Posts: 5,045
    edited 2009-05-05 07:17
    What exactly are you trying to accomplish? I thought that you were trying to compare the readings of the two accelerometers, and determine accuracy and/or precision. For accurate tests, you'll have to make (or find) a mechanical rotator. A lawn mower might work, at the risk of losing your fingers. The idea is to know what they should be outputting, and be able to compare that with what they are outputting. If you try and shake it with your hand, you won't be able to make any reproducible pattern.

    Another idea is to make a position tracker. You'll still have to do the simultaneous measurement idea, but this may be simpler than the rotating arm. Mount them on the board, and (without rotating yaw, pitch, or roll), walk around and around, and eventually return to the exact same spot. You can then perform numeric integration on the data that you've logged, and be able to tell which one ends up with a position closest to the start point. There is a similar example in Smart Sensors and Applications, available for download from parallax for free.
  • Pablo  MartosPablo Martos Posts: 14
    edited 2009-05-05 07:28
    well i am SRLM, but to be honest with you,i have been working with this for a couple of weeks now, but i have become clueless on what to do, Now to get to the point, this is what i am exactly trying to do.. i am trying to explain in a lab class what is an Accelerometer and how does it work. The tools that i have are an LCD display, The Memsic 2125 dual Axis accelerometer, and the Hitcachi tri axis accelerometer, as well as the BS2 IC with breadboard,(actually both the discovery kit, so i have parts as servos). Now, i have seen the manuals that come with it, as per say the dual axis, there is a pdf file of the Memsic 2125 parallax made, now it only shows me a program called sample tilt.bs2, now that program i have succesfully ran, and well i get numbers 2500+- in the x y axis, but what do these numbers really mean? are they degrees, i cant really decode it.. now for the tri axis, its a little more in depth, im just looking for a program that i can run and describe what the tri axis is and how they differ, and which one is more accurate.
  • SRLMSRLM Posts: 5,045
    edited 2009-05-05 16:01
    So, you don't want to scientifically compare the two accelerometers? No fun... [noparse]:)[/noparse]

    Well, the second experiment I mention in my last post would be a good way to explain acceleration as the second derivative of position, and first of velocity.

    I'd assume that those numbers are tenths of a degree, but I haven't really looked at the program to confirm. You can quite simply figure it out by putting the board flat, looking at the numbers, then tilting it to 45 or 90 degrees and looking at the numbers again. That will tell you the units/step.

    There is also a program out here on the forums called something like "Radio Tilt Control for your Boe-Bot", you may want to look at the accelerometer portion of that code. I believe it uses the dual axis version.
  • JasonDorieJasonDorie Posts: 1,930
    edited 2009-05-08 09:28
    Those numbers could be anything - You need to read the spec of the chip to find its acceleration range, and read the kind of input you'll get from it to figure out the number of bits, then use those two values to figure out what the numbers actually mean. For example, if the chip has a range of +/- 2g, and returns 12 bit signed numbers, then the numbers you get will be between -2048 and +2048, with 1g = 1024.

    If the chip has a range of +/- 6g, and returns unsigned 10 bit numbers, then you'll have a range of 0 to 1023, with (1024/6) = 171 = 1g. They don't measure 'degrees' - they usually produce a specific voltage range over a given amount of g range, and then you need to figure out what your sample bit range is to work out the numbers you'll get. Or you can just assume that when it's sitting still on your desk, it's experiencing 1g, and just use that. It'll do in a pinch. [noparse]:)[/noparse]

    All of these chips may have slight inaccuracy due to variations in mounting, temperature, noise, and so on, so the 'center' value might not be what you actually read when the thing is completely level. Also, the thing can only reliably measure 'down angle' if it's not accelerating or decelerating.

    Jason
Sign In or Register to comment.