【正文】
................. 28 致 謝 .................................................. 29 附錄一:系統(tǒng)電路圖 ..................................... 30 附錄二:源程序代碼 ..................................... 31 外文資料 ................................................ 42 外文資料譯文 ........................................... 48 河南科技大學本科畢業(yè)設計(論文) 1 前 言 溫度控制是工業(yè)生產過程中經常遇到的過程控制,有些工藝過程對其溫度的控制效果直接影響著產品的質量,因而設計一種較為理想的溫度控制系統(tǒng)是非常有價值的。 溫度傳感器 DS18B20 模塊軟件設計 .......................................................... 21 167。 主程序流程圖及程序設計 ........................................................................... 20 167。 PID 數(shù)學模型 .......................................................................................... 17 167。 PID 控制原理及特點 ..................................................................................... 16 167。 驅動控制電路 ......................................................................................... 15 第 3 章 控制理論 ........................................ 16 167。 串行口顯示電路 .................................................................................... 12 167。 單片機最小單元設計 .............................................................................. 6 167。 數(shù)字顯示部分 ........................................................................................... 5 167。 硬件單元方案設計與選擇 ............................................................................. 4 167。 系統(tǒng)方案總圖 .................................................................................................. 2 167。 關鍵詞 : 單片機 , 數(shù)字溫度傳感器 , PID 控制 , PWM 控制 河南科技大學本科畢業(yè)設計(論文) II Based Design of Intelligent Temperature Control System ABSTRACT The past two decades, with scientific and technological development and raising the level of industrial production, in the ordinary home water heaters, rice cookers, electric oven and so depends on the temperature control technology, more and more consumer electronics devices, metallurgy, petroleum, chemical industry , electricity and modern agriculture industry, the temperature is extremely important and one of the general thermal parameters, it can be said temperature control technology is everywhere. As the temperature accuracy of a variety of industries have bee increasingly demanding, on the temperature stability of the system requirements more stringent. Optical remote sensing systems as some systems, some of the sophisticated electronic equipment to work properly, the temperature must be constant. In recent years a variety of advanced temperature control method developed rapidly, such as: PID control, fuzzy control, neural work and geic algorithm control. The temperature control system 89C51 microcontroller core, with a digital temperature sensor DS18B20 to measure temperature, and location of sampling data sent to the MCU type PID operation. PID operation result is MCU I/O port output duty cycle of PWM wave, also determines the heating ponents of the output power. In the control process, as set temperature and the measured difference in the everchanging, PID operation results (PWM wave of duty cycle) is also a corresponding change in output power makes the heating ponents changes with the difference timely adjustments in order to make temperature control more quickly and accurately. KEY WORDS: MCU, Digital Temperature Sensor, PWM control, PID control 河南科技大學本科畢業(yè)設計(論文) III 目 錄 前 言 ................................................... 1 第 1 章 總體方案設計 ..................................... 2 167。 PID 運算的結果就是單片機 I/O 口輸出的 PWM 波的占空比,也就決定了加熱元器件的輸出功率。 近幾年來多種先進的溫度控制方式 迅速發(fā)展起來 ,如: PID 控制,模糊控制,神經網絡及遺傳算法控制等。隨著各種行業(yè)對溫度精度的要求越來越高,對溫控系統(tǒng)穩(wěn)定性要求也越來越嚴格。河南科技大學本科畢業(yè)設計(論文) I 基于單片機的智能溫控設計 摘 要 近二十年來,隨著科學技術的發(fā)展和工業(yè)生產水平的提高,在普通家庭里熱水器、電飯煲、電烤箱等依賴于溫控技術的家電設備越來越多。在冶金、石油、化工、電力和現(xiàn)代農業(yè)等行業(yè)中,溫度是極為重要而又普遍的熱工參數(shù)之一,可以說溫度控制技術無處不在。如某些遙感系統(tǒng)的光學系統(tǒng),某些精密的電子器械,要正常工作,溫度必須恒定。 本溫度控制系統(tǒng)以 89C51 單片機為核心,用 數(shù)字溫度傳感器 DS18B20 來測量溫度,并將采樣數(shù)據(jù)送至單片機進行位置式 PID 運算。在控制過程中,由于設定的溫度值和測量值的差在不斷變化, PID 運算的結果( PWM 波的占空比)也相應的改變,使得加熱元器件的輸出功率隨著差值的變化適時調整,從而使溫度控制更加快速、精確。 系統(tǒng)總體目標 .................................................................................................. 2 167。 實驗方案 ........................................................................................................... 3 第 2 章 系統(tǒng)硬件設計方案 ................................. 4 167。 溫度傳感器選擇 ...................................................................................... 4 167。 單元電路設計 .................................................................................................. 6 167。 溫度傳感器電路 ...................................................................................... 9 167。 按鍵控制電路 ......................................................................................... 14 167。 自動控制概述 ................................................................................................ 16 167。 PID 控制算法 .................................................................................................. 17 167。 位置式 PID控制規(guī)律的離散化 .......................................................... 19 第 4 章 系統(tǒng)軟件設計 .................................... 20 167。 按鍵控制流程圖 ............................................................................................ 21 167。 PID 控制程序設計 ......................................................................................... 23 167。 隨著新技術的不斷開發(fā)與應用,單片機的應用已經滲透到電力、 冶金、化工、建材、機械、食品、石油 等各個行業(yè)。 傳統(tǒng)的控制方式 已 不能滿足高精度,高速度的控制要求 。 近幾年來快速發(fā)展了多種 先進的溫度控制方式,如: PID 控制,模糊控制,神經網絡及遺傳算法控制等。 本溫度控制系統(tǒng)為以 89C51 單片機為核心,使用 DS18B20 傳感器實現(xiàn)了對溫度實時監(jiān)測并將采集到的數(shù)據(jù)傳送給單片機,實現(xiàn)了控制的智能化。 輸出 部分采用 PWM 控制 固態(tài)繼電器 的通斷 以實行對溫度的控制 ;顯示部分用 LED 顯示出測量值和設定值,使管理更直觀。 系統(tǒng)總體目標 本課題將設計一個集測量、顯示、控制于一體的溫度控制系統(tǒng)。 167??傮w方案經過反復推敲,確定了以美國 Atmel 公司推出的 51系列單片機為溫度智能控制系統(tǒng)的核心,并選擇集成數(shù)字傳感器、固態(tài)繼電器控制電路、數(shù)碼顯示器等元件,總體方案如圖 11。使用數(shù)字溫度傳感器對控制現(xiàn)場進行溫度采集,傳感器 將采集到的數(shù)據(jù)信號傳送給單片機, 單片機對數(shù)據(jù)進行顯示,同時調用位置式 PID 算法,在控制周期一定時, PID 的結 果決定加熱電路的通斷時間。 實驗方案 用按鍵調整設定 溫度值,用 LED 實時顯示實際和設