r/ECE • • 4d ago

I am having trouble understanding linearization in sensor signal conditioning. Can someone explain in simple terms?

I don't understand how we can possibly change a non-linear curve into a linear one without compromising the accuracy. For control systems, it still makes sense it is done around the steady state using y=mx+c using the operational point so less deviation from accurate results but how do we do that in sensors? Also, why is the slop of the non linear curve negative while tht of linear one positive?
2 Upvotes

10 comments sorted by

3

u/cvu_100 3d ago

The linearization applies some sort of transformation. In most practical systems, this will be some routine in software, or a lookup in a hardware LUT. The transformation will of course incur a loss in accuracy if it is not defined analytically.

This slide does a really poor job of explaining this concept. The majority of sensors (or more correctly, transducers) do not produce a linear analogue output as a function of whatever they are trying to measure. In order to extract useful meaning from that sensor, it is necessary to calibrate it. "Calibration" is probably a much better term than "Linearization" for you to understand what is going on here.

1

u/Unable-Ambassador-16 4d ago

The way I understand it is that when you linearise a system you are making a simplification: as linear systems are much easier to work with mathematically , it may be acceptable to «lose out» on the original representation in favour of a simplification.

It’s is a bit weird why the slope is reversed though

1

u/nixiebunny 3d ago

A linearizer creates a mathematical approximation of the desired output as a function of the actual input. It can even invert the signal, as shown in this example. The math used is either a piecewise approximation from a lookup table with interpolation, or a polynomial curve fit to the sensor response curve. It is not required to be much more accurate than the sensor itself.

1

u/Twilight_Charm 3d ago

How can we convert a non linear curve into a linear one while preserving the actual results?

1

u/nixiebunny 3d ago

To what accuracy?

1

u/differentiallity 3d ago

You recover original accuracy with calibration

1

u/somewhereAtC 3d ago

Which version is the "real" output? Explain in simple terms? Probably not.

For example, imagine that the X axis of (a) is the speed of a machine and we have a speed sensor that we can measure.

The problem is that, when the machine is operating, we will only ever measure the sensor output and then infer the speed (not a guess, a mathematical inference). In other words, we use the graph in reverse. The measured value of the sensor becomes the independent variable and we look at the graph to figure out speed. This is the part that most teachers don't spend enough time explaining.

This inference is normally made by interpolation using data that was collected when the machine was installed. At that time someone accurately set the machine speed to 3 or 4 different speeds and measured the sensor. This will be the only data we ever get about the relationship of Speed and Sensor values. The normal process is to use linear interpolation to infer Speed X given a new sensor reading, and interpolation is (by definition) linear.

Since the real sensor is _not_ linear this will lead to an inaccurate inference. So.... ahead of time we insert the linearization circuit. Now, the data from the 3 or 4 measurements made when the machine was installed represent the straight-line characteristic, graph (c), allowing the use of linear interpolation when calculating X from the (linearized) sensor output.

BTW#1, the slope of the curve is irrelevant because we use interpolation to infer X from the sensor output. Many linearizers use inverting op-amp circuits because that is an easy implementation, and the slope reverses. For this speed example it actually makes the sensor _more_ intuitive since the reading increases as speed increases.

BTW#2, the data collected when the machine is installed is called "calibration data". If you get the chance to take many calibration samples (all at different speeds) the linearization can be done mathematically. For this example, though, the designer chose to use a linearization circuit because then we only need 2 or 3 different speeds to calibrate the sensor.

1

u/ruat_caelum 3d ago

