Shop OBEX P1 Docs P2 Docs Learn Events
Memsic Accelerometer Measuring Inclination — Parallax Forums

Memsic Accelerometer Measuring Inclination

dredre Posts: 106
edited 2009-03-19 16:16 in Accessories




I have seen trying, without success, to measure inclination using Parallax's dual axis Memsic accelerometer per the following application paper and equation given therein:

http://www.memsic.com/data/pdfs/an-00mx-012.pdf

Which gives the resulting equation:

angle of inclination = arccos ( 0.707 x [noparse][[/noparse]Ax+Ay] / g)

The problem is that the result in terms of [noparse][[/noparse]xmG + ymG] gives·practically no·output. I wonder if the equation is in error or, more likely, I am not applying it correctly. The only puzzlement I note in the application paper is that in figure 1 the y axis is noted to be conforming to the lefthand rule; rather than the called for righthand rule. Even with this in mind, as Red Skelton would say, "Things just don't look right to me."

Please note: My application is for use in a moving vehicle, for which I need to eliminate vehicle acceleration. And, I need some magnitude of resolution in order to measure low inclinations. I can, of course, take care of nonlinear output and data smoothing.

Any math/Pbasic coding help is greatly appreciated,

David

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-03-18 22:40
    Could you show us the code you have that does not work? also remember that the stamps do integer math so you need to convert some values to get it to work.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Jessica UelmenJessica Uelmen Posts: 490
    edited 2009-03-18 23:20
    Hi David,

    In Smart Sensors and Applications (available for free download from that link), Chapter 3 covers tilt with the Memsic Dual-Axis Accelerometer. This chapter covers the basics of obtaining tilt measurements, as well as scaling and angle conversion. You can also take a look at Chapter 6 Activity #5 which demonstrates datalogging acceleration forces.

    I hope this helps, happy developing!

    Jessica

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jessica Uelmen
    Education Department
    Parallax, Inc.
  • dredre Posts: 106
    edited 2009-03-19 16:16
    This is a interim reply to thank Stephen and Jessica for their inputs.

    I did not include any coding as I wanted some new thinking on the physics/math/Pbasic coding based on the application paper I referenced. I could have mentioned that, after many coding trials, I simply added the line:

    tilt = xmG + ymG

    to Parallax's demo program "MEMSIC2125-Dual.BS2" in the subroutine "Read_G_Force:". [noparse][[/noparse]Of course after defining 'tilt' as a 'VAR Word', and the debug command to display it.

    I made up an experimental tilt rig, including a woodworker's digital angle meter to calibrate any 'tilt' output. The sensor was mounted in the vertical plane with the x axis at counterclockwise 45 degrees to the horizontal. Essentially there wasn't any change in·output when the rig was tilted·.?

    I had reviewed the 'Smart Sensors & Applications' lessons but those programs, I believe, assumed that the sensor was to be used in a 'nonmoving' application in which any parasitic horizontal acceleration was zero.

    Again, thanks for your interest. I will keep exploring.

    The following was taken from another forum entry :-) :

    "If it Stinks it is Chemistry

    If it is Mushy its Biology

    If it doesn't work its Physics"

    cheers, David

Sign In or Register to comment.