【正文】
1 摘要 在檢測 機(jī)械零件外形尺寸的細(xì)微偏差時,傳統(tǒng)方法有著測量功能單一、測量誤差較大、無法對測量數(shù)據(jù)直接進(jìn)行計算機(jī)處理和智能化等缺陷。然而這些參數(shù)對產(chǎn)品的使用性能有著重要的影響。為實現(xiàn)這些參數(shù)的高效、高精度的測量,針對目前的測量方式存在的這些問題,本課題結(jié)合傳感器、檢測、通訊和微型計算機(jī)等技術(shù),采用模塊化、通用化和標(biāo)準(zhǔn)化的設(shè)計思想,研究開發(fā)了 三色電子柱量儀。 本設(shè)計 首先選定了自感式差動傳感器并為其設(shè)計了信號采集處理的電路,再確定以高性能單片機(jī) ADμC812 為核心,以 使電路設(shè)計 得到簡化、提高 穩(wěn)定性 , 然后圍繞該單片 機(jī)設(shè)計了 可隨總線速度無限擦寫的存取器 FM24C25 容錯性能好的 RS485 串行 通訊接口、 鍵盤和 12232F 點陣式液晶顯示器等一系列模塊,接著 采用 FPGA 器件實現(xiàn) LED 三色光柱顯示驅(qū)動,最后對量儀系統(tǒng)軟件 進(jìn)行了設(shè)計。 關(guān)鍵詞 ADμC812; 菜單 結(jié)構(gòu) ; LED 光柱 顯示 ; FPGA; RS485 串口通訊 2 Abstract When measuring subtle differences of the outer sizes of machine parts, the traditional methods have such defects as being singular in measuring function, existing too many errors and having no way to puterize measured data directly. However, these parameters have great influence on products’ attributes. In order to measure these parameters efficiently and accurately, the system used the technology of sensor, automatic acquisition, munication and puter and adopted the design philosophy of modularization, generalization and standardization. We developed this therecolor LED bargraph display measuring instrument which can measure the dimension and runout tolerances of mechanical parts. The system of hardware using the fully integrated 12bit data acquisition system (ADμC812) and FPGA as the LED bar drive circuit to simplify the hardware design and enhance the stability of the hardware. The system of software offers the framework of the function extensibility and the instrument upgrading with the menu operation. At last, we design the serial munication protocol which is high efficiency of data transfer and high performance of fault tolerant to connect with personal puter through the bus of RS485. Also we develop the software of PC to manager the instrument and collect realtime measuring data with work and realize the user interface. The date of measure and configuration is stored in the ACCESS database convenient for managing, analyzing, displaying and printing the data. Key words: ADμc812。 Menu structure。 LED bargraph display。 FPGA。 RS485 Serial munication protocol 3 目 錄 摘要 ............................................................................................................................. 1 ABSTRACT ............................................................................................................... 2 第 1 章 緒論 ............................................................................................................... 5 課題背景及來源 .............................................................................................. 5 國內(nèi)外發(fā)展現(xiàn)狀 .............................................................................................. 5 課題研究內(nèi)容 .................................................................................................. 7 設(shè)計目的 ................................................................................................... 7 設(shè)計目標(biāo) ................................................................................................... 7 設(shè)計內(nèi)容 ................................................................................................... 8 第 2 章 傳感器測量原理 ........................................................................................... 9 傳感器的定義及構(gòu)成 ...................................................................................... 9 電感傳感器 .................................................................................................... 10 電感式傳感器的特點 ............................................................................. 10 電感式傳感器的分類 ............................................................................. 10 本設(shè)計中傳感器的工作原理 .........................................................................11 第 3 章 系統(tǒng)硬件設(shè)計 ............................................................................................. 15 硬件設(shè)計原則 ................................................................................................ 15 硬件框架的設(shè)計 ............................................................................................ 15 硬件各模塊的設(shè)計 ........................................................................................ 16 傳感器信號調(diào)理模塊 ............................................................................. 16 數(shù)據(jù)采集模塊 ......................................................................................... 20 數(shù)據(jù)處理模塊 ......................................................................................... 23 人機(jī)對話模塊 ......................................................................................... 26 4 存儲模塊 ................................................................................................. 29 外部通訊模塊 ......................................................................................... 32 光柱顯示及其驅(qū)動模塊 ......................................................................... 33 單片機(jī)下載調(diào)試模塊 ............................................................................. 36 電源模塊 ................................................................................................. 38 單片機(jī)下載調(diào)試模塊 ........................................................................... 39 第 4 章 軟件系統(tǒng)設(shè)計 ............................................................................................. 41 軟件設(shè)計原則 ................................................................................................ 41 單片機(jī)系統(tǒng)軟件的設(shè)計 ................................................................................ 42 軟件各模塊的設(shè)計 ........................................................................................ 43 A/D 采樣模塊 .......................................................................................... 43 人機(jī)對話模塊 ......................................................................................... 44 光柱控制模塊 ........................................................