搜档网
当前位置:搜档网 › 汽车电子毕设设计外文文献翻译

汽车电子毕设设计外文文献翻译

Ultrasonic ranging system design

Publication title: Sensor Review. Bradford: 1993.Vol.

ABSTRACT: Ultrasonic ranging technology has wide using worth in many fields, such as the industrial locale, vehicle navigation and sonar engineering. Now it has been used in level measurement, self-guided autonomous vehicles, fieldwork robots automotive navigation, air and underwater target detection, identification, location and so on. So there is an important practicing meaning to learn the ranging theory and ways deeply. To improve the precision of the ultrasonic ranging system in hand, satisfy the request of the engineering personnel for the ranging precision, the bound and the usage, a portable ultrasonic ranging system based on the single chip processor was developed.

Keywords: Ultrasound, Ranging System, Single Chip Processor

1. Introductive

With the development of science and techno logy, the improvement of people’s standard of living, speeding up the development and construction of the city. Urban drainage system have greatly developed their situation is construction improving. However, due to historical reasons many unpredictable factors in the synthesis of her time, the city drainage system. In particular drainage system often lags behind urban construction. Therefore, there are often good building excavation has been building facilities to upgrade the drainage system phenomenon. It brought to the city sewage, and it is clear to the city sewage and drainage culvert in the sewage treatment system. Comfort is very important to people’s lives. Mobile robots designed to clear the drainage culvert and the automatic control system Free sewage culvert clear guarantee robots, the robot is designed to clear the culvert sewage to the core. Control system is the core component of the development of ultrasonic range finder. Therefore, it is very important to design a good ultrasonic range finder.

2. A principle of ultrasonic distance measurement

The application of AT89C51:

SCM is a major piece of computer components are integrated into the chip micro-computer. It is a multi-interface and counting on the micro-controller integration, and intelligence products are widely used in industrial automation. and MCS-51 microcontroller is a typical and representative.

Microcontrollers are used in a multitude of commercial applications such as modems, motor-control systems, air conditioner control systems, automotive engine and among others. The high processing speed and enhanced peripheral set of these microcontrollers make them suitable for such high-speed event-based applications. However, these critical application domains also require that these microcontrollers are highly reliable. The high reliability and low market risks can be ensured by a robust testing process and a proper tools environment for the validation of these microcontrollers both at the component and at the system level. Intel Plaform Engineering department developed an object-oriented multi-threaded test environment for the validation of its AT89C51 automotive microcontrollers. The goals of this environment was not only to provide a robust testing environment for the AT89C51 automotive microcontrollers, but to develop an environment which can be easily extended and reused for the validation of several other future microcontrollers. The environment was developed in conjunction with Microsoft Foundation Classes

(AT89C51).

1.1 Features

* Compatible with MCS-51 Products

* 2Kbytes of Reprogrammable Flash Memory

Endurance: 1,000Write/Erase Cycles

* 2.7V to 6V Operating Range

* Fully Static operation: 0Hz to 24MHz

* Two-level program memory lock

* 128x8-bit internal RAM

* 15programmable I/O lines

* Two 16-bit timer/counters

* Six interrupt sources

*Programmable serial UART channel

* Direct LED drive output

* On-chip analog comparator

* Low power idle and power down modes

1.2 Description

The AT89C2051 is a low-voltage, high-performance CMOS 8-bit microcomputer with 2Kbytes of flash programmable and erasable read only memory (PEROM). The device is manufactured using Atmel’s high density nonvolatile memory technology and is compatible with the industry standard MCS-51 instruction set and pinout. By combining a versatile 8-bit CPU with flash on a monolithic chip, the Atmel AT89C2051 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.

The AT89C2051 provides the following standard features: 2Kbytes of flash,

128bytes of RAM, 15 I/O lines, two 16-bit timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, a precision analog comparator, on-chip oscillator and clock circuitry. In addition, the AT89C2051 is designed with static logic

