CN101922981B - Thermistor temperature detecting method based on DSP (Digital Signal Processing) - Google Patents

Thermistor temperature detecting method based on DSP (Digital Signal Processing) Download PDF

Info

Publication number
CN101922981B
CN101922981B CN2010102782433A CN201010278243A CN101922981B CN 101922981 B CN101922981 B CN 101922981B CN 2010102782433 A CN2010102782433 A CN 2010102782433A CN 201010278243 A CN201010278243 A CN 201010278243A CN 101922981 B CN101922981 B CN 101922981B
Authority
CN
China
Prior art keywords
thermistor
dsp
resistance
temperature
lnr
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2010102782433A
Other languages
Chinese (zh)
Other versions
CN101922981A (en
Inventor
蔡畅
康现伟
陶文涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wisdri Wuhan Automation Co Ltd
Original Assignee
Wisdri Wuhan Automation Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wisdri Wuhan Automation Co Ltd filed Critical Wisdri Wuhan Automation Co Ltd
Priority to CN2010102782433A priority Critical patent/CN101922981B/en
Publication of CN101922981A publication Critical patent/CN101922981A/en
Application granted granted Critical
Publication of CN101922981B publication Critical patent/CN101922981B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a thermistor temperature detecting method based on DSP, wherein a relational expression between T and lgR-T is obtained by utilizing the temperature of thermistor R-T characteristic detection power equipment and fitting a lgR-T curve in DSP. The method comprises the following steps of: converting the computation for lnR into the approximate operation of addition, subtraction, multiplication and division, obtaining a computing formula by adopting a high-item truncation approximate computing method, then determining a segmenting mode by adopting an error comparison method, and finally obtaining the lnR value of each segment by adopting a segmentation algorithm to realize accurate temperature computation. The temperature detecting precision is greatly improved by adopting the method; the method is simple to realize and has high operational speed; the hardware structure is simple, and the cost is saved.

Description

A kind of thermistor temperature detecting method based on DSP
Technical field
The present invention relates to a kind of temp measuring method, particularly based on the thermistor temperature detecting method of DSP.
Background technology
Temperature is controlled in other industrial control equipments such as frequency converter, UPS and often uses.Control system when temperature exceeds normal range of operation, is carried out overheating protection to equipment according to the control of temperature value decision to radiator fan, and preventing to work on causes damage to equipment.At one industrial control equipment like one of necessary design when temperature control is design of Controller in the equipment such as frequency converter, UPS.Temperature detection and control method to this type of opertaing device is complicated at present, and precision is not high, and hardware cost is high.
Summary of the invention
The technical matters that the present invention will solve is: a kind of thermistor temperature detecting method based on DSP is provided, can improves temperature detecting precision effectively.
The present invention solves the problems of the technologies described above the technical scheme of being taked to be: a kind of thermistor temperature detecting method based on DSP is characterized in that: it comprises following step:
S1) select for use thermistor as temperature sensor; Based on DSP platform building system for detecting temperature; System for detecting temperature is specially: first resistance and thermistor are in parallel, thermistor one end ground connection, and the other end and second resistance and the 3rd resistance link; The second resistance other end making alive U, the 3rd resistance other end output voltage U Out, connect with the AD port of DSP; Described thermistor is a negative tempperature coefficient thermistor;
S2) DSP carries out the detection of AD port voltage, carries out the U that obtains after AD proofreaies and correct according to the value of the register that detects OutValue, and the resistance of each resistance calculate the R value;
S3) obtain the R-T family curve by the thermistor instructions, R is asked denary logarithm, obtain the lgR-T curve, the lgR-T curve is carried out cubic fit obtain the relational expression between T and the lgR;
S4) in fixed DSP, the calculating of lnR is converted into the operate approximately of addition subtraction multiplication and division, takes " the high approximation technique of house " to obtain computing formula, and then adopt the error relative method to confirm segmented mode, adopt segmentation algorithm to obtain the lnR value of each segmentation at last;
S5) since with S2) R that draws corresponds to S4) and segmentation in; Draw lnR; Be updated to S3) relational expression in, calculate this moment thermistor temperature value T.
Press such scheme, described step S4) in segmentation algorithm be specially and R carried out 2 repeatedly number formulary segmentation, make R=2 a* 2 b, wherein a is greater than the integer that waits 0,0<b<1, so have:
Figure BDA0000026009470000021
2 a<R=2 a* 2 b<2 A+1, the span of the R that the temperature range that in the R-T curve, obtains detecting is corresponding is with the value of a foundation as segmentation; Obtain the lnR computing formula of each segmentation; This moment is because a is a constant, so the first addend item of lnR computing formula is constant, in the second addend item Be the number in 1 to 2 scope, can directly use " the high approximation technique of house " and calculate.
Press such scheme, the resistance of first resistance, second resistance and the 3rd resistance is chosen so that U OutIn dsp chip AD end input voltage range, be as the criterion.
Principle of work of the present invention is: the characteristic of thermistor is the nonlinear function of a complicacy, is difficult to accurately obtain its relational expression, can only adopt approximate method to calculate.The R-T class of a curve is similar to the logarithmic function curve, therefore the R-T curve is asked denary logarithm, obtains the lgR-T curve, and visible lgR-T curve linear degree is higher, realizes match easily.The lgR-T curve is carried out cubic fit, and the error that calculates is very little.
Because how then calculates lnR with fixed-point algorithm and can obtain lgR in DSP.In fixed DSP, can only carry out the computing of addition subtraction multiplication and division, the operate approximately that must be converted into addition subtraction multiplication and division comes indirect calculation lnR.
ln ( 1 - x ) = - x - x 2 2 - x 3 3 - . . . - x n n ln ( 1 + x ) = x - x 2 x + x 3 3 + . . . + ( - 1 ) n - 1 x n n ln ( 1 - x 1 + x ) = - 2 × ( x + x 3 3 + x 5 5 + . . . ) - - - ( 1 ) ,
Make that
Figure BDA0000026009470000025
substitution (1) obtains
Figure BDA0000026009470000026
because 0<R<+∞, therefore the high-order term cast out more than 5 times of (2) formula obtains
ln R = - 2 × [ 1 - R 1 + R + 1 3 ( 1 - R 1 + R ) 3 ] - - - ( 3 ) ,
When (3) condition set up of formula is and
Figure BDA00000260094700000210
, through (3) formula calculate error just more little.
Adopt the error relative method to confirm the R segmented mode, adopt segmentation algorithm to obtain the lnR value of each segmentation at last.
Beneficial effect of the present invention is: 1, adopt the method to make temperature detecting precision improve greatly; 2, the method realizes simply, fast operation; 3, hardware configuration is simple, practices thrift cost.
Description of drawings
Fig. 1 is based on DSP platform building system for detecting temperature structural drawing
Fig. 2 obtains the lgR-T curve for the thermistor R-T curvilinear transformation of one embodiment of the invention
Fig. 3 is the temperature error curve to obtaining after the lgR-T curve cubic fit among Fig. 2
Fig. 4 is lnR error E (lnR) figure of one embodiment of the invention
Fig. 5 is temperature error E (T) figure of one embodiment of the invention
Embodiment
Fig. 1 is based on DSP platform building system for detecting temperature structural drawing, and the bleeder circuit of using the 3.3V reference power supply is realized the voltage transitions of the resistance of thermistor, and voltage is measured through the AD mouth of DSP, and other all are accomplished remaining temperature computation in the DSP the inside.Wherein bleeder circuit is used after resistance and the thermistor parallel connection of 10K of one 1% precision the output voltage of connecting with the resistance of the 10K of 1% same precision afterwards to the AD mouth of DSP again.Carry out AD in the DSP the inside and detect the AD mouth input voltage U after voltage obtains dividing potential drop Out
The selected thermistor of present embodiment is a negative tempperature coefficient thermistor, and its model is: NTSA0103FZ485, can satisfy-40 ℃-105 ℃ temperature detection requirement.
The concrete steps of present embodiment are:
1) DSP carries out AD mouth voltage detecting, obtains U with carrying out according to the value of the register that detects after AD proofreaies and correct Out, calculate R value relation then and be:
R = 10 × U out U - 2 U out - - - ( 4 )
What adopt in this step is that the resistance of 1% precision carries out dividing potential drop, and the AD of DSP detects that to have obtained the precision after the linearity correction enough good, and the error of calculation of this step is smaller.
2) obtain the R-T family curve by the thermistor instructions, it is asked denary logarithm, obtain the lgR-T curve, as shown in Figure 2.The characteristic of thermistor is the nonlinear function of a complicacy, is difficult to accurately obtain its relational expression, can only adopt approximate method to calculate.Can find out that by the left figure of Fig. 2 the R-T class of a curve is similar to the logarithmic function curve, therefore R-T curve R asked denary logarithm, obtain the lgR-T curve, like the right figure of Fig. 2, visible lgR-T curve linear degree is higher, realizes match easily.
3) the lgR-T curve is carried out cubic fit and obtains the relational expression between T and the lgR:
T=-1.007(lgR) 3+10.64(lgR) 2-69.49(lgR)+84.80 (5)
Temperature error figure to the lgR-T curve carries out obtaining after the cubic fit is as shown in Figure 3; The difference Δ T of the temperature that temperature that horizontal ordinate is represented to calculate for specific resistance value R among the figure and desirable R-T curve are tried to achieve, ordinate represent the thermistor temp value T that specific resistance value R is corresponding.Can know by figure, when lgR calculates cubic fit calculates under the situation accurately error within 0.1 degree centigrade of scope.
4) because
Figure BDA0000026009470000041
comes indirect calculation to go out lgR with the operate approximately that fixed-point algorithm is converted into addition subtraction multiplication and division in DSP.
ln ( 1 - x ) = - x - x 2 2 - x 3 3 - . . . - x n n ln ( 1 + x ) = x - x 2 x + x 3 3 + . . . + ( - 1 ) n - 1 x n n ln ( 1 - x 1 + x ) = - 2 × ( x + x 3 3 + x 5 5 + . . . ) - - - ( 1 )
Make
Figure BDA0000026009470000043
here 0<R<+∞,
Figure BDA0000026009470000044
arranged
ln R = - 2 × [ 1 - R 1 + R + 1 3 ( 1 - R 1 + R ) 3 + 1 5 ( 1 - R 1 + R ) 5 . . . ] - - - ( 2 )
The high-order term that following formula is cast out more than 5 times obtains:
ln R = - 2 × [ 1 - R 1 + R + 1 3 ( 1 - R 1 + R ) 3 ] - - - ( 3 )
When (3) condition set up of formula is
Figure BDA0000026009470000047
and
Figure BDA0000026009470000048
, through (3) formula calculate error just more little.Because 360>R>0.5 in-40<T<100 scopes; When R=0.5,
Figure BDA0000026009470000049
at this moment
ln R = - 2 × [ 1 3 + 1 3 ( 1 3 ) 3 ] = - 0.69136 ln 0.5 = - 0.69315 - - - ( 6 )
There is temperature computation error E (T)=0.054 degree that obtains error E=0.00179 that formula (6) is calculated in the substitution formula (5).
Make
Figure BDA00000260094700000411
promptly in 0.5<R<2 o'clock, formula (3), (5) calculate error E<0.00179E (T)<0.054.Make full use of these characteristics at present, make R=2 a* 2 b, wherein a is that 0<b<1 has greater than the integer that waits 0:
log 2 ( R ) = ( a + b ) ln ( R ) = ln 2 * log 2 ( R ) = ln 2 * ( a + b ) ln ( R ) = a * ln 2 + b * ln 2
2 b = R 2 a ⇒ b = log 2 ( R 2 a ) = ln ( R 2 a ) ln 2
ln ( R ) = a * ln 2 + ln ( R 2 a ) - - - ( 7 )
By 0<b<1, then have 1<2 b<2, promptly be Consequent can the using of event formula (7) " the high approximation technique of house " realized, and (7) formula preceding paragraph is a constant, and (7) formula has only a unknown quantity a, and how present goal displacement confirms a if arriving.
By R=2 a* 2 b, wherein a is that 0<b<1 obtains 2 greater than the integer that waits 0 a<R=2 a* 2 b<2 A+1, adopt and just can realize asking a value and 2 the R staging treating aBe worth.
Want detected temperatures-20 ℃ 0<R<102 in 105 ℃ of scopes at us, then R carried out 2 repeatedly number formulary segmentation, and calculate like following table with segmentation algorithm:
Table 1 carries out segmentation by 2 repeatedly number formulary to R
R 2 a a lnR
64<R<=128 64 6 6*ln2+ln(R/64)
32<R<=64 32 5 5*ln2+ln(R/32)
16<R<=32 16 4 4*ln2+ln(R/16)
8<R<=16 8 3 3*ln2+ln(R/8)
4<R<=8 4 2 2*ln2+ln(R/4)
2<R<=4 2 1 ln2+ln(R/2)
0<R<=2 1 0 0+lnR
Calculate through staging treating like this; In the table 1 in the second addend item of computing formula R/64, R/32 etc. all be the number in 1 to 2 scope; The second addend item has proved that can directly use " the high approximation technique of house " calculates, and can accomplish very little so resulting error is calculated in above segmentation.LnR error E (lnR) figure and the temperature error E (T) that obtain through the method for the invention scheme; It is respectively like Fig. 4, shown in Figure 5; In the drawings horizontal ordinate represent the corresponding temperature value T of the thermistor resistance R that will calculate, ordinate is represented the lnR error E (lnR), the temperature error E (T) that calculate.The lnR graph of errors that curve 1 directly calculates with 3 formulas for not segmentation among Fig. 4, the lnR graph of errors of curve 2 for adopting new sectional type to calculate.Temperature error E (T) curve that curve 3 directly uses (3) formula to calculate for not segmentation among Fig. 5, temperature error E (T) curve of curve (4) for adopting new sectional type algorithm computation to draw.Clearly, adopt new sectional type computing, can reduce the sum of errors temperature error of temperature at the lnR that calculates of the following thermistor resistance R of 60 degree greatly, the precision of the lnR value that new algorithm calculates can reach the precision of temperature detection fully.If the AD of system detect and R under the reliable situation of peripheral circuit precision of U, the method for the invention accounting temperature deviation is in 0.054 degree scope.

