【正文】
。對于中斷操作利用單步運行調試無法完成調試工作,必須采取連續(xù)運行方法來調試。為了準確的對錯誤進行定位,可使用連續(xù)加斷點運行方式來調試這類程序,即利用斷點來逐漸縮小故障范圍,直至最終確定出錯誤位置并加以排除[21]。通過對軟硬件的調試,系統(tǒng)達到了預期效果,現(xiàn)給出各模塊調試結果。 從站1溫度采集從站1通過DS18B20將溫度采集并由1602液晶顯示出來,當從站1收到主站對其發(fā)送的輪詢信號時,從站1就會將DS18B20采集到的溫度發(fā)送到CAN網絡上去。如圖 61所示。 從站4液位測量從站4采集液位信息,其中液位傳感器用一組超聲波傳感器,將采集的液位信息傳遞到CAN網絡上去。如圖62所示。 CAN通信測試CAN網絡建立以后,通過示波器就能監(jiān)測到在CAN總線上的一幀幀數(shù)據(jù)信息。如圖63所示。 顯示模塊調試主站收到從站返回的數(shù)據(jù)信息通過12864進行顯示。圖64為主站系統(tǒng)開機顯示畫面。如圖64所示。 CAN通信網絡聯(lián)機調試通過以上分步調試,系統(tǒng)各部分運行正常,系統(tǒng)聯(lián)調也達到了預期效果。圖65為系統(tǒng)整體聯(lián)調實物圖。圖61 1號從站溫度采集圖62 4號從站液位測量圖63 CAN通信數(shù)據(jù)波形 圖64 顯示模塊效果圖圖65 系統(tǒng)整體運行效果第七章 結論與展望隨著汽車上電子控制裝置越來越多,車身布線也愈來愈復雜,使得運行可靠性降低,故障維修難度加大。為了提高信號的利用率,要求大批量數(shù)據(jù)信息能在不同的電控單元中共享,同時汽車綜合控制系統(tǒng)中大量的控制信號也能實時進行交換,傳統(tǒng)布線已不能滿足這種要求。針對這個問題,本文將CAN總線技術引入到車身控制系統(tǒng)。本文完成了以下主要工作:① 總結CAN總線技術在汽車控制系統(tǒng)中的特點和優(yōu)勢,分析了CAN總線系統(tǒng)的結構原理和通信方式以及CAN總線的通信協(xié)議。闡述了總線控制器SJA1000和收發(fā)器PCA82C250的結構、特點及工作原理。并對它們在CAN總線控制系統(tǒng)中的應用進行了敘述,對本設計中控制器和收發(fā)器的合理選擇進行了分析。② 根據(jù)汽車電器的位置和功能,完成對汽車電器網絡的設計,將汽車電器網絡合理分塊,并針對每個模塊進行了功能描述。并給出總線節(jié)點電路的設計以及電源電路的設計,針對一些干擾,采取了相應措施。同時設計總線接口每一部分的電路,并進行仔細分析。③ 闡述了程序設計的思路和方法,并采用模塊化的編程思想對車身CAN控制系統(tǒng)主要程序進行了設計。從而簡化系統(tǒng)軟件開發(fā)過程。文中針對CAN底層通訊程序進行了較詳細的設計,從而保證系統(tǒng)各單元間的正常通訊。并以左前車門模塊為例,闡述了控制軟件設計流程。為保證軟件運行的可靠性,文中針對軟件的干擾因素進行了分析并提出了相應的抗干擾措施。④ 糾正了最初原理圖和電路板上的錯誤,通過對系統(tǒng)軟、硬件的調試,最終實現(xiàn)了CAN總線網絡的通信。⑤ (SAEJ1939),制定了自己的應用層協(xié)議;系統(tǒng)經過測試后,在性能方面具實時性高、可靠性好、抗干擾行強等優(yōu)點;但是也存在著數(shù)據(jù)傳輸效率低的缺點。在成本方面,本系統(tǒng)采用了獨立CAN控制器SJA1000+CAN驅動器PCA82C250與微控制器連接,與選用帶CAN接口的微處理器相比,具有成本低、擴展靈活等優(yōu)點。CAN總線技術在以后的車身控制中有良好的應用前景。由于本文所研究的CAN總線技術尚處于初步研究階段,要應用到工程實踐,還有大量的后續(xù)工作。主要包括以下幾個方面:① 構建一個技術平臺,對汽車CAN總線網絡進行調試。② 對系統(tǒng)進行全面的穩(wěn)定性分析并提出解決方法。③ 與實際工業(yè)生產相結合,滿足成本和性能要求。參考文獻[1] [M].北京:北京航空航天大學出版社, 2003[2] User39。s Manual. Revision , 2000[3]MOTOROLA Bosch Controller AreaNetwork Protocol Standard[S], 1996[4], . Performance Enhanced Can Like Network[J]. IEEE Transactions on Industrial Electronics, 2000,47(4):951963[5], . Perez, . A Can busbased safetycritical distributed areoengine control systems architecture demonstrateor [J]. Microprocessors and Microsystems, 1999, 23(9): 345355[6], . The feasibility study of SRU/LRU for air vehicle munication network based on CAN bus[J]. Journal of Aeronautics, Astronautics and Aviation, 2010,42(1): 5766[7], . Development of a novel sensor less longitudinal road gradient estimation method based on vehicle CAN bus data[J]. IEEE/ASME Transactions on Mechatronics, 2007,12(3):375386[8][M].北京:北京理工大學出版社, 2003[9] CAN 總線研究與應用. [J].自動化技術與應用,(4):3335[10]鐘勇, 鐘志華等. 電動汽車CAN總線通用協(xié)議的應用研究[J]. 汽車工程, 2006, 28(5): 422426[11]任哲,尹智勇,張圍. 汽車CAN總線控制器設計[J]. 微計算機信息, 2007,23(8): 262264[12]王智磊, 李彥. 混合動力電動汽車CAN總線開發(fā)實踐[J].電子技術應用, 2006,1:9294[13]曹曉琳, 王登峰等. 汽車CAN總線數(shù)字組合儀表設計[J]. 汽車工程, 2010, 32(1):8689[14] 總線原理和應用系統(tǒng)設計[M].北京:北京航空航天大學出版社,1996[15]黃歡, 吳建平等. 基于CAN總線的核醫(yī)療設備測控系統(tǒng)設計[J]. 核電子學與探測技術, 2009, 29(2):336339.[16]張兵, [J].系統(tǒng)仿真學報2009, 21(6):15871590[17]劉應吉, 張?zhí)靷b, 聞邦椿. 基于CAN總線和PSA模型的AMT在線故障診斷系統(tǒng)[J]. 東北大學學報(自然科學版), 2008,29(2):255257[18]Philips Semiconductors. SJA1000 Standalone CAN controller. 2000[19]Philips Semiconductors. PCA82C250 CAN controller [20]國兵,[M].天津:天津大學出版社, 2008[21][M].北京:中國水利水電出版社, 2007.[22][J].化工自動化儀表, 2003,30(4):16[23][D]. 武漢科技大學,2009[24][D].南京理工大學, 2008附錄1 文獻翻譯A Design of Elevator Positioning Control System ModelZhang Yajun, Chen Long, Fan LingyanSchool of Electronics amp。 Information,Hangzhou Dianzi UniversityHangzhou, Zhejiang, 310018The People’s Republic of Chinazyj16888@ABSTRCTThis paper presents a design of elevator positioning control system model based on the ATmega128 microcontroller. The model mainly includes MCU control module, stepper motor drive module, infrared detection module, LCD display module and keys module. The elevator’s running path is set by keys。 the elevator’s running location is detected by the infrared binate tubes. Stepper motor is the executive ponent. MCU controls the speed and direction of the stepper motor by inputting pulse signals to its drive chip L298. LCD displays the realtime information of elevator’s running status. Key Words: ATmega128 microcontroller, stepper motor, drive chip L298, infrared detection circuit.1. INTRODUCTIONA fourfloor elevator system module is designed in this paper. The object of elevator system module is shown in figure 1. The size of the model and the distance between the layers are shown in the figure. The system model provides an intuitional and thorough description for the construction and action principle of elevator, and gives a platform for the further research of the new elevator control technologies. It has a certain reference in relevant professional experiments teaching. It can be chosen as a teaching model for university teachers when they instruct stepper motor’s drive and control. In addition, the model has a certain value for research and development of highrise elevator control software.2. SYSTEM STRUCTURE AND WORKING PRINCIPLEThe basic structure diagram of the elevator positioning control system model is shown in Figure 2. The model includes MCU control module, stepper motor drive module, infrared detection module, LCD module and keys module. The elevator’s running path is set up by keys。 the realtime information of the elevator’s location is detected by infrared detection circuits and is fed back to the MCU. The speed and direction of the stepper motor are controlled by MCU inputting timing pulse signals to its drive chip L298(internal circuits are Hbridge drive circuits).The elevator stops when the information input by the key and the feedback signals of the infrared detection circuits are the same and the elevator’s realtime running status is displayed by the LCD1602.3. SYSTEM HARDWARE DESIGN Stepper motor drive module designStepper motor drive circuit is shown in Figure 3. L298 integrated chip’s input ports connect with the system MCU I/O ports and its output ports connect with the signal input ports of twophase four wires stepper motor. MCU