Electronic – How to calculate measurement error in an exponentially non-linear sensor? (self made pressure sensor)

accuracycalibrationerrorsensorthermistor

I'm trying to calculate the measurement error from a home-made pressure sensor which I have in a voltage divider circuit. It has the same negative exponential non-linear resistance characteristics as an NTC thermistor: with increasing force [N] the resistance [ohms] decreases non-linearly. The pressure sensor acts as a variable resistor, and I am measuring the voltage drop across it using an 8bit ADC.

So far, I have taken resistance measurements (with a multimeter accuracy to .1 ohm) of the homemade velostat pressure sensor at exerted forces from 1 to 10 N using a force gauge (with an accuracy of 0.05N), with 5 resistance measurements at each force value. The average of the 5 measurements are graphed below.

My plan to calculate the exerted force [N] is to use a "power function" which is created from the data in Excel and rearrange it to solve for X (force) at a certain Y (resistance). The resistance (Y) is derived from the voltage measured by the ADC.

Is this a good approach, or should I use a lookup table or linear interpolation? (I'm not sure on how to do either of these yet.)

How do I calculate the measurement error from the sensor seeing as resistance changes only a small amount in higher force ranges, and resistance changes a lot (sensitive) at small exerted force ranges?

enter image description here

enter image description here

EDIT: added chart of my resistance measurements with max and min values graphed (the 20 measurements at each value of F [N] not shown in table).

enter image description here

enter image description here

Best Answer

$$V_2=V_{ref}\dfrac{R_t}{R_1+R_t}=V_{ref}(\dfrac{1}{1+\dfrac{R_1}{R_t}})$$

$$V_2=V_{ref}(\dfrac{1}{1+\dfrac{R_1}{244.5x^{-0.941}}})$$

$$R_t=\dfrac{R_1}{\dfrac{V_{ref}}{V_2}-1}$$

$$244.5x^{-0.941}=\dfrac{R_1}{\dfrac{V_{ref}}{V_2}-1}$$

$$x^{-0.941}=\dfrac{R_1}{244.5(\dfrac{V_{ref}}{V_2}-1)}$$

$$-0.941\cdot lnx=ln\dfrac{R_1}{244.5(\dfrac{V_{ref}}{V_2}-1)}$$

$$x=e^(\dfrac{ln\dfrac{R_1}{244.5(\dfrac{V_{ref}}{V_2}-1)}}{-0.941})$$

$$x=\left( \dfrac{R_1}{244.5(\dfrac{V_{ref}}{V_2}-1)} \right) ^\dfrac{1}{-0.941}$$

You can now use the measurements and write the function into partial Taylor series.

$${\displaystyle x_{approx} = f(V_a)+{\frac {f'(V_a)}{1!}}(V_2-V_a)+{\frac {f''(V_a)}{2!}}(V_2-V_a)^{2}+{\frac {f'''(V_a)}{3!}}(V_2-V_a)^{3}+\cdots ,}$$

For each measurement point a, you calculate the 1 to n-th differential (additional LUT table, with fixed numbers) and then you calculate the interpolated value. Using just 1st derivative could be just fine, with 2nd derivative the measurement error will be greater than approximation error, 3rd derivative is an overkill.

If you have some MATLAB, Octave,...you could solve the derivations and calculate numbers. Then you use those pre-calculated values with regard of your calibration points. The only overhead to the CPU is then squaring the (V2-Va).

You could expand/modify the Taylor series for two neighboring points. link

EDIT:

I have searched the net for some symbolic differentiation. First of all in the school books you will usually find a function defined as y=f(x) so lets rearrange

y=(R_1/(244.45*(V_R/x-1)))^(1/-0.941)

where y is the Force, and x is the measured voltage

I have inserted the equation (R_1/(244.45*(V_R/x-1)))^(1/-0.941) into an online solver - www.derivative-calculator.net. I have chosen the values Vref=3.3V, R1=220 ohm.

enter image description here

I did compute the voltage V2 according to equation (1) when Rt=130, according to your graph (function equivalent) it should be at force=2.

V2=3.3* 130/(220+130) = 1,225V

I got this:

enter image description here

The force should be approx. 2, I don't know why is this deviation. The solver also made an simplification of the function:

$$\dfrac{4889^\frac{1000}{941}\left(\frac{V_{ref}}{x}-1\right)^\frac{1000}{941}}{20^\frac{1000}{941}R_1^\frac{1000}{941}}$$

Finally, the 1st derivative is: $$-\dfrac{50{\cdot}4889^\frac{1000}{941}V_{ref}\left(\frac{V_{ref}}{x}-1\right)^\frac{59}{941}}{941{\cdot}20^\frac{59}{941}R_1^\frac{1000}{941}x^2}$$

Now all you have to do is to insert values.

For example 1st point (F=1; Rt=230), V2=3.3*230/(220+230)= 1.686V. I do insert this value as x, and the value of the 1st derivative is f'(1.686)= -1.37612. The second derivative is 1.737047.

enter image description here

For the small deviation around the 1st point the force could be computed as Taylor series of 2nd order:

$$F_{approx} = 1 - 1.37612\cdot (V_2-1.686V)+0.68806\cdot (V_2-1.686V)^2$$

Calculating the V2 for the 2nd point (F=2; Rt=135) as already before V2=1.225 and inserting into above equation gives F=1.78