【正文】
機 看門狗 驅(qū)動技術(shù)ABSTRACTStepping motor is a kind of controlled by electrical pulse signal phase winding current to achieve fixed angle rotating electromechanical ponents, pared with other types of motor control with easytoopenloop precision, no accumulation of error of the advantages, has been widely used in many fields. In order to obtain good control performance results, there has been a lot of stepping motor control system, which adopts singlechip as the control of the control system has been widely applied. A lot of this control system has been in the drive of step motor is very good, such as subdivision driving technology, but some of the system is more plex, and some relatively simple control process do not coincide, investment is not the economy。 因此本文的研究內(nèi)容就是設(shè)計一套硬件系統(tǒng)較簡單、經(jīng)濟,但功能較為齊全,適應(yīng)性強,操作方便,可靠性高的,能夠有機地把電子技術(shù)、單片機技術(shù)、電機的控制技術(shù)結(jié)合起來步進電機控制系統(tǒng)。很多這種控制系統(tǒng)在步進電機的驅(qū)動上已經(jīng)做的非常好,比如細(xì)分驅(qū)動技術(shù),但是有的系統(tǒng)比較復(fù)雜,和一些相對比較簡單的控制過程不相吻合,投入上也不經(jīng)濟?;趩纹瑱C的步進電機控制系統(tǒng)的設(shè)計摘 要 步進電機是一種通過電脈沖信號控制相繞組電流實現(xiàn)定角轉(zhuǎn)動的機電元件,與其他類型電機相比具有易于開環(huán)精確控制、無積累誤差等優(yōu)點,在眾多領(lǐng)域中獲得了廣泛的應(yīng)用。為了得到性能優(yōu)良的控制結(jié)果,出現(xiàn)了很多步進電機控制系統(tǒng),其中采用單片機作為控制核心的控制系統(tǒng)得到了廣泛的應(yīng)用。有的系統(tǒng)在操作上不是很方便,交互性不強。本文首先簡要描述了步進電機的發(fā)展、應(yīng)用情況、以及常見的控制系統(tǒng)采用的方案,常見的驅(qū)動技術(shù),而且還分析了步進電機的工作原理,然后以單片機為主控制器提出了整個系統(tǒng)的硬件設(shè)計方案,在此基礎(chǔ)上對各個模塊的電路進行詳細(xì)的設(shè)計,接著闡述了步進電機軟件控制開發(fā)的流程。 some systems in the operation is not very convenient, do not have a strong interaction.So the research contents of this thesis is to design a set of hardware system is simple, economic, but the function is plete, strong adaptability, convenient operation, high reliability, can organically integrate electronic technology, single chip technology, motor control technology of stepping motor control system. This paper briefly describes the development of the scheme, the stepper motor applications, as well as the mon control system, driving technology is mon, but also analyzed the working principle of stepping motor, and then by the microcontroller. The hardware design scheme of the system, detailed design on the basis of each module the circuit, then expounds the stepping motor control software development process.Keywords: stepper motor microcontroller watchdog driver technology目 錄摘 要 IABSTRAC II第1章 緒論 1 前言 1 基于電子電路控制手段 1 基于PLC/變頻器控制手段 2 基于單片機控制手段 3 國內(nèi)外發(fā)展情況 4 步進電機驅(qū)動方式分類及比較 6 單電壓驅(qū)動 6 高低壓驅(qū)動 7 自激式恒電流斬波驅(qū)動 8 它激式恒電流斬波驅(qū)動 8 細(xì)分驅(qū)動 9 研究的目的和意義 10 論文安排 11第2章 步進電機概述 13 步進電機的特點 13 步進電機的分類 14 反應(yīng)式步進電機 14 永磁式步進電機 14 混合式步進電機 14 步進電機的運行原理闡述 15第3章 步進電機控制系統(tǒng)概述 17 步進電機控制系統(tǒng)簡介 17 本系統(tǒng)特點與功能 20 本系統(tǒng)特點 20 系統(tǒng)功能 21第4章 系統(tǒng)硬件設(shè)計 22 系統(tǒng)組成 22 系統(tǒng)核心——AT89C51單片機 22 主要特性 23 管腳說明 23 振蕩器特性 25 芯片擦除 25 最小系統(tǒng) 26 外圍電路設(shè)計 27 顯示電路—LCD1602 27 鍵盤電路 34 看門狗復(fù)位電路 36 驅(qū)動電路—L298N 38 電源電路 41第5章 系統(tǒng)軟件設(shè)計 43 系統(tǒng)軟件主流程圖 43 系統(tǒng)初始化流程圖 44 步進電機運行模塊主流程圖 45 系統(tǒng)顯示流程圖 46 系統(tǒng)鍵盤流程圖 47 待機狀態(tài)下鍵盤操作流程 47 連續(xù)運行模式狀態(tài)下鍵盤操作流程 49第6章 總結(jié) 52 結(jié)論 52參考文獻 54致謝 56附錄1:部分系統(tǒng)程序清單 57附錄2:系統(tǒng)圖 5943CONTENTSABSTRACT IABSTRACT II Chapter1 introduction 1 preface 1 Electronic circuit control method based on 1 By means of control based on PLC\/ inverter 2 Based on MCU control 3 domestic and foreign development 4 stepper motor drive mode classification and parison of 6 single voltage drive 6 high and low voltage drive 7 selfexcited constant current chopper drive 8 excitation type constant current chopper drive 8 subdivision drive 9 the purpose and significance of the study 10 The paper 11Chapter2 outlines the step motor 13 stepper motor features 13 stepper motor classification 14 reaction stepping motor 14 permanent magnet stepper motor 14 The hybrid stepping motor 14 The step operation of the principle of stepping motor on 15 Chapter 3 stepper motor control system overview 17 stepper motor control system 17 The characteristics and function of the system 20 Characteristics of the system 20 system functions 21Chapter 4 hardware system design 22 system 22 systemAT89C51MCU core 22 The main characteristics of 23 The pin 23 Oscillator characteristics 25 chip erase 25 minimum system 26 The peripheral circuit design 27 display circuit LCD1602 27 keyboard circuit 34 watchdog reset circuit 36 The drive circuit of L298N 38 power supply circuit 41Chapter5 system software design 43 system software flowchart of 43 system initialization process in Figure 44 The step motor running module flowchart 45 system shows the process in Figure 46 standby keyboard operation process 47 continuous operation mode the keyboard operation process 49Chapter6 summarizes 52 conclusions 52Reference 54Thanks 56Appendix 1:system program in listing 57Appendix 2:system diagram 59第1章 緒論 前言 步進電機在工業(yè)自動化裝備、辦公自動化設(shè)備中有著廣泛的應(yīng)用。 步進電機的控制系統(tǒng)多種多樣,但究其控制手段而言,主要可以分為以下幾種: 基于電子電路控制手段 在一些控制應(yīng)用不高的場合,采用簡單數(shù)字定時集成芯片為步進電機提供脈沖控制信號,步進電機受電脈沖信號控制,電脈沖信號的產(chǎn)生、分配、放大全靠電子元器件的動作來實現(xiàn)。步進電機與控制電路、功率放大驅(qū)動電路組成一體,構(gòu)成步進電機驅(qū)動系統(tǒng)。這個系統(tǒng)由三部分組成:脈沖信號產(chǎn)生電路、脈沖信號分配電路、功率放大驅(qū)動電路。開環(huán)時,其平穩(wěn)性好,成本低,設(shè)計簡單,但未能實現(xiàn)高精度細(xì)分。閉環(huán)控制是不斷直接或間接地檢測轉(zhuǎn)子的位置和速度,然后通過反饋和適當(dāng)?shù)奶幚?,自動給出脈沖鏈,使步進電機每一步響應(yīng)控制信號的命令,從而只要控制策略正確電機不可能輕易失步。脈沖控制器環(huán)形分配器驅(qū)動電路步進電機圖11 基于電子電路控制步進電機系統(tǒng) 基于PLC/變頻器控制手段在一些要求實現(xiàn)精確控制的場合,采用PLC或者變頻器對步進電機進行控制是一個很好的選擇。PLC作為新一代的工業(yè)控制器,由于具有通用性好、實用性強、硬件配套齊全、編程簡單易學(xué)和可靠性高等優(yōu)點而廣泛應(yīng)用于各行業(yè)的自動控制系統(tǒng)中。控制系統(tǒng)采用PLC來產(chǎn)生控制脈沖。環(huán)形脈沖分配器將PLC輸出的控制脈沖按步進電機的通電順序分配到相應(yīng)的繞組。采用軟件環(huán)形分配器占用PLC資源較多,特別是步進電機繞組相數(shù)大于4時,對于大型生產(chǎn)線應(yīng)該予以考慮。步進電機功率驅(qū)動電路將PLC輸出的控制脈沖放大,達(dá)到比較大的驅(qū)動能力。但由于PLC的掃描周期一般為但由于PLC的掃描周期一般為幾毫秒到幾十毫秒,相應(yīng)的頻率只能達(dá)到幾百赫茲,因此,受到PLC工作方式的限制及其掃描周期的影響,步進電機不能在高頻下工作,無法實現(xiàn)高速控制。[3]單片機系統(tǒng)驅(qū)動電路步進電機機械裝置外圍電路圖13 基于單片機控制步進電機系統(tǒng)圖采用單片機來控制步進電機,實現(xiàn)了軟件與硬件相結(jié)合的控制方法。系統(tǒng)中采用單片機接口線直接去控制步進電機各相驅(qū)動線路。環(huán)形分配器其功能由單片機系統(tǒng)實現(xiàn),采用軟件編程的辦法實現(xiàn)脈沖的分配。用軟件代替環(huán)形分配器,通過對單片機的設(shè)定,用同一種電路實現(xiàn)了多相步進電機的控制和驅(qū)動,大大提高了接口電路的靈活性和通用性。 本課題的研究思路即為:采用單片機作為控制核心,實現(xiàn)對步進電機的控制。在其發(fā)展歷程中,出現(xiàn)了多種類型步進電機,按照基本的構(gòu)造和工作原理可分為三大類型即磁阻式、永磁式和混合式。永磁式步進電機則由于轉(zhuǎn)子永磁體加工方面的限制步距角一般較大,相應(yīng)的轉(zhuǎn)動分辨率比較受限,但是由于采用了低成本的爪極式結(jié)構(gòu)使得其制造工藝簡單、價格較低,容易快速批量生產(chǎn),因而廣泛應(yīng)用于對性能要求不高的場合。在步進電機幾十年的發(fā)展過程中,按照相數(shù)、步距角以及機座等劃分,可以說出現(xiàn)過的步進電機的規(guī)格品種極其繁多,然而這種狀態(tài)不利于步進電機產(chǎn)業(yè)的發(fā)展,隨著時間的推移目