【正文】
ABBBCCCDDDAAAB, (步距角為 度)。 因而不同的場合采取不同的的驅(qū)動方式,到目前為止,驅(qū)動方式一般有以下幾種:恒壓、恒壓串電阻、高低壓驅(qū)動、恒流、細(xì)分 驅(qū)動 等。一旦三大要素確定,步進(jìn)電機的型號便確定下來了。 相數(shù) : 4 電壓 : 12 V 電流 : 電阻 : 47Ω 最大靜轉(zhuǎn)距 : 180N 單片機控制步進(jìn)電機的升降頻 一些控制簡單或要求低成本的運動控制系統(tǒng)中,經(jīng)常用步進(jìn)電機做執(zhí)行元件。因此步進(jìn)電機開環(huán)控制系統(tǒng)中,如何防止失步和過沖是開環(huán)控制系統(tǒng)能否正常運行的關(guān)鍵。 失步和過沖現(xiàn)象分別出現(xiàn)在步進(jìn)電機啟動和停止的時候。 實驗表明,圖 13 所示的指數(shù)曲線是步進(jìn)電機最合理的升頻曲線,最符合電機和負(fù)載的慣性規(guī)律。為實現(xiàn)步進(jìn)電機的升降頻,在系統(tǒng)設(shè)計中,一般采 用硬件設(shè)計和軟件設(shè)計,硬件使用積分電路和微分電路實現(xiàn),其元件參數(shù)一經(jīng)選定,曲線形狀就固定不變,因為每個電機及其負(fù)載的機械特性不同,所以他不能最好地與所有的電機適配。針對不同電機的機械特性,我們專門設(shè)計了一個數(shù)據(jù)區(qū),這個數(shù)據(jù)區(qū)中的數(shù)據(jù)即確定了指數(shù)曲線的形狀,我們改變電機時,只要根據(jù)電機的特性改 變數(shù)據(jù)區(qū)的一些數(shù)據(jù),即可使曲線很好的與電機適配 [4]。 CPU 芯片 AT89C51 是主機板的核 心,接收各部分信息并向各部發(fā)出命令,控制電機運行的各種工作狀態(tài)。 由于將多功能 8 位CPU 和閃爍存儲器組合在單個芯片中, 所以 ATMEL 的 AT89C51 是一種高效微控制器, 因其 高性能、高速度、體積小、價格低廉、穩(wěn)定可靠而得到廣泛應(yīng) 畢業(yè)設(shè)計(論文) 10 用 , 成為 在工業(yè)生產(chǎn)中必不可少的器件, 而且 在日常生活中發(fā)揮的作用也越來越大 , 為很多嵌入式控制系統(tǒng)提供了一種靈活性高且價廉的方案。在 FIASH 編程時, P0 口作為原碼輸入口,當(dāng) FIASH 進(jìn)行校驗時, P0 輸出原碼,此時 P0 外部必須被拉高。在 FLASH 編程和校驗時, P1 口作為第八位地址接收。 XTAL1:反向振蕩放大器的輸入及內(nèi)部時鐘工作電路的輸入。 EA/VPP:當(dāng) EA 保持低電平時, 選用 外部程序存儲( 0000HFFFFH),當(dāng) EA端保持高 電平時, 用 內(nèi)部程序存儲器。如圖 22 中所示,在引腳 XTAL1和 XTAL2 外接晶體振蕩器 (簡稱晶振 ),就構(gòu)成了內(nèi)部振蕩方式。 2. 單片機復(fù)位電路: 當(dāng) MCS5l系列單片機的復(fù)位引腳 RST(全稱 RESET)出現(xiàn) 2 個機器周期以 上的高電平時,單片機就執(zhí)行復(fù)位操作。當(dāng)單片機已在運行當(dāng)中時,按下復(fù)位鍵后松開,也能使 RST 保持 一段時間的高電平,從而實現(xiàn) 通電時的自動復(fù)位操作,系統(tǒng)運行過程中的 開關(guān)復(fù)位操作。 由于按鈕是機械觸點,當(dāng)機械觸點斷開、閉合時,會有抖動 , 這種抖動對于人來說是感覺不到的,但對計算機來說,則是完全能感應(yīng)到的, 因為計算機處理的速度是在微秒級,而機械抖動的時間至 少是毫秒級 , 對計算機而言,這已是一個 “ 漫長 ” 的時間了。 按鍵 與控制系統(tǒng) P0 口鍵連接,其連接如下表: 表 21 P0 口與控制鍵連接 控制鍵電路圖如 圖 23 所示: 圖 23 控制鍵電 路圖 167。ULN2020 是高耐壓、大電流、內(nèi)部由七個硅 NPN 達(dá)林頓管成的驅(qū)動芯片。 步進(jìn)電機控制系統(tǒng)硬件電路圖 (見附錄 1) 畢業(yè)設(shè)計(論文) 14 第 3 章 步進(jìn)電機控制系統(tǒng)軟件設(shè)計 167。 降頻流程圖 圖 32 降頻流程圖 本文以 35BY48S03 步進(jìn)電機為例,首先根據(jù)步進(jìn)電機的特性設(shè)計一個數(shù)據(jù)區(qū),再編寫程序?qū)Υ藬?shù)據(jù)的的數(shù)據(jù)進(jìn)行調(diào)試。 走一步子程序流程圖 圖 33 走一步子程序流程圖 167。因此,需要對步進(jìn)電機采用 升降頻控制,以使電機從啟動頻率 中 或者低于啟動頻率的某個合適的值(此值與負(fù)載和步進(jìn)驅(qū)動有關(guān))開始 啟動 ,逐漸加速升到運行頻率然后進(jìn)入勻速運行。 為了達(dá)到精確定位的目的, 在 編程時,將頻率 F(n)的保持時 畢業(yè)設(shè)計(論文) 17 間換算為步數(shù),并對步數(shù) Z(n)進(jìn)行計數(shù)。 如圖 34 所示,我們設(shè)頻率最高升至 1000HZ,用時為 5S,依此確定縱坐標(biāo)每一小格所對應(yīng)的頻率,橫坐標(biāo)每一小格對應(yīng)的時間。 程序源代碼 系統(tǒng)詳細(xì)設(shè) 計程序如下: 文件: include include define uint unsigned int define uchar unsigned char //引腳定義 sbit Start=P0^0。 sbit AP=P1^0。 //定時器 T1 溢出延時 void T1_Delay(uint temp)。 t=65536temp。0xff。 TR1=0。 AP=1。 T1_delay(t)。 BN=0。 BP=1。 AN=0。 AP=0。 Return。 BN=0。 SpeedUp=1。 AN=0。 F=100。 //升頻 if((!SpeedUp)amp。i++) { F=a[i]。j) MotRun(F)。 for(i=0。 for(j=bc。 MotRun(F)。而且隨著系統(tǒng)使用時間越來越長,元器件會發(fā)生變值。程序可用于調(diào)試步進(jìn)電機升降頻的數(shù)據(jù) 區(qū),在步進(jìn)電機的性能檢測、機械特性檢測上都有一定的用途,也可為數(shù)控系統(tǒng)提供一些數(shù)據(jù)。 3 : 3940 [5]伍云輝編著 .單片機應(yīng)用技術(shù) .電子科技大學(xué)出版社 ,1999 :5074 [6]陸子明,徐長根編著 .單片機設(shè)計與應(yīng)用基礎(chǔ)教程 .國防工業(yè)出版社 ,1999:7988 [7]張蔚兮,王穎編著 .微型計算機( MCS51 系列)原理、接口及應(yīng)用 . 南京大學(xué)出版社 ,1999 : 2167 [8]張凱,馬忠梅等 .MCS51 單片機綜合系統(tǒng)及其設(shè)計開發(fā) .科學(xué)出版社 ,1996 : 352 [9]南建輝,王軍茹 .MCS51 單片機原理及應(yīng)用實例編著 .清華大學(xué)出版社 .,2020: 1569 [10]王季秩,曲家騏編著 .執(zhí)行電動機 .機械工業(yè)出版社 ,2020 : 2385 [11]李勛,李剛明 .單片微型計算機大學(xué)讀本 .北京航空航天大學(xué)出版社 ,1998 :7895 [12]吳微 ,文軍 .單片機原理及制作 .武漢大學(xué)出版社 ,1991 [13]蘇彥民編 .電力拖動系統(tǒng)的微型計算機控制 .西安交通大學(xué)出版社 ,1988 :102205 [14]賴福新 .電機控制系統(tǒng) .上海交通大學(xué)出版社 ,1995 : 203254 [15]陳伯時主編 .電力拖動自動控制系統(tǒng)第二版 .機械工業(yè)出版社 ,1992 :5287 畢業(yè)設(shè)計(論文) 26 致 謝 經(jīng)過幾個月的忙碌和學(xué)習(xí),本次畢業(yè)論文設(shè)計已經(jīng)接近尾聲。除了敬高老師的專業(yè)水平外,她的治學(xué)嚴(yán)謹(jǐn)和科學(xué)研究的精神也是我永遠(yuǎn)學(xué)習(xí)的榜樣,并將積極影響我今后的學(xué)習(xí)和工作。 畢業(yè)設(shè)計(論文) 27 附 錄 1 硬件電路原理圖 畢業(yè)設(shè)計(論文) 28 附 錄 2 主流程圖 畢業(yè)設(shè)計(論文) 29 外 文 材 料 譯 文 Quick Start for Beginners to Drive a Stepper Motor Introduction This application note is for novices who want a general quickstart guide showing how to control a stepper motor. Because stepper motors can be used in a variety of ways and are driven by a variety of devices, there is a great deal of information available about how these motors work and how to use them. To reduce confusion, the focus of this application note is on stepper motors that can be driven by microcontrollers. This document includes basic information needed to get started quickly, and includes a practical example that is simple and easy to implement. What is a Stepper Motor? A stepper motor is an electrically powered motor that creates rotation from electrical current driven into the motor. Physically, stepper motors can be large but are often small enough to be driven by current on the order of milliampere. Current pulses are applied to the motor, and this generates discrete rotation of the motor shaft. This is unlike a DC motor that exhibits continuous rotation. Although it is possible to drive a stepper motor in a manner where it has near continuous rotation, doing so requires more finesse of the input waveform that drives the stepper motor. Figure 1 illustrates some basic differences in stepper and DC motor rotation. 畢業(yè)設(shè)計(論文) 30 Types of Stepper Motors There are a variety of stepper motors available, but most of them can be separated into two groups: ? Permanentmag (PM) stepper motor — This kind of motor creates rotation by using the forces between a permanent mag and an electromag created by electrical current. An interesting characteristic of this motor is that even when it is not powered, the motor exhibits some magic resistance to turning. ? Variablereluctance (VR) stepper motor — Unlike the PM stepper motor, the VR stepper motor does not have a permanentmag and creates rotation entirely with electromagic forces. This motor does not exhibit magic resistance to turning when the motor is not powered. What is Inside? 畢業(yè)設(shè)計(論文) 31 Generally, a stepper motor consists of a stator, a rotor with a shaft, and coil windings. The stator is a surrounding casing that remains stationary and is part of the motor housing, while the rotor is a central shaft within the motor that actually spins during use. The characteristics of these ponents and how they are arranged determines whether the stepper motor is a PM or VR stepper motor. Figure 2 and Figure 3 show an examp