for operation down to zero frequency and supports two software selectable power saving modes. The idle mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power down mode saves the RAM contents but freezer the oscillator disabling all other chip functions until the next hardware reset.

1.3 Pin Configuration

1.4 Pin Description

VCC Supply voltage.

GND Ground.

Prot 1

Prot 1 is an 8-bit bidirectional I/O port. Port pins P1.2 to P1.7 provide internal pullups. P1.0 and P1.1 require external pullups. P1.0 and P1.1 also serve as the positive input (AIN0) and the negative input (AIN1), respectively, of the on-chip precision analog comparator. The port 1 output buffers can sink 20mA and can drive LED displays directly. When 1s are written to port 1 pins, they can be used as inputs. When pins P1.2 to P1.7 are used as input and are externally pulled low, they will source current (IIL) because of the internal pullups.

Port 3

Port 3 pins P3.0 to P3.5, P3.7 are seven bidirectional I/O pins with internal pullups. P3.6 is hard-wired as an input to the output of the on-chip comparator and is not accessible as a general purpose I/O pin. The port 3 output buffers can sink 20mA. When 1s are written to port 3 pins they are pulled high by the internal pullups and can be used as inputs. As inputs, port 3 pins that are externally being pulled low will source current (IIL) because of the pullups.

Port 3 also serves the functions of various special features of the AT89C2051 as listed below.

1.5 Programming the Flash

The AT89C2051 is shipped with the 2 Kbytes of on-chip PEROM code memory array in the erased state (i.e., contents=FFH) and ready to be programmed. The code memory array is programmed one byte at a time. Once the array is programmed, to re-program any non-blank byte, the entire memory array needs to be erased electrically.

Internal address counter: the AT89C2051 contains an internal PEROM address counter which is always reset to 000H on the rising edge of RST and is advanced applying a positive going pulse to pin XTAL1.

Programming algorithm: to program the AT89C2051, the following sequence is recommended.

1. power-up sequence:

Apply power between VCC and GND pins Set RST and XTAL1 to GND

With all other pins floating , wait for greater than 10 milliseconds

2. Set pin RST to ‘H’ set pin P

3.2 to ‘H’

3. Apply the appropriate combination of ‘H’ or ‘L’ logic to pins P3.3, P3.4, P3.5,

P3.7 to select one of the programming operations shown in the PEROM programming modes table.

To program and Verify the Array:

4. Apply data for code byte at location 000H to P1.0 to P1.7.

5.Raise RST to 12V to enable programming.

5. Pulse P3.2 once to program a byte in the PEROM array or the lock bits. The byte-write cycle is self-timed and typically takes 1.2ms.

6. To verify the programmed data, lower RST from 12V to logic ‘H’ level and set pins P3.3 to P3.7 to the appropriate levels. Output data can be read at the port P1 pins.

7. To program a byte at the next address location, pulse XTAL1 pin once to advance the internal address counter. Apply new data to the port P1 pins.

8. Repeat steps 5 through 8, changing data and advancing the address counter for the entire 2 Kbytes array or until the end of the object file is reached.

9. Power-off sequence: set XTAL1 to ‘L’ set RST to ‘L’

Float all other I/O pins Turn VCC power off

2.1 The principle of piezoelectric ultrasonic generator

Piezoelectric ultrasonic generator is the use of piezoelectric crystal resonators to work. Ultrasonic generator, the internal structure as shown, it has two piezoelectric chip and a resonance plate. When it’s two plus pulse signal, the frequency equal to the intrinsic piezoelectric oscillation frequency chip, the chip will happen piezoelectric resonance, and promote the development of plate vibration resonance, ultrasound is generated. Conversely, it will be for vibration suppression of piezoelectric chip, the mechanical energy is converted to electrical signals, then it becomes the ultrasonic receiver.