Claims (3)

1. thermistor temperature detecting method based on DSP, it is characterized in that: it comprises following step:
S1) select for use thermistor as temperature sensor; Based on DSP platform building system for detecting temperature; System for detecting temperature is specially: first resistance and thermistor are in parallel, thermistor one end ground connection, and the other end is connected with the 3rd resistance with second resistance; The second resistance other end making alive U, the 3rd resistance other end output voltage U Out, be connected with the AD port of DSP; Described thermistor is a negative tempperature coefficient thermistor;
S2) DSP carries out the detection of AD port voltage, carries out the U that obtains after AD proofreaies and correct according to the value of the register that detects OutValue, and the resistance of each resistance calculate the R value;
S3) obtain the R-T family curve by the thermistor instructions, R is asked denary logarithm, obtain the lgR-T curve, the lgR-T curve is carried out cubic fit obtain the relational expression between T and the lgR;
S4) in fixed DSP, the calculating of lnR is converted into the operate approximately of addition subtraction multiplication and division, takes " the high approximation technique of house " to obtain computing formula, and then adopt the error relative method to confirm segmented mode, adopt segmentation algorithm to obtain the lnR value of each segmentation at last;
S5) since
Figure FDA0000074958170000011
with S2) R that draws corresponds to S4) and segmentation in; Draw lnR; Be updated to S3) relational expression in, calculate this moment thermistor temperature value T.
2. a kind of thermistor temperature detecting method based on DSP according to claim 1 is characterized in that: the segmentation algorithm described step S4) is specially and R is carried out 2 repeatedly number formulary segmentation, makes R=2 a* 2 b, wherein a is greater than the integer that waits 0,0<b<1, so have:
Figure FDA0000074958170000012
2 a<R=2 a* 2 b<2 A+1, the span of the R that the temperature range that in the R-T curve, obtains detecting is corresponding is with the value of a foundation as segmentation; Obtain the lnR computing formula of each segmentation; This moment is because a is a constant, so the first addend item of lnR computing formula is constant, in the second addend item
Figure FDA0000074958170000013
Be the number in 1 to 2 scope, can directly use " the high approximation technique of house " and calculate.
3. a kind of thermistor temperature detecting method based on DSP according to claim 1 and 2 is characterized in that: the resistance of first resistance, second resistance and the 3rd resistance is chosen so that U OutIn dsp chip AD end input voltage range, be as the criterion.
CN2010102782433A 2010-09-10 2010-09-10 Thermistor temperature detecting method based on DSP (Digital Signal Processing) Active CN101922981B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010102782433A CN101922981B (en) 2010-09-10 2010-09-10 Thermistor temperature detecting method based on DSP (Digital Signal Processing)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010102782433A CN101922981B (en) 2010-09-10 2010-09-10 Thermistor temperature detecting method based on DSP (Digital Signal Processing)

