版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、超聲波測(cè)距儀系統(tǒng)設(shè)計(jì)摘要:超聲測(cè)距技術(shù)在工業(yè)現(xiàn)場(chǎng)、車輛導(dǎo)航、水聲工程等領(lǐng)域都具有廣泛的應(yīng)用價(jià)值,目前已應(yīng)用于物位測(cè)量、機(jī)器人自動(dòng)導(dǎo)航以及空氣中與水下的目標(biāo)探測(cè)、識(shí)別、定位等場(chǎng)合。因此,深入研究超聲的測(cè)距理論和方法具有重要的實(shí)踐意義。為了進(jìn)一步提高測(cè)距的精確度,滿足工程人員對(duì)測(cè)量精度、測(cè)距量程和測(cè)距儀使用的要求,本文研制了一套基于單片機(jī)的便攜式超聲測(cè)距系統(tǒng)。關(guān)鍵詞:超聲波,測(cè)距儀,單片機(jī) 1.前言隨著科技的發(fā)展,人們生活水平的提高,城市發(fā)展建設(shè)加快,城市給排水系統(tǒng)也有較大發(fā)展,其狀況不斷改善。但是,由于歷史原因合成時(shí)間住的許多不可預(yù)見因素,城市給排水系統(tǒng),特別是排水系統(tǒng)往往落后于城市建設(shè)。因此,
2、經(jīng)常出現(xiàn)開挖已經(jīng)建設(shè)好的建筑設(shè)施來改造排水系統(tǒng)的現(xiàn)象。城市污水給人們帶來了困擾,因此箱涵的排污疏通對(duì)大城市給排水系統(tǒng)污水處理,人們生活舒適顯得非常重要。而設(shè)計(jì)研制箱涵排水疏通移動(dòng)機(jī)器人的自動(dòng)控制系統(tǒng),保證機(jī)器人在箱涵中自由排污疏通,是箱涵排污疏通機(jī)器人的設(shè)計(jì)研制的核心部分??刂葡到y(tǒng)核心部分就是超聲波測(cè)距儀的研制。因此,設(shè)計(jì)好的超聲波測(cè)距儀就顯得非常重要了。2.超聲波測(cè)距原理 2.1壓電式超聲波發(fā)生器原理壓電式超聲波發(fā)生器實(shí)際上是利用壓電晶體的諧振來工作的。超聲波發(fā)生器內(nèi)部結(jié)構(gòu),它有兩個(gè)壓電晶片和一個(gè)共振板。當(dāng)它的兩極外加脈沖信號(hào),其頻率等于壓電晶片的固有振蕩頻率時(shí),壓電晶片將會(huì)發(fā)生共振,并帶動(dòng)
3、共振板振動(dòng),便產(chǎn)生超聲波。反之,如果兩電極間未外加電壓,當(dāng)共振板接收到超聲波 時(shí),將壓迫壓電晶片作振動(dòng),將機(jī)械能轉(zhuǎn)換為電信號(hào),這時(shí)它就成為超聲波接收器了。測(cè)量脈沖到達(dá)時(shí)間的傳統(tǒng)方法是以擁有固定參數(shù)的接收信號(hào)開端為基礎(chǔ)的。這個(gè)界限恰恰選于噪音水平之上,然而脈沖到達(dá)時(shí)間被定義為脈沖信號(hào)剛好超過界限的第一時(shí)刻。一個(gè)物體的脈沖強(qiáng)度很大程度上取決于這個(gè)物體的自然屬性尺寸還有它與傳感器的距離。進(jìn)一步說,從脈沖起始點(diǎn)到剛好超過界限之間的時(shí)間段隨著脈沖的強(qiáng)度而改變。結(jié)果,一種錯(cuò)誤便出現(xiàn)了兩個(gè)擁有不同強(qiáng)度的脈沖在不同時(shí)間超過界限卻在同一時(shí)間到達(dá)。強(qiáng)度較強(qiáng)的脈沖會(huì)比強(qiáng)度較弱的脈沖超過界限的時(shí)間早點(diǎn),因此我們會(huì)認(rèn)為
4、強(qiáng)度較強(qiáng)的脈沖屬于較近的物體。2.2超聲波測(cè)距原理超聲波發(fā)射器向某一方向發(fā)射超聲波,在發(fā)射時(shí)刻的同時(shí)開始計(jì)時(shí),超聲波在空氣中傳播,途中碰到障礙物就立即返回來,超聲波接收器收到反射波就立即停止計(jì)時(shí)。超聲波在空氣中的傳播速度為340m/s,根據(jù)計(jì)時(shí)器記錄的時(shí)間t,就可以計(jì)算出發(fā)射點(diǎn)距障礙物的距離(s),即:s=340t/23.超聲波測(cè)距系統(tǒng)的電路設(shè)計(jì)系統(tǒng)的特點(diǎn)是利用單片機(jī)控制超聲波的發(fā)射和對(duì)超聲波自發(fā)射至接收往返時(shí)間的計(jì)時(shí),單片機(jī)選用C51,經(jīng)濟(jì)易用,且片內(nèi)有4K的ROM,便于編程。電路原理圖如圖1所示。3.1 40kHz 脈沖的產(chǎn)生與超聲波發(fā)射測(cè)距系統(tǒng)中的超聲波傳感器采用UCM40的壓電陶瓷傳感
5、器,它的工作電壓是40kHz的脈沖信號(hào),這由單片機(jī)執(zhí)行下面程序來產(chǎn)生。puzel: mov 14h, #12h;超聲波發(fā)射持續(xù)200mshere: cpl p1.0 ; 輸出40kHz方波 nop ; nop ; nop ; djnz 14h,here; ret前方測(cè)距電路的輸入端接單片機(jī)P1.0端口,單片機(jī)執(zhí)行上面的程序后,在P1.0 端口輸出一個(gè)40kHz的脈沖信號(hào),經(jīng)過三極管T放大,驅(qū)動(dòng)超聲波發(fā)射頭UCM40T,發(fā)出40kHz的脈沖超聲波,且持續(xù)發(fā)射200ms。右側(cè)和左側(cè)測(cè) 距電路的輸入端分別接P1.1和P1.2端口,工作原理與前方測(cè)距電路相同。3.2超聲波的接收與處理接收頭采用與發(fā)射頭
6、配對(duì)的UCM40R,將超聲波調(diào)制脈沖變?yōu)榻蛔冸妷盒盘?hào),經(jīng)運(yùn)算放大器IC1A和IC1B兩極放大后加至IC2。IC2是帶有鎖 定環(huán)的音頻譯碼集成塊LM567,內(nèi)部的壓控振蕩器的中心頻率f0=1/1.1R8C3,電容C4決定其鎖定帶寬。調(diào)節(jié)R8在發(fā)射的載頻上,則LM567 輸入信號(hào)大于25mV,輸出端8腳由高電平躍變?yōu)榈碗娖?,作為中斷?qǐng)求信號(hào),送至單片機(jī)處理.前方測(cè)距電路的輸出端接單片機(jī)INT0端口,中斷優(yōu)先級(jí)最高,左、右測(cè)距電路的輸出通過與門IC3A的輸出接單片機(jī)INT1端口,同時(shí)單片機(jī)P1.3和P1.4接到IC3A的輸入端,中斷源的識(shí)別由程序查詢來處理,中斷優(yōu)先級(jí)為先右后左。部分源程序如下:re
7、ceive1:push psw push acc clr ex1; 關(guān)外部中斷1 jnb p1.1,right;P1.1引腳為0,轉(zhuǎn)至右測(cè)距電路中斷服務(wù)程序 jnb p1.2,left;P1.2引腳為0,轉(zhuǎn)至左測(cè)距電路中斷服務(wù)程序return: SETB EX1; 開外部中斷1 pop acc pop psw retiright: . ; 右測(cè)距電路中斷服務(wù)程序入口 ajmp returnleft: . ; 左測(cè)距電路中斷服務(wù)程序入口 ajmp return3.3計(jì)算超聲波傳播時(shí)間在啟動(dòng)發(fā)射電路的同時(shí)啟動(dòng)單片機(jī)內(nèi)部的定時(shí)器T0,利用定時(shí)器的計(jì)數(shù)功能記錄超聲波發(fā)射的時(shí)間和收到反射波的時(shí)間。當(dāng)收到
8、超聲波反射波時(shí),接收電路 輸出端產(chǎn)生一個(gè)負(fù)跳變,在INT0或INT1端產(chǎn)生一個(gè)中斷請(qǐng)求信號(hào),單片機(jī)響應(yīng)外部中斷請(qǐng)求,執(zhí)行外部中斷服務(wù)子程序,讀取時(shí)間差,計(jì)算距離。其部分源程序如下:RECEIVE0: PUSH PSW PUSH ACC CLR EX0 ; 關(guān)外部中斷0 MOV R7, TH0 ; 讀取時(shí)間值 MOV R6, TL0 CLR C MOV A, R6 SUBB A, #0BBH; 計(jì)算時(shí)間差 MOV 31H, A ; 存儲(chǔ)結(jié)果 MOV A, R7 SUBB A, #3CH MOV 30H, A SETB EX0 ; 開外部中斷0 POP ACC POP PSW RETI對(duì)于一個(gè)平坦
9、的目標(biāo),距離測(cè)量包括兩個(gè)階段:粗糙的測(cè)量和精細(xì)測(cè)量。第一步:脈沖的傳送產(chǎn)生一種簡(jiǎn)單的超聲波。第二步:根據(jù)公式改變回波放大器的獲得量直到回?fù)鼙粰z測(cè)到。第三步:檢測(cè)兩種回波的振幅與過零時(shí)間。第四步:設(shè)置回波放大器的所得來規(guī)格輸出,假定是3伏。通過脈沖的周期設(shè)置下一個(gè)脈沖。根據(jù)第二部的數(shù)據(jù)設(shè)定時(shí)間窗。第五步:發(fā)射兩串脈沖產(chǎn)生干擾波。測(cè)量過零時(shí)間與回波的振幅。如果逆向發(fā)生在回波中,決定要不通過在低氣壓插入振幅。第六步:通過公式計(jì)算距離y。4.超聲波測(cè)距系統(tǒng)的軟件設(shè)計(jì)軟件分為兩部分,主程序和中斷服務(wù)程序。主程序完成初始化工作、各路超聲波發(fā)射和接收順序的控制。定時(shí)中斷服務(wù)子程序完成三方向超聲波的輪流發(fā)射,
10、外部中斷服務(wù)子程序主要完成時(shí)間值的讀取、距離計(jì)算、結(jié)果的輸出等工作。5.結(jié)論對(duì)所要求測(cè)量范圍30cm200cm內(nèi)的平面物體做了多次測(cè)量發(fā)現(xiàn),其最大誤差為0.5cm,且重復(fù)性好??梢娀趩纹瑱C(jī)設(shè)計(jì)的超聲波測(cè)距系統(tǒng)具有硬件結(jié)構(gòu)簡(jiǎn)單、工作可靠、測(cè)量誤差小等特點(diǎn)。因此,它不僅可用于移動(dòng)機(jī)器人,還可用在其它檢測(cè)系統(tǒng)中。思考:至于為什么接收不用晶體管做放大電路呢,因?yàn)榉糯蟊稊?shù)搞不好,集成放大電路,還帶自動(dòng)電平增益控制,放大倍數(shù)為76dB,中心頻率是38k到40k,剛好是超聲波傳感器的諧振頻率 。Ultrasonic ranging system designAbstract:Ultrasonic rang
11、ing technology has wide using worth in many fields,such as the industrial locale,vehicle navigation and sonar engineeringNow it has been used in level measurement,self-guided autonomous vehicles, fieldwork robots automotive navigation,air and underwater target detection,identification,location and s
12、o onSo 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
13、 on the single chip processor was developedKeywords:Ultrasound r,Ranging System,Single Chip Processor1.IntroductiveWith the development of science and technology, the improvement of people's standard of living, speeding up the development and construction of the city. urban drainage system have
14、greatly developed their situation is constantly 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
15、 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 au
16、tomatic control system Free sewage culvert clear guarantee robot, 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
17、 of ultrasonic distance measurement 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
18、39;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, if the two are not inter-electrode voltage, when the
19、 board received ultrasonic resonance, 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 rece
20、ived 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, si
21、ze 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 sam
22、e 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 principle of ultrasonic distance measurement Ultrasonic transmitter in a direction to launch ultrasound, in the
23、 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 th
24、e 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
25、 since the launch from time to time, single-chip selection of 8751, economic-to-use, and the chip has 4K of ROM, to facilitate programming. Circuit schematic diagram shown in Figure 2. Figure 1 circuit principle diagram3.1 40 kHz ultrasonic pulse generated with the launch Ranging system using the ul
26、trasonic 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
27、; 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
28、, 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,
29、 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 band
30、width. R8-conditioning 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 low-level, as interrupt request signals to the single-chip processing. Ranging in front of single-chip termination circuit output port INT0 interr
31、upt 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 righ
32、t after. Part of the source code is as follows: receive1: 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
33、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 s
34、tart 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 outputs a negative jump in the end of INT0 or INT1 interrupt request
35、 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
36、 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 ph
37、ases: 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 echo
38、es.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
39、 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 so
40、ftware 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
41、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 on
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024-2025學(xué)年人教版九年級(jí)英語復(fù)習(xí) 專題05 閱讀理解之說明文 【期末必刷15篇】
- 八年級(jí)語文第三次月考卷(考試版A3)【測(cè)試范圍:八上第1~5單元】(湖南長沙專用)-A4
- 三年級(jí)下冊(cè)英語一課一練-Module 7 unit2 it's warm today∣外研社(三起)(含解析)-1小學(xué)英語教學(xué)教材課件
- 2023年高頻電控氣閥項(xiàng)目融資計(jì)劃書
- 烹飪?cè)现R(shí)題庫(附參考答案)
- 養(yǎng)老院老人生活照顧細(xì)節(jié)制度
- 養(yǎng)老院老人健康巡查制度
- 汽車行業(yè)質(zhì)量管理體系內(nèi)審員模擬試題及答案
- 新造集裝箱檢驗(yàn)合同范本
- 承包道路填石粉工程協(xié)議書
- 三維超聲輸卵管造影的應(yīng)用課件
- 高壓旋噴樁檢測(cè)方案
- Unit1 My classroom Part A Lets spell(說課稿)-2022-2023學(xué)年英語四年級(jí)上冊(cè)
- 查看下載鄭州電視臺(tái)商都頻道簡(jiǎn)介
- 2023年國開大學(xué)期末考復(fù)習(xí)題-10861《理工英語4》
- 公安廉政心談話六篇
- 【要點(diǎn)解讀】《實(shí)踐是檢驗(yàn)真理的唯一標(biāo)準(zhǔn)》論證邏輯圖
- 數(shù)字電子技術(shù)(山東工商學(xué)院)知到章節(jié)答案智慧樹2023年
- 商務(wù)禮儀(山東聯(lián)盟)知到章節(jié)答案智慧樹2023年山東財(cái)經(jīng)大學(xué)
- 人教部編版語文九年級(jí)上冊(cè)第一單元分層作業(yè)設(shè)計(jì)
- 《怪奇事物所》讀書筆記思維導(dǎo)圖PPT模板下載
評(píng)論
0/150
提交評(píng)論