超声测距系统

上传人:feng****ing 文档编号:72293495 上传时间:2022-04-08 格式:DOC 页数:16 大小:255.50KB
返回 下载 相关 举报
超声测距系统_第1页
第1页 / 共16页
超声测距系统_第2页
第2页 / 共16页
超声测距系统_第3页
第3页 / 共16页
亲,该文档总共16页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
超声测距系统设计原文出处:传感器文摘 布拉福德:1993年 第13页摘要:超声测距技术在工业现场、车辆导航、水声工程等领域都具有广泛的使用价值,目前已使 用于物位测量、机器人自动导航以及空气中和水下的目标探测、识别、定位等场合。因此,深入 研究超声的测距理论和方法具有重要的实践意义。为了进一步提高测距的精确度,满足工程人员 对测量精度、测距量程和测距仪使用的要求,本文研制了一套基于单片机的便携式超声测距系统。 关键词:超声波,测距仪,单片机/、八1、前言随着科技的发展,人们生活水平的提高,城市发展建设加快,城市给排水系统也 有较大发展,其状况不断改善。但是,由于历史原因合成时间住的许多不可预见因素, 城市给排水系统,特别是排水系统往往落后于城市建设。 因此,经常出现开挖已经建 设好的建筑设施来改造排水系统的现象。城市污水给人们带来了困扰,因此箱涵的排 污疏通对大城市给排水系统污水处理,人们生活舒适显得非常重要。而设计研制箱涵 排水疏通移动机器人的自动控制系统, 保证机器人在箱涵中自由排污疏通,是箱涵排 污疏通机器人的设计研制的核心部分。控制系统核心部分就是超声波测距仪的研制。 因此,设计好的超声波测距仪就显得非常重要了。2、超声波测距原理2.1压电式超声波发生器原理压电式超声波发生器实际上是利用压电晶体的谐振来工作的。 超声波发生器内部 结构,它有两个压电晶片和一个共振板。当它的两极外加脉冲信号,其频率等于压电 晶片的固有振荡频率时,压电晶片将会发生共振,并带动共振板振动,便产生超声波。 反之,如果两电极间未外加电压,当共振板接收到超声波 时,将压迫压电晶片作振 动,将机械能转换为电信号,这时它就成为超声波接收器了。测量脉冲到达时间的传统方法是以拥有固定参数的接收信号开端为基础的。这个 界限恰恰选于噪音水平之上,然而脉冲到达时间被定义为脉冲信号刚好超过界限的第一时刻。一个物体的脉冲强度很大程度上取决于这个物体的自然属性尺寸还有它和传 感器的距离。进一步说,从脉冲起始点到刚好超过界限之间的时间段随着脉冲的强度 而改变。结果,一种错误便出现了一一两个拥有不同强度的脉冲在不同时间超过界限 却在同一时间到达。强度较强的脉冲会比强度较弱的脉冲超过界限的时间早点,因此我们会认为强度较强的脉冲属于较近的物体。2.2超声波测距原理超声波发射器向某一方向发射超声波, 在发射时刻的同时开始计时,超声波在空 气中传播,途中碰到障碍物就立即返回来,超声波接收器收到反射波就立即停止计时。 超声波在空气中的传播速度为340m/s,根据计时器记录的时间t,就可以计算出发射 点距障碍物的距离(s),即:s=340t/23、超声波测距系统的电路设计系统的特点是利用单片机控制超声波的发射和对超声波自发射至接收往返时间 的计时,单片机选用C51,经济易用,且片内有4K的ROM便于编程。电路原理图如 图1所示。-OKU4XMMXa sb丄r-8VR43F卄FICldFSTSAHOOliF 科二04c2gelu5artu1.6KLI4VI0UF 任 1E12O0Fr-P亠 i k 3! kJP* F-i O96O 7543j iIb Is LA 0is*7Kfle- g2 口2 2I 23kJ42卜0L2 J CO24wsosoreSS55DSSS图1电路原理图松 34PXu4Knu4K3.1 40kHz脉冲的产生和超声波发射测距系统中的超声波传感器采用 UCM40勺压电陶瓷传感器,它的工作电压是 40kHz的脉冲信号,这由单片机执行下面程序来产生。puzel : mov 14h, #12h ;超声波发射持续 200mshere: 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 0IC2是带有锁 定环的音频译码集成块 LM567内部的压控振荡器的中心频率 f0=1/1.1R8C3,电容C4决定其锁定带宽。调 节R8在发射的载频上,则LM567输入信号大于25mV输出端8脚由高电平跃变为低 电平,作为中断请求信号,送至单片机处理前方测距电路的输出端接单片机INT0端口,中断优先级最高,左、右测距电路 的输出通过和门IC3A的输出接单片机INT1端口,同时单片机P1.3和P1.4接到IC3A 的输入端,中断源的识别由程序查询来处理,中断优先级为先右后左。部分源程序如 下:receive1 : push pswpush accclr ex1;关外部中断1jnb p1.1,right; P1.1弓I脚为0,转至右测距电路中断服务程序jnb p1.2,leftreturn : SETB EX1 ;pop acc;P1.2引脚为0,转至左测距电路中断服务程序pop pswretiright :.;ajmp returnleft :.;ajmp return3.3计算超声波传播时间右测距电路中断服务程序入口左测距电路中断服务程序入口开外部中断1在启动发射电路的同时启动单片机内部的定时器TO,禾U用定时器的计数功能记录超声波发射的时间和收到反射波的时间。当收到超声波反射波时,接收电路输出端产生一个负跳变,在INT0或INT1端产生一个中断请求信号,单片机响应外部中断 请求,执行外部中断服务子程序,读取时间差,计算距离。其部分源程序如下:RECEIVE0 PUSH PSWPUSH ACCCLR EX0MOV R7, TH0MOV R6, TL0CLR CMOV A, R6SUBB A, #0BBHMOV 31H, AMOV A, R7SUBB A, #3CHMOV 30H, ASETB EX0关外部中断0;读取时间值计算时间差存储结果开外部中断0POP ACCPOP PSWRETI对于一个平坦的目标,距离测量包括两个阶段:粗糙的测量和精细测量。第一步:脉冲的传送产生一种简单的超声波。第二步:根据公式改变回波放大器的获得量直到回拨被检测到。第三步:检测两种回波的振幅和过零时间。第四步:设置回波放大器的所得来规格输出, 假定是3伏。通过脉冲的周期设置下一 个脉冲。根据第二部的数据设定时间窗。第五步:发射两串脉冲产生干扰波。测量过零时间和回波的振幅。如果逆向发生在回 波中,决定要不通过在低气压插入振幅。第六步:通过公式计算距离y。4、超声波测距系统的软件设计软件分为两部分,主程序和中断服务程序。主程序完成初始化工作、各路超声波 发射和接收顺序的控制。定时中断服务子程序完成三方向超声波的轮流发射, 外部中 断服务子程序主要完成时间值的读取、距离计算、结果的输出等工作。5、结论对所要求测量范围30cm200cm内的平面物体做了多次测量发现,其最大误差为 0.5c m,且重复性好。可见基于单片机设计的超声波测距系统具有硬件结构简单、工 作可靠、测量误差小等特点。因此,它不仅可用于移动机器人,还可用在其它检测系 统中。思考:至于为什么接收不用晶体管做放大电路呢, 因为放大倍数搞不好,集成放大电 路,还带自动电平增益控制,放大倍数为 76dB,中心频率是38k到40k,刚好是超声 波传感器的谐振频率。参考文献1. Fox, J.D., Khuri-Yakub, B.T. and Ki no, G.S., High Freque ncy Acoustic Wave Measureme nt in Air, in Proceedi ngs of IEEE 1983 Ultraso nic Symposium, October 31-2 November, 1983, Atlanta, GA, pp. 581-4.2. Martin Abreu, J.M., Ceres, R. and Freire, T., Ultrasonic Ranging: Envelope Analysis Gives Improved Accuracy, Sensor Review, Vol. 12 No. 1, 1992, pp. 17-21.3. Parrilla, M., Anaya, J.J. and Fritsch, C., Digital Signal Processing Techniques for High Accuracy Ultras onic Range Measureme nts, IEEE Tran sacti ons: In strume ntati on and Measurement, Vol. 40 No. 4, August 1991, pp. 759-63.4. Can ali, C., Cicco, G.D., Mortem, B., Prude nziati, M., and Taro n, A., A Temperature Compe nsated Ultras onic Sen sor Operati ng in Air for Dista nee and Proximity Measurement, IEEE Transaction on Industry Electronics, Vol. IE-29 No. 4, 1982, pp. 336-41.5. Martin, J.M., Ceres, R., Calderon, L and Freire, T., Ultrasonic Ranging Gets Thermal Correctio n, Se nsor Review, Vol. 9 No. 3, 1989, pp. 153-5.Ultras onic ranging system desig nPublication title: Sensor Review. Bradford: 1993. Vol. 13ABSTRACT : Ultras onic ranging tech no logy has wide using worth in many fields , such as the in dustrial 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 precisi on of the ultras onic 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 r, Ranging System, Single Chip Processor1.ln troductiveWith the developme nt of scie nee and tech no logy, the improveme nt of peoples sta ndard of liv ing, speed ing up the developme nt and con struct ion of the city. urba n drain age system have greatly developed their situatio n is con sta ntly impro ving. However, due to historical reas ons many un predictable factors in the syn thesis of her time, the city drain age system .In particular drain age system ofte n lags beh ind urba n con struct ion. Therefore, there are ofte n good buildi ng excavati on has bee n buildi ng facilities to upgrade the drain age system phe nomenon. It brought to the city sewage, and it is clear to the city sewage and drain age culvert in the sewage treatme nt system. comfort is very importa nt to peoples lives. Mobile robots desig ned to clear the drain age culvert and the automatic con trol system Free sewage culvert clear guara ntee robot, the robot is desig ned to clear the culvert sewage to the core. Con trol System is the core comp onent of the developme nt of ultrasonic range finder. Therefore, it is very important to design a good ultrasonic range fin der.2. A principle of ultrasonic distanee measurement2.1 The principle of piezoelectric ultrasonic generatorPiezoelectric ultras onic gen erator is the use of piezoelectric crystal res on ators to work. Ultrasonic generator, the internal structure as shown, it has two piezoelectric chip and a resonance plate. When its two plus pulse signal, the frequency equal to the intrinsic piezoelectric oscillati on freque ncy chip, the chip will happe n piezoelectric res onan ce, and promote the developme nt of plate vibrati on res onan ce, ultraso und is gen erated. Conv ersely, if the two are not in ter-electrode voltage, whe n the board received ultras onic res onan ce, it will be for vibrati on suppressi on of piezoelectric chip, the mecha ni cal en ergy is con verted to electrical signals, then it becomes the ultrasonic receiver.The traditional way to determine the moment of the echos arrival is based on thresholding the received signal with a fixed referenee. 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 sig nal surpassesthat threshold. The inten sity of an echo reflect ing from an object strongly depends on the objects nature, size and distance from the sensor. Further, the time interval from the echos starting point to the moment when it surpassesthe threshold cha nges with the inten sity of the echo. As a con seque nce, a con siderable error may occur Eve n two echoes with differe nt in ten sities arrivi ng 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.2The prin ciple of ultras onic dista nce measureme ntUltras onic tran smitter in a directi on to launch ultraso und, in the mome nt 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 ultras onic reflected wave received by the receiver immediately stop the clock. Ultraso und in the air as the propagatio n velocity of 340m / s, accordi ng to the timer records the time t, we can calculate the distance between the launch distance barrier (s), that is: s = 340t / 23. Ultrasonic Ranging System for the Second Circuit DesignSystem is characterized by sin gle-chip microcomputer to con trol the use of ultras onic tran smitter and ultras onic receiver since the launch from time to time, si ngle-chip select ion of 8751, economic-to-use, and the chip has 4K of ROM, to facilitate programming. Circuitschematic diagram show n in Figure 2.T1rs卄liCD4E2FN5K堆5占 OAHrLSPF-.sS二二13Z討27 K K 24 23 K 凶 20O 高 17 16 二fl2Klu2UFigure 1 circuit prin ciple diagram83答3.1 40 kHz ultras onic pulse gen erated with the launchRanging system using the ultras onic sen sor of piezoelectric ceramic sen sors UCM40, its operating voltage of the pulse signal is 40kHz, which by the single-chip implementation of the followi ng procedures to gen erate.puzel: mov 14h, # 12h; ultrasonic firing continued 200mshere: cpl p1.0; output 40kHz square waven op;n op;n op;djnz 14h, here;retRanging in front of sin gle-chip term in ati on circuit P1.0 in put port, sin gle 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, the n in put port P1.1 and P1.2, the worki ng prin ciple and circuit in front of the same locati on.3.2 Receptio n and process ing of ultras onicUsed 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-c on trolled oscillator cen ter freque ncy of f0 = 1/1.1R8C3, capacitor C4 determ ine their target bandwidth. R8-conditioning in the launch of the carrier frequency on the LM567 in put sig nal is greater tha n 25mV, the output from the high jump 8 feet into a low-level, as in terrupt request sig nals to the sin gle-chip process ing.Ranging in front of sin gle-chip term in atio n circuit output port INT0 in terrupt the highest priority, right or left location of the output circuit with output gate IC3A access INT1 port sin gle-chip, while sin gle-chip P1.3 and P1.4 received in put IC3A, i nterrupted 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: receive1: push pswpush accclr ex1; related external interrupt 1jnb p1.1, right; P1.1 pin to 0, ra nging from right to in terrupt service routine circuitjnb p1.2, left; P1.2 pin to 0, to the left ranging circuit in terrupt service rout inereturn: SETB EX1; ope n exter nal in terrupt 1pop accpop pswretiright:; right location entrance circuit interrupt service routineAjmpRetur nleft:; left Ranging entrance circuit in terrupt service rout ineAjmpRetur n3.3 The calculation of ultrasonic propagation timeWhen you start firing at the same time start the single-chip circuitry within the timerT0, the use of timer counting function records the time and the launch of ultrasonic reflected wave received time. When you receive the ultras onic reflected wave, the receiver circuit outputs a n egative jump in the end of INTO or INT1 in terrupt request gen erates a signal, single-chip microcomputer in response to external interrupt request, the implementation of the external interrupt service subroutine, read the time differenee, calculating the distance . Some of its source code is as follows:RECEIVEO: PUSH PSWPUSH ACCCLR EXO; related external in terrupt 0MOV R7, THO; read the time valueMOV R6, TLOCLR CMOV A, R6SUBB A, # 0BBH; calculate the time differeneeMOV 31H, A; storage resultsMOV A, R7SUBB A, # 3CHMOV 30H, ASETB EXO; ope n exter nal in terrupt 0POP ACCPOP PSWRETIFor a flat target, a distanee measurement consists of two phases: a coarse measureme nt and. a fine measureme nt: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: Detect ion of the amplitudes and zero-cross ing 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 trai ns to produce an in terfered wave. Testi ng the zero-cross ing 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 ml and t sub m2 .Step 6: Calculati on of the dista nee y using equati on .4. The ultras onic ranging system software desig nSoftware is divided into two parts, the main program and interrupt service routine. Completio n of the work of the mai n program is in itialized, each seque nceof ultras on ic tran smitti ng and recei ving con trol.In terrupt service routi nes from time to time to complete three of the rotati on direct ion of ultras on ic laun ch, the main external in terrupt service subrout ine to read the value of completion time, distance calculation, the results of the output and so on.5. Con clusi onsRequired measuri ng range of 30cm 200cm objects in side the pla ne to do a nu mber of measurementsfound that the maximum error is 0.5cm, and good reproducibility.Sin gle-chip desig n can be see n on the ultras onic 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 detecti on systems.Thoughts: As for why the receiver do not have the tran sistor amplifier circuit, because the magnification well, integrated amplifier, but also with automatic gain control level, magn ificati on to 76dB, the cen ter freque ncy is 38k to 40k, is exactly res onant ultras onic sen sors freque ncyREFERENCES1. Fox, J.D., Khuri-Yakub, B.T. and Kino, G.S., High Frequency Acoustic Wave Measurement in Air, in Proceedings of IEEE 1983 Ultrasonic Symposium, October 31-2 November, 1983, Atlanta, GA, pp. 581-4.2. Martin Abreu, J.M., Ceres, R. and Freire, T., Ultrasonic Ranging: Envelope Analysis Gives Improved Accuracy, Sensor Review, Vol. 12 No. 1, 1992, pp. 17-21.3. Parrilla, M., Anaya, J.J. and Fritsch, C., Digital Signal Processing Techniques for High Accuracy Ultrasonic Range Measurements, IEEE Transactions: Instrumentation and Measurement, Vol. 40 No. 4, August 1991, pp. 759-63.4. Canali, C., Cicco, G.D., Mortem, B., Prudenziati, M., and Taron, A., A Temperature Compensated Ultrasonic Sensor Operating in Air for Distance and Proximity Measurement, IEEE Transaction on Industry Electronics, Vol. IE-29 No. 4, 1982, pp. 336-41.5. Martin, J.M., Ceres, R., Calderon, L and Freire, T., Ultrasonic Ranging Gets Thermal Correction, Sensor Review, Vol. 9 No. 3, 1989, pp. 153-5.
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 活动策划


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!