The traditional way to determine the moment of the echo’s arrival is based on thresholding the received signal with a fixed reference. The threshold is chosen well above the noise level, whereas the moment of arrival of an echo is defined as the first moment the echo signal surpasses that threshold. The intensity of an echo reflecting from an object strongly depends on the object’s nature, size and distance from the sensor. Further, the time interval from the echo’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.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

3. Ultrasonic Ranging System for the Second Circuit Design

System is characterized by single-chip microcomputer to control the use of ultrasonic transmitter and ultrasonic receiver since the launch from time to time, single-chip selection of 875, economic-to-use, and the chip has 4K of ROM, to facilitate programming.

3.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 single-chip implementation of the following procedures to generate.

puzel: mov 14h, # 12h; ultrasonic firing continued 200ms

Here: cpl p1.0; output 40kHz square wave

nop;

nop;

nop;

djnz 14h, here;

ret

Ranging in front of single-chip termination circuit P1.0 input port, single chip implementation of the above procedure, the P1.0 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 P1.1 and P1.2, the working principle and circuit in front of the same location.

3.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 op-amp amplification IC1A and after polarization IC1B to IC2. IC2 is locked loop with audio decoder chip LM567, internal voltage-controlled oscillator center frequency of f0=1/1.1R8C3, capacitor C4 determine

their target bandwidth. R8-conditioning in the launch of the high jump 8 feet into a low-level, as interrupt request signals to the single-chip processing.

Ranging in front of single-chip termination circuit output port INT0 interrupt the highest priority, right or left location of the output circuit with output gate IC3A access INT1 port single-chip, while single-chip P1.3 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:

Receivel: push psw

push acc

clr ex1; related external interrupt 1

jnb p1.1, right; P1.1 pin to 0, ranging from right to interrupt service routine circuit

jnb p1.2, left; P1.2 pin to 0, to the left ranging circuit interrupt service routine

return: SETB EX1; open external interrupt 1

pop acc

pop psw

reti

right: …; right location entrance circuit interrupt service routine

Ajmp Return

left: …; left ranging entrance circuit interrupt service routine

Ajmp Return

3.3 The calculation of ultrasonic propagation time

When you start firing at the same time start the single-chip 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 output a negative jump in the end of INT0 or INT1 interrupt request generates a signal, single-chip microcomputer in response to external interrupt request, the implementation of the external interrupt service subroutine, read the time difference, calculating the distance. Some of its source code is as follows:

RECEIVE0: PUSH PSW

PUSH ACC

CLR EX0; related external interrupt 0

MOV R7, TH0; read the time value

MOV R6, TL0

CLR C

MOV A, R6

SUBB A, #0BBH; calculate the time difference

MOV 31H, A; storage results

MOV A, R7

SUBB A, # 3CH

MOV 30H, A

SETB EX0; open external interrupt 0\

POP ACC

POP PSW

RETI

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 zero-crossing 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 zero-crossing 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.

4、The ultrasonic ranging system software design

Software is divided into two parts, the main program and interrupt service routine. 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 complete three of the rotation direction of ultrasonic launch, the main external interrupt service subroutine to read the value of completion time, distance calculation, the results of the output and so on.

5、Conclusions

Required measuring range of 30cm-200cm objects inside the plane to do a number of measurements found that the maximum error is 0.5cm, and good reproducibility. Single-chip design can be seen on the ultrasonic ranging system has a hardware structure is simple, reliable, small features such as measurement error. Therefore, it can be used not only for mobile robot can be used in other detection system.

Thoughts: As for why the receiver do not have the transistor amplifier circuit, because the magnification well, integrated amplifier, but also with automatic gain control level, magnification to 76dB, the center frequency is 38k to 40k, is exactly resonant ultrasonic sensors frequency.

6、Parking sensor

6.1 Parking sensor introduction

Reversing radar, full name is "reversing the anti-collision radar, also known as" parking assist device, car parking or reversing the safety of assistive devices, ultrasonic sensors(commonly known as probes), controls and displays (or buzzer)and other components. To inform the driver around the obstacle to the sound or a more

