Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help me to calculate Temperature from this equation!

Status
Not open for further replies.

sush

Member level 4
Member level 4
Joined
Aug 24, 2005
Messages
78
Helped
3
Reputation
6
Reaction score
2
Trophy points
1,288
Activity points
1,946
how to solve it

hi all
i want to design a Nickel-120 RTD based temperature controller.

Linearization equation for nickel is:
Rt/R0 = 1+ aT + bT^2 + cT^3 + DT^4 + ET^5 + FT^6

where
T is the unknown temperature

a= 5.485 x 10^-3

b= 6.65 x 10^-6

c= 0

d = 2.805 x 10^-11

e= 0

f= -2 x 10^-17

R0=120

and Rt is the resistance value of RTD obtained from external hardware.

now i have to calculate Temperture out of this equation.

how can i solve this algebric equation for t ? i have the value of Rt/R0.
i tried using log but got stuck with log of negative number.

basically we need a equation in terms of R ; i.e. T= ...............
so that i can calculate out the temperature from R value obtained from external hardware.

i'm using Keil c51. 89c51, LCD

thnkx
byee
 

how to solve it

**broken link removed**
**broken link removed**

??
 

Re: how to solve it

hello,

You can use my software posted in this topic :



You can use Excel to generate a text file containy the data of your RTD in two columns. The first column is T and the second column is R values. Then you run my linSens program on your file. The linSens program will compute linearization polynomials that represents R=f(T) and T=g(R).

Take a look at the "pt46.dat" example file contained in lensens.zip distribution and the result file "result_pt46.txt" that show how to compute the linearization.

If you need more help let me know.

Sincereley
 

    sush

    Points: 2
    Helpful Answer Positive Rating
Re: how to solve it

first of all i'l thank you for taking efforts for me. I tried running your software. but it is giving differnt values which r not correct. secondly, the software first gives the direct equation then the inverse equation but when we chose for inverse the software just shows the equation for fraction of second and then the software closes itself. somehow i was able to capture the image which i'm sending. i designed the table in excel and saved it as .Dat file which also i'm sending. see if you can please help me out in finding the right equation.Thanks
 

Re: how to solve it

Hello,

The LinSens program is a Windows console programm. So you must run it in a Dos command window.
I ran it on your nickel.dat file and here are the results. You can use these results directly for your nickel linearization :
==========================================================
| |
| LINEARIZATION SOFTWARE |
| |
|http://www.alamath.com alamath@alamath.com|
==========================================================
Enter the Data File Name = nickel.dat

Enter the X-unit of the 1st column [ex. C, Ohm, mV] =C

Enter the Y-unit of the 2nd column [ex. C, Ohm, mV] =Ohm

File "nickel.dat" contains 341 x 2 points
Xmin = -80 C , Xmax = 260 C
Ymin = 66.6 Ohm , Ymax = 380.3 Ohm
The slope of the (X,Y) curve is 0.9054 Ohm/C
An error of 0.01 C in X gives an error of 0.009054 Ohm
An error of 0.01 Ohm in Y gives an error of 0.01104 C

%%%%%%%%%%%%%% DIRECT LINEARIZATION %%%%%%%%%%%%%%%%%%

Enter the wanted polynomial Order = 4

Enter The max accepted Error in Y (in Ohm) = 10e-3

========== INTERVAL N░ 1===============
xmin= +141 , xmax = +260
Err max = 0.009401
Y=P(X)=
-1.404814e-008 X^4
+6.387025e-006 X^3
+0.0009123533 X^2
+1.005249 X^1
+239.8276 X^0
========== INTERVAL N░ 2===============
xmin= -2 , xmax = +141
Err max = 0.009988
Y=P(X)=
-1.451739e-009 X^4
+7.945672e-007 X^3
+0.0009314315 X^2
+0.7025649 X^1
+118.598 X^0
========== INTERVAL N░ 3===============
xmin= -80 , xmax = -2
Err max = 0.001044
Y=P(X)=
+1.35982e-008 X^4
+1.349032e-006 X^3
+2.628075e-005 X^2
+0.6497805 X^1
+66.60085 X^0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The File nickel.dat contains 341 x 2 points
Xmin = -80C , Xmax = 260C
Ymin = 66.6Ohm , Ymax = 380.3Ohm
The slope of the (X,Y) curve is 0.9054 Ohm/C
An error of 0.01 C in X gives an error of 0.009054 Ohm
An error of 0.01 Ohm in Y gives an error of 0.01104 C

