Design of Ultrasonic Density Meter Based on Ultrasonic Echo Attenuation Theory

Publisher:心灵捕手Latest update time:2012-07-05 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Theoretical Analysis

Ultrasonic waves When propagating in a suspension, the ultrasonic waves that encounter the suspended particles are scattered and attenuated at the interface, and the remaining part is incident on the particles and absorbed and attenuated. The ultrasonic waves that contact the interface are also attenuated by viscosity and finally reach the receiving end. The various attenuation mechanisms are very complicated, but they are all caused by suspended particles and are proportional to the number of suspended particles. Therefore, under certain conditions, the attenuation is proportional to the concentration. By measuring the acoustic attenuation coefficient of the suspension, the concentration can be calculated. Suppose the attenuation rate and the receiving voltage when there are suspended particles in the liquid are (a0+ax) and E respectively. The attenuation rate and the receiving voltage when there are no suspended particles in the liquid are a0 and E0 respectively. The distance between the transmitting and receiving ends is L, and the transmitting voltage is Er, then:

Transmitter voltage

According to the above two formulas, the attenuation rate caused by suspended particles can be calculated by ax=(lnE0-lnEx)/L.

The sound wave amplitude received by the receiving probe will decay with the increase of the suspension concentration, and the voltage value converted from the sound wave amplitude will also decay with the increase of the concentration. After the concentration-voltage decay curve is calibrated, the concentration value can be obtained from the measured voltage.

2 Hardware Design

As shown in Figure 1, the whole system is based on the ultrasonic transmitting and receiving circuits. The direct digital frequency synthesis chip AD9833 is used to generate pulse trains. The ultrasonic transducer is driven by the power amplifier circuit. The ultrasonic wave reaches the receiving transducer through the suspension. The echo attenuation signal is logarithmically amplified by the 92 dB logarithmic amplifier AD8307. Finally, the microcontroller processes the data to obtain the concentration value. The system also includes keyboard, display, parameter storage, switch output, relay output, current output, UART communication and other parts.

Hardware Design

2.1 Main control chip circuit

This system is based on the high-speed mixed-signal ISP Flash microcontroller C8051F021 from Silab, USA. The attenuation method ultrasonic concentration meter requires precise control of the timing of ultrasonic emission and reception, which requires not only a fast processor but also multiple timers; the voltage signal returned by the receiving unit is less than 2.5 V, which needs to be converted into a digital signal through precise A/D acquisition and passed to the CPU for processing. The characteristics of C8051F021 are as follows;

① High-speed, pipelined 8051-compatible CIP-51 core (up to 25 MIPS).

②12-bit on-chip SAR ADC with programmable conversion rate, up to 100 kbps, and programmable amplifier gain.

③4 352 bytes of internal data RAM, 64 KB Flash memory; can be programmed in the system.

④5 general-purpose 16-bit counters, timer array, hardware SMBus, SPI and 2 UART serial ports.

⑤Low power consumption (10 mA@20 MHz), multiple power-saving sleep and shutdown modes.

2.2 DDS generates pulse train of ultrasonic transmitting unit

Direct digital frequency synthesizer (DDS) performs frequency synthesis based on the concept of "phase". It can not only generate sine waves of different frequencies, but also control the initial phase of the waveform, and can also generate triangle waves and square waves. This system uses DDS AD9833 as the pulse generator of the ultrasonic transmitter unit. AD9833 is programmable and can work with only an external clock to generate a simple sine wave through a high-speed serial peripheral interface (SPI). AD9833 can generate waveforms from 0 Hz to 12.5 MHz based on a 25 MHz clock.

The pulse generation circuit of the ultrasonic transmitting unit is shown in Figure 2. The clock of DDS comes from a 25 MHz active crystal oscillator. The SPI bus CLK, DATA, and CS of AD9833 are connected to the I/O port of the microprocessor through a 74HC244. 74HC244 is an octal in-phase three-state buffer used to enhance the signal load capacity. Through the control of the microprocessor, AD9833 outputs a square wave of the required frequency at the VOUT pin. Under the action of the NAND gate, the output of AD9833 and the strobe signal EN of the microcontroller generate a pulse train at the output end of the NAND gate. This pulse train can drive the ultrasonic transducer through the power amplifier circuit.

Pulse generation circuit of ultrasonic transmitting unit

2.3 Logarithmic amplifier of ultrasonic echo receiving unit

In the field of signal processing, some signals often have a very wide dynamic range. For example, in radar, sonar and other systems, the dynamic range of the signal to be processed can reach more than 120 dB; the voltage at the front end of the ultrasonic echo receiver can also range from "μV" level to "V" level. The wide dynamic range often brings many problems to application design.

In practical applications, the signal to be processed is usually compressed nonlinearly. The most widely used is the logarithmic amplifier. It makes the envelope of the output signal and the input signal logarithmically proportional. Its compression of the signal dynamic range does not require the input signal level to control the gain like the AGC system. Its gain is inversely proportional to the signal size. It is widely used in communications, radar, ultrasound, and electronic countermeasures.

As shown in Figure 3, the scheme adopts single-ended input, with logarithmic zero point and slope adjustment circuit, setting the logarithmic zero point at -84 dBm and the slope at about 20 mV/dB. A buffer (AD8031) is added after the logarithmic amplifier, which has two main functions: one is to make the final output of the receiving module low impedance and improve the anti-interference ability; the other is to restore the logarithmic slope to 25 mV/dB through the voltage gain of this stage. The designed logarithmic amplifier signal input range is set to -72 dBm (at 50 Ω source impedance, -72 dBm is equivalent to a sine wave with an amplitude of ±80 μV) to +10 dBm (sine wave with an amplitude of ±1 V), and the corresponding logarithmic output voltage is 0.3~2.35 V, with a logarithmic dynamic range of 82 dB. The circuit is made into a module and encapsulated in a shielding case. All leads (except the ground wire and the output signal line) are led out through a through-hole capacitor, and the outer pole of the through-hole capacitor is grounded to improve the shielding effect.