intuitive display to lift the driver parking, reversing and start the vehicle around to

visit the distress caused by, and to help the driver to remove the vision dead

ends and blurred vision defects and improve driving safety.

6.2 Reversing radar detection principle

Reversing radar, according to high-speed flight of the bats in the

night, not collided with any obstacle principles of design and

development. Probe mounted on the rear bumper, according to different price and brand, the probe only ranging from two, three, four, six, eight,

respectively, pipe around. The probe radiation, 45-degree angle up and down

about the search target. The greatest advantage is to explore lower than the bumper of the driver from the rear window is difficult to see obstacles, and the police, such

as flower beds, children playing in the squatting on the car.

Display parking sensor installed in the rear view mirror, it constantly

remind drivers to car distance behind

the object distance to the dangerous distance, the buzzer starts singing, allow the driver to stop. When the gear lever linked into reverse gear, reversing radar, auto-

start the work, the working range of 0.3 to 2.0 meters, so stop when the driver was very practical. Reversing radar is equivalent to an ultrasound probe for ultrasonic probe can be divided into two categories: First, Electrical, ultrasonic, the second is to use mechanical means to produce ultrasound, in view of the more commonly used piezoelectric ultrasonic generator, it has two power chips and a sounding

board, plus apulse signal when the poles, its frequency equal to the intrinsic oscillation frequency of the piezoelectric pressure chip will be resonant and driven

by the vibration of the sounding board, the mechanical energy into electrical signal, which became the ultrasonic probe works. In order to better study Ultrasonic and use up, people have to design and manufacture of ultrasonic sound, the ultrasonic probe to

be used in the use of car parking sensor. With this principle in a non-contact

detection technology for distance measurement is simple, convenient and rapid, easy

to do real-time control, distance accuracy of practical industrial requirements. Parking sensor for ranging send out ultrasonic signal at a given

moment, and shot in the face of the measured object back to the signal wave, reversing radar receiver to use statistics in the ultrasonic signal from the transmitter to receive echo signals calculate the propagation velocity in the medium, which can calculate the distance of the probe and to detect objects.

6.3 Reversing radar functionality and performance

Parking sensor can be divided into the LCD distance display, audible alarm, and azimuth directions, voice prompts, automatic probe detection function is complete, reversing radar distance, audible alarm, position-indicating function. A good performance reversing radar, its main properties include: (1) sensitivity, whether the

response fast enough when there is an obstacle. (2) the existence of blind spots. (3) detection distance range.

6.4 Each part of the role

Reversing radar has the following effects: (1) ultrasonic sensor: used to

launch and receive ultrasonic signals, ultrasonic sensors can

measure distance. (2) host: after the launch of the sine wave pulse to the ultrasonic sensors, and process the received signal, to calculate the distance value, the data and monitor communication. (3) display or abuzzer: the receiving

host from the data, and display the distance value and provide different

levels according to the distance from the alarm sound.

6.5 Cautions

1, the installation height: general ground: car before the installation of 45 ~

55: 50 ~ 65cmcar after installation. 2, regular cleaning

of the probe to prevent the fill. 3, do not use the hard

stuff the probe surface cover will produce false positives or ranging allowed to

probe surface coverage, such as mud. 4, winter to avoid freezing. 5, 6 / 8 probe reversing radar before and after the probe is not free to swap may cause the Chang

Ming false positive problem. 6, note that the probe mounting orientation, in accordance with UP installation upward. 7, the probe is not recommended to install sheet

metal, sheet metal vibration will cause the probe resonance, resulting in false positives.

超声测距系统设计

原文出处:传感器文摘布拉福德:1993年