%%%%%%%%%%%%%% INVERSE LINEARIZATION %%%%%%%%%%%%%%%%%%

Enter the wanted polynomial Order = 4

Enter The Max accepted error in X (in C) = 0.01

========== INTERVAL N░ 1===============
xmin= +227 , xmax = +380.31
Err max = 0.00938
X=Q(Y)=
+7.514729e-009 Y^4
-1.457967e-006 Y^3
-0.001022669 Y^2
+1.024941 Y^1
+128.0094 Y^0
========== INTERVAL N░ 2===============
xmin= +120.709 , xmax = +227
Err max = 0.009677
X=Q(Y)=
-7.752391e-009 Y^4
+6.23529e-006 Y^3
-0.00261534 Y^2
+1.411862 Y^1
+0.9903225 Y^0
========== INTERVAL N░ 3===============
xmin= +66.6 , xmax = +120.709
Err max = 0.001193
X=Q(Y)=
-3.868097e-008 Y^4
-1.199767e-005 Y^3
-4.998673e-007 Y^2
+1.538247 Y^1
-80.00009 Y^0
========================

Now in order to compute T versus R you look for R value in order to choose the polynomial. Let R = 150 Ohm for example. then you must choose the second inverse polynomial that covers the [120.7 227] interval. Then you can compute T by :
Y=(150-120.7);
// Notice that the origin of the polynomial is the lower bound of the interval
// in order increase the computation accuracy
T= (-7.752391e-009 *Y^4 + 6.23529e-006 *Y^3 -0.00261534 *Y^2 +1.411862 *Y^1 +0.9903225 );

You can avoid computing the power function by writing
y=a4*x^4+a3*x^3+a2*x^2+a1*x+a0
as :
y=(((a4*x + a3) *x + a2)*x + a1)*x + a0 ;

I hope I helped you.

Sincereley.
 

    sush

    Points: 2
    Helpful Answer Positive Rating
how to solve it

yazou35 Thanks a lot. I can't express myself here, for how much thankful i am. The mistake i was making in using your software was, i didn't did (150-120.7) step. u r genius yazou35. One last thing, by increasing the polynomial Order to 6 or more can i increase the accuracy of the equation.

Thanks once again

I have clicked on "helped me" twice :D
 

Re: how to solve it

sush said:
One last thing, by increasing the polynomial Order to 6 or more can i increase the accuracy of the equation.

No, Increasing the polynomial order will increase the computation complexity. If the computation is done on a microcontroller you must choose a small order. The linearaization means "replace high order polynomial with many small order ones". My software look for the biggest interval such that the linearization error is smaller than the wanted error. If you want to increase the accuracy you must choose a smaller wanted (accepted) error. this will increase the number of intervals (polynomials). If you resistance measurement is done with an accuracy S then you can choose a wanted linearization error of about S/3 which make the linearization error negligeable with respect to the measurement error.

The rules when using my software are :
1- increasing the polynomial order ==> bigger intervals ==> less polynomials
2- small accepted error ==> more intervals ==> more polynomials

The measurement accuracy depends on your hardware. If you make ratio measurement with respect to a reference resistance Rref of 400 ohm and you are using a 10 bits ADC converter then your quantification error is 400/2^10 = 0.4 ohm . In this case an accepted linearization error of 0.1 ohm is strongly enough.

Good luck :D
 

    sush

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top