Logarithmic amplifier for ultrasonic echo receiving unit


[page]

3 Software Design

The ultrasonic concentration meter software consists of four parts: signal processing program, interface program, control signal output program, and communication program. The overall software flow is shown in Figure 4. The signal processing program realizes functions such as DDS control, ultrasonic emission, echo signal A/D acquisition, and signal comprehensive processing, and is the focus of the software program. The interface program includes functions such as interface display, parameter setting, and keyboard processing to achieve good communication with users. The control signal output program realizes the output of current signals, relay signals, and switch quantities, meeting the needs of industrial field control. The communication program sends the single A/D value stored in the instrument and the display value of the comprehensive processing according to a certain protocol for the performance verification of the instrument.

Software overall process

The core of the software program consists of ultrasonic emission (including DDS pulse synthesis), ultrasonic echo A/D acquisition program, signal filtering program, and concentration calculation program.

3.1 Ultrasonic emission program, echo A/D acquisition program

The DDS selected in this system is SPI bus. Under the action of serial port clock SCLK, data is loaded to the device in 16-bit mode. FSYNC pin is an enable pin, level-triggered, and low level is effective. When performing serial data transmission, FSYNC pin must be set low, and attention should be paid to the minimum value of the establishment time from FSYNC effective to the falling edge of SCLK. After FSYNC is set low, data is sent to the input shift register of DDS at the falling edge of 16 SCLK. FSYNC can be set high at the falling edge of the 16th SCLK, but attention should be paid to the minimum and maximum value of the data holding time from the falling edge of SCLK to the rising edge of FSYNC. Of course, it is also possible to continuously load multiple 16-bit data when FSYNC is low, and set FSYNC high only at the falling edge of the 16th SCLK of the last data. Finally, it should be noted that when writing data, SCLK clock is a high-low level pulse, but when FSYNC just starts to become low (when writing data is about to start), SCLK must be high.

Through the hardware SPI of the microcontroller (using the three ports of the microcontroller), the DDS can be controlled to output a square wave of 0 Hz to 12.5 MHz. In addition, a port and the output of the DDS are used as the input of the NAND gate, so that the duration of the pulse train can be controlled. When the pulse train output is turned on, the duration is counted. According to the transmission speed of the ultrasonic wave in the slurry and the distance between the transmitting and receiving sensors , it can be determined when to receive the ultrasonic echo. By using the on-chip A/D to collect the ultrasonic echo, the digital signal collected by the A/D can be processed.

3.2 Signal filtering procedure

There are many commonly used software filtering methods, including limiting filtering, median filtering, arithmetic average filtering, recursive average filtering, median average filtering, limiting average filtering, first-order lag filtering, weighted recursive average filtering, and de-jitter filtering. Due to the harsh industrial field environment, the collected signals cannot be used directly without processing, so it is necessary to filter the collected A/D values. Since the jumps on site are random, conventional filtering procedures cannot be used. A comprehensive method of limiting filtering and de-jitter filtering is required - limiting de-jitter filtering.

The limiting filter method is based on experience to determine the maximum deviation value allowed between two samples (set to A). Every time a new value is detected, it is judged: if the difference between the current value and the previous value is less than or equal to A, then the current value is valid; if the difference between the current value and the previous value is greater than A, then the current value is invalid, and the current value is abandoned and the next A/D sampling is continued.

The de-jitter filtering method is to set a filter counter and compare each sampling value with the current effective value: if the sampling value is equal to the current effective value, the counter is cleared; if the sampling value is greater than or less than the current effective value, the counter is incremented by 1, and it is determined whether the counter is greater than or equal to the upper limit N (overflow). If the counter overflows, the current value is replaced by the current effective value, and the counter is cleared. The limit de-jitter filtering program can make corresponding changes with the jumps on site, making signal processing more reasonable and accurate.

3.3 Concentration calculation procedure

The concentration calculation program includes two parts: concentration curve fitting and temperature compensation.

Curve fitting is a data processing method that uses a continuous curve to approximately describe or compare the functional relationship between coordinates represented by a discrete point group on a plane. After multiple test corrections, the concentration curve fitting uses two first-order curves and one second-order curve to ensure the maximum concentration fit. At the same time, due to the needs of different on-site environments, some fitting parameters are set to facilitate adjustment at any time.

Temperature changes bring errors to the actual measurement of ultrasonic sensors, which is manifested in nonlinear changes in the microcontroller's ultrasonic echo A/D acquisition. In order to solve this problem, temperature compensation must be performed, the relationship between them must be found, and the corresponding mathematical model must be established. This system uses the fitting method to find the fitting polynomial of the static output characteristics of the sensor at each temperature, writes each fitting parameter b0, b1, b2, ..., bk into the program, and performs temperature compensation on the ultrasonic echo data collected by the A/D on the microcontroller chip, that is, the corresponding correct value after compensation is found and calculated by the input temperature and A/D value to ensure the accuracy of the concentration data.

Conclusion

This article discusses the realization method and main application technology of ultrasonic concentration meter. The transmitting circuit adopts DDS and the receiving circuit adopts logarithmic amplifier . Engineering practice has proved that these methods are feasible. However, due to the limitation of its own circuit and the environmental interference of industrial site, the accuracy of this product needs to be improved.

Reference address:Design of Ultrasonic Density Meter Based on Ultrasonic Echo Attenuation Theory

Previous article:Application of DDS signal source in frequency sweep test
Next article:Analysis on Generation and Detection Methods of Power Grid Harmonics

Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号