超声测距技术在工业现场、车辆导航、水声工程等领域具有广泛的应用价值,目前已应用于物位测量、机器人自动导航以及空气中与水下的目标探测、识别、定位等场合。因此,深入研究超声的测距理论和方法具有重要的实践意义。为了进一步提高测距的精确度,满足工程人员对测量精度、测距量程和测距仪使用的要求,本文研制了一套基于单片机的便携式超声测距系统。

关键词:超声波、测距仪、单片机

1、前言

随着科技的发展,人们生活水平的提高,城市发展建设加快,城市给排水系统也有较大发展,其状况不断改善。但是,由于历史原因合成时间的许多不可预见因素,城市给排水系统,特别是排水系统往往落后于城市建设。因此,经常出现开挖已经建设好的建筑设施来改造排水系统的现象。城市污水给人们带来了困扰,因此箱涵的排污疏通对大城市给排水系统污水处理,人们生活舒适显得非常重要。而设计研制箱涵排水疏通移动机器人的自动控制系统,保证机器人在箱涵中自由排污疏通,是箱涵排污疏通机器人的设计研制的核心部分。控制系统核心部分就是超声波测距仪的研制。因此,设计好的超声波测距仪就显得非常重要了。

2、超声波测距原理

AT89C51应用:

单片机是把主要计算机功能部件都集成在一块芯片上的微型计算机。它是一种集计数和多中接口于一体的微控制器,被广泛应用在智能产品和工业自动化上,而51单片机是个单片机中最为典型和最有代表性的一种。

单片机广泛应用于商业:诸如调制解调器,电动机控制系统,空调控制系统,汽车发动机和其他一些领域。这些单片机的高速处理速度和增强型外围设备集合使得它们适合于这种高速事件应用场合。然而,这些关键应用领域也要求这些单片机高度可靠。强大的测试环境和用于验证这些无论在元部件层次还是系统级别的单片机的合适的工具环境保证了高可靠性和低市场风险。Intel 平台工程部门开发了一种面

向对象的用于验证它的AT89C51 汽车单片机多线性测试环境。这种环境的目标不仅是为AT89C51 汽车单片机提供一种强大测试环境,而且开发一种能够容易扩展并重复用来验证其他几种将来的单片机。开发的这种环境连接了AT89C51。

1.1 特点

* 兼容MCS-51 产品

* 2字节的可再编程闪存

耐力擦写/擦除周期

* 2.7V 至 6V 工作范围

* 全静态操作存储器锁定

* 两级程序存储器锁定

* 128 x 8位内部RAM

* 15个可编程I/O线

* 2个16位定时器/计数器

* 六个中断源

* 可编程串行UART通道

* 直接LED驱动输出

* 片上模拟比较器

* 低功耗空闲和掉电模式

1.2 说明

该AT89C2051是一个低电压,高性能CMOS 8位2Kbytes 的flash可编程,可擦除只读存储器(PEROM)设备是制造采用Atmel的高密度非易失性内存技术,并与兼容的工商业污水附加费微机工业标准MCS-51指令集,并通过结合在一个通用的单芯片闪存的8位CPU引脚,Atmel的AT89C2051是一种功能强大的微机提供了高度灵活和成本效益的解决方案,许多嵌入式控制应用。

该AT89C2051提供以下标准功能2字节的闪存,128字节RAM,15 I/O线,两个16位定时器/计数器,一个五向量2级中断结构,一个全双工串行口,一个精密模拟比较器,片上振荡器和时钟电路此外,该AT89C2051的设计与操作频率下降到零静态逻辑,支持两种软件可选的节电模式空闲模式时CPU停止工作,同时允许RAM,定时

/计数器,串行口和中断系统继续工作暂停模式保存RAM的内容,但冻结,直到下一个硬件复位振荡器禁用所有其他芯片功能。

1.3 引脚配置

1.4 引脚说明

VCC 电源电压

GND 接地

端口 1

