提出了一個由AT89C52單片機控制步進電機的實例。可以通過鍵盤輸入相關數據, 并根據需要, 實時對步進電機工作方式進行設置, 具有實時性和交互性的特點。該系統可應用于步進電機控制的大多數場合。實踐表明, 系統性能優于傳統的步進電機控制器。關鍵詞: 單片機; 步進電動機; 直流固態繼電器; 實時控制Con trol System of Stepp ingMotor Ba sed on AT89C52 ChipM icrocomputerMENGWu2sheng, L ILiang (College of Automatization, Northwestern Polytechnical Unversity, Xipan 710072, China)ABSTRACT: A stepp ing motor control system based on AT89C52 chip microcomputer was described.The data can be inputwith keyboard, and stepp ingmotorwas controlled by these data. According to the demand, users can set the workingmodel of stepp ingmotor in real2time. This system can be widely used in stepp ing motor controlling. The p ractice showed that the performance of this system outdid the tradi tional stepp ing motor controller.KEY WORDS: Chip microcomputer; Stepp ingmotor; DCSSR; Real2time control
基于多點網絡的水廠自動監控系統設計Design of MPI Based Automatic Monitoring and Control System in Water Works劉 美 俊(湖南工程學院,湘潭411101)摘要針對水廠工作水泵多、現場離控制站距離遠的特點,提出了一種基于MPI多點網絡的自動監控系統的設計方法,分析了系統的工作原理,介紹了系統中數據的采集與處理、主站與從站的通信原理以及系統軟件的設計。由于這種系統的主、從站PLC之間采用MPI網絡通信,具有運行可靠、性能價格比高的特點,所以適用于中小規模水廠的分布式監控場合。關鍵詞多點網絡主站從站監控系統Abstract Ina ccordancew ithth efe atuersof w aterw orks,i. e. ,manyp umpsin o perationa ndth ep umps, farfor mt hec ontrolst ation,th em ethodo fdesigninga na utomati(〕monitoringa ndc ontorlsy stemb asedo nM PIis p resented.Th eo perationalpr incipleo fth esy stemi san alyzed,th ed atac olection,data processing; communication between master station and slave station as wel as design and system software are discussed. Because MPI network communicationis used among master station, slave stations and PLC, the system is reliable and high cost-efective. It is, suitable for smal and mediumsized water works for distrbuted monitoring and control.Keywords MPI Masterst ation Slaves tation Monitoringa ndc ontorlsy stem
自來 水 廠 的自動控制系統一般分為兩大部分,一對組態硬件要求較高,投資較大。相對而言,MPI網是水源地深水泵的工作控制,一是水廠區變頻恒壓供絡速度可達187.5 M bps,通過一級中繼器傳輸距離可水控制,兩部分的實際距離通常都比較遠。某廠水源達Ikm 。根據水廠的具體情況,確定以MPI方式組地有3臺深井泵給水廠區的蓄水池供水。水廠區的成網絡,主站PLC為S7-300系列的CPU3121FM,從任務是對水池的水進行消毒處理后,通過加壓泵向管站為S7-200系列的CPU222。這樣既滿足了系統要路恒壓供水。選用Siemens公司的S7系列可編程控求,又相對于Profibus網絡節省了三分之一的成本,制器(PLC)和上位機組成實時數據采集和監控系統, 這種分布式監控系統具有較高的性能價格比。系統對深水泵進行遠程控制,對供水泵采用變頻器進行恒中PLC的物理層采用RS - 485接口,網絡延伸選用壓控制以保證整個水廠的電機設備安全、可靠地運帶防雷保護的中繼器,使系統的安全運行得到了保行。證。MPI網絡的拓撲結構如圖1所示。1 多點網絡(NWI)監控系統的組成Sie me ns 公司S7系列PLC通常有MP」多點網絡與Profibus現場總線網絡兩種組網方式。Profibus現場總線的應用目前較為普遍,通用性較好,它由Profibus一DP, Profibus一FMS, Profibus一PA組成。Profibus - DP型用于分散外設間的數據傳輸,傳輸速率為9.6kbps一12Mbps,主要用于現場控制器與分散1/0之間的通信,可滿足交直流調速系統快速響應的時間要求,特別適合于加工自動化領域的應用;Profibus - FMS主要解決車間級通信問題,完成中等傳輸速度的循環或非循環數據交換任務,適用于紡織、樓宇自動化、可編程控制器、低壓開關等;Profibus - PA型采用了OSI模型的物理層和數據鏈路層,適用于過程自動化的總線類型。
PLC TM卡開發系統匯編程序(ATM8051)
;***************** 定義管腳*************************SCL BIT P1.0SDA BIT P1.1GC BIT P1.2BZ BIT P3.6LEDI BIT P1.4LEDII BIT P1.5OK BIT 20H.1OUT1 BIT P1.3OUT2 BIT P1.0OUT3 BIT P1.1RXD BIT P3.0TXD BIT P3.1PCV BIT P3.2WPC BIT P3.3RPC BIT P3.5LEDR BIT P3.4LEDL BIT P3.6TM BIT P3.7;********************定義寄存器***********************ROMDTA EQU 30H;NUMBY EQU 61H;SLA EQU 60H;MTD EQU 2FH;MRD EQU 40H;TEMP EQU 50H;;ORG 00H;;INDEX:MOV P1, #00H;MOV P2, #0FFHMOV MTD ,#00HCALL REEMOV R0,40HCJNE R0,#01,NO;MOV P2,#1CHLJMP VIMEN MOV P2,#79HACALL TOUCHRESET ;JNC NO ;CALL READTM ;CJNE A,#01H,NO;NOPMOV MTD, #00HCALL WEENOPMOV P2,#4AHSETB BZCALL TIMECLR BZMOV PCON, #0FFHVIME:CALL TIME1CALL TOUCHRESETJNC VIMECALL READTMCJNE A, #01H,VIME;NOPNOPNOPIII: MOV MTD,#00HCALL REECALL BBJNB OK,NO1LJMP ZHUNO1:MOV MTD,#10H