0 Introduction
In industrial distance measurement, non-contact distance measurement is often used due to work requirements and complex environments. Laser, infrared and ultrasonic waves are the most commonly used measurement media in non-contact distance measurement. Although laser distance measurement has high distance measurement accuracy and simple operation, it is greatly affected by the environment, and the system detection is not easy to maintain and the price is relatively expensive.
Infrared ranging is easily affected by ambient light intensity and light color, and the measurement accuracy is not high. Compared with the first two, ultrasonic waves are mechanical waves, which are not affected by light, electromagnetic interference, and low cost. They can measure the level of objects at fixed points and continuously. They have good adaptability in harsh environments such as dust, smoke, and corrosion. They are widely used in level measurement, manipulator control, reversing radar, robot obstacle avoidance, and other industrial sites. Therefore, in recent years, people have conducted a lot of discussions and research on ultrasonic ranging. The ultrasonic ranging sensors currently studied generally have a small ranging range, poor linearity and repeatability. The research method proposed in this paper can solve these two problems well. On the premise of ensuring that the linearity and repeatability are not less than 1. 5‰, the measurement range reaches more than 5 m.
1 Principle of Ultrasonic Ranging System
Among the current ultrasonic distance measurement methods, the echo time method is widely used. The main principle of this method is to detect the time t from the transducer transmitting the ultrasonic wave to receiving the echo signal through threshold comparison or phase correlation, and then calculate the distance s according to the ultrasonic velocity v during measurement. The calculation formula is:
Where speed v is a function of ambient temperature T:
The main errors of echo time distance measurement come from the change of sound speed, the attenuation of echo signal and the setting of receiving threshold. In measuring echo time, the threshold comparison method is simple and practical, but it is easily affected by environmental noise; the phase correlation method has a smaller error than the threshold comparison method and is not easily affected by external noise, but it has high requirements on the speed and storage of the microprocessor, which will increase the cost of hardware and software.
Different from the echo time method, another widely used distance measurement method is the phase difference method, which is mainly based on the vibration principle of mechanical waves. The phase change of 2π corresponds to 1 wavelength of the mechanical wave. The wavelength difference is calculated based on the phase difference between the transmitted wave and the returned wave, and then the distance value is obtained. This method has high measurement accuracy, but it is limited to the measurement of distance within 1 wavelength, and the identification of phase difference will also greatly increase the design cost.
After carefully analyzing and studying the advantages and disadvantages of the above methods, this paper uses the threshold comparison principle based on the pulse time method. The ultrasonic transmitting module uses a flyback converter to increase the ultrasonic transmission power, and the receiving module uses a time-controlled gain amplifier to accurately obtain the echo signal, and finally calculates the distance value. The use of these two core components not only makes the distance measurement system circuit structure simple and low in design cost, but also has a large measurement range and good static characteristics.
2 Ultrasonic ranging system
The overall principle block diagram of the ultrasonic ranging system is shown in Figure 1. The main control part of the ultrasonic ranging system is the C8051f320 single-chip microcomputer, which is a fully integrated mixed-signal system-on-chip microprocessor with a microcontroller core with a high-speed pipeline structure of up to 25MIPS and a full-speed non-intrusive in-system debugging interface. The main reason for using this microprocessor in the ultrasonic ranging system is that it has 5 capture/comparison modules and a programmable counter/timer array (PCA) with a watchdog timer function, which not only makes it very convenient and accurate to measure the echo time, but also can control the operation of 5 ultrasonic ranging modules at the same time.
Figure 1 Overall principle block diagram of ultrasonic ranging system
The transmitting and receiving parts of the ranging system are mainly composed of a flyback converter and a dedicated integrated circuit PM0268. The main advantage of the flyback converter over the forward converter is that it does not require an output filter inductor, which is very important for reducing the size of the converter and reducing costs. PW0268 is a dedicated integrated circuit for ultrasonic ranging. There are two sets of adjustable RC oscillators on the chip, one is the system reference time base, and the other is the ultrasonic oscillation frequency. The ultrasonic RC oscillator has the function of automatic frequency conversion, which can correct the drift of the transducer resonant frequency caused by temperature. A 32-order gain time-controlled amplifier is also integrated on the chip, which can easily compensate for the attenuation of the ultrasonic amplitude in the wave path. PW0268 also has a built-in bandpass filter that only requires a small amount of external resistors and capacitors, as well as a high-speed comparator, which can convert the amplified echo signal into a TTL digital signal that can be processed by the microprocessor.
In addition, due to the integration of ambient temperature compensation and LCD display circuit, the ranging system also has functions such as real-time compensation of sound velocity and real-time display of measurement results.
3 Ultrasonic ranging hardware circuit design
The ultrasonic transmitting and receiving circuit is the core circuit of ultrasonic ranging, which mainly includes the calculation and design of the flyback converter driving transducer circuit and the PW0268 peripheral circuit.
3.1 Flyback Converter Driving Circuit
The ultrasonic transmitting circuit uses the flyback converter commonly used in switching power supplies to significantly increase the voltage signal of the ultrasonic drive, so that the emitted ultrasonic signal is strong enough to facilitate the accurate judgment of the echo signal. The driving circuit is shown in Figure 2. The 40 kHz pulse train controls the field effect tube to continuously switch on and off, so that the primary voltage of the converter is coupled to the secondary to complete the voltage increase, and the transducer is driven to emit ultrasonic waves. Among them, the design of the converter must not only consider the maximum voltage stress of the switching field effect tube, but also focus on the effective value of the primary and secondary currents of the converter, the saturation of the magnetic core, and the impedance matching with the transducer.
Figure 2 Flyback converter drive circuit
3.2 PW0268 peripheral circuit
The I_O pin of PW0268 is a bidirectional pin. When a short low-level pulse is applied to this pin, the Driver_O pin starts to output an ultrasonic oscillation drive signal. After that, a timing signal (Tout) will be started inside PW0268. After that, the I_O pin changes from input to output mode and remains in a high-level state. During the Tout timing period, any external pull-down action on the I_O pin will not make the Driver_O output an oscillation waveform again. When the Tout timing is completed, the I_O pin will be restored to the input state and will start again. When the Driver_O sends out the ultrasonic drive signal, the transducer changes from the transmitting state to the receiving state. The received signal is first sent to the preamplifier of PW0268, then passes through the time-controlled gain amplifier and the bandpass filter, and finally performs echo amplitude detection and comparison before output. The echo signal is sent to the built-in comparator after being processed by the amplifier gain. When the input amplitude exceeds the set threshold, the output is switched to a high level, and the I_O pin is pulled to a low potential.
When C8051f320 detects this falling edge, it considers that the echo signal is received, and thus calculates the distance value. The internal principle and peripheral circuit of PW0268 are shown in Figure 3.
Figure 3 PW0268 peripheral circuit [page]
The biggest advantage of PW0268 for ultrasonic ranging is that it integrates a time-controlled amplifier, and its gain increases in steps of 220/F, where F refers to the system clock frequency of PW0268, which is calculated based on the maximum distance to be measured.
Therefore, for a distance measurement system with a maximum measurement distance of 5 m, after PW0268 sends a pulse train, the gain of the time-controlled amplifier will step by one step every 0.92 ms, thereby compensating for the attenuation of the ultrasonic wave amplitude in the wave path. The time-controlled gain step is shown in Figure 4.
Figure 4 PW0268 time-controlled gain
4 Ultrasonic ranging system software design
The system software consists of the main program, timer timing program, PCA capture interrupt program, ambient temperature acquisition, serial output and LCD display.
The system works in the continuous real-time ranging state. After initialization, the low level triggers PW0268 to send out an ultrasonic drive signal, and the PCA capture timing is turned on at the same time. The system starts waiting to receive the echo signal. When the echo signal is received within the maximum waiting time, the timing is stopped. After correcting the speed of sound according to the ambient temperature, the distance value is calculated and output for display. A complete ranging process is completed; when no echo signal is received within the maximum waiting time, the timing is reset and re-triggered. The flow chart of the system operation is shown in Figure 5.
Figure 5 System flow chart
5 Experimental results and analysis
In order to calibrate the measurement accuracy of the ultrasonic ranging system, a 100 cm × 100 cm × 2 cm hard flat wooden board was used as an obstacle for measurement, and the actual distance was measured with a steel tape measure as the standard value. After experimental verification, the designed ultrasonic ranging system has a measurement blind area of about 300 mm. The system was calibrated three times in the range of (500 ~ 5500) mm for forward and reverse strokes, and the experimental data were analyzed and calculated. The test data are shown in Table 1, and the fitting straight line is shown in Figure 6. The static characteristic indicators of the ultrasonic ranging system are calculated, that is, the linearity is: 0.11%, the repeatability is: 0.15%, and the hysteresis is 0.10%.
Table 1 Data table of 3 forward and reverse stroke experiments
Figure 6 Data of three forward and reverse stroke experiments
6 Conclusion
The ultrasonic ranging system designed in this paper adopts a flyback converter, which not only greatly increases the power of the transmitted ultrasonic wave, but also facilitates the judgment and reception of the echo signal, thereby improving the sensitivity and accuracy of the ranging system. When receiving ultrasonic waves, a time-controlled gain amplifier is used to compensate for the amplitude attenuation of the signal in the wave path, accurately obtain the echo signal, and then calculate the distance value. After experimental testing, the ranging system designed in this paper not only has a simple measurement method, a clear circuit structure, and a low cost, but also has excellent ranging performance, and can be applied to industrial non-contact ranging and other places.
Previous article:Research on Multi-sensor Measurement and Control System Based on μc/OS-II
Next article:Design test system using MSP430 series microcontroller
- Popular Resources
- Popular amplifiers
- Computer Vision Applications in Autonomous Vehicles: Methods, Challenges, and Future Directions
- Semantic Segmentation for Autonomous Driving: Model Evaluation, Dataset Generation, Viewpoint Comparison, and Real-time Performance
- Machine Learning and Embedded Computing in Advanced Driver Assistance Systems (ADAS)
- Intelligent program synthesis framework and key scientific problems for embedded software
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Overview of MCU bus, three-bus structure of MCU
- Most Popular Blogs of 2021: Connect, Power, and Protect
- Recruiting circuit engineers with high salary (Nantong Intelligent Perception Research Institute, Shanghai Institute of Technical Physics, Chinese Academy of Sciences)
- Does anyone have the schematic diagram of jmb366?
- If the clamp meter (multimeter) does not measure but there are still numbers, is it a malfunction?
- RK3399 open source motherboard hardware and software information released - free download
- Low Noise Amplifier LNA——ATF54143
- EEWORLD University Hall - Digital Oscilloscope Operation Digital Oscilloscope Operation_National Taiwan Normal University_Teacher Zhang Guowei
- [ESP32-Audio-Kit Audio Development Board Review] Part 1: Building esp-idf and esp-adf development environments based on vs code
- [Raspberry Pi Pico Review] Pico power supply part