端口 1是一个8位双向 I/O 端口引脚P1.2 至P1.7,提供P1.1和P1.0内部上拉需要P1和P1.1外部上拉也可作为正输入(AIN0)和服输入(AIN1),分别对片内精密模拟比较器的端口1 输出缓冲器可以吸收20mA的电流,并且可以直接驱动LED时1秒写入端口1引脚,他们可以作为输入引脚P1.2时至P1.7作为输入,并从外部拉低,将输出电流(IIL)由于内部上拉在端口1也接收片内flash存储。

端口 3

端口 3 引脚P3.0至P3.5,P3.7有内部上拉双向I/O引脚是作为对片上比较器输出输入硬连接,而不是作为一个通用访问构成I/O引脚的输出缓冲器可吸收20mA,当1秒写入端口3拉高内部上拉,可作为输入,端口3被外部拉低的引脚为低电平输入的引脚将输出电流(IIL),由于上拉在端口3也接收片内flash存储。

端口引脚的第二功能:

P3.0 RXD(串行输入口)

P3.1 TXD(串行输出端口)

P3.2 INT0(外部中断0)

P3.3 INT1(外部中断1)

P3.4 T0(定时器0外部输入)

P3.5 T1(定时器1外部输入)

端口3也可以用下面列出的AT89C2051各种特殊功能。

1.5 Flash 进行编程

该AT89C2051是随片上PEROM代码存储阵列的2千字节的擦除状态(即,内容

=FFH),并准备进行编程代码存储器阵列的编程以一次一个字节数组一旦被编程,以重新编程的任何非空白字节,整个存储器阵列需要电擦除内部地址计数器。

内部地址计数器的AT89C2051包含的内部PEROM地址,计数器,它总是重置为000H的RST的上升沿和先进应用到管脚XTAL1一个正脉冲。

编程算法:编程AT89C2051的,按下列顺序推荐。

1、上电顺序:

接通电源VCC和GND引脚之间设置RST和XTAL1和GND

与所有其他引脚浮动,等待大于10毫秒

2、设置“H”集引脚RST引脚P3.2“H”

3、申请适当结合“H”或“L”逻辑管脚的P3.3,P3.4,P3.5,P3.7分别选择在PEROM编程模式表所示的编程操作之一。

进行编程和验证阵列:

4、适用于位置000H的P1.0到P1.7.5.Raise RST至12V,使编程代码字节的数据。

5、一次脉冲P3.2编程在PEROM阵列字节或锁定位。字节写周期是自定时的,通常需要1.2ms。

6、为了验证编程的数据,从12V到逻辑“H”级和一套引脚P3.3的P3.7分别到适当的水平较低的RST。在P1口引脚输出数据可以读取。

7、编写一个字节的下一个地址位置,脉冲XTAL1引脚一次,以推进内部地址计数器。申请新的数据到P1口管脚。

8、重复步骤5到8,不断变化的数据,并推动整个2字节数组的地址计数器或对象文件的末尾,直到达到。

9、断电顺序:集XTAL1和“L”设置RST的“L”

漂浮其他所有的I / O引脚切断VCC

2.1压电式超声波发生器原理

压电式超声波发生器实际上是利用压电晶体的谐振来工作的。超声波发生器内部结构,它有两个压电晶片和一个共振板。当它的两极外加脉冲信号,其频率等于压电晶片的固有振荡频率时,压电晶片将会发生共振,并带动共振板振动,便产生超声波。反之,如果两电极间未外加电压,当共振板接收到超声波时,将压迫压电晶片作振动,将机械能转化为电信号,这时它就成为超声波接收器了。

测量脉冲到达时间的传统方法是以拥有固定参数的接受信号开端为基础的。这个界限恰恰选于噪音水平之上,然而脉冲到达时间被定义为脉冲信号刚好超过界限的第一时刻。一个物体的脉冲强度很大程度上取决于这个物体的自然属性尺寸还有它与传感器的距离。进一步说,从脉冲起始点到刚好超过界限之间的时间段随着脉冲的强度而改变。结果,一种错误便出现了——两个拥有不同强度的脉冲在不同时间超过界限却在同一时间到达。强度较强的脉冲会比强度较弱的脉冲超过界限的时间早点儿,因此我们会认为强度较强的脉冲属于较近的物体。

