Summary of the invention
Technical matters to be solved by this invention provides a kind of ultrasonic liquid level measuring appearance based on the pseudo-code correlation technique, and measuring instrument is simple in structure, and the measuring method precision is high.
For realizing above-mentioned purpose; The invention provides a kind of ultrasonic liquid level measuring appearance, comprise single-chip microcomputer, ultrasonic emitting module and ultrasound wave receiver module, wherein based on the pseudo-code correlation technique; Said ultrasonic emitting module comprises I/O passage, modulation circuit, power amplification circuit and ultrasonic emitting sensor; The pseudo-code signal that single-chip microcomputer produces is through the digital signal output channel of I/O circuit, is added in the input end of modulation circuit as modulation signal, and the sine wave signal that modulation circuit is produced carries out the frequency keying modulation; After power amplification circuit carries out power amplification, remove to drive the ultrasonic emitting sensor again, outwards launch ultrasonic signal; Said ultrasound wave receiver module comprises prefix operation amplifying circuit, demodulator circuit, I/O circuit and ultrasound wave receiving sensor; The ultrasonic signal that the ultrasound wave receiving sensor receives is after the prefix operation amplifying circuit amplifies; Demodulator circuit carries out demodulation process to amplifying signal; Detect pseudo-code signal, this pseudo-code signal directly gets into single-chip microcomputer through the digital signal input channel of I/O circuit, and single-chip microcomputer carries out the relevant matches computing with this pseudo-code signal and modulation code.
As most preferred embodiment of the present invention, the resonance frequency of said ultrasonic sensor is 40kHz;
As most preferred embodiment of the present invention, the pseudo-random code sequence length that said single-chip microcomputer produces is 255;
As most preferred embodiment of the present invention; Said modulation circuit comprises modulator chip XR2206; The input end of this modulator chip XR2206 is connected with photoelectric isolating circuit; The input end of said photoelectric isolating circuit is connected with the pseudo-code signal that single-chip microcomputer produces, and the output terminal of said modulator chip XR2206 is connected with first operational amplifier, and the output of this first operational amplifier links to each other with the ultrasonic emitting sensor;
As most preferred embodiment of the present invention; The capacitor C 4 of the pin Wout of said modulator chip XR2206 through series connection and resistance R 8 are connected the reverse input end of first operational amplifier; The resistance R 7 of the pin Tres of said modulator chip XR2206 through series connection and resistance R 9 are connected the in-phase input end of second operational amplifier; Wherein, the contact ground connection between resistance R 7 and the resistance R 9 further is connected with resistance R _ f 1 between the output terminal of said second operational amplifier and the reverse input end;
As most preferred embodiment of the present invention; Said demodulator circuit comprises demodulator chip XR-2211; The input end of this demodulator chip XR-2211 is connected with second operational amplifier and the 3rd operational amplifier of the series connection that links to each other; The output terminal of said demodulator chip XR-2211 is connected with the photodetachment circuit, and the output terminal of this photodetachment circuit links to each other with single-chip microcomputer;
As most preferred embodiment of the present invention; The in-phase input end of said second operational amplifier is connected with the resistance R 10 and resistance R 11 that is connected in series; The in-phase input end of second operational amplifier is connected the contact between resistance R 10 and the resistance R 11; The inverting input of said second operational amplifier links to each other with the ultrasound wave receiving sensor with resistance R i through the capacitor C 5 of series connection; Be connected with the resistance R 12 and resistance R _ f 2 of connecting between the output terminal of said second operational amplifier and the reverse input end, wherein, the contact between said resistance R 12 and the resistance R _ f 2 is through resistance R 13 ground connection; The output terminal of said second operational amplifier is connected the reverse input end of the 3rd operational amplifier through resistance R 16; The in-phase input end of said the 3rd operational amplifier is through resistance R 15 and resistance R 14 ground connection; The in-phase input end of said the 3rd operational amplifier is connected the contact between resistance R 15 and the resistance R 14; Be connected with resistance R 17 between the output terminal of said the 3rd operational amplifier and the reverse input end, the output terminal of said the 3rd operational amplifier is connected the input end of demodulator chip XR-2211; The output terminal of said demodulator chip XR-2211 is connected the input end of photodetachment circuit through short rent RES2.
Compared with prior art; The ultrasonic liquid level measuring appearance that the present invention is based on the pseudo-code technology has the following advantages at least: (1) the present invention is applied to pseudo-random code and correlation technique in the ultrasonic meter; Confirm the transmission time of ultrasound wave in medium through the relevant matches computing; It is less disturbed by noise signal, has higher measuring accuracy; (2) the present invention utilizes pseudo-random code that ultrasonic signal is carried out frequency keying modulation (FSK) emission, has improved the ultrasound wave effective range; (3) the present invention uses single-chip microcomputer that data are handled, and is prone to carry out communication with other system or host computer, realizes that ultrasonic meter is intelligent.During experiment, it is 6.25kHz that single-chip microcomputer produces the pseudo-random code frequency, and m sequence code length is 255, and average distance accuracy is 98%.
Embodiment
Below in conjunction with accompanying drawing the ultrasonic liquid level measuring appearance and the measuring method thereof that the present invention is based on the pseudo-code technology are done detailed description:
See also shown in Figure 2ly, the ultrasonic liquid level measuring appearance that the present invention is based on pseudo-code technology mainly is made up of single-chip microcomputer, ultrasonic emitting module and ultrasound wave receiver module.
Said single-chip microcomputer is the core of fluid level measuring instrument, is bearing two tasks, and the first produces the m sequence code (native system sequence code length is 255) that ultrasonic signal is modulated; It two is relevant matches computings of accomplishing modulation code and information code, and confirms testing distance according to operation result.
Said ultrasonic emitting module comprises I/O passage, modulation circuit, power amplification circuit and ultrasonic emitting sensor.The pseudo-code signal that single-chip microcomputer produces is through the digital signal output channel of I/O circuit; Be added in the input end of modulation circuit as modulation signal; The frequency that modulation circuit is produced is that the sine wave signal of 40kHZ carries out frequency keying modulation (FSK); After power amplification circuit carries out power amplification, remove to drive the ultrasonic emitting sensor again, outwards launch ultrasonic signal.
Said ultrasound wave receiver module comprises prefix operation amplifying circuit, demodulator circuit, I/O circuit and ultrasound wave receiving sensor.The ultrasonic signal that the ultrasound wave receiving sensor receives is after the prefix operation amplifying circuit amplifies; Demodulator circuit carries out demodulation process to amplifying signal; Detect pseudo-code signal; This pseudo-code signal directly gets into single-chip microcomputer through the digital signal input channel of I/O circuit, and single-chip microcomputer carries out the relevant matches computing with this pseudo-code signal and modulation code.
Please consult shown in Figure 3 especially; Said modulation circuit comprises modulator chip XR2206; The input end of this modulator chip XR2206 is connected with photoelectric isolating circuit; The input end of said photoelectric isolating circuit is connected with the pseudo-code signal that single-chip microcomputer produces, and the output terminal of said modulator chip XR2206 is connected with first operational amplifier, and the output of this first operational amplifier links to each other with the ultrasonic emitting sensor.The capacitor C 4 of the pin Wout of said modulator chip XR2206 through series connection and resistance R 8 are connected the reverse input end of first operational amplifier; The resistance R 7 of the pin Tres of said modulator chip XR2206 through series connection and resistance R 9 are connected the in-phase input end of second operational amplifier; Wherein, Contact ground connection between resistance R 7 and the resistance R 9 further is connected with resistance R _ f 1 between the output terminal of said second operational amplifier and the reverse input end.
Please consult shown in Figure 4 especially; Said demodulator circuit comprises demodulator chip XR-2211; The input end of this demodulator chip XR-2211 is connected with second operational amplifier and the 3rd operational amplifier of the series connection that links to each other; The output terminal of said demodulator chip XR-2211 is connected with the photodetachment circuit, and the output terminal of this photodetachment circuit links to each other with single-chip microcomputer.The in-phase input end of said second operational amplifier is connected with the resistance R 10 and resistance R 11 that is connected in series; The in-phase input end of second operational amplifier is connected the contact between resistance R 10 and the resistance R 11; The inverting input of said second operational amplifier links to each other with the ultrasound wave receiving sensor with resistance R i through the capacitor C 5 of series connection; Be connected with the resistance R 12 and resistance R _ f 2 of connecting between the output terminal of said second operational amplifier and the reverse input end; Wherein, the contact between said resistance R 12 and the resistance R _ f 2 is through resistance R 13 ground connection; The output terminal of said second operational amplifier is connected the reverse input end of the 3rd operational amplifier through resistance R 16; The in-phase input end of said the 3rd operational amplifier is through resistance R 15 and resistance R 14 ground connection; The in-phase input end of said the 3rd operational amplifier is connected the contact between resistance R 15 and the resistance R 14; Be connected with resistance R 17 between the output terminal of said the 3rd operational amplifier and the reverse input end, the output terminal of said the 3rd operational amplifier is connected the input end of demodulator chip XR-2211; The output terminal of said demodulator chip XR-2211 is connected the input end of photodetachment circuit through short rent RES2.
Please combine shown in Figure 1ly, the measuring method of fluid level measuring instrument of the present invention is:
(1) single-chip microcomputer produces pseudo-code signal; And this pseudo-code signal exported through the I/O passage; This pseudo-code signal is added in the input end of modulation circuit as modulation signal; Sine wave to modulation circuit produces is modulated, and carries out power amplification rear drive ultrasound wave generation sensor through power amplification circuit again, outwards launches ultrasonic signal;
(2) former road was returned after the outside ultrasonic waves transmitted signal of the ultrasonic emitting sensor of fluid level measuring instrument was met the water surface; And received by the ultrasound wave receiving sensor of fluid level measuring instrument; After ultrasonic sensor receives this ultrasonic signal; This ultrasound signal transmission is carried out the signal amplification in operational amplification circuit; This amplifying signal is then carried out demodulation to detect pseudo-code signal wherein by demodulator circuit, and the pseudo-code signal that is detected is input in the single-chip microcomputer through the I/O passage, and single-chip microcomputer receives behind this pseudo-code signal the pseudo-code signal that this pseudo-code signal that receives and single-chip microcomputer are produced and carries out the distance that the relevant matches computing has obtained this fluid level measuring instrument and liquid level.
Said single-chip microcomputer carries out the relevant matches computing with the pseudo-code signal of pseudo-code signal that receives and single-chip microcomputer generation, to obtain the distance of this fluid level measuring instrument and liquid level, specifically adopts following method:
(1) pseudo-code signal of single-chip microcomputer generation is designated as b, and the pseudo-code signal that receives is designated as m, wherein,
Information code m is that sequence b delays some positions and obtains, and then, the related coefficient between information code m and the sequence b calculates according to following formula:
Wherein, R
Bm(j) be related coefficient between information code m and the sequence b;
J is the number of information code m and sequence b dislocation;
I is i element among the information code m;
P is the length of information code m;
A is the identical number of the corresponding bit symbols of two sequences of carrying out related operation;
D is the corresponding bit symbols of the two sequences number inequality of carrying out related operation;
(2) in p the related coefficient that step (1) obtains, ask for maximum related coefficient, the meter maximal value appears at the corresponding related coefficient of the v time matching operation, and then be the time delay of information code m and sequence b: τ
k=v*width, wherein, τ
kBe time delay, v is the speed of ultrasound signal transmission, and width is the symbol width of information code m, and unit is second;
(3) according to formula: D=340* τ
k(rice), calculate fluid level measuring instrument and liquid level apart from d, wherein,
D=2d。
The above is merely one embodiment of the present invention; It or not whole or unique embodiment; The conversion of any equivalence that those of ordinary skills take technical scheme of the present invention through reading instructions of the present invention is claim of the present invention and contains.