In autonomous walking robotics, robots must be walking in unknown and uncertain environments, must collect environmental information in real time to achieve avoidance and navigation, which must rely on sensor systems that can achieve environmental information. Sensor such as visual, infrared, laser, and ultrasonic waves are widely used in walking robots. Since the ultrasonic ranging method is simple, the price is cheap, the size is small, the design is simple, and it is easy to achieve real-time control, and the industry can achieve industrial practical requirements in terms of measurement distance, measurement, etc., so a wide range of applications. The robots described herein adopt a three-square ultrasonic ranging system that provides information about the distance from the front, left and right environments of the robot.
Ultrasonic ranging principle
The interior of the ultrasonic generator consists of two piezoelectric sheets and a resonant plate. When its polar external pulse signal, and its frequency is equal to the inherent oscillation frequency of the piezoelectric wafer, the piezoelectric wafer will resonate, and the resonance plate vibration is activated, and ultrasonic waves are generated. Conversely, if there is no external voltage between the two poles, it is an ultrasonic receiver when the resonance plate receives the ultrasonic wave. Ultrasonic ranging generally has two methods: 1 take the average voltage value of the output pulse, the voltage is proportional to the distance, the measurement voltage can be measured; 2 Measure the width of the output pulse, that is, the time interval T of the transmitted ultrasonic wave and the reception ultrasonic wave. According to the measured distance S = VT? 2 to get the measurement distance, since the ultrasonic speed V is related to the temperature, so if the temperature changes are relatively large, correction should be corrected by temperature compensation.
This measurement system adopts the second method, since the measurement requirements are not particularly high, it can be considered that the temperature is substantially unchanged. The system is implemented by the PIC16F877 microcontroller, and the real-time control of the peripheral circuit is implemented by software, and provides signals required to peripheral circuits, including frequency vibration signals, data processing signals, and the like, thereby simplifying the peripheral circuit, and is well transplantability. The system hardware circuit block is shown in Figure 1.
Be
Figure 1 System hardware circuit block diagram
Since this system only needs to know the front, left, right, there is an obstacle, do not need to know the specific distance of the obstacle and the robot, so there is no need to display the circuit, only need to set a valve value, so that the obstacle is When the distance of the robot reaches a value, the microcontroller controls the robot's motor, which can be implemented through software programming.
Ultrasonic transmitting circuit
The ultrasonic transmitting circuit produces a 40 kHz ultrasonic signal from the RA0 port when the single-chip is electrically powdered. However, the signal is not allowed to transmit an ultrasonic emission head through the non-door into the amplifying circuit, only when the switch S1 is closed. The RA1 port emits a gate signal that is 4 kHz, and the timer TMR1 inside the single-chip machine is activated and the count is started. Each of the waveforms of the gating signal transmits 10 complete waveforms each, which can be derived from their frequencies. The cycle of ultrasonic waves is 1 (40 kHz) = 01025ms, and the period of the gate control signal is 1 (4kHz) = 0125ms. The distance between the obstacle and the mobile robot is obtained according to S = VT2. When the ultrasonic receiving header receives the ultrasonic wave reflected back, the counter stops counting, and the time t can be obtained from the period of the counter to the rendering signal. RA2 port RS trigger, the RS trigger can automatically control the transmitting and stop of ultrasonic waves. The circuit of the system also includes a manual reset circuit, controlled by the MCLR pin of the single chip microcomputer, and the ultrasonic transmission circuit diagram is shown in Figure 2.
Be
Figure 2 Ultrasonic transmitting circuit diagram
Gateway (RS trigger)
In order to achieve automatic control of ultrasonic transmission and reception, it is necessary to add a gate control in the circuit. The gating signal frequency is 4 kHz, such as the output pulse as a gate signal, so that the pulse of the known frequency Fc is just through the gate, then T = NTC, where TC is a period of known pulses, n is the number of pulses. The gate control circuit consists of RS trigger, and when the input end r = 1 (s = 0) is reset, the output terminal Q = 0; when R = 0 (s = 1) is set, ie Q = 1. The RS trigger is connected to the RA2 port of the microcontroller.
Ultrasonic amplification circuit
Ultrasonic amplifying circuit consists of a triode, since only 20 mA to 25 mA pull-up current is more than 20mA to 25 mA, and the ultrasonic transmitter requires a current from the non-door to amplify the current to complete the emission of ultrasonic waves. The ultrasonic amplification transmit circuit is shown in Figure 3.
Be
Figure 3 Ultrasonic amplification transmit circuit diagram
Ultrasonic receiving magnifying circuit
Since the ultrasonic signal received is weak, it is necessary to add an ultrasonic reception amplifying circuit after it will follow. The circuit uses two integrated op amps, designed to two, two levels are inhabited, because the voltage amplification of the same phase is 1 + RFR, so the magnification of 10, the two magnification is close to 100 times, so The subsequent circuit can easily detect the input signal. Integrated op amp is powered by dual power supply, and the ultrasonic reception amplifier circuit is shown in Figure 4.
Be
Figure 4 Ultrasonic reception amplified circuit diagram
Signal filter circuit
From the sound wave from the signal amplification circuit, there is a certain interference. In order to remove the interference signal, a filter circuit is required, and the signal filter circuit is selected from which the heart frequency is 40 kHz, with a bandwidth of 2 kHz, and add a zero comparator. To convert the output signal into a square wave signal. The signal filter circuit is shown in Figure 5.
Be
Figure 5 Signal filter circuit diagram
Signal shaping circuit
The square wave signal from the signal filter circuit is very irregular, so it is subsequently plus a shaped circuit, and the plastic circuit is constructed from two-stage non-door, and together with a resistor, and then send the microcontroller after the formation, the signal shaping circuit is shown in Figure 6.
Be
Figure 6 Signal shaping circuit diagram
The ultrasonic ranging system designed in this paper adopts single-chip programming technology, with hardware completion of the system requirements, which can meet most of the project needs. Compared with traditional ranging systems, there is a simple structure, cheap, and good graft.
Be
Source: Wiku Electronic Market Network
Our other product: