Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Eliminating DC offset from accelerometer

  1. Sep 30, 2011 #1
    Hi,

    I have an interesting problem: most people use accelerometers to sense orientation and thus measure the DC output value.

    What I'm trying to do is sense higher frequency vibrations (3-10 Hz). The accelerometer will also be slowly changing orientation so the DC offset will be changing with time.

    Right now I'm using a digital high-pass filter on the signal and while it works it introduces some unavoidable phase shift. See:
    http://tinyurl.com/3zpgez9


    Just want to check with any mechatronics gurus out there to see if there are any better ways to eliminate or subtract the DC offset from my sensor. Thanks so much!
     
  2. jcsd
  3. Sep 30, 2011 #2
    Getting rid of DC response from sensor

    Hi,

    I'm trying to sense higher frequency vibrations (3-10 Hz) for a project (just the amplitude). I decided to use an accelerometer that will be slowly changing orientation so the DC offset will be changing with time. I want to get rid of this offset as it will mess with my control system.

    Right now I'm using a digital high-pass filter on the signal and while it works it introduces some unavoidable phase shift. See for example:
    http://tinyurl.com/3zpgez9


    Just want to check to see if there are any better ways to eliminate or subtract the DC offset due to changes in orientation from my sensor. Thanks so much!
     
  4. Sep 30, 2011 #3
    How are you reading the accelerometer? What you need is a DC blocking capacitor (or "AC coupling" on your DAQ device).
     
  5. Sep 30, 2011 #4
    You may be able to use the digital equivalent of an ideal high pass filter with constant phase shift. Are you familiar with the discrete Fourier transform?
     
  6. Sep 30, 2011 #5
    I think a DC blocking capacitor would form a high pass RC filter (R being the DAC), with the phase shift that implies. For the latter option it might be worth finding more information on the DAC's AC coupling feature, if there is one.
     
  7. Sep 30, 2011 #6
    Thanks -- I'm reading the signal with an 8-bit microcontroller. I am vaguely familiar with DFT but it may be too much for the controller I'm using.

     
  8. Sep 30, 2011 #7
    What microcontroller have you been using? How was the filtering described in the OP implemented?
     
  9. Sep 30, 2011 #8
    Is there an amplifier between the accelerometer and the microcontroller?
     
  10. Sep 30, 2011 #9
    Re: Getting rid of DC response from sensor

    Use DC offset cancellation. High pass always introduce phase shift.

    Use a very low frequence multipole low pass filter and filter out all the signals ( 3-10Hz) you want, use a summing junction to subtract the DC out. Problem is then you have to wait for the DC to settle before sampling.
     
  11. Sep 30, 2011 #10

    uart

    User Avatar
    Science Advisor

    How much phase shift can you tolerate?

    If you make the transition frequency of your HPF sufficiently low then the phase shift at 3-10Hz will be small. You could even use a simple C-R high pass filter to achieve this.

    For example a C-R HPF at 0.03 Hz will introduce only about 1/2 a degree phase shift at your signal frequency. You'll need a good bipolar electrolytic capacitor and preamp with a reasonably high input resistance to make this work. Something like 50k and 100uF should work ok.

    There is a problem however if the DC offset is changing, because then it's not really DC is it. So it can get through the HPF if its transition frequency is set too low. So you might need to compromise, set the transition frequency a bit higher than the above example and accept a little bit more phase shift.

    It would help if you could tell us what sort of drift rate you expect on the DC offset and what amount of phase shift you can tolerate.
     
  12. Sep 30, 2011 #11
    I'm using an AVR (atmega8a) and I'm currently digitally implementing a high-pass filter in my code.

    I've been tweaking the parameters on that filter...as someone mentioned I can program a very slow cut-off frequency but that introduces phase lag. If the cut-off frequency is higher, the accuracy is better (no phase lag) but changes in orientation of the accelerometer pass through the filter.

    It is a trade-off and is a bit annoying to tune...just wanted to see if I'm stuck with using this approach.

    I'm new to AC coupling -- what happens if there is drift in the DC (accelerometer changing orientation)? Does that pass through? What frequencies are cut off?

     
    Last edited: Sep 30, 2011
  13. Sep 30, 2011 #12
    This is the exact trade-off I'm experiencing. I'm digitally implementing the filter and am just manually tuning until I get the behavior that is "acceptable".

    I'm really wondering if I can get it better though...

     
  14. Sep 30, 2011 #13
    no, the signals are currently read directly by the microcontroller

     
  15. Oct 2, 2011 #14
    Hi people,

    I have accelerometer readings from a 3 axis accelerometer and need some help coding a few things. I am using matlab for the coding bit. It is worn by someone kayaking on one of the hands. and when the paddle hits the water there is a jerk produced and I have to charaterise that jerk produced . I am using a fourier trasnform and a low pass filter and then transferring it back to the time domain.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Eliminating DC offset from accelerometer
  1. DC Offset (Replies: 2)

  2. DC offset (Replies: 7)

  3. Dc offset component (Replies: 2)

Loading...