(3) summary of the invention
The purpose of this invention is to provide a kind of ultrasonic flow testing circuit.
The present invention for the technical scheme that solves its technical barrier and take is:
A kind of ultrasonic flow testing circuit of the present invention is by the ultrasound source signal generating circuit, and signal sends, receiving circuit, detecting circuit, and the phase-detecting circuit, 12 AD modules of " phase-pressure " change-over circuit and microprocessor are formed.It is characterized in that: the ultrasound source signal generating circuit, the signal that produces a 1MHZ continues whole suitable, reverse-current metering process; Detecting circuit filters out noise and interferer signal detection and goes out real ultrasonic signal; The phase-detecting circuit converts mistiming of ultrasonic transmission into phase signal; " phase-pressure " change-over circuit converts phase signal into voltage signal; 12 A/D modular converters of microprocessor, the voltage signal that " phase-pressure " change-over circuit is exported carries out the conversion of simulating signal to digital signal, so that microprocessor calculates flow according to the digital signal that records through corresponding software algorithm.
1, ultrasound source signal generating circuit:
In the ultrasound source signal generating circuit; System clock (SMCLK) the 83 pin output frequencies that transmit by microcontroller are the 4MHZ pulse signal, and this signal improves the signal driving force through U9 (74HC1G86, XOR gate); Again through U3 (74HC74; Double D trigger) 4 frequency dividing circuits of forming become the 1MHZ signal to give 11 pin (A4) of U4 (74HC02, rejection gate) the 4MHZ signal frequency split.This signal continues the whole measuring process of measurement each time.
2, signal transmission, receiving circuit:
(1) signal sends:
Microprocessor through two I/O ports (65,66 pin) control U5 (74HC4053, analog switch) launch, the selection of receiving transducer.Transducer 1 is for sending transducer when low when 66 pin are high, 65 pin, and transducer 2 is receiving transducer (being following current measures); When 66 pin be low, transducer 2 was for sending transducer when 65 pin were high, transducer 1 is receiving transducer (being reverse-current metering).
After emission, receiving transducer are confirmed; Be output as low level (being high level usually) by microprocessor I/O port (69 pin); Make and be carried in U4 (74HC02; Rejection gate) be loaded on the selected in advance transmitting transducer through U5 by the output of 13 pin (Y4) of U4 after the anti-phase that transmits of 11 pin (A4), the excitation transducer produces ultrasound wave.
(2) signal receives:
After receiving transducer receives ultrasound wave, convert ultrasonic signal into analog electrical signal and behind U5 (74HC4053, analog switch), C3 capacitor filtering, give U6 (LMX331, high-speed comparator) (being detecting circuit).
3, detecting circuit:
Detecting circuit mainly is that filter out noise and undesired signal detect real ultrasonic signal.Because the phase-detecting circuit is made up of high-speed comparator, the power consumption of always working can be very big, so on the circuit its power supply is controlled, only when measuring, it supplied power, and do not have at ordinary times.Make Q2 (9012) conducting give U6 (LMX331, high-speed comparator) power supply at each beginning microprocessor of measuring through I/O port (67 pin) output low level (being high level at ordinary times), continue whole measuring process.
The simulating signal that receiving transducer receives is given (1 pin) in-phase end of comparer U6 (LMX331, high-speed comparator).Its end of oppisite phase (3) is a reference level, mainly through resistance R 22, R21 and R20 the supply voltage dividing potential drop is obtained.When supply voltage was 3.6V, reference voltage was about 1.78V, only was higher than the 1.78v pulse in the signal that promptly receives and just was regarded as effectively, and being lower than 1.78V pulse (noise, undesired signal) will be by filtering.Process phase-detecting circuit receives the actual signal in the simulating signal and is converted into digital signal and supplies follow-up phase-detecting processing of circuit.
4, phase-detecting circuit:
The phase-detecting circuit is the core of entire circuit design.Major function is the mistiming with ultrasonic transmission to convert phase signal into.Circuit mainly is made up of U4 (74HC02, rejection gate), U7 (74HC74, double D trigger), U8 (74HC74, double D trigger), U12 (74HC1G14, not gate), U13 (74VLG79, XOR gate).
Following current, reverse-current metering are carried out respectively, expect the phase differential of the two, and a corresponding reference signal must be arranged, and Here it is produces hyperacoustic source signal (being the SMCLK signal output (83 pin) of microprocessor).
The reference signal of phase bit comparison (microprocessor 83 pin output 4MHz signal) is through U8 (74HC74; Double D trigger) the 4 frequency divider frequency divisions of forming become the 1MHz synchronizing signal by 8 pin of U8 (/Q2) export to U13 (74VLG79 respectively; XOR gate) 2 pin (CLK signal) and U4 (74HC02; Rejection gate) 3 pin (B1), but the generation of this synchronizing signal is controlled (8, the 9 pin input signals of U4) by the I/O port (77 pin) and the detection output signal of microprocessor.
When signal receives; Microprocessor I/O port 76 pin are that high level, 77 pin are high level (at ordinary times for low); After first pulse that detecting circuit detects is reverse by U4, export to 11 pin (CLK2) of U7 by its 10th pin (Y3); This moment U7 8 pin (/Q2) output high level produces the synchronizing datum signal that produces through U8.
The phase detection signal of exporting low level (being high level usually) 10 pulses of generation from the benchmark synchronizing signal of 10us through microprocessor I/O port 70 pin is outputed to 1 pin (CLR1) of U7 by 1 pin (Y1) of U4; From the signal (promptly receiving signal) after 3 pin (CLK1) the input detection of U7, detect of 5 pin (Q1) output of the phase signal of corresponding 10 pulses, after U12 is reverse, export to phase-voltage conversion circuit by U7 with it.
Here need should be mentioned that signal propagates in the gate circuit of phase-detecting circuit, trigger; Because the time-delay of hardware self can be introduced equally and differ error; But differing in subtraction of suitable, the adverse current of finally trying to achieve, hardware circuit is introduced differs error and can balance out.In addition; The number of the time decision phase-detecting pulse of microprocessor I/O port 70 pin output low levels; In the introduction of foregoing circuit principle, having got 10 phase-detecting pulses illustrates; Actually get what phase-detecting pulses and will come calmly, but should be the integral multiple of seized signal period according to range of measuring and precision.
5, phase-voltage conversion circuit:
Detected phase difference signal through the phase-detecting circuit, but microprocessor can't be handled this signal along (or contrary) flow measurement signal and benchmark synchronizing signal.So must convert phase difference signal into microprocessor can identified signal, the effect of Here it is phase voltage conversion circuit.
The phase voltage conversion circuit mainly is to differ pulse signal through 10 to control simple constant-current source circuit discharging and recharging of accurate electric capacity realized pressing mutually conversion.The embodiment that differs in signal is exactly pulsewidth in fact, differs big more, and pulsewidth is big more, and promptly dutycycle is big more, and this part circuit has utilized the principle of width modulation to realize in fact.
Transistor through X1, X2, three positive-negative-positives of X3 on circuit has constituted a constant-current source circuit; C3 is an accurate electric capacity, and Linearity is very good; U2 (SGM358, amplifier) has constituted a voltage follower, and the high-impedance state that is mainly used in the prime input end charges to electric capacity, and back level output is followed prime and measured for microprocessor AD.
Principle of work: before the output of microprocessor I/O port 70 pin is hanged down in the phase-detecting circuit; I/O port 2 pin of microprocessor are changed to high-impedance state (usually as delivery outlet, output 0), and 10 that this moment, the phase-detecting circuit detected differ pulse control constant current source to capacitor C 3 chargings; Differ big more; Pulsewidth is wide more, and the duration of charging is long more, and is just high more at the voltage amplitude of the in-phase input end of U2.The output terminal of U2 with the conversion range signal deliver to microprocessor the AD passage with the microprocessor measurement processing.Measure to finish microprocessor I/O port 2 pin and be changed to delivery outlet, export lowly, make electric capacity pass through the R2 discharge, so that measure usefulness next time.
The phase voltage conversion circuit has been used amplifier, and the quiescent dissipation of amplifier self is very large, and it is very big especially power consumption being required lower occasion influence.So the power supply to amplifier on circuit design is controlled, only in each the measurement, just supply power to amplifier.
6, the AD of microprocessor device measures:
The AD of microprocessor measures the voltage signal of phase-voltage conversion circuit output, so that microprocessor calculates flow according to the data that record through respective algorithms.Certainly circuit also can be joined independently the AD chip and used.It is fixed that the precision of AD and reference voltage come according to desired measuring accuracy.If reach sufficiently high precision, the precision of AD will be more than 12.
It more than is the principle of work of ultrasonic flow metering module each several part circuit.In addition; In order to solve the error that phase-voltage conversion circuit constant current source part and accurate electric capacity are introduced with temperature variation; Can carry out at every turn concurrent-countercurrent measure before low level (being height at ordinary times) through microprocessor I/O port 76 pin output 1us (ultrasonic frequency is 1MHz); Produce a reference amplitude signal through phase-voltage conversion circuit, concurrent-countercurrent finally record width of cloth difference therewith reference amplitude just compare and can the error counteracting that temperature variation cause circuit to be introduced be fallen.
(5) embodiment
Below in conjunction with embodiment technical scheme of the present invention is described in further detail.Protection scope of the present invention will not only be confined to the statement of following content.
A kind of ultrasonic flow testing circuit is by the ultrasound source signal generating circuit, and signal sends, receiving circuit, detecting circuit, and the phase-detecting circuit, 12 AD modules of " phase-pressure " change-over circuit and microprocessor are formed.
The ultrasound source signal generating circuit is that the SMCLK pin output frequency by microcontroller is the 4MHZ pulse signal, and this signal becomes the 1MHZ signal to give 11 pin (A4) of U4 the 4MHZ signal frequency split through 4 frequency dividing circuits that U9 forms through U3 again.
Signal sends, receiving circuit: (1) signal sends: microprocessor controls through two I/O ports (65,66 pin) that U5 launches, the selection of receiving transducer.After emission, receiving transducer are confirmed; Be output as low (usual) by microprocessor I/O port (69 pin) for high; 13 pin output by U4 is loaded on the selected in advance transmitting transducer through U5, and the excitation transducer produces ultrasound wave.(2) signal receives: after receiving transducer receives ultrasound wave, convert ultrasonic signal into analog electrical signal and behind U5, C3 capacitor filtering, give U6 (being detecting circuit).
Detecting circuit: make Q2 (9012) conducting give U6 (LMX331, high-speed comparator) power supply at each beginning microprocessor of measuring through I/O port (67 pin) output low (at ordinary times for high), continue whole measuring process.The simulating signal that receiving transducer receives is given the in-phase end of comparer U6.Its end of oppisite phase is a reference level, mainly through resistance R 22, R21 and R20 the supply voltage dividing potential drop is obtained.I/O port (67) pin of microprocessor is delivered to the base stage of triode Q2 through resistance R 24, collector through resistance R 19 deliver to comparer U6 in-phase input end, collector is also delivered to the inverting input of U6 after resistance R 22, resistance R 21 in addition.Resistance R 20, capacitor C 13 1 are connected to the inverting input of U6, an end ground connection.When supply voltage was 3.6V, reference voltage was about 1.78V, only was higher than the 1.78v pulse in the signal that promptly receives and just was regarded as effectively, and being lower than the 1.78V pulse will be by filtering.Process phase-detecting circuit receives the actual signal in the simulating signal and is converted into digital signal and supplies follow-up phase-detecting processing of circuit.
The phase-detecting circuit: circuit mainly is made up of U4, U7, U8, U12, U13.Microprocessor 83 pin become the 1MHz synchronizing signal to export to 2 pin of U13 and 3 pin of U4 respectively by 8 pin of U8 through the 4 frequency divider frequency divisions that U8 forms, but the generation of this synchronizing signal is controlled (8, the 9 pin input signals of U4) by the I/O port (77 pin) and the detection output signal of microprocessor reason.When signal receives; Microprocessor I/O port 76 pin are that height, 77 pin are high (at ordinary times for low); When first pulse that detecting circuit detects is exported to 11 pin (CLK2) of U7 by the reverse back of U4 by its 10th pin (Y3), this moment U7 8 pin (/Q2) output is high, makes the synchronizing datum signal generation that produces through U8; The phase detection signal of crossing low level (usual in high) 10 pulses of generation from the benchmark synchronizing signal of microprocessor I/O port 70 pin output 10us is outputed to 1 pin (CLR1) of U7 by 1 pin (Y1) of U4; From the signal (promptly receiving signal) after 3 pin (CLK1) the input detection of U7, detect of 5 pin (Q1) output of the phase signal of corresponding 10 pulses, after U12 is reverse, export to phase-voltage conversion circuit by U7 with it.
Phase-voltage conversion circuit: the transistor through X1, X2, three positive-negative-positives of X3 on circuit has constituted a simple constant-current source circuit; C3 is an accurate electric capacity, and Linearity is very good; U2 (U2A and U2B) has constituted a voltage follower, and the high-impedance state that is mainly used in the prime input end charges to electric capacity, and back level output is followed prime and measured for microprocessor AD.The base stage parallel connection of the base stage of triode X1, triode X2, triode X3 is after resistance R 4 is connected to the output terminal of U12.The emitter of triode X1, triode X2, triode X3 is connected to the 3.6V power supply through resistance R 5, resistance R 6, resistance R 7 respectively.The output port of U2A is delivered to micro controller I/O port (97 pin) behind resistance R 3, resistance R 8 shunt capacitance C4.
This circuit application is in the flow metering occasion, and the flow that utilizes this circuit to develop is taken into account calorimeter, water meter, gas meter, flow meter also within protection scope of the present invention.