【正文】
I 基于單片機(jī)的步進(jìn)電機(jī)控制系統(tǒng)的設(shè)計(jì) 摘 要 步進(jìn)電機(jī)是一種通過電脈沖信號控制相繞組電流實(shí)現(xiàn)定角轉(zhuǎn)動的機(jī)電元件,與其他類型電機(jī)相比具有易于開環(huán)精確控制、無積累誤差等優(yōu)點(diǎn),在眾多領(lǐng)域中獲得了廣泛的應(yīng)用。為了得到性能優(yōu)良的控制結(jié)果,出現(xiàn)了很多步進(jìn)電機(jī)控制系統(tǒng),其中采用單片機(jī)作為控制核心的控制系統(tǒng)得到了廣泛的應(yīng)用。很多這種控制系統(tǒng)在步進(jìn)電機(jī)的驅(qū)動上已經(jīng)做的非常好,比如細(xì)分驅(qū)動技術(shù),但是有的系統(tǒng)比較復(fù)雜,和一些相對比較簡單的控制過程不相吻合,投入上也不經(jīng)濟(jì) 。有的系統(tǒng)在操作上不是很方便,交互性不強(qiáng)。 因此本文的研究內(nèi)容就是設(shè)計(jì)一套硬件系統(tǒng)較簡單、 經(jīng)濟(jì),但功能較為齊全,適應(yīng)性強(qiáng),操作方便,可靠性高的,能夠有機(jī)地把電子技術(shù)、單片機(jī)技術(shù)、電機(jī)的控制技術(shù)結(jié)合起來步進(jìn)電機(jī)控制系統(tǒng)。本文首先簡要描述了步進(jìn)電機(jī)的發(fā)展、應(yīng)用情況、以及常見的控制系統(tǒng)采用的方案,常見的驅(qū)動技術(shù),而且還分析了步進(jìn)電機(jī)的工作原理,然后以單片機(jī)為主控制器提出了整個系統(tǒng)的硬件設(shè)計(jì)方案,在此基礎(chǔ)上對各個模塊的電路進(jìn)行詳細(xì)的設(shè)計(jì),接著闡述了步進(jìn)電機(jī)軟件控制開發(fā)的流程。 關(guān)鍵詞 :步進(jìn)電機(jī) 單片機(jī) 看門狗 驅(qū)動技術(shù) II ABSTRACT Stepping 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 w ith easytoopenloop precision, no accumulation of error of the advantages, has been w idely used in many fields. In order to obtain good control performance results, there has been a lot of stepping motor control system, w hich 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 econo my。 so me 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 anically integrate electronic technology, single chip technology, motor control technology of stepping motor control syste m. This paper briefly describes the development of the scheme, the stepper motor applications, as well as the mon control system, driving te chnology 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 soft ware development process. Keywords: stepper motor microcontroller watchdog driver technology III 目 錄 摘 要 .................................................................................................... I ABSTRAC............................................................................................. II 第 1 章 緒論 ..........................................................................................1 前言 ......................................................................................... 1 基于電子電路控制手段 ................................................. 1 基于 PLC/變頻器控制手段 ............................................ 2 基于單片機(jī)控制手段 ..................................................... 3 國內(nèi)外發(fā)展情況 ...................................................................... 4 步進(jìn)電機(jī)驅(qū)動方式分類及比較 ............................................... 6 單電壓驅(qū)動 .................................................................... 6 高低壓驅(qū)動 .................................................................... 7 自激式恒電流斬波驅(qū)動 ................................................. 8 它激式恒電流斬波驅(qū)動 ................................................. 8 細(xì)分驅(qū)動 ........................................................................ 9 研究的目的和意義 .................................................................10 論文安排 ................................................................................. 11 第 2 章 步進(jìn)電機(jī)概述 .........................................................................13 步進(jìn)電機(jī)的特點(diǎn) .....................................................................13 步進(jìn)電機(jī)的分類 .....................................................................14 反應(yīng)式步進(jìn)電機(jī) ...........................................................14 永磁式步進(jìn)電機(jī) ...........................................................14 混合式步進(jìn)電機(jī) ...........................................................14 步進(jìn)電機(jī)的運(yùn)行原理闡述 ......................................................15 第 3 章 步進(jìn)電機(jī)控制系統(tǒng)概述 .........................................................17 步進(jìn)電機(jī)控制系統(tǒng)簡介 ..........................................................17 本系統(tǒng)特點(diǎn)與功能 .................................................................20 本系統(tǒng)特點(diǎn) ...................................................................20 系統(tǒng)功能 .......................................................................21 第 4 章 系統(tǒng)硬件設(shè)計(jì) .........................................................................22 系統(tǒng)組成 ................................................................................22 系統(tǒng)核心 —— AT89C51 單片機(jī) ..............................................22 主要特性 ......................................................................23 管腳說明 ......................................................................23 振蕩器特性 ...................................................................25 芯片擦除 .......................................................................25 最小系統(tǒng) ......................................................................26 外圍電路設(shè)計(jì) .........................................................................27 顯示電路 — LCD1602 ....................................................27 IV 鍵盤電路 .......................................................................34 看門狗復(fù)位電路 ...........................................................36 驅(qū)動電路 — L298N ........................................................38 電源電路 .......................................................................41 第 5 章 系統(tǒng)軟件設(shè)計(jì) .........................................................................43 系統(tǒng)軟件主流程圖 .................................................................43 系統(tǒng)初始化流程圖 .................................................................44 步進(jìn)電機(jī)運(yùn)行模塊主流程圖 ................