Two-wire system thermal resistance thermometric conductor resistance is the method for compensation automatically
Technical field
The present invention relates to a kind of temperature measurement technology, particularly a kind of two-wire system thermal resistance thermometric conductor resistance is the method for compensation automatically.
Background technology
Temperature is one of production process parameters the most frequently used in the present commercial production, and the measuring method of therefore studying temperature is significant with device.Practical temperature sensor kind is a lot, abroad is main (accounting for 2/3) with the radiation temperature measurement, domestic then adopt thermopair and thermal resistances (accounting for 98%) more.
The lead-in wire of thermal resistance mainly contains two-wire system, three-wire system and three kinds of modes of four-wire system at present.
Two-wire system: respectively connect mode that a lead draws resistance signal at the two ends of thermal resistance two-wire system.This lead-in wire method is very simple, but certainly exists lead resistance R owing to connect lead, and the size of resistance R is relevant with the factor of the material of lead and length, and therefore this lead-in wire mode only is applicable to the occasion that measuring accuracy is lower.
Three-wire system: the end at the root of thermal resistance connects a lead-in wire; The mode that the other end connects two lead-in wires is called three-wire system; Common and the supporting use of electric bridge of this mode can be eliminated the influence of lead resistance preferably, is the most frequently used lead resistance in the industrial process control.
Four-wire system: the mode that respectively connects two leads at the root two ends of thermal resistance is called four-wire system, and wherein two lead-in wires provide steady current I for thermal resistance, convert R to voltage signal U, causes secondary instrument to U through other two lead-in wires again.This lead-in wire mode can be eliminated the resistance influence of lead-in wire fully, is mainly used in high-precision temperature detection.
Therefore, not only there be the influence of conductor resistance to the thermal resistance resistance in traditional two-wire system thermal resistance resistance measuring method, but also exists the temperature that causes because of temperature variation to float.
Summary of the invention
It is low and receive the big problem of extraneous thermal effect to The present invention be directed to the two line system temp measuring accuracy; A kind of two-wire system thermal resistance thermometric conductor resistance method of compensation has automatically been proposed; Utilize capacitor charge and discharge principle and single-chip microcomputer function, ingeniously accurately calculate thermoelectric resistance.
Technical scheme of the present invention is: a kind of two-wire system thermal resistance thermometric conductor resistance is the method for compensation automatically, specifically comprises the steps:
1) set up sample circuit: circuit is made up of the single-chip microcomputer and the constant current source of interior band A/D conversion, and constant current source output connects the two-wire system thermal resistance, and the A/D port of single-chip microcomputer connects the two-wire system thermal resistance, electric capacity of parallel connection at the thermal resistance two ends, and this electric capacity is sampling capacitance;
2) sampling: set the A/D converter sampling time, the port of single-chip microcomputer output control constant current source switch, at first ports-settings is 1; Close constant current source, to the discharge delay time, ports-settings is 0; Open constant current source, rise to the specified working current time to the constant current source electric current, A/D converter begins sample voltage value; Compose sampled value to V1, and then delay time the duration of charging, A/D converter carries out the second time and gathers; Compose collection second time value to V2, single-chip microcomputer calculates the voltage V3=V1-V2 on the thermal resistance, and voltage obtains the thermal resistance resistance divided by constant current source output constant current value;
3) capacitance verification: replace electric capacity with shorting stub, A/D converter collects actual V1 value, comparison step 2) in V1 value,, return step 1) change capacitor's capacity after, repeating step 2 different like two values) sample, be worth identical up to two.
The said sampling capacitance duration of charging is less than the specified working current time of rising to of constant current source.
Single-chip microcomputer is selected the MC9S12XS128 single-chip microcomputer for use in the said constant current source, the A/D converter of inner 12 successive approximations.
Beneficial effect of the present invention is: two-wire system thermal resistance thermometric conductor resistance of the present invention is the method for compensation automatically; Can be applicable in the measurement of industry spot all temps; Compare common two line system temp measuring accuracy and improve greatly, reach certain class requirement, can save hardware resource; Simply, efficiently, economy, reliability is high, can be applicable to during the industry spot all temps measures.
Description of drawings
Fig. 1 realizes circuit diagram for the method that two-wire system thermal resistance thermometric conductor resistance of the present invention compensates automatically;
Fig. 2 is constant current source powered on moment capacitance short-circuit isoboles in the method for the automatic compensation of two-wire system thermal resistance thermometric conductor resistance of the present invention;
Fig. 3 is the automatic method constant current source of the compensation electric capacity isoboles that opens circuit that powers on behind the certain hour of two-wire system thermal resistance thermometric conductor resistance of the present invention;
The method program process flow diagram that Fig. 4 compensates for two-wire system thermal resistance thermometric conductor resistance of the present invention automatically.
Embodiment
The two-wire system thermal resistance thermometric conductor resistance method of compensation automatically is based on the single-chip microcomputer acquisition system, adds a sampling capacitance that is skillfully constructed, and system uses the simplest equipment to solve a complicated problems.
Like Fig. 1 circuit diagram, comprise by the monolithic unit and the constant current source of interior band A/D conversion and forming that constant current source output connects the two-wire system thermal resistance and supplies power to it; The A/D port of single-chip microcomputer connects the two-wire system thermal resistance, capacitor C of parallel connection at the thermal resistance two ends, and this capacitor C is referred to as sampling capacitance; Electric capacity is equivalent to a container of containing electricity, and it is a capacitive to the impedance of electric current, therefore is called capacitive reactance; A key property of capacitive reactance is exactly to be directly proportional with current electric capacity; The current electric capacity of electric capacity is big more, and capacitive reactance is big more, and is just big more to the impedance of electric current; The current electric capacity of electric capacity is more little, and capacitive reactance is more little, and is just more little to the impedance of electric current.Electric capacity is before powering on, and being equivalent to electric capacity is zero, promptly is not with any electric charge, and capacitive reactance at this moment is also minimum; The energising immediate current is very big, almost is equivalent to short circuit, after a period of time that powers on; Owing to be full of electric charge on the electric capacity, capacitive reactance at this moment is maximum, has played the effect of opening circuit.
This scheme is through the open and close of the I/O mouth control constant current source of single-chip microcomputer.When opening constant current source, upper reaches, thermal resistance loop excess current owing to just power on, is not with any electric charge on the capacitor C, almost be equivalent to short circuit, and its isoboles is as shown in Figure 2, so the voltage V1 that utilizes A/D to sample is exactly two voltage sums on the conductor resistance; After constant current source is opened a period of time; Be full of electric charge on the electric capacity; Total be equivalent to open circuit, isoboles is as shown in Figure 3, be exactly two conductor resistances of voltage V2 that at this moment sample through A/D again and the voltage on the thermal resistance resistance; Can calculate the voltage V3 on the thermal resistance, i.e. V3=V2-V1 through single-chip microcomputer.What the present invention adopted is constant current source, calculates the resistance that voltage on the thermal resistance has also just been known thermal resistance, has so just eliminated the influence of conductor resistance to the thermal resistance resistance, thereby has made temp measuring system more accurate.
Program circuit of the present invention is as shown in Figure 4.Master routine is at first set bus clock, for transformation period of A/D provides clock reference.Afterwards A/D converter is carried out initialization, promptly to the setting of registers such as the working method of A/D converter, switching time, precision.I/O mouth to single-chip microcomputer is that the PA0 mouth is set to delivery outlet then, and at first is set at 1, and the purpose of doing like this is to close constant current source, and the 100ms that delays time afterwards lets capacitor discharge arrive zero charge.After electric capacity had been put electricity, PA0 was set at 0, opened constant current source.And then time-delay 20us, purpose is in order to let constant current source rise to specified working current 1mA.Carry out A/D sampling again, compose the value of adopting to V1, V1 is exactly the voltage on the conductor resistance that measures of the short-circuiting effect of electric capacity powered on moment.At time-delay 100ms, let electric capacity be full of electricity then, make electric capacity form the effect that opens circuit, carry out the A/D sampling at last again, compose the value of adopting to V2, V2 is exactly the voltage on conductor resistance and the thermal resistance all-in resistance.Like this, just can learn the voltage V3=V1-V2 on the thermal resistance.
Image data is like table 1-5, and table 1 is worked as C=22uf, the sampling code value of V1 during t=5.3us; Table 2 is worked as C=22uf, the sampling code value of V1 during t=10.6us; Table 3 is worked as C=22uf, the sampling code value of V1 during t=21.2us; Table 4 is worked as C=47uf, the sampling code value of V1 during t=21.2us; Table 5 is worked as C=680uf, the sampling code value of V1 during t=31.8us.
Table 1
Table 2
Table 3
Table 4
Table 5
V1
|
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
10 |
When experimental data is gathered, replace electric capacity with a shorting stub, can collect V1 value actual correct on the conductor resistance like this, V1=4V.
From experimental data, can find out, when capacitance is 22uf and 47uf, just can adopt data when having only time delay, that is to say, the rise time 10.6us < t < 21.2us of constant current source greater than 21.2us.Simultaneously, the value that capacitance C adopts when big is bigger than the value error that capacitance C hour adopts, thus can not choose bigger electric capacity in order to obtain bigger capacitor charging time, otherwise be easy to generate than mistake.Through too much group experiment contrast, the value that system adopts when capacitance C=47uf is the most accurately, and capacitor C is full of the rise time of the time of electricity less than constant current source, and measured effect is fine.So native system adopts the sampling capacitance of 47uf.
Simultaneously can find that promptly used the electric capacity of suitable capacitance value, still there is certain error in the data value of adopting.This is that the reference voltage of sampling is 5V because the data sampling of native system adopts is the A/D converter of 12 successive approximations carrying of MC9S12XS128 single-chip microcomputer inside, thus minimum can detected analog quantity changing value be 1/2
12, the sampling resolution that is to say native system is 5/2
12=1.221mV.
The V1=4 of code value accurately that systematic survey obtains, but the code value of sampling sometimes is 5, that is to say minimum one that differs between actual value and the exact value to A/D, and promptly the maximal value of native system absolute error is the sampling resolution of A/D.The range of native system is
.According to the accuracy of instrument computing formula:
; Therefore, the native system precision is:
; So the precision that the native system thermal resistance is measured just is 0.024%.