【正文】
Further, the time interval from the echo39。s starting point to the moment when it surpasses the threshold changes with the intensity of the echo. As a consequence, a considerable error may occur Even two echoes with different intensities arriving exactly at the same time will surpass the threshold at different moments. The stronger one will surpass the threshold earlier than the weaker, so it will be considered as belonging to a nearer object.2, the principle of ultrasonic distance measurement Ultrasonic transmitter in a direction to launch ultrasound, in the moment to launch the beginning of time at the same time, the spread of ultrasound in the air, obstacles on his way to return immediately, the ultrasonic reflected wave received by the receiver immediately stop the clock. Ultrasound in the air as the propagation velocity of 340m / s, according to the timer records the time t, we can calculate the distance between the launch distance barrier (s), that is: s = 340t / 2 Ranging System for the Second Circuit Design System is characterized by singlechip microputer to control the use of ultrasonic transmitter and ultrasonic receiver since the launch from time to time, singlechip selection of 8751, economictouse, and the chip has 4K of ROM, to facilitate programming. Circuit schematic diagram shown in Figure 2. Draw only the front range of the circuit wiring diagram, left and right in front of Ranging Ranging circuits and the same circuit, it is omitted. 1,40 kHz ultrasonic pulse generated with the launch Ranging system using the ultrasonic sensor of piezoelectric ceramic sensors UCM40, its operating voltage of the pulse signal is 40kHz, which by the singlechip implementation of the following procedures to generate. puzel: mov 14h, 12h。 ultrasonic firing continued 200ms Ranging in front of singlechip termination circuit input port, single chip implementation of the above procedure, the port in a 40kHz pulse output signal, after amplification transistor T, the drive to launch the first ultrasonic UCM40T, issued 40kHz ultrasonic pulse, and the continued launch of 200ms. Ranging the right and the left side of the circuit, respectively, then input port and , the working principle and circuit in front of the same location. 2, reception and processing of ultrasonic Used to receive the first launch of the first pair UCM40R, the ultrasonic pulse modulation signal into an alternating voltage, the opamp amplification IC1A and after polarization IC1B to IC2. IC2 is locked loop with audio decoder chip LM567, internal voltagecontrolled oscillator center frequency of f0 = 1/, capacitor C4 determine their target bandwidth. R8conditioning in the launch of the carrier frequency on the LM567 input signal is greater than 25mV, the output from the high jump 8 feet into a lowlevel, as interrupt request signals to the singlechip processing. Ranging in front of singlechip termination circuit output port INT0 interrupt the highest priority, right or left location of the output circuit with output gate IC3A access INT1 port singlechip, while singlechip and P1. 4 received input IC3A, interrupted by the process to identify the source of inquiry to deal with, interrupt priority level for the first left right after. Part of the source code is as follows: 3, the calculation of ultrasonic propagation time When you start firing at the same time start the singlechip circuitry within the timer T0, the use of timer counting function records the time and the launch of ultrasonic reflected wave received time. When you receive the ultrasonic reflected wave, the receiver circuit outputs a negative jump in the end of INT0 or INT1 interrupt request generates a signal, singlechip microputer in response to external interrupt request, the implementation of the external interrupt service subroutine, read the time difference, calculating the distance . For a flat target, a distance measurement consists of two phases: a coarse measurement and. a fine measurement:Step 1: Transmission of one pulse train to produce a simple ultrasonic wave.Step 2: Changing the gain of both echo amplifiers according to equation , until the echo is detected.Step 3: Detection of the amplitudes and zerocrossing times of both echoes.Step 4: Setting the gains of both echo amplifiers to normalize the output at, say 3 volts. Setting the period of the next pulses according to the : period of echoes. Setting the time window according to the data of step 2.Step 5: Sending two pulse trains to produce an interfered wave. Testing the zerocrossing times and amplitudes of the echoes. If phase inversion occurs in the echo, determine to otherwise calculate to by interpolation using the amplitudes near the trough. Derive t sub m1 and t sub m2 .Step 6: Calculation of the distance y using equation ., the ultrasonic ranging system software design Software is divided into two parts, the main program and interrupt service routine, shown in Figure 3 (a) (b) (c) below. Completion of the work of the main program is initialized, each sequence of ultrasonic transmitting and receiving control. Interrupt service routines from time to time to plete three of the rotation direction of ultrasonic launch, the main external interrupt service subroutine to read the value of pletion time, distance calculation, the results of the output and so on..System initialization after the start timer T1 starts counting from 0 to enter the main program to wait for the T1 overflow into the T1 interrupt service routine when the time is reached。 T1 interrupt service routine will start a new ultrasonic transmitting, the square wave will be generated in the pin at the same time open the timer T0 timing, in order to avoid the diffraction of the direct wave, the delay 1ms and then, after the INT0 interrupt Enable。 the INT0 interrupt to allow open, if thisoccurs when the low is representative of the received echo signal, th