2.2超声波测距原理

超声波发射器向某一方向发射超声波,在发射时刻的同时开始计时,超声波在空气中传播,途中碰到障碍物就立即返回来,超声波接收器收到反射波就立即停止计时。超声波在空气中的传播速度为340m/s,根据计时器记录的时间t,就可以计算出发射点距障碍物的距离(s),即:s=340t/2

3、超声波测距系统的电路设计

系统的特点是利用单片机控制超声波的发射和对超声波自发射至接收往返时间的计时,单片机选用C51,经济易用,且片内有4k的ROM,便于编程。

3.1 40 kHz 脉冲的产生与超声波发射

测距系统中的超声波传感器采用UCM40的压电陶瓷传感器,它的工作电压是40 kHz的脉冲信号,这由单片机执行下面程序来产生。

puzel: mov 14h, # 12h; 超声波发射持续200ms

Here: cpl p1.0; 输出40kHz方波

nop;

nop;

nop;

djnz 14h, here;

ret

前方测距电路的输入端接单片机P1.0端口,单片机执行上面的程序后,在

P1.0端口输出一个40kHz的脉冲信号,经过三极管T放大,驱动超声波发射头UCM40T,发出40kHz的脉冲超声波,且持续发射200ms。右侧和左侧测距电路的输入端分别接P1.1和P1.2端口,工作原理与前方测距电路相同。

3.2超声波的接收与处理

接收头采用与发射头配对的UCM40R,将超声波调制脉冲变为交变电压信号,经运算放大器IC1A和IC1B两极放大后加至IC2。IC2是带有锁定环的音频译码集成块LM567,内部的压控振荡器的中心频率f0=1/1.1R8C3,电容C4决定其锁定带宽。调节R8在发射的载频上,则LM567输入信号大于25mV,输出端8教由高电平跃变为低电平,作为中断请求信号,送至单片机处理。

前方测距电路的输出端接单片机INT0端口,中断优先级最高,左、右测距电路的输出通过与门IC3A的输出接单片机INT1端口,同时单片机P1.3和P1.4接到IC3A的输入端,中断源的识别由程序查询来处理,中断优先级为先右后左。部分源程序如下:

receivel : push psw

push acc

clr ex1; 关外部中断1

jnb p1.1, right; P1.1 引脚为0,转至右测距电路中断服务程序 jnb p1.2, left; P1.2 引脚为0,转至左测距电路中断服务程序return: SETB EX1; 开外部中断1

pop acc

pop psw

reti

right: …; 右测距电路中断服务程序入口

Ajmp Return

left: …; 左测距电路中断服务程序入口

Ajmp Return

3.3计算超声波传播时间

在启动发射电路的同时启动单片机内部结构的定时器T0,利用定时器的计数功能记录超声波发射的时间和收到反射波的时间。当收到超声波反射波时,接收电路输出端产生一个负跳变,在INT0或INT1端产生一个中断请求信号,单片机响应外部中断请求,执行外部中断服务子程序,读取时间差,计算距离。其部分源程序如下:

RECEIVE0: PUSH PSW

PUSH ACC

CLR EX0; related external interrupt 0

MOV R7, TH0; read the time value

MOV R6, TL0

CLR C

MOV A, R6

SUBB A, #0BBH; calculate the time difference

MOV 31H, A; storage results

MOV A, R7

SUBB A, # 3CH

MOV 30H, A

SETB EX0; open external interrupt 0\

POP ACC

POP PSW

RETI

对于一个平坦的目标,距离测量包括两个阶段:粗糙的测量和精细测量。

第一步: 脉冲的传送产生一种简单的超声波。

第二部: 根据公式改变回波放大器的获得量直到回波被检测到。