Publications (2)

Publication Number Publication Date
CN101922981A CN101922981A (en) 2010-12-22
CN101922981B true CN101922981B (en) 2012-01-04

Family

ID=43338044

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010102782433A Active CN101922981B (en) 2010-09-10 2010-09-10 Thermistor temperature detecting method based on DSP (Digital Signal Processing)

Country Status (1)

Country Link
CN (1) CN101922981B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103961066B (en) * 2013-01-24 2015-12-23 重庆融海超声医学工程研究中心有限公司 A kind of temp measuring method and temperature measuring equipment
CN103970184B (en) * 2013-02-06 2017-05-17 上海东软载波微电子有限公司 Method and device for adjusting real time clock system
CN104048777B (en) * 2014-06-24 2017-02-01 中国东方电气集团有限公司 Temperature value and resistance value conversion method for NTC-type thermistor
CN104697659B (en) * 2015-03-04 2018-03-20 徐州工程学院 A kind of temperature measuring equipment and method using NTC thermistor
CN105350076A (en) * 2015-11-06 2016-02-24 山西晶科光电材料有限公司 Monitoring method for sapphire crystal growth temperature
CN106706153B (en) * 2017-03-17 2019-09-06 北京航天试验技术研究所 A kind of processing method of low temperature temperature-sensitive resistance-temperature characteristic data
CN110044508B (en) * 2018-01-15 2021-02-26 佛山市顺德区美的电热电器制造有限公司 Electromagnetic heating system and temperature measuring method and device thereof
CN109580028A (en) * 2018-12-19 2019-04-05 上海帆声图像科技有限公司 Heat up measurement method inside display screen
CN111623898A (en) * 2020-06-24 2020-09-04 广东纽恩泰新能源科技发展有限公司 NTC thermistor temperature and resistance detection method and temperature sensor detection method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118190A (en) * 2007-06-15 2008-02-06 杨如祥 Temperature measurement device and process for measuring temperature with device
CN101771428A (en) * 2010-01-19 2010-07-07 青岛海信移动通信技术股份有限公司 Temperature detection circuit and mobile communication equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101118190A (en) * 2007-06-15 2008-02-06 杨如祥 Temperature measurement device and process for measuring temperature with device
CN101771428A (en) * 2010-01-19 2010-07-07 青岛海信移动通信技术股份有限公司 Temperature detection circuit and mobile communication equipment

