19基于單片機(jī)的數(shù)控車床XY工作臺(tái)與控制系統(tǒng)設(shè)計(jì)
19基于單片機(jī)的數(shù)控車床XY工作臺(tái)與控制系統(tǒng)設(shè)計(jì),19,基于,單片機(jī),數(shù)控車床,xy,工作臺(tái),控制系統(tǒng),設(shè)計(jì)
Single Chip Microcomputer A microcontroller (or MCU) is a computer-on-a-chip. It is a type of microprocessor emphasizing self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). The majority of computer systems in use today are embedded in other machinery, such as telephones, clocks, appliances, vehicles, and infrastructure. An embedded system usually has minimal requirements for memory and program length and may require simple but unusual input/output systems. For example, most embedded systems lack keyboards, screens, disks, printers, or other recognizable I/O devices of a personal computer. They may control electric motors, relays or voltages, and read switches, variable resistors or other electronic devices. Often, the only I/O device readable by a human is a single light-emitting diode, and severe cost or power constraints can even eliminate that. In contrast to general-purpose CPUs, microcontrollers do not have an address bus or a data bus, because they integrate all the RAM and non-volatile memory on the same chip as the CPU. Because they need fewer pins, the chip can be placed in a much smaller, cheaper package. Integrating the memory and other peripherals on a single chip and testing them as a unit increases the cost of that chip, but often results in decreased net cost of the embedded system as a whole. (Even if the cost of a CPU that has integrated peripherals is slightly more than the cost of a CPU + external peripherals, having fewer chips typically allows a smaller and cheaper circuit board, and reduces the labor required to assemble and test the circuit board). This trend leads to design. A microcontroller is a single integrated circuit, commonly with the following features: central processing unit - ranging from small and simple 4-bit processors to sophisticated 32- or 64-bit processors input/output interfaces such as serial ports (UARTs) other serial communications interfaces like I2C, Serial Peripheral Interface and Controller Area Network for system interconnect peripherals such as timers and watchdog RAM for data storage ROM, EPROM, EEPROM or Flash memory for program storage clock generator - often an oscillator for a quartz timing crystal, resonator or RC circuit many include analog-to-digital converters This integration drastically reduces the number of chips and the amount of wiring and PCB space that would be needed to produce equivalent systems using separate chips and have proved to be highly popular in embedded systems since their introduction in the 1970s. Some microcontrollers can afford to use a Harvard architecture: separate memory buses for instructions and data, allowing accesses to take place concurrently. The single slice of the earlier period all of machines are 8 or 4.Among them, the INTEL is most successful of 8031, because of in brief dependable but the function was quite good to acquire very big good opinion.Henceforth at 8031 up developed MCS51 serieses a single slice machine system.According to the single slice of this system machine system is still in the extensive usage till now.Because the industry controls the exaltation of[with] realm request, starting appearing 16 single slice machine, but because sex price wanted to don't get a very extensive application than the disregard.Develop greatly along with the consumption electronics product after 90's, the single slice machine technique got a huge exaltation.Along with the extensive application of INTEL i 960 serieses especially later ARM series, the 32 single slice machine replaces 16 single slice the high level position of the machine quickly, and gets into an essential market.And traditional of 8 single slice the function of the machine also got to fly to raise soon, handling an ability to compare with to raise few a hundredfolds in 80's.Currently, 32 single slice of the high level with main machine already over 300 MHzs, the function keeps appropriation processor of making track for the mid 90's, and the common model number factory price drop into to USD 1, tallest carry of model number also only USD 10.The contemporary and single slice machine system has already no longer developed and used just under the naked machine environment, the in great quantities appropriative built-in operate system is applied extensively in the whole serieseses of the single slice is on board.But Be ising the high level of handheld PC and cellular phone core processing single slice the machine even can use appropriative Windows and the Linux operate system directly. Single slice the machine ratio appropriation processor is the most suitable to match to apply in the built-in system, so it got the most applications.In fact the single slice machine is an amount the most calculators are in the world.The modern mankind are living medium use of.assemble in almost each electronics and machine product have a single slice machine.All have 1-2 single slice machine in the computer accessorieses such as cellular phone, telephone, calculator, home appliances, electronics toy, handheld PC and mouse etc..And personal computer in would also capable number not a few single slice the machine be working.Provide with more than 40 departments a single slice machine generally on the car, complicated industry's controling the top of the system even may has single several hundred pedestalses slices machine to work in the meantime!Single slice the amount of the machine not only far above the PC machine and other calculations of comprehensive, even than the mankind's amount still want have another Singlechip study should be an important part in the five: First, the bus: we know that a circuit is always from the components through wires connected, and in analog circuits, the connection does not become a problem, because the devices are generally serial inter-relationship between the various devices connection is not much, but not the same as computer circuits, which is based on the microprocessor as the core, the device must be connected with the microprocessor, the device must be between the mutual coordination and so on need to connect on a lot of If still the same as analog circuits, in the microprocessor and a separate connection between the devices, the quantity line will be many alarmingly so in the microprocessor introduced the concept of bus, all devices share the connection All devices of all eight data lines from eight public online, which is equivalent to all devices in parallel, but only this is not enough, if there is two devices send data simultaneously, a 0, a 1, then , the receiving party received what is it? This situation is not allowed, so to pass the line of control to control the device time job, any time there can be only one device to send data (which may have multiple devices simultaneously receiving). Device's data lines will be referred to as data bus, all the line of control devices known as control bus. Singlechip at internal or external memory and other devices have memory cells, these memory cells to be assigned addresses to use, the allocation of addresses is of course to give the form of electrical signals, and because memory cells are more so for address the allocation of more lines, these lines were known as the address bus. Second, data, address, command: The reason why these three together, because these three are the essence is the same - figure, or are a string of'0 'and'1', composed of sequence . In other words, addresses, instructions are also data. Command: from single-chip chip designer provides a figure, it is consistent with our mnemonic commonly used commands have a strict one-to-one relationship, not by the developer to change the MCU. Address: Singlechip are looking for internal, external storage units, input and output port based on the value of the internal unit's address has been provided for the chip designers, and can not be changed, the external unit can be single-chip developers to decide, but Yes there is some address must be the unit (see procedures for the implementation process). Data: This is the object of treatment by the microprocessor, in a variety of different applications in different circuits, in general, the data may be processed so have several situations: 1 .address (such as MOV DPTR, # 1000H), that address 1000h into the DPTR. 2. the way the words or control characters (such as MOV TMOD, # 3), 3 which controls the characters. 3. constants (such as MOV TH0, # 10H) 10H that is constant from time to time. 4 .The actual output value (such as the mouth then P1 lantern light to light the whole, then the implementation of instruction: MOV P1, # 0FFH, to light the whole dark, then the implementation of instruction: MOV P1, # 00H) and 00H are here 0FFH actual output value. Another example is the font code for the LED, is the actual output value. Understanding of the address, the nature of instructions, running is not difficult to understand why the process of running fly, the data will be implemented as instructions. Three, P0 mouth, P2 and P3 the mouth of the second function Usage: often on P0 beginner I, P2 and P3 mouth I use the second function puzzled think the second function and the original features have a switch between the process, or that there have to be a directive, in fact, the port's second feature is completely automatic, no need to use command to convert. Such as P3.6, P3.7, respectively, are WR, RD signal, when the micro-chip RAM or external justifications machine has an external I / O port, they were used as the second function, can not be used as general-purpose I / O port to use, as long as one microprocessor implementation of the MOVX instruction 1, there will be a corresponding signal sent from the P3.6 or P3.7, no prior use instructions indicate. In fact 'can not be used as general-purpose I / O port use' is not 'should not' but (user) 'not' as a general-purpose I / O port to use. At command you can arrange a Medium of Instruction SETB P3.7, and when the single-chip implementation of this Article directions, P3.7 will also become high, but users will not do so, because This usually will lead to the collapse of the system. Four, the program implementation process: single-chip power-on reset in 8051 after the program counter (PC) in the value of'0000 ', so the procedure always'0000' unit begin implementation of, that is to say: the system's ROM must exist in the'0000 'in this unit, and'0000' in the storage unit must be a command. Five, the stack: the stack is a region, are used to store data, the region does not have any unique position, that is a part of internal RAM, special is its data storage and access methods, namely, the so-called 'advanced after that last-in first-out ', and the stack has a special data transmission command, ie' PUSH 'and' POP ', there is a special unit specifically for its services, that is, the stack pointer SP, when they first PUSH instruction, the SP on (at the original value of the foundation on) automatically add one, whenever the implementation of a POP instruction, SP on (at the original value basis) minus one automatically. Because of the value of SP can be used to change directions, so as long as the stage at the beginning of the proceedings to change the value of the SP, you can put the stack set up the required memory units, such as at the beginning of the proceedings, with a MOV SP, # 5FH instructions when put on the stack from the memory modules installed in the unit 60H start. The normal procedure at the beginning of the total that there is a stack pointer of the instruction set, because at startup, SP initial value of 07H, thus the stack from the beginning the next unit 08h, and 08h to 1Fh in the region 8031 is the second, Three, four working registers area, often used, this will lead to data chaos. The author has prepared a different program, not exactly the same instructions to initialize the stack, which is the author's customary problem. When set up the stack area, does not mean that the region as a dedicated memory, it can be as common as the use of memory region, but under normal circumstances programming will not put it as an ordinary memory use. 湘潭大學(xué)興湘學(xué)院畢業(yè)論文(設(shè)計(jì))評(píng)閱表學(xué)號(hào) 2006183819 姓名 蔣迎龍 專業(yè) 機(jī)械設(shè)計(jì)制造及其自動(dòng)化 畢業(yè)論文(設(shè)計(jì))題目: 基于單片機(jī)的數(shù)控車床 XY 工作臺(tái)與控制系統(tǒng)設(shè)計(jì) 評(píng)價(jià)項(xiàng)目 評(píng) 價(jià) 內(nèi) 容選題1.是否符合培養(yǎng)目標(biāo),體現(xiàn)學(xué)科、專業(yè)特點(diǎn)和教學(xué)計(jì)劃的基本要求,達(dá)到綜合訓(xùn)練的目的;2.難度、份量是否適當(dāng);3.是否與生產(chǎn)、科研、社會(huì)等實(shí)際相結(jié)合。能力1.是否有查閱文獻(xiàn)、綜合歸納資料的能力;2.是否有綜合運(yùn)用知識(shí)的能力;3.是否具備研究方案的設(shè)計(jì)能力、研究方法和手段的運(yùn)用能力;4.是否具備一定的外文與計(jì)算機(jī)應(yīng)用能力;5.工科是否有經(jīng)濟(jì)分析能力。論文(設(shè)計(jì))質(zhì)量1.立論是否正確,論述是否充分,結(jié)構(gòu)是否嚴(yán)謹(jǐn)合理;實(shí)驗(yàn)是否正確,設(shè)計(jì)、計(jì)算、分析處理是否科學(xué);技術(shù)用語是否準(zhǔn)確,符號(hào)是否統(tǒng)一,圖表圖紙是否完備、整潔、正確,引文是否規(guī)范;2.文字是否通順,有無觀點(diǎn)提煉,綜合概括能力如何;3.有無理論價(jià)值或?qū)嶋H應(yīng)用價(jià)值,有無創(chuàng)新之處。綜合評(píng)價(jià)論文選題綜合性較強(qiáng),基本符合機(jī)械專業(yè)培養(yǎng)目標(biāo)和要求;題目難度適中,與生產(chǎn)實(shí)際結(jié)合較緊密。論文作者具查閱文獻(xiàn)和綜合歸納資料的能力以及一定的設(shè)計(jì)能力尚可;綜合應(yīng)用本科所學(xué)知識(shí)的能力以及計(jì)算機(jī)能力一般;英文水平及應(yīng)用欠佳;方案設(shè)計(jì)時(shí)有一定的經(jīng)濟(jì)分析能力。論文立論正確,論述比較充分,整體結(jié)構(gòu)尚可,引文比較規(guī)范,設(shè)計(jì)與計(jì)算比較科學(xué),圖表圖紙比較完備,但不是十分正確。論文文字通順,但觀點(diǎn)提煉不足,綜合概括能力一般。論文用一定的實(shí)際應(yīng)用價(jià)值,但創(chuàng)新能力不是很強(qiáng)。評(píng)閱人: 2010 年 月 日湘潭大學(xué)興湘學(xué)院- 1 -基于單片機(jī)的數(shù)控車床 XY 工作臺(tái)與控制系統(tǒng)設(shè)計(jì)摘 要了解數(shù)控機(jī)床的概念,所謂數(shù)字控制是按照含有機(jī)床(刀具) 運(yùn)動(dòng)信息程序所指定的順序自動(dòng)執(zhí)行操作的過程。而計(jì)算機(jī)數(shù)控機(jī)床就是數(shù)控機(jī)床在計(jì)算機(jī)監(jiān)控下進(jìn)行工作。它的優(yōu)點(diǎn)很多,可以在同一機(jī)床上一次裝 夾可完成多個(gè)操作,生產(chǎn)率顯著提高等優(yōu)點(diǎn),但它的價(jià)格昂貴。由于我國(guó)現(xiàn)在使用的機(jī)床大多數(shù)為普通車床,自動(dòng)化程度低,要更新現(xiàn)有機(jī)床需要很多資金。為了解決這個(gè)問題,也為了適應(yīng)多品種中、小批量零件加工我們選擇機(jī)床經(jīng)濟(jì)型數(shù)控改造??v向進(jìn)給機(jī)構(gòu)的改造:拆去原機(jī)床的溜板箱、光 杠與絲杠以及安裝座,配上滾珠絲杠及相應(yīng)的安裝裝置,縱向驅(qū)動(dòng)的步進(jìn)電機(jī)及減速箱安裝在車床的床尾,不占據(jù)絲杠空間。橫向進(jìn)給機(jī)構(gòu)的改造:拆除橫向絲杠換上滾珠絲杠,由步進(jìn)電機(jī)帶動(dòng)。 關(guān)鍵詞:運(yùn)動(dòng)信息,滾珠絲杠,步進(jìn)電機(jī)Single Chip Microcomputer-based XY table CNC lathe and Control System DesignABSTRACTNumerical Control (NC) is any machining process in which the operations are executed automatically in sequences as specified by the program that contains the information for the tool movement .When Numerical Control is performed under computer supervision, it is called Computer Numerical Control (CNC).CNC machines have many advantages over conventional machines. For example, there is a possibility lf performing operations on the same machine in one setup and production is significantly increased. One of its disadvantages is that they are quite expensive. In our country conventional machine is used widely. So if the machines are replaced, there is going to need a large money. In order to agree with the development of our economy, we can reform the conventional machines. The reformation of the tool movement: we demolish the current smooth leading, leading screw and installing stand. Then replace the ball leaking to the relevant position. The reformation of the horizontal mechanism: we make the horizontal ball lead screw instead of the conventional screw. And Stepper motor drives the screw. KEY WORDS: tool movement,conventional machines ,Stepper motor湘潭大學(xué)興湘學(xué)院- 2 -第一章 緒論1.1 數(shù)控機(jī)床的生產(chǎn)與發(fā)展裝備工業(yè)的技術(shù)水平和現(xiàn)代化程度決定著整個(gè)國(guó)民經(jīng)濟(jì)的水平和現(xiàn)代化程度,數(shù)控技術(shù)及裝備是發(fā)展新興高新技術(shù)產(chǎn)業(yè)和尖端工業(yè)的使能技術(shù)和最基本的裝備,又是當(dāng)今先進(jìn)制造技術(shù)和裝備最核心的技術(shù)。數(shù)控技術(shù)是用數(shù)字信息對(duì)機(jī)械運(yùn)動(dòng)和工作過程進(jìn)行控制的技術(shù),而數(shù)控裝備是以數(shù)控技術(shù)為代表的新技術(shù)對(duì)傳統(tǒng)制造產(chǎn)業(yè)和新興制造業(yè)的滲透形成的機(jī)電一體化產(chǎn)品,其技術(shù)范圍覆蓋很多領(lǐng)域??茖W(xué)技術(shù)和社會(huì)生產(chǎn)的不斷發(fā)展,對(duì)機(jī)械產(chǎn)品的質(zhì)量和生產(chǎn)率提出了越來越高的要求。機(jī)械加工工藝過程的自動(dòng)化是實(shí)現(xiàn)上述要求的最重要措施之一。他不僅能夠提高產(chǎn)品的質(zhì)量和生產(chǎn)效率、降低生產(chǎn)成本,還能夠大大改善工人的勞動(dòng)條件。許多生產(chǎn)企業(yè)已經(jīng)采用了自動(dòng)機(jī)床、組合機(jī)床和專用自動(dòng)生產(chǎn)線。采用這種高度自動(dòng)化和高效率的設(shè)備,盡管需要很大的初始投資以及較長(zhǎng)的生產(chǎn)準(zhǔn)備時(shí)間,但是在大批量的生產(chǎn)條件下,由于分?jǐn)傇诿恳粋€(gè)工件上的費(fèi)用很少,經(jīng)濟(jì)效益仍然是非常顯著的。但是,在機(jī)械制造工業(yè)中并不是所有的產(chǎn)品零件都具有很大的批量,單件和小批量生產(chǎn)的零件占機(jī)械加工總量的 80%以上。尤其是在造船、航空航天、機(jī)床、重型機(jī)械以及國(guó)防部門,其生產(chǎn)特點(diǎn)是加工批量小、改型頻繁、零件的形狀復(fù)雜而且精度要求很高,采用專用化程度很高的自動(dòng)化機(jī)床加工這類零件就顯得很不合適,因?yàn)樯a(chǎn)過程中需要經(jīng)常改裝與調(diào)整設(shè)備,對(duì)于專用生產(chǎn)線來說,這種改裝與調(diào)整甚至是不可能實(shí)現(xiàn)的。為了解決這些問題,滿足多品種、小批量的自動(dòng)化生產(chǎn),迫切需要一種靈活的、通用的能夠適應(yīng)產(chǎn)品頻繁變化的柔性自動(dòng)化機(jī)床。數(shù)控機(jī)床就是在這樣的背景下產(chǎn)生與發(fā)展起來的。它極其有效地解決了上述一系列矛盾,為單件、小批量生產(chǎn)的精密復(fù)雜零件提供了自動(dòng)化加工手段。1.2 數(shù)控機(jī)床的發(fā)展趨勢(shì)隨著計(jì)算機(jī)、微電子、信息、自動(dòng)控制、精密檢測(cè)及機(jī)械制造技術(shù)的高速發(fā)展,機(jī)床數(shù)控技術(shù)有了長(zhǎng)足的進(jìn)步。近幾年一些相關(guān)技術(shù)的發(fā)展,如刀具及新材料的發(fā)展,主軸伺服和進(jìn)給伺服、超高速切削等技術(shù)的發(fā)展,以及對(duì)機(jī)械產(chǎn)品質(zhì)量的要求越來越高等,加速了數(shù)控機(jī)床的發(fā)展。目前數(shù)控機(jī)床正朝著高速度、高精度、高工序集中度、高復(fù)合化和高可靠性等方向發(fā)展。世界數(shù)控技術(shù)及其裝備發(fā)展趨勢(shì)主要體現(xiàn)在以下幾個(gè)方面:湘潭大學(xué)興湘學(xué)院- 3 -(1) .高速高效高精度(2) .柔性化(3) .工藝復(fù)合化和多軸化(4) .實(shí)時(shí)智能化(5) .結(jié)構(gòu)新型化(6) .編程技術(shù)自動(dòng)化(7) .集成化(8) .開放式閉環(huán)控制模式1.3 數(shù)控機(jī)床在先進(jìn)制造技術(shù)中的作用自從 20 世紀(jì)中期,人們將計(jì)算機(jī)技術(shù)引用到控制機(jī)床加工飛機(jī)機(jī)翼樣板的復(fù)雜曲線中以來,數(shù)控技術(shù)在機(jī)床控制方面取得了廣泛、深入的發(fā)展,各種數(shù)控機(jī)床成為了現(xiàn)代制造業(yè)的關(guān)鍵設(shè)備,是它們保證了現(xiàn)代制造業(yè)向高精度、高速度、高效率、高柔性化的方向發(fā)展。由于數(shù)控機(jī)床的出現(xiàn),帶動(dòng)了 CAD/CAM 技術(shù)向?qū)嵱没?、工程化發(fā)展,特別是計(jì)算機(jī)技術(shù)的迅速發(fā)展,推動(dòng) CAD/CAM 技術(shù)向更高層次和更高水平發(fā)展,而且進(jìn)一步發(fā)展了計(jì)算機(jī)輔助工藝設(shè)計(jì)(CAPP)數(shù)據(jù)庫(kù)、集成制造生產(chǎn)系統(tǒng)相關(guān)信息的自動(dòng)生成、自動(dòng)處理、自動(dòng)傳輸??梢哉f數(shù)控技術(shù)既是聯(lián)系 CAD/CAM的紐帶,也是進(jìn)一步通向集成化 CAD/CAM 的橋梁。1.4 對(duì)我國(guó)數(shù)控技術(shù)及其產(chǎn)業(yè)發(fā)展的基本估計(jì)我國(guó)數(shù)控技術(shù)起步于 1958 年 ,近 50 年的發(fā)展歷程大致可分為三個(gè)階段:第一階段從 1958 年到 1979 年 ,即封閉式發(fā)展階段。在此階段 ,由于國(guó)外的技術(shù)封鎖和我國(guó)的基礎(chǔ)條件的制 ,數(shù)控技術(shù)的發(fā)展較為緩慢。第二階段是在國(guó)家的“六五” 、 “七五”期間以及“八五”的前期 ,即引進(jìn)技術(shù) ,消化吸收 ,初步建立起國(guó)產(chǎn)化體系階段。在此階段 ,由于改革開放和國(guó)家的重視 ,以及研究開發(fā)環(huán)境和國(guó)際環(huán)境的改善 ,我國(guó)數(shù)控技術(shù)的研究、開發(fā)以及在產(chǎn)品的國(guó)產(chǎn)化方面都取得了長(zhǎng)足的進(jìn)步。第三階段是在國(guó)家的“八五”的后期和“九五”期間 ,即實(shí)施產(chǎn)業(yè)化的研究 ,進(jìn)入市場(chǎng)競(jìng)爭(zhēng)階段??v觀我國(guó)數(shù)控技術(shù)近 50 年的發(fā)展歷程 ,特別是經(jīng)過 4 個(gè) 5 年計(jì)劃的攻關(guān) ,總體來看取得的成績(jī)還是不小。1.5 畢業(yè)設(shè)計(jì)的目的、意義《機(jī)電一體化系統(tǒng)設(shè)計(jì)》畢業(yè)設(shè)計(jì)是培養(yǎng)學(xué)生設(shè)計(jì)能力的重要實(shí)踐性教學(xué)環(huán)節(jié)之一,是綜合運(yùn)用所學(xué)過的機(jī)械、電子、自動(dòng)控制、計(jì)算機(jī)等知識(shí)進(jìn)行的基本設(shè)計(jì)訓(xùn)練。其目的是:湘潭大學(xué)興湘學(xué)院- 4 -能夠正確運(yùn)用《機(jī)電一體化系統(tǒng)設(shè)計(jì)》課程的基本理論和相關(guān)知識(shí),掌握機(jī)電一體化系統(tǒng)(產(chǎn)品)的功能構(gòu)成、特點(diǎn)和設(shè)計(jì)思想、設(shè)計(jì)方法,了解設(shè)計(jì)方案的擬定、比較、分析和計(jì)算,培養(yǎng)學(xué)生分析問題和解決問題的能力,使學(xué)生具有機(jī)電一體化系統(tǒng)設(shè)計(jì)的初步能力;通過機(jī)械部分設(shè)計(jì),掌握機(jī)電一體化系統(tǒng)典型機(jī)械零部件和執(zhí)行元件的計(jì)算、選型和結(jié)構(gòu)設(shè)計(jì)方法和步驟;通過測(cè)試及控制系統(tǒng)方案設(shè)計(jì),掌握機(jī)電一體化系統(tǒng)控制系統(tǒng)的硬件組成、工作原理,和軟件編程思想;通過畢業(yè)設(shè)計(jì)提高學(xué)生應(yīng)用手冊(cè)、標(biāo)準(zhǔn)及編寫技術(shù)說明書的能力,促進(jìn)學(xué)生在科學(xué)態(tài)度、創(chuàng)新精神、專業(yè)技能等方面綜合素質(zhì)的提高。1.6 畢業(yè)設(shè)計(jì)的內(nèi)容畢業(yè)設(shè)計(jì)題目:基于單片機(jī)的數(shù)控車床 XY 工作臺(tái)與控制系統(tǒng)設(shè)計(jì)已知條件:定位精度:±0.01mm,滾珠絲杠及導(dǎo)軌使用壽命為 T=16000h,中等沖擊,工作臺(tái)的有效行程為 , ,快速進(jìn)給速度mLx40?y40, ,和工作載荷 。min/20maxv?in/2avy NFz190?湘潭大學(xué)興湘學(xué)院- 5 -第二章 數(shù)控系統(tǒng)總體方案的確定數(shù)控系統(tǒng)總體方案設(shè)計(jì)的內(nèi)容包括:系統(tǒng)運(yùn)動(dòng)方式的確定,執(zhí)行機(jī)構(gòu)及傳動(dòng)方案的確定,伺服電機(jī)類型及調(diào)速方案確定,計(jì)算機(jī)控制系統(tǒng)的選擇。進(jìn)行方案的分析、比較和論證。1.1 系統(tǒng)運(yùn)動(dòng)方式的確定該系統(tǒng)要求工作臺(tái)沿各坐標(biāo)軸的運(yùn)動(dòng)有精確的運(yùn)動(dòng)關(guān)系因此采用連續(xù)控制方式。1.2 伺服系統(tǒng)的選擇開環(huán)伺服系統(tǒng)在負(fù)載不大時(shí)多采用功率步進(jìn)電機(jī)作為伺服電機(jī)。開環(huán)控制系統(tǒng)由于沒有檢測(cè)反饋部件,因而不能糾正系統(tǒng)的傳動(dòng)誤差。但開環(huán)系統(tǒng)結(jié)構(gòu)簡(jiǎn)單,調(diào)整維修容易,在速度和精度要求不太高的場(chǎng)合得到廣泛應(yīng)用??紤]到運(yùn)動(dòng)精度要求不高,為簡(jiǎn)化結(jié)構(gòu),降低成本,宜采用步進(jìn)電機(jī)作為開環(huán)伺服系統(tǒng)驅(qū)動(dòng)。1.3 計(jì)算機(jī)系統(tǒng)的選擇采用 MCS-51 系列中的 8031 單片機(jī)擴(kuò)展控制系統(tǒng)。MCS-51 單片機(jī)的主要特點(diǎn)是集成度高,可靠性好,功能強(qiáng),速度快,性價(jià)比高。控制系統(tǒng)由微機(jī)部分、鍵盤及顯示器、I/O 接口及光電隔離電路、步進(jìn)功率放大電路等組成。系統(tǒng)的工作程序和控制命令通過鍵盤操作實(shí)現(xiàn)。顯示器采用數(shù)碼管顯示加工數(shù)據(jù)和工作狀態(tài)等信息。1.4 X—Y 工作臺(tái)的傳動(dòng)方式為保證一定的傳動(dòng)精度和平穩(wěn)性以及結(jié)構(gòu)的緊湊,采用滾珠絲杠螺母?jìng)鲃?dòng)副。為提高傳動(dòng)剛度和消除間隙,采用有預(yù)加載荷的結(jié)構(gòu)。由于工作臺(tái)的運(yùn)動(dòng)部件重量和工作載荷不大,故選用滾動(dòng)直線導(dǎo)軌副,從而減小工作臺(tái)的摩擦系數(shù),提高運(yùn)動(dòng)平穩(wěn)性。考慮電機(jī)步距角和絲杠導(dǎo)程只能按標(biāo)準(zhǔn)選取,為達(dá)到分辨率的要求,以及考慮步進(jìn)電機(jī)負(fù)載匹配,采用齒輪減速傳動(dòng)。系統(tǒng)總體框圖如下:湘潭大學(xué)興湘學(xué)院- 6 -圖 2-1計(jì)算機(jī)光電隔離 功率放大步進(jìn)電機(jī)X 向工作臺(tái)光電隔離 功率放大步進(jìn)電機(jī) Y 向工作臺(tái)湘潭大學(xué)興湘學(xué)院- 7 -第三章 機(jī)械部分設(shè)計(jì)機(jī)械部分設(shè)計(jì)內(nèi)容包括:確定系統(tǒng)脈沖當(dāng)量,運(yùn)動(dòng)部件慣性的計(jì)算,選擇步進(jìn)電機(jī),傳動(dòng)及導(dǎo)向元件的設(shè)計(jì)、計(jì)算與選擇,繪制機(jī)械部分裝配圖等。1.1 確定系統(tǒng)脈沖當(dāng)量脈沖當(dāng)量 δp 是一個(gè)進(jìn)給指令時(shí)工作臺(tái)的位移量,應(yīng)小于等于工作臺(tái)的位置精度,由于定位精度為±0.01mm 因此選擇脈沖當(dāng)量為 0.01mm。1.2 工作臺(tái)外形尺寸及重量初步估算根據(jù)給定的有效行程,畫出工作臺(tái)簡(jiǎn)圖,估算 X 向和 Y 向工作臺(tái)承載重量WX 和 WY。取 X 向?qū)к壷武撉虻闹行木酁?410mm,Y 向?qū)к壷武撉虻闹行木酁?00mm,設(shè)計(jì)工作臺(tái)簡(jiǎn)圖如下:X 向拖板(上拖板) 尺寸為: 50412?重量: NWx 8.6718.75041223?????Y 向拖板(下拖板) 尺寸為: 重量: x ..23上導(dǎo)軌(含電機(jī)) 重量: 97.4810.7)5082409 23???????夾具及工件重量:約 155NX-Y 工作臺(tái)運(yùn)動(dòng)部分總重量為:圖 3-1湘潭大學(xué)興湘學(xué)院- 8 -NW201597.482.65.71????1.3 滾動(dòng)導(dǎo)軌副的計(jì)算、選擇根據(jù)給定的工作載荷 Fz 和估算的 Wx 和 Wy 計(jì)算導(dǎo)軌的靜安全系數(shù)fSL=C0/P,式中:C0 為導(dǎo)軌的基本靜額定載荷,kN ;工作載荷 P=0.5(Fz+W); fSL=1.0~3.0(一般運(yùn)行狀況),3.0~5.0(運(yùn)動(dòng)時(shí)受沖擊、振動(dòng)) 。根據(jù)計(jì)算結(jié)果查有關(guān)資料初選導(dǎo)軌:因系統(tǒng)受中等沖擊,因此取 0.4?SLfYXSLoPfC,?)(5.0,,ZYWF?N79.1285).6719(5.0?Y 6. ??PfXSLO.43.284?CY根據(jù)計(jì)算額定靜載荷初選導(dǎo)軌,其型號(hào)為:HJG-D25?;緟?shù)如下:表 3-1額定載荷/N 靜態(tài)力矩/N*M 滑座重量導(dǎo)軌重量導(dǎo)軌長(zhǎng)度動(dòng)載荷 aC靜載荷 oATBCTgK/gmL(mm)17500 26000 198 198 288 0.60 3.1 760滑座個(gè)數(shù) 單向行程長(zhǎng)度 每分鐘往復(fù)次數(shù)M Sl n4 0.6 4導(dǎo)軌的額定動(dòng)載荷 NCa1750?依據(jù)使用速度 v(m/min)和初選導(dǎo)軌的基本動(dòng)額定載荷 驗(yàn)算導(dǎo)軌的工)(KNCo作壽命 T:額定行程長(zhǎng)度壽命: 3)(FfKaWCTHS?475190MFZ湘潭大學(xué)興湘學(xué)院- 9 -1?Tf2W8.0CfH5?OdRK kmFCfTaWTHS 53.1609)47528.01(5)( 33 ??導(dǎo)軌的額定工作時(shí)間壽命: nlSH2103?? hThlTS 16057634046.1933 ????導(dǎo)軌的工作壽命足夠。1.4 滾珠絲杠計(jì)算、選擇初選絲杠材質(zhì):CrWMn 鋼,HRC58~60,導(dǎo)程: ml50?強(qiáng)度計(jì)算:絲杠軸向力: )((,,max NWFfKFyxzyx??其中:K=1.15,滾動(dòng)導(dǎo)軌摩擦系數(shù) f=0.003~0005;在車床車削外圓時(shí):Fx=(0.1~0.6)Fz,F(xiàn)y=(0.15~0.7)Fz,可取 Fx=0.5Fz,F(xiàn)y=0.6Fz 計(jì)算。取 f=0.004, 則:40zFZX951.5.???NY6N786.102).670(..max ???340壽命值: ,其中絲杠轉(zhuǎn)速61nTL?min)/(axrlvnohT0min/4052maxrlvno??38160?L湘潭大學(xué)興湘學(xué)院- 10 -最大動(dòng)載荷: FfLQWH3?式中:fW 為載荷系數(shù),中等沖擊時(shí)為 1.2~1.5;fH 為硬度系數(shù),HRC≥58 時(shí)為1.0。查表得中等沖擊時(shí) , 則:2.1f?HfNX 70.9680.384??QY 35.3根據(jù)使用情況選擇滾珠絲杠螺母的結(jié)構(gòu)形式,并根據(jù)最大動(dòng)載荷的數(shù)值可選擇滾珠絲杠的型號(hào)為::CM 系列滾珠絲桿副,其型號(hào)為:CM2005-5 。其基本參數(shù)如下:表 3-2公稱直徑 基本導(dǎo)程 絲杠外徑 絲杠底徑 循環(huán)圈數(shù)絲杠代號(hào)D0 Ph D1 D3 nCM2005-5 20 5 19.5 16.76 5額定載荷 剛度 螺母安裝尺寸動(dòng)載荷 靜載荷 K D L B14205 38244 730 70 62 11螺母安裝尺寸 油杯孔D1 D4 1?2h M45 56 5.8 10 6 M6其額定動(dòng)載荷為 14205N>Qy 足夠用。滾珠循環(huán)方式為外循環(huán)螺旋槽式,預(yù)緊方式采用雙螺母螺紋預(yù)緊形式。滾珠絲杠螺母副的幾何參數(shù)的計(jì)算如下表湘潭大學(xué)興湘學(xué)院- 11 -表 3-3名稱 計(jì)算公式 結(jié)果公稱直徑 0d―― 20mm螺距 t ―― 5mm接觸角 ?―― 045鋼球直徑 bd―― 3.175mm螺紋滾道法向半徑 R0.52bd?1.651mm偏心距 e()sine???0.04489mm螺紋升角 ?0tarcgd???0'43螺桿外徑 d(.2~5)b?19.365mm螺桿內(nèi)徑 110eR??16.788mm螺桿接觸直徑 2d2cosbd?17.755mm螺母螺紋外徑 D0e?23.212mm螺母內(nèi)徑(外循環(huán)) 1(.~25)bd??20.7mm傳動(dòng)效率計(jì)算絲杠螺母副的傳動(dòng)效率為: )(????gt式中: 為摩擦角; 為絲杠螺旋升角。'10o??'34o?96.0)34()('''??oggtt??穩(wěn)定性驗(yàn)算絲杠兩端采用止推軸承時(shí)不需要穩(wěn)定性驗(yàn)算。剛度驗(yàn)算湘潭大學(xué)興湘學(xué)院- 12 -滾珠絲杠受工作負(fù)載引起的導(dǎo)程變化量為: ESFlL01???Y 向所受牽引力大,故用 Y 向參數(shù)計(jì)算NF21.3?cml50)/(6.2E?cmRS14.5.42??L661 09.0.3?????絲杠受扭矩引起的導(dǎo)程變化量很小,可忽略不計(jì)。導(dǎo)程變形總誤差 Δ 為][/.251 ????E 級(jí)精度絲杠允許的螺距誤差 。m/15??1.5 齒輪計(jì)算、設(shè)計(jì)因步進(jìn)電機(jī)步距角 滾珠絲杠螺距 t=5mm,要實(shí)現(xiàn)脈沖當(dāng)量ob.?,在傳動(dòng)系統(tǒng)中應(yīng)加一對(duì)齒輪降速傳動(dòng)。stepmp/01.??齒輪傳動(dòng)比: ,步進(jìn)電機(jī)步距角:pbli?360stepob/5.1??8.21.5360???pbli??12Zi取小齒輪齒數(shù) ,則大齒輪齒數(shù)241?502?Z大小齒輪材料均為 45 鋼由于軟齒面齒輪工藝簡(jiǎn)單、生產(chǎn)率高,故選擇軟齒面齒輪。因傳遞的扭距較小,取模數(shù) m=1mm 則:分度圓直徑: 124dmz?? 250?齒頂圓直徑: 1()()126a m?2 5z齒根圓直徑: 1.4..fd??2(5)(0)47??湘潭大學(xué)興湘學(xué)院- 13 -齒寬: 124dbm??? 取 125b?30 中心距: 0.5()0.5()7a??分度圓壓力角: ?大小齒輪均采用漸開線標(biāo)準(zhǔn)圓柱齒輪1.6 步進(jìn)電機(jī)慣性負(fù)載的計(jì)算以及步進(jìn)電機(jī)的選用根據(jù)等效轉(zhuǎn)動(dòng)慣量的計(jì)算公式,有:(1)等效轉(zhuǎn)動(dòng)慣量的計(jì)算折算到步進(jìn)電機(jī)軸上的等效負(fù)載轉(zhuǎn)動(dòng)慣量為: 23210 )180()()bpq MJZJ??????式中: q為折算到電機(jī)軸上的慣性負(fù)載; 0J為步進(jìn)電機(jī)軸的轉(zhuǎn)動(dòng)慣量; 1J為齒輪 1 的轉(zhuǎn)動(dòng)慣量;2J為齒輪 2 的轉(zhuǎn)動(dòng)慣量; 3J為滾珠絲杠的轉(zhuǎn)動(dòng)慣量;M 為移動(dòng)部件的質(zhì)量。對(duì)鋼材料的圓柱零件可以按照下式進(jìn)行估算: LD???43078.式中 為圓柱零件直徑, 為圓柱零件的長(zhǎng)度。所以有: 22431 /107.652.. cmkgJ ???2078???22433 /..電機(jī)軸的轉(zhuǎn)動(dòng)慣量很小,可以忽略,所以有: 22222 /79.0)5.1843(01)4.375.16()017.6 cmkgJd ???????????(2)步進(jìn)電機(jī)啟動(dòng)力矩的計(jì)算設(shè)步進(jìn)電機(jī)的等效負(fù)載力矩為 T,負(fù)載力為 P,根據(jù)能量守恒原理,電機(jī)所做的功與負(fù)載力所做的功有如下的關(guān)系: PST???式中 為電機(jī)轉(zhuǎn)角,S 為移動(dòng)部件的相應(yīng)位移, 為機(jī)械傳動(dòng)的效率。若取?,則 ,且 。所以:b?p?)(zsPG???bzsp???2)]([36??湘潭大學(xué)興湘學(xué)院- 14 -式中: 為移動(dòng)部件負(fù)載(N) ,G 為移動(dòng)部件質(zhì)量(N) , 為與重力方向一sP zP致的作用在移動(dòng)部件上的負(fù)載力(N) , 為導(dǎo)軌摩擦系數(shù), 為步進(jìn)電機(jī)的步?b?距角(rad),T 為電機(jī)軸負(fù)載力矩( N.cm) 。取 (淬火鋼滾珠導(dǎo)軌的摩擦系數(shù)) , , ???.0?? 8.0??NHs21.3?慮到重力影響,Y 向電機(jī)負(fù)載較大,所以有: cmNT ????56.8.0514.2)]12(3[1.6考慮到啟動(dòng)時(shí)運(yùn)動(dòng)部件慣性的影響,則啟動(dòng)轉(zhuǎn)矩: 5.0~3q?取系數(shù)為 0.4,則: cNTq??4.17.0568對(duì)于工作方式為三相 6 拍的步進(jìn)電機(jī): cmTqj ??92.178.0max(3)步進(jìn)電機(jī)的最高工作頻率 1670.60maxa?pvf?空載啟動(dòng)頻率要大于最高運(yùn)行頻率 ,同時(shí)電機(jī)最大靜轉(zhuǎn)矩要足夠大,查表maxf選擇兩個(gè) 90BF001 型步進(jìn)電機(jī)。電機(jī)有關(guān)參數(shù)如下:表 3-4主要技術(shù)參數(shù)型號(hào)相數(shù)步距角電壓(V)相電流(A)最大靜轉(zhuǎn)矩 maxjT(n.m)空載啟動(dòng)頻率空載運(yùn)行頻率分配方式90BF001 4 0.9 80 7 3.92 2000 8000 4 相 8 拍外形尺寸(mm)外直徑 長(zhǎng)度 軸直徑重量kg轉(zhuǎn)子轉(zhuǎn)動(dòng)慣量Kg.m90 145 9 4.5 1764湘潭大學(xué)興湘學(xué)院- 15 -第四章 數(shù)控系統(tǒng)硬件電路設(shè)計(jì)1.1 數(shù)控系統(tǒng)的硬件電路由以下幾部分組成:1、主控制器。即中央處理單元 CPU2、總線。包括數(shù)據(jù)總線,地址總線,控制總線。3、存儲(chǔ)器。包括只讀可編程序存儲(chǔ)器和隨機(jī)讀寫數(shù)據(jù)存儲(chǔ)器。4、接口。即 I/O 輸入輸出接口。數(shù)控系統(tǒng)的硬件框圖如下所示:圖 4-11.2 主控制器 CPU 的選擇MCS-51 系列單片機(jī)是集中 CPU,它有如下特點(diǎn):1、可靠性高。因?yàn)樾酒前垂I(yè)測(cè)控環(huán)境要求設(shè)計(jì)的,故抗干擾的能力優(yōu)于 PC 機(jī)。系中央處理單元 CPU存儲(chǔ)器RAMROM輸入/輸出I/O 接口信號(hào)變換控制對(duì)象外設(shè):鍵盤,顯示器,打印機(jī),磁盤機(jī),通訊接口等湘潭大學(xué)興湘學(xué)院- 16 -統(tǒng)軟件(如:程序指令,常數(shù),表格)固化在 ROM 中,不易受病毒破壞。許多信號(hào)的通道均在一個(gè)芯片內(nèi),故運(yùn)作時(shí)系統(tǒng)穩(wěn)定可靠。2、便于擴(kuò)展。片內(nèi)具有計(jì)算機(jī)正常運(yùn)行所必需的部件,片外有很多供擴(kuò)展用的(總線,并行和串行的輸入/輸出)管腳,很容易組成一定規(guī)模的計(jì)算機(jī)應(yīng)用系統(tǒng)。3、控制功能強(qiáng)。具有豐富的控制指令,如:條件分支轉(zhuǎn)移指令,I/O 口的邏輯操作指令,位處理指令。4、實(shí)用性好。體積小,功耗低,價(jià)格便宜,易于產(chǎn)品化。由于上述原因,選用 8031 作為主控芯片。1.3 存儲(chǔ)器擴(kuò)展電路設(shè)計(jì)1、程序存儲(chǔ)器的擴(kuò)展單片機(jī)應(yīng)用系統(tǒng)中擴(kuò)展用的程序存儲(chǔ)器芯片大多采用 EPROM 芯片。其型號(hào)有:2716,2732,2764,27128,27258,其容量分別為2k,4k,8k,16k,32k。在選擇芯片時(shí)要考慮 CPU 與 EPROM 時(shí)序的匹配。8031 所能讀取的時(shí)間必須大于 EPROM 所要求的讀取時(shí)間。此外,還需要考慮最大讀出速度,工作溫度以及存儲(chǔ)器容量等因素。在滿足容量要求時(shí),盡量選擇大容量芯片,以減少芯片數(shù)量以簡(jiǎn)化系統(tǒng)。綜合以上因素,選擇 2764 芯片作為本次設(shè)計(jì)的程序存儲(chǔ)器擴(kuò)展用芯片。于 8031 芯片的 P0 口是分時(shí)傳送低 8 位地址線和數(shù)據(jù)線的,故 8031 擴(kuò)展系統(tǒng)中一定要有地址鎖存器,常用的地址鎖存器芯片是 74LS373。2、數(shù)據(jù)存儲(chǔ)器的擴(kuò)展由于 8031 芯片內(nèi)部 RAM 只有 128 字節(jié)供用戶使用,遠(yuǎn)不能滿足系統(tǒng)需要,因此需要擴(kuò)展片外的數(shù)據(jù)存儲(chǔ)器(RAM) 。常用的數(shù)據(jù)存儲(chǔ)器有6116、6264、62128 等,這里選用 6264。3、I/O 擴(kuò)展電路設(shè)計(jì)8031 單片機(jī)共有 4 個(gè) 8 位并行 I/O 接口,但供用戶使用的只有 P1 口及部分 P3 口線。因此要進(jìn)行 I/O 口的擴(kuò)展。8155 為多功能的可編程接口芯片,內(nèi)部包含有 256 字節(jié) RAM,兩個(gè)可編程 8 位并行口、一個(gè) 6 位并行口和一個(gè) 14位的計(jì)數(shù)器。8155 是 8051 單片機(jī)應(yīng)用系統(tǒng)中最適用的外圍器件。數(shù)據(jù)存貯器是 256x8 位靜態(tài) RAM。I/O 由三個(gè)通用口組成,其中的 6 位口可編程為狀態(tài)控制信號(hào)??删幊痰?14 位計(jì)數(shù)器/定時(shí)器用于給單片機(jī)系統(tǒng)提供方波或計(jì)數(shù)脈沖。8155 與微機(jī)接口較簡(jiǎn)單,是微機(jī)系統(tǒng)廣泛使用的接口芯片。湘潭大學(xué)興湘學(xué)院- 17 -第五章 系統(tǒng)控制軟件的設(shè)計(jì)1.1 系統(tǒng)控制功能分析數(shù)控 X-Y 工作臺(tái)的控制功能包括:1、系統(tǒng)初始化。如對(duì) I/O 接口 8155,8255A 進(jìn)行必要的初始化工作,預(yù)置接口工作方式控制字。2、工作臺(tái)復(fù)位。開機(jī)后工作臺(tái)應(yīng)該自動(dòng)復(fù)位,亦可手動(dòng)復(fù)位。3、輸入和顯示加工程序。4、監(jiān)視按鍵,鍵盤及開關(guān)。如監(jiān)視緊急停機(jī)鍵及行程開關(guān),鍵盤掃描等功能。5、工作臺(tái)超程顯示與處理。工作臺(tái)位移超過規(guī)定值時(shí)應(yīng)該立即停止工作臺(tái)的運(yùn)動(dòng),并顯示相應(yīng)的指示字符。6、工作臺(tái)的自動(dòng)控制。7、工作臺(tái)的手動(dòng)控制。8、工作臺(tái)的聯(lián)動(dòng)控制。1.2 系統(tǒng)管理程序控制管理稱許是系統(tǒng)的主程序,開機(jī)后即進(jìn)入管理程序。其主要功能是接受和執(zhí)行操作者的命令。在設(shè)計(jì)管理程序時(shí),應(yīng)確定接收命令的形式,系統(tǒng)的各種操作功能等。數(shù)控 X-Y 工作臺(tái)的基本操作功能有:輸入加工程序,自動(dòng)加工,刀位控制,工作臺(tái)位置控制,手動(dòng)操作,緊急停機(jī)等。根據(jù)以上分析,設(shè)計(jì)管理程序流程圖如下所示:湘潭大學(xué)興湘學(xué)院- 18 -加工程序輸入鍵按下機(jī)床復(fù)位開始系統(tǒng)初始化自動(dòng)加工鍵按下手動(dòng)加工鍵按下加工數(shù)據(jù)輸入自動(dòng)加工手動(dòng)調(diào)整NNNYYY圖 5-11.3 自動(dòng)加工程序設(shè)計(jì)(1)機(jī)床在自動(dòng)加工時(shí)的動(dòng)作順序:工作臺(tái)移動(dòng)到位→刀具快速進(jìn)給→加工→退刀→工作臺(tái)運(yùn)動(dòng)到下一位置;(2)計(jì)算機(jī)在加工過程中的操作:讀取刀具軌跡,控制機(jī)床完成加工;(3)由以上分析,設(shè)計(jì)自動(dòng)加工程序框圖如下所示:湘潭大學(xué)興湘學(xué)院- 19 -入口零件坐標(biāo)地址指針讀零件坐標(biāo)調(diào)步進(jìn)電機(jī)子程序工作臺(tái)移動(dòng)到位刀具快進(jìn)加工快速退刀零件坐標(biāo)地址指針加一零件加工完成NY返回圖 5-21.4 匯編語言程序設(shè)計(jì)1、內(nèi)存地址分配加速脈沖數(shù)計(jì)數(shù)器 N0 地址設(shè)為 20H;恒速脈沖數(shù)計(jì)數(shù)器 N1 低 8 位字節(jié)地址為 21H,高 8 位字節(jié)地址位 22H;減速脈沖數(shù)計(jì)數(shù)器 N2 地址位 23H。加速,減速,恒速脈沖總數(shù)寄存器 N 低位字節(jié)地址位 24H,高位字節(jié)地址位 25H;步湘潭大學(xué)興湘學(xué)院- 20 -進(jìn)電機(jī)進(jìn)給控制子程序 FEED 首地址位 0E80H。每調(diào)用一次該程序,步進(jìn)電機(jī)按規(guī)定方向進(jìn)給一步。2、程序清單N0 EQU 20H ;加速N1L EQU 21H ;恒速N1H EQU 22H N2 EQU 23H ;減速NL EQU 24H ;脈沖總數(shù)寄存器NH EQU 25HDS EQU 26H ;地址指針偏移量FEED EQU 0E80HORG 0E00H0E00 START: MOV P,#60H0E03 MOV TMOD,#01H ;設(shè)計(jì)數(shù)器工作方式為 1,16位定時(shí)器0E06 MOV N0,#01A4H ;設(shè) N0 為 3200E09 MOV N2, #1A4H0E0C MOV A , N0 ;計(jì)算 2XN00E0E RL A0E0F MOV R0, A0E10 CLR C ;計(jì)算 N1=N-2N00E11 MOV A, NL0E13 SUBB A, R00E14 MOV N1L, A0E16 MOV A, NH0E18 SUBB A,#00H0E1A MOV N1H,A0E1C MOV DPTR, #1000H ;設(shè)時(shí)間常數(shù)指針初值為1000H0E1F MOV DS, #00H ;設(shè)地址偏移量初值為 00H0E22 MOVC A, @A+DPTR ;從 EPROM 中讀時(shí)間常數(shù)0E23 MOV TL0, A ;送時(shí)間常數(shù)至定時(shí)器 0 中0E25 INC DS0E27 MOV A,DS湘潭大學(xué)興湘學(xué)院- 21 -0E2 MOVC A,@A+DPTR 0E2A MOV TH0,A0E2C INC DS0E2E SETB EA ;開中斷允許0E30 SETB ET0 ;允許定時(shí)器 0 中斷0E32 SETB TR0 ;啟動(dòng)定時(shí)器 0 開始計(jì)算0E34 WAIT:JB EA,WAIT ;中斷允許返回0E37 RET中斷服務(wù)程序: ORG 000BH000B LJMP 0F00H0F00 MOVC A,@A+DPTR0F03 MOV TL0, A0F05 INC DS0F07 MOV A,DS0F09 MOVC A,@A+DPTR0F0A MOV TH0, A0F0C INC DS ;修改地址偏移量指針0F0E ACALL FEED ;調(diào) FEED 子程序0F10 MOV A, N0 ;判斷 N0 是否為 00F12 CJNE A, #00H, LOOP10F15 MOV A, N1H ;判斷 N1 是否為 0 0F17 CJNE A,#00H, LOOP20F1A MOV A,N1H0F1C CJNE A,#00H ,LOOP20F1F MOV A,N2 ;判斷 N2 是否為 0 0F21 CJNE A,#00H,LOOP30F24 CLR EA ;N2 為 0 ,減速結(jié)束,關(guān)中斷0F26 RETI0F27 LOOP1:DEC N0 ;N0 不為 0,則 N0←N0-10F29 RETI0F2A LOOP2:MOV A,N1L ;N1 不為 0,則 N1←N1-10F2C CLR C0F2D SUBB A, #01H0F2F MOV N1L, A湘潭大學(xué)興湘學(xué)院- 22 -0F31 MOV A, N1H0F33 SUBB A,#00H0F35 MOV N1H,A0F37 RETI0F38 LOOP3:DEC N2 ;N2 不為 0,則 N2←N2-10F3A RETI逐點(diǎn)比較法插補(bǔ)程序:RP: MOV SP,#60HMOV 4AH,#00H ;F 單元清零MOV 49H,#00HMOV 48H,#01H ;X 電動(dòng)機(jī)初始化MOV 47H,#02H ;Y 電動(dòng)機(jī)初始化MOV DPTR, #0030HMOV A ,#03H ;XY 電動(dòng)機(jī)上電MOVX @DPTR,ACLR C ;計(jì)算終判值MOV A,52H ;低位 X、Xe 相減,得 aSUBB A,4EHMOV 54H,A ;保存結(jié)果于終判值單元低位字節(jié)MOV A ,51H ;高位 X、Xe 相減,得 bSUBB A,4DHMOV 53H,A ;保存結(jié)果于終判值單元高位字節(jié)CLR C ;低位 Ye、Y 相減,得 cMOV A,4CHSUBB A,50HMOV 20H,C ;暫存 Ye、Y 低位相減產(chǎn)生的借位位ADD A,54H ;計(jì)算 d=a+c,d 為低位終判值MOV 54H,A ;保存 d 于終判值單元低位字節(jié)MOV 21H,C ;暫存 d=a+c 產(chǎn)生的進(jìn)位位MOV A,4BH湘潭大學(xué)興湘學(xué)院- 23 -MOV C,20H ;恢復(fù) Ye、Y 低位相減產(chǎn)生的借位位SUBB A,4FH ;高位 Ye、Y 相減,得 eMOV C,21H ;恢復(fù) d=a+c 產(chǎn)生的進(jìn)位位ADDC A,53H ;計(jì)算 f=b+e,f 為高位終判值MOV 53H,A ;保存 f 于終判值單元高位字節(jié)PR2:ACALL DL0 ;延時(shí)子程序MOV A,49H ;取 F 高位字節(jié)JB ACC.7,RP6 ;高位=1,F(xiàn)<0,去 RP6ACALL XMM ;高位=0,F(xiàn)>0,X 反轉(zhuǎn)一步CLR C ;計(jì)算新偏差 F=F-2X +1MOV A,4AH ;計(jì)算 g=F-X 低位SUBB A,52HXCH A,B ;g 存入 B 寄存器MOV A,49H ;計(jì)算 h=F-X 高位SUBB A,51HXCH A,B ;低位存 A,高位存 B。BA 內(nèi)容為 F-XCLR C ;計(jì)算 i=g-X=F -2X 低位SUBB A,52HXCH A,B ;B 內(nèi)容為 F-2X 低位,A 內(nèi)容為 F-X 高位SUBB A,51H ;A 內(nèi)容為 F-2X 高位XCH A,B ;BA 內(nèi)容為 F-2XADD A,#01H ;計(jì)算 F-2X+1MOV 4AH,A ;4A 內(nèi)容為 F-2X+1 低位XCH A,B ;B 內(nèi)容為 F-2X +1 低位,A內(nèi)容為 F-2X 高位ADDC A,#00H ;考慮 F-2X+1 的進(jìn)位MOV 49H,A ;49H 的內(nèi)容為 F- 2X+1 高位CLR C ;計(jì)算 X=X-1MOV A,52H ;低位SUBB A,#01H湘潭大學(xué)興湘學(xué)院- 24 -MOV 52H,AMOV A,51H ;高位SUBB A,#00HMOV 51H,ARP4:CLR C ;終判值減1MOV A,54HSUBB A,#01HMOV 54H,AMOV A,53HSUBB A,#00HMOV 53H,AORL A,54HJNZ RP2 ;插補(bǔ)沒結(jié)束,轉(zhuǎn)至 RP2LJMP 0000HRP6:ACALL YMP ;Y 電動(dòng)機(jī)正轉(zhuǎn)MOV R6,#02H ;此處“ 2”,為“F+2Y+1”的“2”RP7:MOV A,4AH ;F +2Y+1ADD A,50HMOV 4AH,AMOV A,49HADDC A,4FHMOV 49H,ADJNZ R6,RP7MOV A,4AHADD A,#01HMOV 4AH,AMOV A,49HADDC A,#00HMOV A,50HADD A,#01HMOV 50H,AMOV A,4FHADDC A,#00H湘潭大學(xué)興湘學(xué)院- 25 -MOV 4FH, AAJMP RP4第六章 結(jié)束語與致謝通過過此次設(shè)計(jì),讓我對(duì)于理論知識(shí)尤其是專業(yè)知識(shí)有了更深的了解和認(rèn)識(shí),并能將其進(jìn)行一次比較全面系統(tǒng)的總結(jié)和應(yīng)用;使我學(xué)會(huì)了如何查閱現(xiàn)有的技術(shù)資料、如何舉一反三、如何通過改進(jìn)并加入自己的想法與觀點(diǎn),使之成為自己的東西。進(jìn)一步加強(qiáng)了我綜合分析解決實(shí)際問題和獨(dú)立思考的能力。在這次設(shè)計(jì)中我們同組的同學(xué)共同的研究,討論問題,查閱資料,相互幫助,從實(shí)際應(yīng)用出發(fā)將設(shè)計(jì)完成的比較合理且具有實(shí)際的意義。同時(shí),我們也發(fā)現(xiàn)了一些問題。比如對(duì)知識(shí)的運(yùn)用的熟練程度還不夠,知識(shí)范圍比較的狹隘,導(dǎo)致在設(shè)計(jì)中的一些問題無法及時(shí)發(fā)現(xiàn)和解決。在此,我向我的指導(dǎo)老師劉習(xí)文老師表示由衷的感謝,感謝他的指導(dǎo)與監(jiān)督。其次我要感謝那些曾經(jīng)給予我?guī)椭耐瑢W(xué)們。最后我還要感謝大學(xué)里我所有的任課老師,感謝他們?yōu)槲覀鞯澜饣蟆O嫣洞髮W(xué)興湘學(xué)院- 26 -參 考 文 獻(xiàn)[1] 徐元昌.?dāng)?shù)控技術(shù)[M].北京:中國(guó)輕工業(yè)出版社, 2004.[2] 文懷興,廈田.?dāng)?shù)控機(jī)床系統(tǒng)設(shè)計(jì)[M] .北京:化學(xué)工業(yè)出版社, 2005.[3] 王潤(rùn)孝,秦現(xiàn)生.機(jī)床數(shù)控原理與系統(tǒng)[M] .西安:西北工業(yè)大學(xué)出版社, 2004.[4] 徐元昌.機(jī)電系統(tǒng)設(shè)計(jì)[M] .北京:化學(xué)工業(yè)出版社, 2005.[5] 鄭文緯,吳克堅(jiān).機(jī)械原理[M] .北京:高等教育出版社, 1997.[6] 周開勤.機(jī)械零件手冊(cè)[M] .北京:高等教育出版社, 2001.[7] 陳嬋娟.?dāng)?shù)控車床系統(tǒng)[M] .北京:化學(xué)工業(yè)出版社, 2005.[8] 成大先.機(jī)械設(shè)計(jì)手冊(cè)[M] .北京:化學(xué)工業(yè)出版社, 1992.[9] 濮良貴,紀(jì)名剛.機(jī)械設(shè)計(jì)[M] .北京:高等教育出版社, 2005.[10] 李光斌.單片微型計(jì)算機(jī)原理與應(yīng)用[M].武漢:華中科技大學(xué)出版社, 2006.[11] 杜國(guó)臣,王士軍.機(jī)床數(shù)控技術(shù)[M].北京:北京大學(xué)出版社, 2006.[12] 張建民.機(jī)電一體化系統(tǒng)設(shè)計(jì)[M].北京:高等教育出版社, 2007.[13] 鄭堤,唐可洪.機(jī)電一體化設(shè)計(jì)基礎(chǔ)[M].北京:機(jī)械工業(yè)出版社, 1997.[14] 張訓(xùn)文.機(jī)電一體化系統(tǒng)設(shè)計(jì)與應(yīng)用[M].北京:北京理工大學(xué)出版社, 2006.[15] 唐介.電機(jī)與拖動(dòng)[M].北京:高等教育出版社, 2005.[16] 趙丁選.機(jī)電一體化使用手冊(cè)[M].北京:化學(xué)工業(yè)出版社社, 2003.[17] 汪道輝.單片機(jī)系統(tǒng)設(shè)計(jì)與實(shí)踐[M].北京:電子工業(yè)出版社, 2006.[18] 張大明,彭旭昀.單片微機(jī)控制應(yīng)用技術(shù)[M].北京:機(jī)械工業(yè)出版社,2006.
收藏