Eliminating DC offset from accelerometer

  • Thread starter Thread starter joe_lou
  • Start date Start date
  • Tags Tags
    Accelerometer Dc
Click For Summary

Discussion Overview

The discussion revolves around methods to eliminate DC offset from accelerometer readings, particularly in the context of sensing higher frequency vibrations (3-10 Hz) while accounting for slowly changing orientation. Participants explore various filtering techniques and their implications on phase shift and signal integrity.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • Some participants suggest using a digital high-pass filter to remove DC offset, noting that it introduces phase shift.
  • Others propose the use of a DC blocking capacitor or AC coupling as a potential solution, highlighting its role in forming a high-pass RC filter.
  • A few participants mention the possibility of using the discrete Fourier transform (DFT) to achieve a digital equivalent of an ideal high-pass filter with constant phase shift.
  • One participant discusses the trade-offs involved in tuning the cut-off frequency of the high-pass filter, balancing phase lag against the ability to filter out changes in orientation.
  • Another participant raises the concern that if the DC offset is changing, it may not be effectively filtered out, complicating the use of high-pass filters.
  • Some participants inquire about the specifics of the microcontroller setup and whether an amplifier is used between the accelerometer and the microcontroller.
  • One participant mentions the use of a multipole low-pass filter to filter out unwanted signals while suggesting a summing junction to subtract the DC offset.
  • There is a discussion on the acceptable levels of phase shift and how it can be minimized by adjusting the transition frequency of the high-pass filter.

Areas of Agreement / Disagreement

Participants express a range of views on the best methods to eliminate DC offset, with no consensus reached on a single approach. The discussion remains unresolved regarding the optimal filtering technique and its implementation.

Contextual Notes

Participants note limitations related to the phase shift introduced by filtering techniques and the challenges posed by changing DC offsets. The effectiveness of various proposed solutions may depend on specific implementation details and the characteristics of the accelerometer used.

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.
 

Similar threads

  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 9 ·
Replies
9
Views
10K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
22K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 17 ·
Replies
17
Views
26K
  • · Replies 7 ·
Replies
7
Views
16K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K