第三部: 检测两种回波的振幅与过零时间。

第四部: 设置回拨放大器的所得来规定输出,假定是3伏。通过脉冲的周期设置下一个脉冲。根据第二部的数据设定时间窗。

第五步: 发射两串脉冲产生干扰波。测量过零时间与回波振幅。如果逆向发生在回波中,决定要不要通过在低气压插入振幅。

第六步: 通过公式计算距离y。

4、超声波测距系统的软件设计

软件分为两部分,主程序和中断服务程序。主程序完成初始化工作、各路超声波发射和接收顺序的控制。定时中断服务子程序完成三方向超声波的轮流发射,外部中断服务子程序主要完成时间值的读取、距离计算、结果的输出等工作。

5、结论

对所要求测量范围30cm—200cm内的平面物体做了多次测量发现,其最大误差为0.5cm,且重复性好。可见基于单片机设计的超声波测距系统具有硬件结构简单、工作可靠、测量误差小等特点。因此,它不仅可用于移动机器人,还可用在其他检测系统中。

6、倒车雷达

6.1倒车雷达介绍

倒车雷达全称叫“倒车防撞雷达”,也叫“泊车辅助装置”,是汽车泊车或者倒车时的安全辅助装置,由超声波传感器(俗称探头)、控制器和显示器(或蜂鸣

器)等部分组成。能以声音或者更为直观的显示告知驾驶员周围障碍物的情况,解除了驾驶员泊车、倒车和起动车辆时前后左右探视所引起的困扰,并帮助驾驶员扫除了视野死角和视线模糊的缺陷,提高驾驶的安全性。

6.2 倒车雷达探测原理

倒车雷达是根据蝙蝠在黑夜里高速飞行而不会与任何障碍物相撞的原理设计开发的。探头装在后保险杠上,根据不同价格和品牌,探头有二、三、四、六、八只不等,分别管前后左右。探头以45度角辐射,上下左右搜寻目标。它最大的好处是能探索到那些低于保险杠而司机从后窗难以看见的障碍物,并报警,如花坛、蹲在车后玩耍的小孩等。

倒车雷达的显示器装在后视镜上,它不停地提醒司机车距后面物体还有多少距离,到危险距离时,蜂鸣器就开始鸣叫,让司机停车。档位杆挂入倒挡时,倒车雷达自动开始工作,测距范围达0.3到2.0米左右,故在停车时,对司机很实用。倒车雷达就相当于超声波探头,从整体上来说超声波探头可以分为两大类:一是用电气方式产生超声波,二是用机械方式产生超声波,鉴于目前较为常用的是压电式超声波发生器,它有两个电晶片和一个共振板,当两极外加脉冲信号,它的频率等于压电晶片的固有震荡频率时,压力晶片将会发生共振,并带动共振板振动,将机械的能转为电信号的这一过程,这就成了超声波探头的工作原理。为了更好地研究超声波和利用起来,人们已经设计和制造出很多超声波发声器,超声波探头加以运用在使用汽车倒车雷达上。这种原理用在一种非接触检测技术上,用于测距来说其计算简单,方便迅速,易于做到实时控制,距离准确度达到工业实用的要求。倒车雷达用于测距上,在某一时刻发出超声波信号,在遇到被测物体后的射回信号波,被倒车雷达接收到,得用在超声波信号从发射到接收回波信号这一个时间而计算出在介质中的传播速度,这就可以计算出探头与被探测到的物体的距离。

6.3 倒车雷达的功能和性能

倒车雷达可分为LCD距离显示、声音提示报警、方位指示、语音提示、探头自动检测等,功能较齐全的倒车雷达应该有距离显示、声音提示报警、方位指示等功能。一台性能良好的倒车雷达它的主要性能主要包括:(1)灵敏度,在有障碍物的时候反应是否够快。(2)是否存在盲区。(3)探测距离范围。

相关主题