版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
1、<p><b> 中文3126字</b></p><p> 基于單片機的步進電機控制流水線設(shè)計</p><p> 凌希裴,陳鵬,靖國,李燕文</p><p> 210042江蘇南京,南京師范大學(xué),電氣與自動化工程學(xué)院</p><p> 電子郵件:crystalpei2008@163.com,c.pen
2、g@ njnu.ed.cn</p><p> 摘要:通過采用電子化和智能化技術(shù),本文實現(xiàn)了力學(xué)和電子產(chǎn)品流水線包裝控制的有效整合。要達到這個目的,步進電機是由一個單片微型計算機(SCM)式STC89C516RD+的控制。一旦LJ-JT02的光電開關(guān)型檢測產(chǎn)品合格,信號給出了以供應(yīng)鏈管理為指導(dǎo)的步進電機。此外,剪刀用于切斷包裝帶,這是由HRS4H-S-DC5V的繼電器類型實現(xiàn)。實驗結(jié)果表明,上述設(shè)計的有效性。&l
3、t;/p><p> 關(guān)鍵詞:單片機(SCM);步進電機;驅(qū)動芯片;接力</p><p><b> 1 引言</b></p><p> 在20世紀50年代到70年代,隨著電子和合成化學(xué)品的快速發(fā)展,對用合成材料作為包裝材料的一系列新的包裝技術(shù)和設(shè)備有很大的影響。例如,有高速自動包裝機的機電一體化,容易操作的多功能包裝機和高生產(chǎn)率的自動包裝機。這
4、些機器使包裝機械行業(yè)成為被看好的機械制造行業(yè)。雖然早在20世紀50年代中期就已經(jīng)有一些包裝機械廠出現(xiàn)在中國,然而生產(chǎn)率很低。在改革開放之初,許多食品機械和包裝機械被介紹到中國,極大地促進了行業(yè)發(fā)展。20世紀80年代后期,國民經(jīng)濟的快速發(fā)展對包裝機的需求量很大。而與此同時,很多傳統(tǒng)的用于生產(chǎn)農(nóng)業(yè)機械的工廠,開始生產(chǎn)包裝機械。在1997年底,包裝機械制造廠的數(shù)目已增至1600個左右,并有大約75個研究機構(gòu)從事包裝機械的研究和開發(fā)。更重要的是
5、,大約有21所高校引入關(guān)于包裝機械的專業(yè)。因此,該行業(yè)在中國不僅要推進,還應(yīng)進一步提高。</p><p> 未來具有微電腦和機電一體化的包裝機械將呈現(xiàn)增長的趨勢。一個完整的機電一體化系統(tǒng)是一個系統(tǒng)集成multidisciplines,如機械、微電子計算機和傳感器。它帶來了深刻的變化,通過設(shè)計、制造和包裝機械的控制和改變industry.In來達到更快速地開發(fā)。事情應(yīng)該這樣做才能提高包裝機械,機電一體化,產(chǎn)品的可
6、靠性和穩(wěn)定性的水平,因此,現(xiàn)代包裝產(chǎn)業(yè)將會進一步得到改善。</p><p> 在這項工作中,我們在模擬包裝流水線的基礎(chǔ)上,由單片機驅(qū)動步進電機控制。首先我們介紹的是硬件電路的整體設(shè)計和硬件的主要連接,然后描述了軟件設(shè)計和編程過程,最后我們證明了產(chǎn)品設(shè)計實驗的可行性,以及對包裝機械未來的展望。</p><p><b> 2 硬件電路設(shè)計</b></p>
7、<p> 2.1 總體電路設(shè)計</p><p> 為了便于實驗,用剪刀和發(fā)光二極管代替部分由步進電機控制的器件。當發(fā)光二極管發(fā)光,這意味著相應(yīng)的端口輸出高電平。如果他們不亮,這意味著相應(yīng)的端口輸出低電平。一種光電開關(guān)被安裝在傳送帶上,如果沒有產(chǎn)品通過時,光電開關(guān)的紅外線接收器和發(fā)射設(shè)備被關(guān)閉,并且輸出為高電平。如果某些對象被傳遞,紅外線被中斷,它會立即輸出一個負脈沖。一旦單片機的輸入端口檢測到光
8、電開關(guān)傳輸?shù)呢撁}沖,單片機的輸出端會產(chǎn)生由程序控制的特殊電平,傳輸?shù)津?qū)動芯片,使步進電機工作。當包裝的時間到了,單片機輸出脈沖信號給繼電器,使剪刀接近,切斷包裝帶。在這之后,剪刀再次打開,等待下一次的行動。</p><p><b> 2.2 主要組件</b></p><p> 2.2.1 步進電機</p><p> 步進電機是一臺將電
9、脈沖信號轉(zhuǎn)變?yōu)榻俏灰苹蚓€位移的機器。步進電機可以作為一個特殊的電機,用于控制其他機器。因為其誤差將不會被累積,所以被廣泛應(yīng)用于各種開環(huán)控制電路。</p><p> 2.2.2 STC89C516RD+</p><p> SCM是單片微型計算機的縮寫,其也被稱為微控制器。它是一種半導(dǎo)體芯片,集成了CPU,ROM,RAM,I / O接口,定時器/計數(shù)器,中斷系統(tǒng)和其他一些部件于一身,構(gòu)成
10、了一個完整的數(shù)字計算機。目前該供應(yīng)鏈管理已成功應(yīng)用于智能儀表,機電設(shè)備,過程控制,數(shù)據(jù)處理,自動檢測,家用電器和其他一些領(lǐng)域。在本設(shè)計中,我們使用了宏景科技公司生產(chǎn)STC89C516RD+。 STC89C516RD+的工作電壓為5V,工作頻率范圍為0-80MHz,其實際的工作頻率一般為48MHZ。</p><p> 2.2.3 L297</p><p> 為了簡化外圍電路,在此設(shè)計中
11、,我們采用步進電機驅(qū)動芯片L297來驅(qū)動它。 L297是步進電機的一個專用控制器。它不僅可以生成四個控制信號,還可以控制兩相雙極和四相單極步進電機。L297為20引腳塑料雙列直插器件。</p><p> 2.2.4 繼電器</p><p> 一個中繼被稱為一個開關(guān),它關(guān)閉時可在特殊條件下打開。繼電器的開關(guān)特性已被廣泛應(yīng)用于控制系統(tǒng),尤其是在離散控制系統(tǒng)。在這個設(shè)計中,我們選擇電壓繼電
12、器HRS4H-S-DC5V,這是常用的電路保護器件,它可以提供過壓保護和低壓閉鎖。</p><p> HRS4H-S-DC5V的施加電壓為5V,它的吸合電壓為3.75V。</p><p> 2.3 主設(shè)備的連接</p><p> 2.3.1 單片機與L297之間的連接</p><p> 步進電機驅(qū)動芯片L297,它只需要輸入的時鐘
13、,方向和模式信號是有效的。因此,在軟件編程的過程中,應(yīng)該做的唯一一件事就是從單片機的P1.1口產(chǎn)生高低電平交替的脈沖。與此同時,根據(jù)控制轉(zhuǎn)向和模式,使P1.3和P1.4端口都設(shè)置為高級或符合要求的狀態(tài)。</p><p> 理論上P1.3和L297可以直接連接,但實際上微控制器的負荷使P1口的輸出電壓低且不穩(wěn)定。系統(tǒng)不能識別的高低電壓之間的過渡,因而P1.1不能輸出理想的脈沖到L297。為了解決這個問題,我們使用
14、電壓跟隨器來連接單片機的輸出端口。它們可以維持和穩(wěn)定電壓。電壓跟隨器具有良好的抗干擾性,并且可以穩(wěn)定地輸出,因此它可以使電壓達到其驅(qū)動電路的標準。</p><p> 2.3.2 L297與步進電機之間的連接</p><p> 7904是一個普通的門電路芯片,它由四個AND門構(gòu)成。IRLZ44N是增強型NMOS器件。</p><p> 2.3.3 單片機與繼
15、電器之間的連接</p><p> 原則上單片機的輸出端口可以直接連接到繼電器,但實驗中單片機的輸出信號實際上是非常不穩(wěn)定的。由于負載的原因,P1.5的輸出電壓被拉低,因此它不能驅(qū)動繼電器。為了解決這個問題,我們使用光電耦合器來驅(qū)動繼電器。光電耦合器具有良好的抗干擾性能,可以解決輸出的問題,這使得電路變得可靠。繼電器VCC為12V,當單片機P1.5輸出高電壓時,由于繼電器的作用,開關(guān)打開;當P1.5輸出低電壓時,
16、開關(guān)閉合。</p><p><b> 3 軟件設(shè)計</b></p><p><b> 3.1 程序流程</b></p><p> 當沒有物體通過時,光電開關(guān)輸出高電壓。一旦某些物體被檢測到,這個光電開關(guān)的輸出立即產(chǎn)生一個下降沿信號,并將其輸入到單片機的P1.0口。然后單片機輸出的信號給步進電機驅(qū)動器芯片的三個控制端
17、口:CLK(P1.1),CW(P1.3),HALF(P1.4),以此來控制步進電機的工作。我們可以通過單片機定時器設(shè)定具體的包裝時間。包裝完成后,從P1.5口產(chǎn)生低電壓使繼電器立即導(dǎo)通,然后再次關(guān)閉打開的開關(guān)。這樣就完成切割包裝帶的工作。</p><p><b> 3.2 編程</b></p><p> 本設(shè)計中的程序是用C語言編寫的。C語言與匯編語言相比具有較
18、靈活,方便和緊湊的優(yōu)點。更重要的是它可以在一個大的領(lǐng)域中應(yīng)用,具有良好的便攜性。我們選擇Keil C集成開發(fā)環(huán)境,它具有Windows界面,有效地生成目標代碼的特點。大多數(shù)匯編語言代碼生成非常緊湊,易于理解。然后,該程序是由具有操作方便的ISP,STC軟件下載到單片機的。主程序如下所示:</p><p> Void main () </p><p> { ports(); </p
19、><p> Time()_init(); </p><p><b> While(1) </b></p><p> { if(P1^0==0) </p><p><b> ……. </b></p><p><b> }</b></p>
20、<p><b> }</b></p><p> 光電開關(guān)的信號由查詢模式檢測。與中斷子程序中,相應(yīng)的微控制器產(chǎn)生轉(zhuǎn)換的高低電壓。中斷子程序如下圖所示:</p><p> P1^1=0; </p><p> delay(m); </p><p><b>
21、 P1^1=1; </b></p><p> delay(m); </p><p><b> P1^3= 0; </b></p><p> P1^4= 0; </p><p> 在主程序中該中斷子程序被調(diào)用多次。被用來產(chǎn)生脈沖,以驅(qū)動步進電機工作。在這個實驗中,我們設(shè)置全步和反向模式,它在中斷子程
22、序中可以看出。</p><p><b> 4 測試結(jié)果</b></p><p> 最后將程序燒寫到單片機中,來完成完整的硬件電路。為了便于實驗,單片機的三個輸出端口:P1.1,P1.3,P1.4,應(yīng)連接到L297再連接到三個發(fā)光二極管,如圖6,光發(fā)光二極管以發(fā)光來判斷輸出高電壓。因此,他們滅,表示從單片機輸出低電壓。為了便于觀察,該繼電器的輸出端連接一個發(fā)光二極管
23、,而不是剪刀。在開始時,四個光發(fā)二極管全都發(fā)光。</p><p> 實驗的結(jié)果表明,當光電開關(guān)檢測到某些對象時,P1.1的發(fā)光二極管開始閃爍,表示產(chǎn)生脈沖,同時P1.3和P1.4的發(fā)光二極管立即熄滅,表示步進馬達開始正向和半步模式工作。一段時間后,連接到所述延遲器輸出的發(fā)光二極管亮起后立即熄滅,表示開關(guān)打開,然后再關(guān)閉。該行為是指剪刀切斷包裝膠帶,然后再打開,等待下一步的行動。</p><p
24、><b> 5 結(jié)論</b></p><p> 該實驗?zāi)Mpipeling控制的進程,由單片機驅(qū)動步進電機。值得注意的是,在實踐中,輸出電壓被下拉是因為負載低且不穩(wěn)定,因此,電壓跟隨器和光電耦合器在這里是為了防干擾。</p><p> 本文結(jié)合單片機和步進電機來模擬包裝生產(chǎn)線控制??梢酝ㄟ^用單片機編程,而不是模擬通道或數(shù)字電路來實現(xiàn)。這種控制技術(shù),可以提高
25、系統(tǒng)的性能,不依賴于硬件,但需要軟件評測,這就是所謂的微控制技術(shù)。隨著微控制技術(shù)的發(fā)展,全自動和智力水平將在包裝行業(yè)得到不斷的提高。</p><p> Pipelining Design Controlled by Stepper Motor Based on SCM </p><p> LingXi Pei, Chen Peng, Jing Guo, LiYan Wen</p&
26、gt;<p> School of Electrical and Automation Engineering, Nanjing Normal University, Nanjing, Jiangsu, 210042 </p><p> E-mail: crystalpei2008@163.com, c.peng@njnu.ed.cn</p><p> Abstrac
27、t: By employing electronics and intelligent technology, this paper realizes an effective integration of mechanics and electronics in pipelining packing control. To achieve this aim, stepper motor is controlled by a singl
28、e-chip microcomputer(SCM) type of STC89C516RD+. Once the photoelectric switch type of LJ-JT02 detects products passing, signals are given out to SCM to direct the stepper motor. Furthermore, the scissors are used to cut
29、off the package tape, which are realized by a relay t</p><p> Keyword: Single-chip Microcomputer(SCM); Stepper Motor; Driving-chip; Relay</p><p> 1 INTRODUCTION</p><p> During t
30、he 1950s to 1970s, with the rapid development of electronics and synthetic chemicals, the packaging machinery has been influenced a lot, and there were a series of new packaging technology and equipment based on syntheti
31、c materials as packing materials. For example, there were high-speed automated packaging machines of electromechanical integration, multi-functional packaging machines which are easy to operate and automatic packaging ma
32、chines with high productivity. Those machines made t</p><p> In the future the packaging machinery has a growing tendency for the application of microcomputer and electromechanical integration. A complete m
33、echatronics system is a system to integrate multidisciplines such as machinery, computers microelectronics and sensors. It brings profound changes to the design, manufacturing and control of packaging machinery and chang
34、es the situation of the industry.In order to develop more quickly, something should be done to improve the level of packaging machinery</p><p> In this work, we simulate the control process of packaging ass
35、embly line based on stepper motor which is operated by SCM. First we introduce the overall design of hardware circuit and the main connection of hardware, and then describe the software design and programming ideas, at l
36、ast we testify the feasibility of the design by experiment, as well as prospect for the future packaging machinery.</p><p> 2 HARDWARE CIRCUIT DESIGN</p><p> 2.1 Overall Circuit Design</p
37、><p> To facilitate the experiment, the parts of scissors and stepper motor are instead by light-emitting diodes. When the light-emitting diodes are light, that means the corresponding ports output high level.
38、 While they are not light, that means the corresponding ports output low level. A photoelectric switch is installed on the conveyor belt. If there is no product passing, the infrared receiver and transmitter devices of t
39、he photoelectric switch are closed and the output is high level. If some obje</p><p> 2.2 Main Components</p><p> 2.2.1 Stepper Motor</p><p> A stepper motor is a machine which
40、 transmits electrical pulse signals into angular or linear displacement. The stepper motor can be used as a special motor for controlling other machines because its errors will not be accumulated. It is widely used in a
41、variety of occasions of open-loop. </p><p> 2.2.2 STC89C516RD+ </p><p> SCM is an abbreviation of a single-chip micro-computer, which is also known as a micro-controller. It is a semiconducto
42、r chip, integrated by a CPU, ROM, RAM, I/O interface, timer/counter, interruption systems and some other components, constituting a complete digital computer. At present SCM has been successfully used in intelligent inst
43、ruments, electromechanical devices, process controls, data processing, automatic detection, household appliances and some other fields. In this design we use STC</p><p> 2.2.3 L297</p><p> To
44、 simplify the external circuit, in this design we use a stepper motor driver chip L297 to drive it. L297 is a special controller for stepper motors. It can generate four control signals. It can control two-phase bipolar
45、and four-phase unipolar stepper motors. The device is 20-pin of plastic dual in-line.</p><p> 2.2.4 Relay</p><p> A relay is known as a switch. It closes or opens in special conditions. The s
46、witching characteristics of the relay has been widely applied in many control systems, especially in a discrete control system. In this design we select voltage relay HRS4H-S-DC5V which is commonly used in circuit protec
47、tion devices for over-voltage protection or low-voltage lockout. </p><p> The applied voltage of HRS4H-S-DC5V is 5V, and its pick-up voltage is 3.75V.</p><p> 2.3 Connection of the Main Devic
48、es</p><p> 2.3.1 Connection between SCM and L297 </p><p> The stepper motor driver chip L297 has an advantage that it just needs inputting signals of clock, direction and mode. So in the prog
49、ress of software programming, the only thing which should be done is to produce high-low alternating pulses from P1.1 port of SCM. At the same time, to control the steering and mode, P1.3 and P1.4 ports are set to high -
50、 level or low-level on request.</p><p> Theoretically speaking P1.3 and L297 can be connected directly, but actually the loads of microcontroller make the output voltage of P1 port low and unstable. The sys
51、tem could not identify the transition between the high and low voltages and thus P1.1 can not output ideal pulses to the L297. In order to solve this problem, we use voltage followers to connect the output ports of SCM.
52、They are to maintain and stabilize voltage. The voltage follower has good interference immunity and can output sta</p><p> 2.3.2 Connection Between L297 and Stepper Motor </p><p> 7904 is a
53、common gate circuit chip, which is formed by four AND gates. IRLZ44N is enhanced NMOS. </p><p> 2.3.3 Connection Between SCM and Relay </p><p> In principle the output ports of SCM can be con
54、nected to the relay directly. In the experiment the output of SCM is actually very unstable, and the output voltage of P1.5 is pulled down low because of the loads, so it can not drive the relay. To solve the problem, we
55、 use optocoupler to drive the relay. The optocoupler has good anti-interference performance and can effectly solve the output problem, which makes the circuit more reliable. Then VCC of relay is 12V. when P1.5 of SCM out
56、puts high-vol</p><p> 3 SOFTWARE DESIGN</p><p> 3.1 Program Flow</p><p> When there is no object passing, the photoelectric switch outputs high-voltage. Once some object is det
57、ected, the output of the photoelectric switch generates a falling edge signal immediately, and input it to P1.0 of SCM. Then SCM outputs desired signals to the three control ports of stepper motor driver chip: CLK (P1.1)
58、, CW (P1.3), HALF (P1.4) to control the stepper motor to work. We can set specific packaging time through the SCM timer. After finishing packaging, a moment low-voltage from P1.</p><p> 3.2 Programming <
59、;/p><p> In this design the program is written in C language. C has the advantages of both the high-level language and assemble language. It is flexible, convenient and compact in structure. What’s more it can
60、 be applied in a large of fields and has good portability. We choose Keil C language integrated development environment which shows Windows interface that generates object codes efficiently. The majority of assembly lang
61、uage codes generated are very compact and easy to understand. Then the program i</p><p> Void main () </p><p> { ports(); </p><p> Time()_init(); </p><p><b>
62、While(1) </b></p><p> { if(P1^0==0) </p><p><b> ……. </b></p><p><b> }</b></p><p><b> }</b></p><p> The signa
63、ls of photoelectric switch are detected by query mode. With interruption subroutine, the corresponding microcontroller produces conversion of high and low voltages. The interruption subroutine is shown as below. </p&
64、gt;<p> P1^1=0; </p><p> delay(m); </p><p><b> P1^1=1; </b></p><p> delay(m); </p><p><b> P1^3= 0; </b></p>
65、;<p> P1^4= 0; </p><p> In main program this interruption subroutine is called for several times. That generates pulses to drive the stepper motor to work. In this experiment we set full-step and r
66、everse mode, which can be seen in the interruption subroutine.</p><p> 4 TEST RESULTS </p><p> After the hardware circuit is built completely, the program is burnt into the SCM. In order to e
67、asy the experiment, the three output ports of SCM, P1.1, P1.3, P1.4, which should be connected to L297, is connected to three light emitting diodes, as shown in Figure 6. That the light emitting diodes are light means to
68、 output high voltage. And that they are off means to output low voltage from SCM. In order to facilitate observation, the output of the relay is also connected to a light-emitting diod</p><p> The results o
69、f the experiment show that when some object is passing the transmitter and the receiver of the photoelectric switch, that is to say, when the photoelectric switch detects some object, the light-emitting diode of P1.1 beg
70、ins to flash, which shows pulses are generated. At the same time the light-emitting diodes of P1.3 and P1.4 are off immediately, which means the stepper motor begins to work with the forward and half-step mode. After a p
71、eriod of time, the light-emitting diode connect</p><p> 5 CONCLUSION</p><p> This experiment simulates the progress of the pipeling control, using stepper motor driven by SCM. It is noteworth
72、y that in practice the output voltage is pulled down to be low and unstable because of the loads, so voltage follower and optocouplers are introduced here for anti-interference. </p><p> This article combi
73、nes SCM and the stepper motor to simulate packaging lines control. This can be achieved by SCM with programming instead of mimic channel or digital circuits. </p><p> This control-technology which can impro
74、ve the system performance does not dependent on hardware but onsoftware. It is called the micro-control technology. With the development of micro-control technology, the automatical and intellectual level will be improve
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 步進電機的單片機控制外文翻譯
- 外文翻譯---基于單片機的步進電機電路控制設(shè)計
- 基于51單片機的流水線產(chǎn)品計數(shù)器設(shè)計
- 單片機步進電機課程設(shè)計--單片機控制步進電機的設(shè)計
- 單片機課程設(shè)計--基于單片機的步進電機控制
- 基于單片機的步進電機的控制
- 單片機課程設(shè)計--單片機控制步進電機
- 單片機課程設(shè)計-單片機控制步進電機
- 基于單片機的步進電機控制系統(tǒng)畢業(yè)設(shè)計(含外文翻譯)
- 基于單片機的步進電機控制單片機課程設(shè)計
- 基于單片機的步進電機控制系統(tǒng)畢業(yè)設(shè)計(含外文翻譯)
- 基于51單片機的步進電機控制-
- 單片機課程設(shè)計--基于單片機的四相步進電機控制
- 基于單片機的步進電機控制畢業(yè)設(shè)計
- 基于單片機的步進電機控制畢業(yè)設(shè)計
- 基于51單片機的步進電機的控制設(shè)計
- 應(yīng)用物理畢業(yè)論文基于單片機的流水線產(chǎn)品計數(shù)系統(tǒng)設(shè)計
- 畢業(yè)論文--基于51單片機的流水線產(chǎn)品計數(shù)器設(shè)計
- 畢業(yè)論文--基于51單片機的流水線產(chǎn)品計數(shù)器設(shè)計
- 單片機課程設(shè)計——基于單片機的步進電機控制器設(shè)計
評論
0/150
提交評論