Also Published As

Publication number Publication date
CN101922981A (en) 2010-12-22

Similar Documents

Publication Publication Date Title
CN101922981B (en) Thermistor temperature detecting method based on DSP (Digital Signal Processing)
CN103777067B (en) Chip power-consumption measuring circuit, chip and chip power-consumption measuring method
CN101621810A (en) Received signal strength indication detector and method for calibrating received signal strength indication
CN105352630A (en) Segmental linear calibration system and method for temperature sensor chip
CN103185645B (en) High-precision temperature detecting device and detecting method applied to draught fan control system
CN108168680B (en) Dynamic weighing filtering method and system
CN105629052B (en) Chip power-consumption real-time detection method
CN101470164B (en) Method for measuring S parameter of passive circuit and measuring apparatus for implementing the same
CN112104417B (en) Optical power detection and parameter calibration method and device, electronic equipment and storage medium
CN106094963A (en) APD array chip bias voltage Full-automatic temperature compensation system
US20120101750A1 (en) Device for measuring power supply efficiency and method for using same
CN205102947U (en) Three -way formula platinum resistance PT100 temperature detection circuit
Hanta et al. Rational approximation of time delay
CN103389753A (en) Water temperature monitoring system with water temperature signal amplification function
CN205228677U (en) A linear calbiration system of segmentation for temperature sensor chips
US11423203B2 (en) System and method for modeling thermal circuits
CN105571590B (en) A kind of fusion compensation method
CN203551125U (en) Over-temperature alarm circuit
CN103234881A (en) Atmospheric particulate matter monitor
US20170288439A1 (en) Signal processing circuit, coulomb counter circuit, and electronic device
CN102735269A (en) Correction method and device
CN114509185A (en) System and method for partitioning measurement precision of surface acoustic wave temperature sensor in low-temperature environment
CN104406641B (en) A kind of ultrasonic flowmeter peak-value detection method and compensation system
CN206670832U (en) A kind of device for lifting temperature survey precision
KR101488694B1 (en) a volume perceiving ilquid flow meter program and the ilquid flow rate measuring method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant