The objective of the invention is to: improve under the prerequisite of total cost in little amplitude, adopt advanced temperature sensor, to improve stability, reliability, consistance and the measuring accuracy of system, and satisfy the specific (special) requirements of grain keeping department, the particular surroundings that adapts to silo is to reach the purpose of using reliably and with long-term.
Purpose of the present invention can adopt following measure to realize:
It comprisesmicrocomputer 1, printer 2, AD transition card 3, the second parallel port card 4,master controller 5 and sub-controller andsensor 6 thereof; AD transition card 3, the second parallel port card 4 are inserted in the expansion slot of microcomputer; Sub-controller andsensor 6 thereof are installed in the silo;Master controller 5 can connect 32 sub-controllers at most, andmaster controller 5 can reach 2KM with the ultimate range ofsub-controller 6; The extension line of second parallel port is forwarded tosub-controller 6 through redefining frommaster controller 5, and transfers to anothersub-controller 6 from asub-controller 6, is used to control the multipath conversion of sensor; Eachsub-controller 6 can connect 64 sensors at most; Total system can connect 2048 sensors at most; The output ofsub-controller 6 is through the resistance eutral grounding ofmaster controller 5, and AD transition card 3 carries out voltage sample in the resistance upper end, converts voltage digital to, converts temperature to through program again.
Master controller 5 among the present invention is to be made of module 7,module 8,module 9; Module 7 is power supply change-over devices, and the V ofsub-controller 6 is supplied with in its outputDdModule 9 is the 16th, 14,1,4 of the output of module 7, the second parallel port card 4, and 3,2 pins are forwarded tosub-controller 6, ultimate range≤2KM with 7 core shielding lines; Pin 17 is standby in themodule 9 ofmaster controller 5;Module 8 is made of 32 fixed resistances and 32 Precision trimming resistance; Their resistance sum is transferred to 10K Ω, and error is no more than ± 1 Ω; The input ofmodule 8 is from the output of 32sub-controllers 6; 32 passages that connect AD transition card 3 in the upper end of 32 resistance; The output line ofsub-controller 6 is also used shielding line; The output of eachsub-controller 6 can be merged into the multicore shielding line according to distance and entermaster controller 5; All shielding two ends all should ground connection; The ground wire of module 7 also should be carried out no resistance with the ground wire ofmicrocomputer 1 and be connected; The dc impedance of the ground wire ofsub-controller 6 farthest and the ground wire ofmaster controller 5 should be greater than 10 Ω.
Sub-controller among the present invention andsensor 6 thereof are to be made ofmodule 10, module 11,module 12; Module 11 is made of 6 groups of voltage amplifiers; Its input and 16,14,1,4 ofmodule 9,3,2 lead-foot-lines link to each other, and its output divides two groups: the S of theoutput link block 10 of 16,14,1 lead-foot-line correspondence' 2, S' 1, S' 0The S of theoutput link block 12 of another group 4,3,2 lead-foot-line correspondences2, S1, S0Module 10 is made of 4051 chips; 8 outputs of itsinput link block 12, the corresponding resistance of thenumbering link block 8 of sub-controller is pressed in its output;Module 12 is made of 8 4051 chips, 8 4028 chips, 8 HTS-2 type temperature sensors; The power end of 8 temperature sensors connects 8 output terminals of 4028 chips, and the signal end of 8 temperature sensors connects 8 input ends of 4051 chips; The S of 3 equal link blocks 11 of control end of 4051 chips and 4028 chips2, S1, S0The power supply that all devices ofsub-controller 6 all usemaster controller 5 to attract.
The second parallel port card 4 uses operational order OUT (N), M and OUT (N+2), M among the present invention; Wherein N is the first address of the second parallel port card 4, and M is an operand; When M according to 12,13, when 14,15,8,9,10,11 order changes, OUT (N+2), M will 16,14, produce 7,6,5,4,3,2,1,0 output according to the rule of the table-2 of appendix A on 1 the pin; When M according to 15,14, when 13,12,11,10,9,8 order changes, OUT (N), M will 4,3, produce 7,6,5,4,3,2,1,0 output according to the rule of the table-1 of appendix A on 2 the pin; Through the anti-phase amplification of module 11, will produce two groups ofcontrol sequences 0,1,2,3,4,5,6,7 respectively at the output terminal of module 11, be used forcontrol module 10 andmodule 12 respectively.
The rudimentary algorithm of microcomputerized multi-point remote temp measuring system of the present invention is:
(1) duplicate measurements, averaging is net result;
(2) between each the measurement, there is the time interval of 1mS;
When (3) every pair of sensor carries out measuring operation, all should carry out the sky of some earlier and measure, its measurement result is given it up;
(4) usefulness is calculated the stability of the method checking system of variance; When variance≤1000, the repeatability of measurement can reach ± 0.1 ℃ within; Otherwise, should check circuit quality of connection or sensor quality;
(5) the rudimentary algorithm program is in appendix B;
The method of adjustment of the systematic error of microcomputerized multi-point remote temp measuring system of the present invention is:
(1) sets up the temperature file, as appendix C;
(2) 64 sensors of a sub-controller (6) are put into the medium with uniform temp; Medium temperature transfers near the low warm spot;
(3), make the voltage value of the low warm spot of each sensor progressively close to the corresponding voltage numerical value of all sensors temperature-averaging value with test procedure algorithm (appendix D);
(4) with the temperature term of each sensor in copy editor's modification of program temperature file, make it consistent with medium temperature.;
(5) medium temperature is caused near high temperature dot from approaching low warm spot liter, carry out (3), (4) again;
(6) in user program, use the temperature file that has mixed up, use rudimentary algorithm and straight line two point form equation, just can converse multi-point temp accurately.
Advantage of the present invention is: total system can connect 2048 sensors at most; Maximum transmission distance can reach 2KM; Program adopts particular algorithm; In 30 ℃~+ 50 ℃ scopes, can make error≤0.5 ℃ of the corresponding point temperature on the screen of each sensor ambient temperature and microcomputer, repeatability≤0.1 ℃; Civil power does not advance silo; Energy-conservation; Needn't consider heat dissipation problem, just can be hermetically sealed to circuit implementation in the silo, to prevent harmful gas corrosion in the silo.
The present invention does with detailed description below with reference to embodiment (accompanying drawing):
Universal microcomputer 1 can be selected above any of PC-486 for use.Minimum internal memory 4MB, hard disk least residue space 20MB, VGA is colored to be shown.Software platform is that DOS6.2 is above with more than the UCDOS5.0.
Printer 2 can be selected any one on the market for use.First parallel port on the mainboard of it anduniversal microcomputer 1 links to each other according to standard method.
AD transition card 3 is selected PS-2108 type AD/DA card for use.Its important technological parameters is as follows:
▲ AD part
Conversion figure place: 8;
Analog input channel: 32 tunnel;
Mould is gone into scope: 0~+ 5V;
Switching time: (114 μ S;
Systematic error: (0.4FSR;
▲ DA part
Port number; 4 the tunnel;
All the other slightly;
The PS-2108 card is inserted in the EISA expansion slot on the mainboard of universal microcomputer 1.The cabinet ofuniversal microcomputer 1 exposes outside one 37 core socket.With 40 core flat cables it is caused in themodule 8 of master controller 5.Wherein only connect 1~37 core, all the other 38~40 core skies, method of attachment one to one, maximum length≤3 meter.The first address of PS-2108 card is set with the DIP switch on the card.Address when dispatching from the factory is 100H (decimal system 256).
The second parallel port card can be selected any one IO card for use, i.e. the following microcomputer of PC-386 interface card commonly used.The IO cartoon often has the dual serial interface, a parallel interface, a floppy drive interface, a hard-disk interface.It is inserted in the EISA expansion slot of universal microcomputer 1.The 25 core sockets that cabinet exposes outside are parallel port sockets.First parallel port of the above microcomputer of PC-486 is usually on mainboard.Microcomputer can enter SETUP program (POST program) when start.Utilize this program to be extended for two parallel ports to a parallel port of former configuration.According to the bios version difference, the first address of second parallel port may be 3BCH (decimal system 956), 378H (decimal system 888), 278H (decimal system 632).Please note and distinguish first parallel port and second parallel port, because the print screen of DOS requires printer to be connected on first parallel port.
Two serial ports on 4 road DA on the PS-2108 card, the IO card, floppy drive interface, hard-disk interface are that the LQCK system is standby when expanding again.
Microcomputerized multi-point remote temp measuring system of the present invention does not adopt the definition of 25 core pins of standard parallel port to the use of second parallel port.It has redefined 16,14,1,4,3,2,17 totally seven pins wherein, and they are caused themodule 9 ofmaster controller 5 with 7 core shielding lines.The maximum length of 7 core shielding lines≤3 meter.
No. 16 pinouts are (S' 2);
No. 14 pinouts are (S' 1);
No. 1 pinout is (S' 0);
No. 4 pinouts are (S2);
No. 3 pinouts are (S1);
No. 2 pinouts are (S0);
No. 17 pin is standby;
Master controller 5 is divided into module 7,module 8,module 9.
Module 7 is power supply change-over devices, can be by the input of 220V civil power, and+17V output, 30W power designs.+ 17V is connected to a terminal ofmodule 9 from module 7 inmaster controller 5 inside.The ground wire of module 7 must be carried out no resistance with the ground wire ofuniversal microcomputer 1 and be connected (≤4 Ω).
Module 9 is made of terminal.The rarest 9 terminals.One of them terminal connects the shielding of 7 heart yearns that second parallel port attracts, the ground wire of connection module 7, and the other end of shielding is connected the ground wire with microcomputer 1.7 terminals connect 7 cores of second parallel port.The 9th terminal connection module 7 attracts+the 17V power supply.
Module 9 also adopts 7 core shielding lines whensub-controller 6 is drawn.Except that 17 pins of second parallel port stay in the master controller standby, 6 cores of second parallel port that all the other have defined and+the 17V power supply forms 7 cores, bonding.
Sub-controller 6 is made of "preposition 4051 "module 10, " voltage amplifier " module 11 and " 4051 unit group "module 12.
The circuit diagram of " voltage amplifier " module 11 is seen Fig. 4.Transistor Q1 wherein, Q2 ..., Q12 adopts low power tube 9014; R1, R3, R5, R7, R9, R11 are 5K Ω; R2, R4, R6, R8, R10, R12 are 4.7M Ω.The 7 core shielding lines of drawing frommaster controller 5 are the input end V of connection module 11 respectivelyDd, (S' 2), (S' 1), (S' 0), (S2), (S1), (S0).Its 6 road output terminal divides two groups: S wherein' 2, S' 1, S'0Meet the S of "preposition 4051 "module 10' 2, S' 1, S' 0S2, S1, S0Meet the S of " 4051 unit group "2, S1, S0
"preposition 4051 "module 10 is made of one 4051 chip.Its 8 tunnel input X0, X1, X2, X3, X4, X5, X6, X7Meet the output X of 8 " 4051 unit group "modules 12 respectively.The output X ofmodule 10 remote (≤2KM) meet a certain passage T in themodule 8 of master controller 5i(i=1,2 ..., 32).Here supposesub-controller 6 be numbered T-i (i=1,2 ..., 32).
Module 12 is by one 4051 chip, 4028 chips, 8 DIP type switches, and 8 HTS-2 type temperature sensors constitute.
The technical parameter of HTS-2 type sensor is as follows:
Operating temperature range :-55 ℃~+ 150 ℃;
Operating voltage range :+3V~+ 30V;
Output current: 294.1 μ A (when medium temperature is 25 ℃);
Temperature control: 1 μ A/ ℃;
The linearity: be better than 0.5%;
Motional impedance: 〉=10M Ω;
Maximum transmission distance :≤2KM;
The number of module 11 goes out to hold S2, S1, S0Be connected to the S of 4051 chips and 4028 chips2, S1, S0Pin.The output terminal X of 4028 chips0, X1, X2, X3, X4, X5, X6, X7Be connected to sensor C respectively0, C1, C2, C3, C4, C5, C6, C7Power end.The signal end of sensor is connected to the input end X of 4051 chips0, X1, X2, X3, X4, X5, X6, X7DIP type switch SW0, SW1, SW2, SW3, SW4, SW5, SW6, SW7Also be connected to the input end X of 4051 chips respectively0, X1, X2, X3, X4, X5, X6, X7The equal ground connection of the other end.The output terminal X of 4051 chips is connected to the input end X ofmodule 10 respectively by the numbering of " 4051 unit group "0, X1, X2, X3, X4, X5, X6, X7
The output terminal X ofmodule 10press sub-controller 6 numbering 6-i (i=1,2 ..., 32) be connected to respectively themodule 8 ofmaster controller 5 T-i (i=1,2 ..., 32).
The circuit diagram ofmodule 8 is seen Fig. 8 and Fig. 9.R whereini(i=1,2 ..., 32) resistance be 9.1K Ω, ri(i=1,2 ..., 32) be the Precision trimming resistance of 0~2K Ω, SWi(i=1,2 ..., 32) be DIP type switch.Sub-controller 6-i (i=1,2 ..., 32) output terminal X be connected to the T ofmodule 8 through the distance that is not more than 2KMi(i=1,2 ..., 32).
By adjusting ri(i=1,2 ..., 32), make RiAnd ri(i=1,2 ..., 32) the resistance sum equal 10K Ω, error is not more than ± 1 Ω.DIP type switch SWi(i=1,2 ..., 32) connection see Fig. 9.
Maximum dc impedance between all ground wire of system is necessary≤10 Ω, and the copper mesh shielding of 96 * φ 0.15 can guarantee this point in being not more than the length of 2KM.
7 core control lines frommaster controller 5 is drawn tosub-controller 6 should connect nearestsub-controller 6 earlier when connecting, transfer to other sub-controller from this sub-controller, to save wire rod again.
Also must add shielding fromsub-controller 6 to the analog signal line thatmaster controller 5 connects.But can be according to the merging of transferring of the relative geographic position at sub-controller place, making the analog signal line that enters master controller is the multicore shielding line, to save cost.
Microcomputerized multi-point remote temp measuring system of the present invention can be supported 32sub-controllers 6 at most, and each sub-controller 6 can be supported 64 HTS-2 type temperature sensors at most.Like this, microcomputerized multi-point remote temp measuring system of the present invention can be supported 2048 HTS-2 type temperature sensors at most.
The principle of work of microcomputerized multi-point remote temp measuring system of the present invention is as follows:
Microcomputerized multi-point remote temp measuring system of the present invention is a kind of of centralized data acquisition system (DAS).
If according to Figure 10 wiring ,+17V voltage is delivered to the power end of HTS-2 type sensor, sensor changes with ambient temperature, produces linear current signal, through being not more than circuit transmission and the 10K Ω resistance eutral grounding of 2KM, formation loop.Sampled voltage deliver to the AD card the i paths (i=1,2 ..., 32), hand overmicrocomputer 1 to handle, just formed a less microcomputerized multi-point remote temp measuring system.This mini system can be supported 32 sensors at most.
The operating voltage that requires because of HTS-2 type sensor is+3V~+ 30V, VDd+ 11V~+ when 17V changes, can not influence measurement result.Again because of the motional impedance 〉=10M Ω of HTS-2 type sensor, the motional impedance that is no more than the transmission line of 2KM at most be no more than ten thousand of sensor impedance/, can not influence measurement result yet.
The current sensitivity of temperature: 1 μ A/ ℃;
The voltage sensitivity of temperature: 10mV/ ℃;
The voltage value sensitivity of temperature: 0.5/ ℃;
According to the requirement and the actual conditions of silo keeping, medium (grain) temperature range is-30 ℃~+ 50 ℃.Therefore:
The scope of current signal is 239.1 μ A~319.1 μ A;
The scope of sampled voltage is 2.391V~3.191V;
The scope of voltage value is 121.941~162.741;
It is undesired all to belong at this extraneous numerical value.
Now, system is extended to microcomputerized multi-point remote temp measuring system of the present invention itself.Promptly the HTS-2 type sensor among Figure 10 is replaced tosub-controller 6, and add upper control line (S' 2), (S' 1), (S' 0), (S2), (S1), (S0) etc.
Sets of signals (S' 2), (S' 1), (S' 0) and sets of signals (S2), (S1), (S0) be subjected to programme controlled.Its operational order is seen the table-1 and the table-2 of appendix A.
Truth table according to table-1, use operational order in the following order:
OUT(N),15
OUT(N),14
OUT(N),13
OUT(N),12
OUT(N),11
OUT(N),10
OUT(N),9
OUT (N), 8 o'clock, pin 4,3,2 control sequences of forming will produce 7,6,5,4,3,2,1,0 digital controlled signal in proper order.
Truth table according to table-2, use operational order in the following order:
OUT(N+2),12
OUT(N+2),13
OUT(N+2),14
OUT(N+2),15
OUT(N+2),8
OUT(N+2),9
OUT(N+2),10
OUT (N+2), 11 o'clock,pin 16,14,1 control sequence will produce 7,6,5,4 in proper order, 3,2,1,0 digital controlled signal.
Here, N is the first address of second parallel port.According to truth table, two groups of operational orders are mutually independently, are independent of each other.
That is, sets of signals (S2), (S1), (S0) and sets of signals (S' 2), (S' 1), (S' 0) can producecontrol sequence 7,6,5,4,3,2,1,0 respectively.The input and output of 6 groups of voltage amplifiers of module 11 are anti-phase, output signal group S2, S1, S0With output signal group S' 2, S' 1, S' 0Just producecontrol sequence 0,1,2,3,4,5,6,7 respectively.
Second parallel port is a positive logic signal, and high level is+5V that low level is 0V.Through after reaching the distance of 2KM, high level may decay to+below the 3V.The voltage amplifier of module 11 can be increased to high level+6V~+ 10V.Low level remains unchanged.At VDdBe operated in+11V~+ 17V between the time, but the equal operate as normal of all chips.
Sets of signals S whenmodule 122, S1, S0Control signal be i (i=0,1,2 ..., 7) time, the output Xi of 4028 chips is obtained V by gatingDdVoltage, all the other Xi(j ≠ i) all obtains 0V voltage.Sensor Ci(i=0,1,2 ..., 7) obtain operating voltage, all the other Cj(j ≠ i) has to 0V voltage.Simultaneously, the input X of 4051 chips1(i=0,1,2 ..., 7) connect all the other X with output Xi(j ≠ i) all be not switched on.
Sets of signals (S when module 10' 2), (S' 1), (S' 0) control signal be i (i=0,1,2 ..., 7) time, be numbered 12-i (i=0,1,2 ..., 7) the output X of output X and "preposition 4051 "module 10 ofmodule 12 connect, through transmission line, Ri, ri(i=0,1,2 ..., 7) ground connection, form the loop.So, sensor Ci(i=0,1,2 ..., 7) the current signal of medium temperature, at TiThe place is sampled.All the other sensor Cj(all (output terminal of j ≠ i) is blocked at module 12-j for j ≠ i).
Like this, 64 of sub-controller sensors all can be polled.
When programmed control gating channel number k (k=1,2 ..., 32) time, 32 sub-controller 6-k (k=1,2 ..., 32) all have an opportunity polled.That is 2048 sensors are all had an opportunity polled.
The DIP type switch SW of module 8k(k=1,2 ..., 32) effect be: work as TkWhen number passage does not connect sub-controller, closed SWk(K=1,2 ..., 32), make the k passage obtain 0V voltage.Even the k passage is connected to sub-controller, it also will obtain 0V voltage, and just temperature signal is without 10K Ω resistance.
The DIP type switch SW of module 10i(i=0,1,2 ..., 7) effect be: when be numbered i (i=0,1,2 ..., 7)module 12 not during place in circuit, closed SWi(i=0,1,2 ..., 7), can make the input end X of "preposition 4051 "i(i=0,1,2 ..., 7) obtain 0V voltage, do not suspended, thereby can be worked reliably and with long-term.
The DIP type switch SW of module 12i(i=0,1,2 ..., 7) effect be: as sensor Ci(i=0,1,2 ..., 7) not during place in circuit, closed SWi(i=0,1,2 ..., 7), can make the input end X of " 4051 unit group "i(i=0,1,2 ..., 7) obtain 0V voltage, do not suspended, thereby can be worked reliably and with long-term.
Microcomputerized multi-point remote temp measuring system of the present invention is the product of an electronic surveying temperature, and the accuracy of its measurement is the product key of success.Microcomputerized multi-point remote temp measuring system of the present invention is again a thermometric product that is subjected to microcomputor program control, and its error Control is subjected to the restriction of programmed algorithm to a great extent.The program rudimentary algorithm of microcomputerized multi-point remote temp measuring system of the present invention is seen appendix B.Algorithm routine is write as by the C language.Its main points are:
1, duplicate measurements, averaging is final measurement.Composite measurement speed and precision two aspect factors, with duplicate measurements 80~100 times for well.
2, between each duplicate measurements, there is the time interval of 1mS.
3, when measuring a certain sensor, should carry out " the empty measurement " about 20 times earlier, measurement result is given it up.
4. should calculate variance.Variance answers≤1000.Otherwise, should check circuit quality of connection and sensor quality.
When voltage value is converted to temperature value, adopt the two point form straight-line equation.Given low warm spot (for example Y1=15 ℃) and high temperature dot (for example Y2=35 ℃), its corresponding voltage value of Theoretical Calculation is respectively X1=147.5 and X2=152.5.When the voltage value of certain sensor of actual measurement is X, the temperature Y that it is corresponding, can calculate by following formula:
y=(x-x1)*(y2-y1)/(x2-x1)+y1;
But, no matter be sensor or circuit, all may produce inconsistency.That is to say that the X1 of Theoretical Calculation and X2 might not be accurately for a plurality of sensors and circuit thereof, even we can say that major part is inaccurate.That is to say that though the linearity of sensor and stability are good, its slope and intercept vary.Calculate if all press above-mentioned formula, can produce sizable systematic error.At each concrete sensor and corresponding circuits thereof, find out its slope and intercept accurately, could the adjustment temperature.
Microcomputerized multi-point remote temp measuring system of the present invention adopts the computer aided testing (CAT) technology, with specific programmed algorithm, finds out the slope and the intercept of each road sensor.Specific practice is as follows:
Prepare the minimum container that can contain 60 literss of water, interior dress 2KW waterproof electric heater.Its heat-insulating property should reach in-30 ℃~+ 50 ℃ scopes, and the temperature increase and decrease is no more than 1 ℃ in 10 minutes.Prepare the equipment of an energy ice making again.Make in the water container and can put mixture of ice and water at any time.The mercury thermometer of 0.1 ℃ of scale is absolutely necessary.
64 sensors of the system of being connected into are put into water (sensor and lead-in wire thereof must waterproof be put tide).Measure the accurate temperature of water.If temperature is higher, should be on the rocks, make temperature about 10 ℃.Accurate again measuring water temperature is designated as Tmin ℃.
In the microcomputer disk, set up a temperature file (being designated as WDWJ).In the file following information should be arranged:
▲ sensor place channel number;
▲ sensor place " 4051 unit group " numbering;
▲ sensor numbering itself;
▲ Y1 and X1, X1 are initial value;
▲ Y2 and X2, X2 are initial value;
The information of ▲ each sensor accounts for delegation;
The example of WDWJ is seen appendix C.The rudimentary algorithm of test procedure (C Programming with Pascal Language) is seen appendix D.
The algorithm main points are as follows:
1, keyboard input mercury thermometer reading (also can omit);
2, survey out the voltage value X of sensor with rudimentary algorithm (appendix B)i(i=0,1,2 ..., 63);
3, with two point form straight-line equation accounting temperature Yi(i=0,1,2 ..., 63);
4, from 64 sensors, pick out the maximum YMaxWith a reckling YMin, and record place numbering KMaxAnd KMin
5, calculate the medial temperature of 64 sensors
6, calculate (
), be designated as C
Min7, calculate () and (), be designated as D respectivelyMaxAnd DMin
8. Automatic Program is revised the currency of the X1 among the WDWJ, and each only the modification is numbered KMaxAnd KMinThe currency of X1 of sensor, replacement formula is:
X1 '=X1+0.25*DMax(KMax);
X1 '=X1-0.25*DMin(KMin);
9, get back to 2, up to the difference of maximal value and minimum value less than 0.5;
10, shut down procedure operation enters copy editor's program, and WDWJ is edited.15 ℃ of data item of each sensor are all changed into Y1-CMinValue;
With electrical heating water temperature is brought up to about 40 ℃, write down accurate water temperature TMaxRevise X2 with above-mentioned algorithm.
So far, each sensor all passes through " posture adjustment ", and WDWJ can use in user program.
Power budget:
Each sensor power consumption: 0.3mA * V=5.1mW.Not by the sensor of gating, not power consumption in theory, the control signal power consumption is very little.So, each sub-controller and affiliated sensor power consumption≤1W.Total system power consumption≤32W.
Frequence estimation:
On the line, temperature signal is a direct current signal, does not produce frequency.Control signal will have the 1mS time because of each the measurement at interval, so, frequency≤1KHZ.The dominant frequency of microcomputer is very little to the line frequency influence.
When being exclusively used in grain heap thermometric, should also be noted that following item:
The grain heap often carries out aluminum phosphide fumigation, produces strong corrosion gas, and circuit carries out hermetically sealed in the reply storehouse:
Sensor should be made the cable for measuring temperature form, and the joint of cable for measuring temperature and extended line should seal, and extended line enters the sub-controller place and should seal, and sub-controller should be hermetically sealed.
Appendix A
Table-1 parallel port instruction OUT (N), the M truth table
Annotate: N is the parallel port first address
Table-2 parallel ports instruction OUT (N+2), the M truth table
Annotate: N is the parallel port first address
Appendix B program rudimentary algorithm
void main () { int bingkou2={388}; First address */int the ic of/* parallel port two, k, m, n; Int pport1[8]=15,14,13,12,11,10,9,8}; Int pport2[8]=12,13,14,15,8,9,10,11}; Float fb, fm, fy1[64]=0}, fs1[64]={ 0}; Float fb1[100]={ 0}; Outportb (256,0); / * selects the 0# passage of AD card, and first address is 256*/delay (4), for (k=0; K<=7; K++) outportb (bingkou2+2, pport2[k]); Delay (1); For (m=0; M<=7; M++) outportb (bingkou2, pport1[m]); For (n=0; N<=19; N++) {/* throws away preceding 20 measurement result */ic=inportb (256); / * starts AD conversion */delay (1); Ic=inportb (257); / * read AD translation data */; Fb=0; Fm=0, for (n=0; N<=99; N++) { ic=inportb (256); Go:ic=inportb (258); Delay (1); If (ic=0) goto go, ic=inportb (257); Fb1[n]=(float) ic; Fb=fb+fb1[n]; Fm=fm+fb1[n] * fb1[n]; ; Fb=fb/100; Fy1[k*8+m]=fb ,/* voltage digital */fs1[k*8+m]=fm-100*fb*fb; / * variance */}; ;C WDWJ0 0 0 15.0 147.5 35.0 152.50 0 1 15.0 147.5 35.0 152.50 0 2 15.0 147.5 35.0 152.50 0 3 15.0 147.5 35.0 152.50 0 4 15.0 147.5 35.0 152.50 0 5 15.0 147.5 35.0 152.50 0 6 15.0 147.5 36.0 152.50 0 7 15.0 147.5 35.0 152.50 1 0 15.0 147.5 35.0 152.50 1 1 15.0 147.5 35.0 152.50 1 2 15.0 147.5 35 0 152.50 1 3 15.0 147.5 35.0 152.50 1 4 15.0 147.5 35.0 152.50 1 5 15.0 147.5 35.0 152.50 1 6 15.0 147.5 35.0 152.50 1 7 15.0 147.5 35.0 152.50 2 0 15.0 147.5 35.0 152.50 2 1 15.0 147.5 35.0 152.50 2 2 15.0 147.5 35.0 152.50 2 3 15.0 147.5 35.0 152.50 2 4 15.0 147.5 35.0 152.50 2 5 15.0 147.5 35.0 152.50 2 6 15.0 147.5 35.0 152.50 2 7 15.0 147.5 35.0 152.50 3 0 15.0 147.5 35.0 152.50 3 1 15.0 147.5 35.0 152.50 3 2 15.0 147.5 35.0 152.50 3 3 15.0 147.5 35.0 152.50 3 4 15.0 147.5 35.0 152.50 3 5 15.0 147.5 35.0 152.50 3 6 15.0 147.5 35.0 152 50 3 7 15.0 147.5 35.0 152.50 4 0 15.0 147.5 35.0 152.50 4 1 15.0 147.5 35.0 152.50 4 2 15.0 147.5 35.0 152.50 4 3 15.0 147.5 35.0 152.50 4 4 15.0 147.5 35.0 152.50 4 5 15.0 147.5 35.0 152.50 4 6 15.0 147.5 35.0 152.50 4 7 15.0 147.5 35.0 152.50 5 0 15.0 147.5 35.0 152.50 5 1 15.0 147.5 35.0 152.50 5 2 15.0 147.5 35.0 152.50 5 3 15.0 147.5 35.0 152.50 5 4 15.0 147.5 35.0 152.50 5 5 15.0 147.5 35 0 152.50 5 6 15.0 147.5 35.0 152.50 5 7 15.0 147.5 35.0 152.50 6 0 15.0 147.5 35.0 152.50 6 1 15.0 147.5 35.0 152.50 6 2 15.0 147.5 35.0 152.50 6 3 15.0 147.5 35.0 152 50 6 4 15.0 147.5 35.0 152.50 6 5 15.0 147.5 35.0 152.50 6 6 15.0 147.5 35.0 152.50 6 7 15.0 147.5 35.0 152.50 7 0 15.0 147.5 35.0 152.50 7 1 15.0 147.5 35.0 152.50 7 2 15.0 147.5 35.0 152.50 7 3 15.0 147.5 35.0 147.50 7 4 15.0 147.5 35.0 152.50 7 5 15.0 147.5 35.0 152.50 7 6 15.0 147.5 35.0 152.50 7 7 15.0 147.5 35.0 152.5
Appendix D test procedure algorithm
struct wdwj{ int td, bb1, bh2, float wendu1[2]; Float wendu2[2]; Wdwj; Struct wdwj far*pf0[64]; Int bingkou2={888}; First address */int the adk={256} of/* parallel port two; First address */int the pport1[8 of/* AD card]=15,14,13,12,11,10,9,9}, int pport2[8]=12,13,14,15,8,9 10,11}, float fy[64], fy1[64]=0}, fs[64]={ 0}; Void teat (); / * * * * * * * * * * * * * * min program********************/void main () { FILE * fp; Char che[8]; Int ia1, ia2, ia3, kmax, kmin; Float fa1, fa2, fa3, fa4, fb, fc, fd, ff; Float fdmax, fdmin, fmax, fmin; Pf0[0]=(struct wdwj*) malloc (sizeof (struct wdwj); , if (! Pf0[0]) { exit (1); ; For (i=0; I<=63; I++) pf0[i+1]=pf0[i]+1; Strcpy (che, " wdwj "); If (! (fp=fopen (che, " r "))) { exit (1); ; For (i=0; I<=63; I++) { fscanf (fp, " %i %i %i " , ﹠amp; A1 , ﹠amp; Ia2 , ﹠amp; Ia3); Fscanf (fp, " %f %f %f %f " , ﹠amp; Fa1 , ﹠amp; Fa2 , ﹠amp; Fa3 , ﹠amp; Fa4); (* pf0[i]), td=ia1; (* pf0[i]), bb1=ia2; (* pf0[i] }, bb2=ia3; (* pf0[i]), wendu1[0]=fa1;<!--SIPO<dP n="18">--<dp n="d18"/>(* pf0[i]), wendu1[1]=fa2 (* pf0[i]), wendu2[0]=fa3; (* pf0[i]), wendu2[1]=fa4; ;If (fclose (fp)) { exit (1); ; Yn:test (); Fb=0; For (i=0; I<=63; I++) fa1=(* pf0[i]), wcndu1[0]; Fa2=(* pf0[i]), wendu1[1]; Fa3=(* pf0[i]), wendu2[0]; Fa4=(* pf0[i]), wendu2[1]; Ff=py1[i]); Fy[i]=(ff-fa2) * (fa3-fa1)/(fa4-fa2)+fa1; / * temperature value */fb=fb+fy[i]; ; Fb=fb/64; / * mean value */kmax=0; Kmin=0; Fmax=fy[0]; Fmin=fy[0]; For (i=0; I<=63; I++) if (fy[i]>fmax) fmax=fy[i]; Kmax=i; ; If (fy[i]<fmin) fmin=fy[i]; Kmin=i; ; ; Fdmax=fmax-fb; / * replaces */fdmin=fb-fmin; Fc=(* pf0[kmax]), wendu1[1]; Fc=fc+0.25*fdmax; (* pf0[kmax]), wendu1[1]=fc; Fd=(* pf0[kmin]), wendu1[1]; Fd=fd-0.25*fdmin;<!--SIPO<dP n="19">--<dp n="d19"/>(* pf0[kmin]) wendu1[1]=fd; If ((fdmax-fdmin)>0.5) { goto yn; ; }/* * * * * * * * * * * * * * end main**********************/Void test () { int ic, k, m, n; Flout fb, fm; Float fb1[100]={ 0}; Outportb (adk, 0); / * selects the 0# passage */delay (4) of AD card; For (k=0; K<=7; K++) ontportb (bingkou2+2, pport2[k]); Delay (1); For (m=0; M<=7; M++) outportb (bingkou2, pport1[m]); For (n=0; N<=19; N++) {/* throws away preceding 20 measurement result */ic=inportb (adk); / * starts AD conversion */delay (1); Ic=inportb (adk+1); / * read AD translation data */; Fb=0; Fm=0; For (n=0; N=99; N++) { ic=inportb (adk); Go; Ic=inportb (adk+2); Dclay (1); If (ic==0) goto go; Ic=inportb (adk+1); Fb1[n]=(float) ic; Fb=fb+fb1[n]; Fm=fm+fb1[n] * fb1[n]; ; Fb=fb/100; Fy1[k*8+m]=fb; / * voltage digital */fs1[k*8+m]=fm-100*fb*fb; / * variance */}; ;