Shop OBEX P1 Docs P2 Docs Learn Events
memsic — Parallax Forums

memsic

MarkysparkyMarkysparky Posts: 21
edited 2005-04-11 01:16 in BASIC Stamp
OK i have gotten the accelerometer to work...the problem lies in a zero value...is there a way to precisly and accuratly set a zero acceleration when the accelerometer is at an actual zero? when it sits on my counter it reads an acceleration where there should be none.

thanks

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-10 00:09
    ·· Not sure which accelerometer you're talking about, but my guess would be it's not level.· Try making sure it's level and see what you get then.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 00:32
    i am talking about the Memsic 2125 Dual-axis Accelerometer...when it is level and at rest i still get values i should not be getting...any other ideas?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-10 01:27
    Are the values changing?· Or are they constant when it's sitting level and not moving?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 01:50
    yes they jump up and down irregulary
  • KenMKenM Posts: 657
    edited 2005-04-10 02:33
    What is being used to power the accelerometer?

    Have you looked at the supply voltage on a scope ac coupled 0-100mV range?

    Does the supply voltage look the same when stable versus not stable accelerometer readings?

    If you don't have a scope, hang a large (10 uf or larger) and a small (0.1 uF) cap on the supply voltage to ground. Be sure your large cap voltage rating is larger than your supply voltage.

    Does the above eliminate the irregular noisy signal?
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 14:03
    I will try this...i do not have a scope so i will try it with the caps...could you a bit more clearer on what to do with the caps?
  • JonbJonb Posts: 146
    edited 2005-04-10 14:18
    Ken·was pretty clear about where to place the capacitor (Cap), from the supply voltage(+) to ground (-) in hopes of perhaps stabilizing the power.


    (+)
    |
    ·············(Cap)
    (-)
    |

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/10/2005 2:26:09 PM GMT
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 14:29
    does he want me to hang both a 10 uf (or larger) and a .1uf off or hang a 10 uf (or larger) off and try it or hang a .1 uf off and try???
  • JonbJonb Posts: 146
    edited 2005-04-10 14:42
    KenM said...

    ...hang a large (10 uf or larger) and a small (0.1 uF) cap on the supply voltage to ground. Be sure your large cap voltage rating is larger than your supply voltage.

    ····· tongue.gif·Although on most of my projects I only place a small cap to stabilise the power supply and I have no problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/10/2005 10:51:58 PM GMT
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 14:43
    any specific order?
  • JonbJonb Posts: 146
    edited 2005-04-10 14:46
    I dont believe it should make a difference, as each cap will filter out a range of noise or supply current when there is a surge in demand.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-10 15:14
    ·· The fact that you're getting erratic readings indicates that you have either a power supply issue, for example, noise on the power supply lines.· In this case the suggestions offered could help.

    ·· Or you could have a connection or ground problem.· I would recheck the wiring and make sure that the Memsic and Stamp have a common ground, and that all the wires are secure.

    ·· The device isn't overly complicated, in that 3 lines go to Stamp I/O pins, 1 to Vdd and 2 to Vss.· But I have seen a missing connection deliver erratic results.· Especially from a missing line to ground.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 16:16
    now in the memsic documentation at memsic.com/memsic/pdfs/an-00mx-001.pdf they have high pass and low pass filters how would this work??
  • JonbJonb Posts: 146
    edited 2005-04-10 16:42
    I believe that they are included on the module you are using. Since you have not mentioned exactly what you are using it is hard to tell.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/10/2005 4:46:53 PM GMT
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 16:50
    a while ago I said...
    i am talking about the Memsic 2125 Dual-axis Accelerometer
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 20:41
    just wanted to know if the schematics in the document I posted is any good? I added the attachment to this document
  • JonbJonb Posts: 146
    edited 2005-04-10 21:11
    I assume the documents are correct, as they are from the manufacturer.

    Do you have memsic 2125 IC or did you purchase the Parallax module which includes other components and is on a PCB with pins? The IC is not something you hook up directly to the stamp·smile.gif. You need to·add components such as on the modules which are sold at many places.

    Do you have this?
    http://www.parallax.com/detail.asp?product_id=28017

    If so, and you have read the documentation and it does not work, I'm at a loss. Maybe the IC is defective.

    If you did not purchase the module, but have the IC then try to copy what is done on the module, which is based on the spec sheet. When you've given up as I have, then purchase the module tongue.gif which was straightforward to use.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/10/2005 9:28:52 PM GMT
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 21:59
    Yes i have the parallax version...I bought it from parallax.com...it does work the only thing is that when everything is constant I still get a value i shouldn't. It will be on my kitchen counter and I will be getting a value small value but it is not zero. If I do an offset in the code it still happens. it is not a constant drift. is there a way to compensate for that?
  • JonbJonb Posts: 146
    edited 2005-04-10 22:16
    Ok, I understand your problem better now. Temperature can affect the memsic 2125.·It is normal to get small fluctuations and spikes so you need to filter them out.

    From the Parallax documents:

    Since the Memsic 2125 is a thermal device, the temperature is available from the TOut pin and can be 
    measured using an external analog to digital converter (i.e., LTC1298). 
    Details: 
    • Output calibrated to 1.25 volts @ 25.0° C 
    • Output change: 5 millivolts per degree C
    


    Not only do you need to take into account temperature which will affect your readings, but you need to filter out fluctuations and spikes. Your calibration in software will need to take the temperature into account, as your 0 will be different at different temperatures. I used an external temp sensor which was already in the design. but you could use a A/D on TOUT.

    I like the software approach to smooth it out.
    Check this out maybe it will help:

    http://owlogic.com/BS2math5.htm#Smoothing

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/10/2005 10:29:21 PM GMT
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 22:28
    before i change anything with the code I think i will try the low pass filter...should i use the schematic from the documentation I attached earlier? Also in the documentation I attached earlier i saw that there was a schematic for termal compensation...should I give that a go also? I will look at the link you added before

    thanks for your help
  • JonbJonb Posts: 146
    edited 2005-04-10 22:36
    I tend to shy away from hardware solutions so experiment to your hearts content. I am a software guy, although a RC low pass uses 2 components i think. Try it out and report back.


    I can not seem to locate the code I used, but based it on previous posts regarding this subject. More info can be found by searching for "accelerometer", but the smoothing technique is the key. Basically you could take a few samples and eliminate erradic readings or average it out.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/10/2005 10:55:58 PM GMT
  • MarkysparkyMarkysparky Posts: 21
    edited 2005-04-10 23:44
    you used a external temperature sensor and used that to set zero for the acceleration?
  • JonbJonb Posts: 146
    edited 2005-04-11 01:16
    Yes, I used ambient temperature to crudely compensate for temperature variations, but you are better off using an a/d converter on tout if you will be using(like me) it in sub zero temperatures or high temperature environments aswell.

    The output pins on the 2125 output a pwm signal with varying voltage from .1 to 4.9v but is callibrated to 1.25v @ 25C.

    A temperature of say -20C(not uncommon up here) can change the value by 225 millivolt.

    I didnt use an absolute zero, instead using ranges worked well for my task. The memsic 2125 has many uses and is very sensitive.·Maybe the sensor is picking up vibrations from something.

    Log the output data after smoothing it(with pass filters or through software), you will see it is much more useable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/11/2005 1:48:25 AM GMT
Sign In or Register to comment.