Let me give some examples to think about.

  • We output 16ma to a valve. It is set up for 4-20 ma stroke. One might do the math 16-4=12 :: 12/(20-4)=0.75 :: 16ma = 75%

    • What is that 75% Unit? 75% of LINEAR Stroke distance or Rotation angle depending on the valve hardware.
    • What is the VALVE output in process?
    • The CV of the valve is not linear. It is dependent on pressure drop, trim, valve mechanism, e.g. butterfly or ball valve, etc.
  • Our human brains don't do well with saying 20% of output to PY equated to 4% of CV on the Pressure Valve. Or that when the CV is 50% of maximum flow, the valve's input signal might be at 73%

  • Since modern PID loops can "Black box" most issues (e.g. I need more flow so I open the valve a bit more without NEEDING to know the PY and (CV of)PV relationship.

    • I can perfectly control most loops without having to know the CV linearization because I don't actually SEE it. It is "trapped" in the math of the PID loop.
  • so the Input (ma) to CV (flow rate) curve is linearized in a general way, even though all valves are different and will get MORE different over time as trim is damaged, etc. But we do this to quickly use a loop up table to get the valve to a "Close enough" position.

The above example is there to explain WHY the linearization of a CV and loss of information might not be something we care about. In short our control scheme says to go to 50% flow rate. We look at the linearization of the CV curve and the valve opens to 70% (roughly 50% flow after linerization) and then the PID loop zeros in on the target flow rate, by looking at the FT and then either opening or closing the valve in small amounts.

We lost information in the linerization. E.g. when we looked at the milliamp to CV "line" it was not accurate in multiple places. **BUT it was accurate enough for the FIRST STEP. So we got to say 90% of our target point, and then let the PID loop take over from there.

  • It's like having cruse set at 75mph, getting on the brakes for a bit, then speeding up to 70 ish and hitting resume.

    • The automatic control system will have less difficulty in getting to the set point if it starts much closer.

why negative slope

  • likely to show you that slope DOES NOT matter. (This is just an "inverse" linearization. E.g. as this goes up we want the valve to open. Think of it like having a valve on the bottom of a tank that lets water out. As the water goes up the valve opens to let water out to maintain a level. The Pump that supplies water does the opposite. As the level goes down the pump increases flow.

Often we do any inversions in the control logic, but if you did them on the signal side you'd just skip that step in the controls.

linearization is a subset of "Best fit" modeling.

  • We can "Best fit" a bunch of data to known curves or expected outcomes.

  • Linear quadratic estimation is basically linearizing the "ERRORS" in a system and deleting them in the opposing vector. ITs a way to get "Very close" to the real value when we know the system is noisy or has errors. https://en.wikipedia.org/wiki/Kalman_filter

  • We "Best fit" the polynomial curve that is the relationship between resistive temperature elements and resistance.

So what about accuracy!!!

It's no where as near as important as consistency and repeatability in real world control. So we do things to make things consistent.

When we swap a RTD TE for another RTD TE the system changes because of the metallurgy of the TE. FULL STOP. What read at 100deg C before isn't going to read at 100deg c now, because a part of the system that has unknown errors has been changed.

As valves degrade or venturi tubes get torn up, etc. The output or sensor readings will vary because the engineered "Ideal" inside diameter no longer matches perfectly to the math.

  • We do lose accuracy when we linearize, but we choose WHERE to lose that accuracy.

    • If the critical potion of a batch pharmaceutical process needs accurate temperature readings at 78deg c, and 6.32 PH You know what we do? We design, calibrate, and linearize around those operating points. So that the system is MOST accurate at the design specifications.
    • The trade off is that we are less accurate farther from the design specification set point. But since we don't want to be out there anyway we can logically presume that the control system is going to correct and head back to the set points.
    • Therefor the over all time spent in the less accurate regions is limited.

it's engineering not math

(It's actually turtlesmath all the way down*)

The engineer is just worried about getting something (be that flow rate, temp, density, dissolved oxygen, etc) close to the set point And within allowable tolerances.

When the system is designed we know these error bars and carry them through the math in such a way that we can still control around them.

  • Think of it this way. If you had a car that you KNEW could jerk the steering wheel X degrees to the left at any point during your drive, how would you drive compared to how you drive now? This unexpected change in direction is a loss of information/control.

    • If it was only 1 degree, you might just hug the right side of the lane and continue to drive 70mph on highways etc. because you could correct it in a timely manner and there isn't too much of a risk, etc.

    If it was 90 degrees, you'd probably drive at 5 mph on back roads with the hazards on, while also coming to a complete stop where there was on-coming traffic because the outcome of not doing that COULD mean you swerve into a car and kill someone. * Engineering is about *MANAGING THE ERRORS** so that you still get the outcome in a reasonably "good enough" shape. One type of these errors is, as you pointed out, loss of accuracy from linearization.

summary

  • You do lose information and accuracy.

  • That's not that big of a deal if it's not that big of a deal

    • sorting out if it is a big deal in that particular instance takes math and engineering.
  • Lots of standards do this to make things CONSISTENT. E.g. see the IEC's RTD CVD.

1

u/eddy2029 1d ago

I think the idea they’re trying to show is much simpler:

Imagine you have a sensor which measures a signal x. The problem is that the sensor is non linear, so, for example, its output is e^x.

Instead of using it as it is, since we like to work with linear systems, we find a way to make it linear. In our example you’d have to take the ln. So after the “linearization” block your output is ln(e^x) = x. Then, since you might want to change the slope, in general you can use a linearization which is A*ln( output ), whith whatever A you need.

Now, if the sensor characteristic were different you would use a different function. Also, this large signal linearization isn’t always possible, so it’s common do do a first order taylor (small signal approx) and accept some amount of error