Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Question on analog sensor signal processing 1

Status
Not open for further replies.

E2005

Electrical
Jul 18, 2005
46
0
0
US
Not sure if its a basic question to ask. If you have an analog sensor and the output drifts over time or output is non repeatable(input being constant). Also assume thats the best sensor you can get and you are relying on those values to set thresholds etc. Is there a way to take care of imperfections in the sensor on the signal processing side. I know ways to get rid of noise but not drifts in values or non repetabilty. Are there standard ways to fix them as many sensors promise to be very repeatable , non drifting etc but in actuality for the same input they may give varying (or slightly varying ) values each time.One way could be when looking at the output of the sensor using a band( +/- say 5%) around each value to take care of drift rather then using exact values but hoping there are better ways. If someone can point me in the right direction of where to look. Thanks
 
Replies continue below

Recommended for you

Kalman filtering... hope your math and probability skills are up to par.

Dan - Owner
Footwell%20Animation%20Tiny.gif
 
I'm not necessarily convinced that Kalman filtering would get rid of drift, at least, not without some secondary data source that isn't drifting, or multiple copies of the same sensor that drift in different directions.

A more classical approach to drift would be to use some form of chopper stabilization, where the sensor is cyclically zeroed out. Obviously, this has limitations on bandwidth and settling time, but it was a tried and trued approach from 40 years ago. AC coupling is a similar approach, if it can be mechanized.

Your last couple of sentences seem to be talking about repeatability, which is a low-frequency read noise, of sorts, and massive averaging or filtering will reduce that.

Ultimately, though, you can never get completely noise-free behavior, since that's inherent in the quantum mechanical nature of physical processes. To wit, even a perfectly noise-free, but physically real current source will show noisy behavior, i.e., Shot noise, since not all the electrons will arrive or leave at the times they're scheduled for.

In most measurement and control systems, you need to ensure that your design isn't asking for more performance than is physically achievable.

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
you are essentially asking the age old question of separating the "signal from the noise".

the sensor 'drift' is hopefully a very low frequency component of your signal such that you can develop a filter that tracks the average output of your sensor and yet still responds to the 'signal of interest'.

MacGyver has the best solution although i think it can be implemented without much painful math.

First form an average of the signal.

Av=K*(Y-Av)

Execute this with each new value as Y in order to update 'Av' as the average estimate. Select K to cancel the drift. Smaller K makes the average longer to attain but also filters out more slowly moving drift errors.

Hopefully your real signal of interest is S.

S = Y-Av

Hopefully this signal removes the slowly moving drift and S is what you are really measuring.






 
I'm going to assume that the drift is in the sensor itself, not in the electronics after the physical sensor element.

1) Periodic Built In Test (PBIT), end-to-end. Or 'self-calibration'. On the 'Physical World' side of the sensor, present it with a calibrated stimulus (or several) on a periodic basis. If it was a pressure sensor (for example), then you'd add a plumbing system with valves to connect the sensor to either the measurement source (normal operation), or to the calibration system.

2) Another trick is to "flip" the sensor over so the offset cancels out. The reversal has to be done quicker than the drift. This concept is obviously only applicable to very few technologies.

 
Thanks to all your inputs. Its an pleasure to be here. Firstly I was talking about the drift over time in the sensor not the circuit.Kalman filtering does seem like the best solution but hoping for an easier solution.By repetability I meant for the same input you dont get the exact output. Such as in pressure pads in a small weiging machine. 1Kg of weight lets say produces 0.5V output but it can vary ).45V to 5.5V. So eveytime you put the weight you get a different result (between 0.45 to 5.5. The problem is if one does now know the band or that the band is approx. I think one can fight with the physics of a sensor to some degree. I do not have a calibrated stimuls for it to compare it (it would have been good ).I know averaging introduces hysteris and can take care of some types of noises but trying to understand how averaging can take care if signal is approx and also drifting over time. I guess I have to kmow the nature of the sensor for any kind of modelling or cyclically zero it out when the system starts(repeated calibration) and also eleminate causes of drift if possible.
 
Apologies in my example. 1 kg should produce 5V output, but you get any where from 4.5 to 5.5. This is just for example, in my case its not a 1V variation, it varies. Also if I run a test when the sensor is new, make a loop up chart for future and later if the sensor starts drifting (offseting over time) then the lookup become useless and I will beed to recallibrate.
 
If the variance is that large, then calibration should be performed priot to every measurement. That's the way many consumer bathroom and postal scales are designed. Either that, or you need to choose a more repeatable sensor, if possible.

A sensor that varies 10% of reading is a pretty poor choice for accurate measurements. Usually, weight sensors, ala strain gauges, can be designed in different circuit configurations, such as temperature-compensated bridges, to eliminate most of the uncertainties induced by the physical structure of the sensor.

Without taking globs of data, you won't even know if the errors are truly random or systematic. Averaging and filtering ALL assume a zero-mean behavior. If your data is not zero-mean, then averaging will give you a false sense of noise reduction, when it might actually be doing nothing at all.

TTFN

FAQ731-376
Chinese prisoner wins Nobel Peace Prize
 
If you mean you place the weight on and say get 4.7 then remove it and immediately reapply it and get 5.2 and ...4.9,5.4....etc

Your A/D converter could be averaging too fast. There should be no reason for anything relative to the measurement to change that rapidly.

If your A/D is acquiring too fast then you read all the little hills and valleys of noise you would see if you hooked a scope up to the signal. Note this is not the same as overall sample rate.

If you cannot make your A/D integrate over longer time then adding a filter prior to the A/D input pin would be the right stuff.





 
Kalman filtering is used (for example) to blend GPS and INS position solutions to obtain one, optimal, overall location solution. I'm not quite sure how that would apply here.

If the sensor in question is measuring - for example - atmospheric pressure (that varies from hour to hour), and the sensor is drifting (also from hour to hour), then there's no filtering that can separate one from the other.

OP is being a bit coy about what sort of sensor is being used and exactly what is being measured.
 
if you scale is not set directly on a solid floor that is concrete then the surrounding vibration is probably causing the varience.

Otherwise you have the wrong wiegh scale and does not give you the degree of accurancy.

plus if your using this for shipping purposes, the scale has to be certified for trade.

Using scaling to fudge it probably breaks the above rule.
 
With no independent way to estimate the error reading you simply have signal + error ( or noise ).

The only linear processing thing that can be done is filter out the spectrum of the error,noise as best as possible.
To start with this requires some detailed knowledge of the spectrum of both the signals and error OR the statistics of the error.

Kalman filtering or Weiner filtering begins with the statistics of the noise but their implementation is a bit difficult.

Only the OP can help qualify the frequency spectrum of his signal and his errors (noise) and then we may be able to help.

 
Status
Not open for further replies.
Back
Top