Eliminating DC offset from accelerometer

  • Thread starter Thread starter joe_lou
  • Start date Start date
  • Tags Tags
    Accelerometer Dc
AI Thread Summary
The discussion focuses on the challenge of eliminating DC offset in accelerometer readings while measuring higher frequency vibrations (3-10 Hz) amidst changing orientation. Users suggest various methods, including using a DC blocking capacitor or AC coupling, which can introduce phase shifts that complicate signal accuracy. The trade-off between cut-off frequency and phase lag is emphasized, with recommendations for tuning filter parameters to achieve acceptable performance. Participants also highlight the importance of understanding drift rates and the impact of changing DC offsets on filtering effectiveness. Overall, the conversation seeks to refine techniques for accurate vibration measurement without compromising signal integrity.
joe_lou
Messages
6
Reaction score
0
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!
 
Engineering news on Phys.org
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!
 
How are you reading the accelerometer? What you need is a DC blocking capacitor (or "AC coupling" on your DAQ device).
 
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?
 
MRFMengineer said:
How are you reading the accelerometer? What you need is a DC blocking capacitor (or "AC coupling" on your DAQ device).

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.
 
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.

MisterX said:
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?
 
What microcontroller have you been using? How was the filtering described in the OP implemented?
 
Is there an amplifier between the accelerometer and the microcontroller?
 


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.
 
  • #10
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.
 
  • #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?

MisterX said:
What microcontroller have you been using? How was the filtering described in the OP implemented?
 
Last edited:
  • #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...

uart said:
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.
 
  • #13
no, the signals are currently read directly by the microcontroller

MRFMengineer said:
Is there an amplifier between the accelerometer and the microcontroller?
 
  • #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.
 
Back
Top