Abstract: According to the shortcomings of the existing conventional CA6140 general lathes, a numerically-controlled conversion scheme and a single-chip microcomputer system design are proposed to improve the machining accuracy and expand the scope of use of the machine tool, and to increase productivity. This paper describes the design process of the CNC turning of the ordinary lathe, and introduces the design of the CA6140 mechanical transformation part and the design of the CNC system in detail. The 8031 ​​CPU is used as the control system to process the signal. The I/O interface outputs the stepping pulse. After the gear is decelerated by the first gear, the scroll screw is rotated to achieve vertical and horizontal feed motion.
Keywords: CNC machine tool, single-chip CNC system, retrofit design
I. Overview
Machine tools as an important basic equipment for the machinery manufacturing industry, its development has attracted people's attention. Due to the rise of computer technology, a qualitative breakthrough in the control information of the machine tools has emerged, resulting in a new generation of machine tools using digital technology for flexible automation control - The birth and development of CNC machine tools. The emergence and application of computers provide an ideal means for humans to automate the mechanical processing process. With the development of computers, CNC machine tools have also been rapidly developed and widely used. At the same time, people have fundamentally changed the concept of traditional machine tool transmission and structure. CNC machine tools have attracted worldwide attention for their excellent performance and precision, agile and diversified functions, and created a precedent for mechanical and electrical integration. CNC machine tool is a mechatronic product that realizes machine tool control with digital information. It controls the relative position between the tool and the workpiece, start and stop of the machine motor, spindle speed change, workpiece release and clamping, tool selection, cooling pump Various operations and sequential operations such as start and stop are recorded on the control medium using coded numbers, and then the digital information is sent to a numerical control device or a computer. After decoding, calculation, and issuing various instructions to control the machine servo system or other The actuators process the required workpieces.
Compared with ordinary machine tools, CNC machine tools mainly have the following advantages:
1. Adaptability, suitable for processing single pieces or small batches of complex workpieces; when changing the processing of workpieces on the CNC machine tool, only need to re-program the new workpiece processing program, you can achieve new workpiece processing.
2. High processing precision
3. High production efficiency
4. Reduce labor intensity and improve working conditions;
5. Good economic benefits;
6. Facilitate the modernization of production management.
CNC machine tools have become the mainstream products in China's market demand, and the demand has been increasing year by year. In recent years, China's CNC machine tools have made remarkable progress in industrialization and product development, especially in terms of high-speed, multi-axis, composite, and precision of machine tools. However, compared with the similar products of advanced countries, domestic CNC machine tools still have gaps and cannot meet the needs of national construction. China is a big machine tool country with more than three million ordinary machine tools. However, the quality of the machine tools is poor, and the performance is backward. The average output value of a single machine tool is only about 1/10 that of advanced industrial countries, and the gap is too great to be transformed. The transformation of the old CNC machine tools, as the name suggests, is to add microcomputer control devices to ordinary machine tools, so that it has a certain degree of automation capabilities, in order to achieve the desired processing process goals. With the increasing popularity of CNC machine tools, the technical and economic benefits of CNC machine tools are understood by everyone. In the technological transformation of domestic factories, the computer numerical control transformation of machine tools has become an important aspect. Many factories have used CNC, digital display, and PC technology to transform common machine tools while acquiring CNC machine tools, and have achieved good economic benefits.
China's economic resources are limited, the country is large, and the machine tools require large quantities, so it is impossible to purchase considerable amounts of new CNC machine tools. However, there are many old machine tools in China, and the use of economical CNC systems to transform ordinary machine tools has resulted in low investment. Next, it can not only meet the needs of processing, but also improve the degree of automation of the machine tool, more in line with China's national conditions. In 1984, China began to produce economical numerical control systems and used them to transform old machine tools. So far, many manufacturers have produced economical CNC systems. It can be expected that in the future, economical CNC transformation of machine tools will be rapidly developed and popularized. So, this graduation design example is typical and practical.
Second, the overall program design
2.1 Design tasks
The design task is to carry out numerical control transformation of the CA6140 ordinary lathe. Open-loop control of vertical and horizontal feed systems using a microcomputer, longitudinal (Z-direction) pulse equivalent 0.01mm/pulse, transverse (X-direction) pulse equivalent 0.005mm/pulse, stepper motor drive components, transmission system Ball screw, knife holder with automatic indexing tool holder.
2.2 Argumentation of the overall plan
For the economical numerical control transformation of ordinary machine tools, when determining the overall design plan, it should be considered that under the premise of meeting the design requirements, changes to the machine tools should be as small as possible to reduce costs.
1) The determination of the numerical control system's movement mode The numerical control system can be divided into point control system, point position linear control system and continuous control system according to the movement mode. Because the CA6140 lathe is required to process complex contour parts, the microcomputer numerical control system adopts a two-axis linkage continuous control system.
2) Reformation of servo feed system The servo feed system of CNC machine tools is divided into open loop, semi-closed loop and closed loop. Open-loop control has the advantages of simple structure, easy design and manufacturing, good control accuracy, easy debugging, low price, convenient use and maintenance. Therefore, the design decided to use an open-loop control system.
3) The hardware circuit design of the numerical control system Any numerical control system is made up of hardware and software two parts. Hardware is the basis of numerical control system. The performance of the system directly affects the performance of the overall CNC system. With hardware, software can run effectively. In designing the numerical control device, the choice of CPU is the key, choose CPU should consider the following elements:
(1) Clock frequency and word length are closely related to the speed and precision of the controlled object;
(2) The capacity of the expandable memory is related to the strength of the numerical control function;
(3) The ability of the I/O port to expand is related to the ability to control the peripherals.
In addition, according to the application of the numerical control system, control objects and various performance, parameter requirements, etc., should be considered together to determine the CPU. In China, the general application of CNC machine tool transformation is Z80CPU and MCS-51 series single-chip microcomputers, mainly because their supporting chips are cheap, popular, versatile, easy to manufacture and maintain, and can fully meet the needs of economical CNC machine tools. Transformation needs. This design is based on the MCS-51 series single-chip microcomputer, 51 series relative to the 48 series of instructions more abundant, relatively cheaper than the 96 series, 51 series, is no ROM 8051, 8751 is the 8051 with EPROM instead of ROM. At present, the most widely used industrial computer is the 8031 ​​microcontroller. The design of the 8031 ​​chip as the core, increase the memory expansion circuit, interface and panel operation switch control system.
2.3 Determination of overall plan
After the demonstration of the overall design proposal, the economical NC transformation diagram of the CA6140 lathe was determined. The spindle speed of the CA6140 lathe part retains the function of the original machine tool, ie, manual shifting. Lathe longitudinal (Z-axis) and transverse (X-axis) feed motions are driven by stepper motors. Composed of 8031 ​​single-chip microcomputer as the core of the numerical control device, the I/O interface, the annular distributor and the power amplifier control the rotation of the stepping motor, and the gear screw drives the ball screw to rotate, thereby realizing the longitudinal and horizontal feed motion of the lathe. . The tool holder is changed to a computer-controlled, automatically controlled, automatic indexing toolholder driven by a motor. In order to maintain the function of the cutting thread, a spindle pulse generator must be installed. For this purpose, the spindle is rotated synchronously by a synchronous toothed belt to send out two signals: the number of pulses to be transmitted and a synchronization signal, via the isolation circuit. And I/O interface to the computer.
Third, computer numerical control system hardware circuit design
3.1 Overall Design of Microcomputer Numerical Control System Hardware Circuit
The system uses the 8031 ​​CPU as the central processor of the CNC system. An external 2764EPROM is used as a program memory for the monitoring program and a processing program for storing common parts. Then use a piece of 6264 RAM to store the parts program and working parameters that need to be modified randomly. The decoding method is used to address the extended chip and a 74LS138 decoder is used to complete this function. 8279 as the system's input and output port expansion, respectively, then the keyboard input, output display, 8255 connected stepper motor ring distributor, respectively, parallel control of the X-axis and Z-axis stepper motor. In addition, we must also consider the photoelectric isolation between the machine tool and the microcontroller, power amplifier circuit.
The pin functions are briefly described as follows:
1) Source pin VSS: Power ground. VCC: +5V power supply.
2) Input/output (I/O) port The 8031 ​​microcontroller has 4 ports P0, P1, P2, and P3 and 8 I/O lines for each port. When the system expands external memory, port P0 is used to output low-order 8-bit parallel data, port P2 is used to output high-order 8-bit address, P3 port can be used as an 8-bit quasi-bidirectional parallel port, and it also has a second function, each pin. The second function is defined as follows: P3.0 RXD: Serial data input. P3.1 TXD: Serial data output P3.2 INT0: External interrupt 0 request signal input. P3.3 INT1: External interrupt 1 request signal input. P3.4 T0: Timer/Counter 0 external input P3.5 T1: Timer/Counter 1 external input P3.6 WR: External data memory write strobe. P3.7 RD: External data memory read strobe. Before performing the second function operation, the output latch to the second function must be set by the program.
3) Signal control line RST/VPD: RST is the input pin of the reset signal line. After the clock circuit is working, a high level above two machine cycles appears on this pin to complete a reset operation. The 8031 ​​microcontroller uses two reset methods: one is power-up automatic reset and the other is switch reset. ALE/PROG:ALE is the address latch enable signal. Its role is to latch the CPU's low eight-bit address from the P0 port in an additional latch. External program memory read strobe signal. It is valid when it is low.
VPP: The CPU executes the program in internal program memory when EA is high and the PC value is less than 0FFFH. When EA is low, the CPU executes only programs in external program memory. XTAL1: The inverting amplifier input of the oscillator must be grounded when using the external oscillator; XTAL2: The inverting amplifier output of the oscillator, when using the external oscillator, receiving the external oscillator signal;
3.2 Off-chip three-bus architecture
In practical applications, single-chip microcomputers often have to expand external memory, I/O ports, and so on. The pin of the one-chip computer, besides the power, reset, clock input and user I/O mouth, other pin is all set up in order to realize systematic expansion, these pins make up the form of three buses:
1) Address bus AB
The address bus width is 16 bits. Therefore, the external memory direct address range is 64KB. P0 port through the address latch 16-bit address bus to provide the low 8-bit address (A7 ~ A0), P2 port directly provides the high 8-bit address (A15 ~ A8).
2) Data bus DB
The data bus width is 8 bits, provided by the P0 port.
3) Control Bus CB
The control bus consists of the P3 port in the second functional state and the four independent control lines RST, EA, ALE and PSEN. 8255A programmable parallel I/O port expansion chip 8255A programmable parallel I/O port expansion chip can be directly connected with the MCS series single-chip microcomputer system bus. It has three 8-bit parallel I/O ports and has three working modes. Programming can easily use the unconditional transfer, query transfer, or interrupt transfer to complete the information exchange between the CPU and peripheral devices.
8255A structure and pin functions: 8255A structure
The 8255A's internal architecture consists of three 8-bit parallel data I/O ports, two operating mode control circuits, a read/write control logic circuit, and an 8-bit data bus buffer. The functions of each part are described as follows:
(1) Three 8-bit parallel I/O ports A, B, C
Port A: It has an 8-bit data output latch/buffer and an 8-bit data input latch. Programmable as an 8-bit input, or an 8-bit output, or an 8-bit bidirectional register.
Port B: It has an 8-bit data output latch/buffer and an 8-bit input or output register, but it cannot be bidirectional input/output.
Port C: It has an 8-bit data output latch/buffer and an 8-bit data input buffer. The C port can be divided into two 4-bit ports for input or output, and can also be used as a port A and port B strobe State control signal when working in mode.
(2) Operating mode control circuit
A, B two groups of control circuit divides three ports into A, B two groups, A group controls A mouth everybody and C mouth high four, B group controls B mouth everybody and C mouth low four. Each of the two groups of control circuits has a control command register for receiving a control word written by the CPU to determine the operation of the two sets of ports. According to the requirements of the control word, the C port can be cleared to "0" or set to "1".
(3) Read/write control logic circuit It receives the address signal from the CPU and some control signals to control the working status of each port.
(4) Data Bus Buffer This is a tri-state bi-directional buffer that is directly connected to the system's data bus to enable the transfer of information between the CPU and the 8255A.
Keywords: CNC machine tool, single-chip CNC system, retrofit design
I. Overview
Machine tools as an important basic equipment for the machinery manufacturing industry, its development has attracted people's attention. Due to the rise of computer technology, a qualitative breakthrough in the control information of the machine tools has emerged, resulting in a new generation of machine tools using digital technology for flexible automation control - The birth and development of CNC machine tools. The emergence and application of computers provide an ideal means for humans to automate the mechanical processing process. With the development of computers, CNC machine tools have also been rapidly developed and widely used. At the same time, people have fundamentally changed the concept of traditional machine tool transmission and structure. CNC machine tools have attracted worldwide attention for their excellent performance and precision, agile and diversified functions, and created a precedent for mechanical and electrical integration. CNC machine tool is a mechatronic product that realizes machine tool control with digital information. It controls the relative position between the tool and the workpiece, start and stop of the machine motor, spindle speed change, workpiece release and clamping, tool selection, cooling pump Various operations and sequential operations such as start and stop are recorded on the control medium using coded numbers, and then the digital information is sent to a numerical control device or a computer. After decoding, calculation, and issuing various instructions to control the machine servo system or other The actuators process the required workpieces.
Compared with ordinary machine tools, CNC machine tools mainly have the following advantages:
1. Adaptability, suitable for processing single pieces or small batches of complex workpieces; when changing the processing of workpieces on the CNC machine tool, only need to re-program the new workpiece processing program, you can achieve new workpiece processing.
2. High processing precision
3. High production efficiency
4. Reduce labor intensity and improve working conditions;
5. Good economic benefits;
6. Facilitate the modernization of production management.
CNC machine tools have become the mainstream products in China's market demand, and the demand has been increasing year by year. In recent years, China's CNC machine tools have made remarkable progress in industrialization and product development, especially in terms of high-speed, multi-axis, composite, and precision of machine tools. However, compared with the similar products of advanced countries, domestic CNC machine tools still have gaps and cannot meet the needs of national construction. China is a big machine tool country with more than three million ordinary machine tools. However, the quality of the machine tools is poor, and the performance is backward. The average output value of a single machine tool is only about 1/10 that of advanced industrial countries, and the gap is too great to be transformed. The transformation of the old CNC machine tools, as the name suggests, is to add microcomputer control devices to ordinary machine tools, so that it has a certain degree of automation capabilities, in order to achieve the desired processing process goals. With the increasing popularity of CNC machine tools, the technical and economic benefits of CNC machine tools are understood by everyone. In the technological transformation of domestic factories, the computer numerical control transformation of machine tools has become an important aspect. Many factories have used CNC, digital display, and PC technology to transform common machine tools while acquiring CNC machine tools, and have achieved good economic benefits.
China's economic resources are limited, the country is large, and the machine tools require large quantities, so it is impossible to purchase considerable amounts of new CNC machine tools. However, there are many old machine tools in China, and the use of economical CNC systems to transform ordinary machine tools has resulted in low investment. Next, it can not only meet the needs of processing, but also improve the degree of automation of the machine tool, more in line with China's national conditions. In 1984, China began to produce economical numerical control systems and used them to transform old machine tools. So far, many manufacturers have produced economical CNC systems. It can be expected that in the future, economical CNC transformation of machine tools will be rapidly developed and popularized. So, this graduation design example is typical and practical.
Second, the overall program design
2.1 Design tasks
The design task is to carry out numerical control transformation of the CA6140 ordinary lathe. Open-loop control of vertical and horizontal feed systems using a microcomputer, longitudinal (Z-direction) pulse equivalent 0.01mm/pulse, transverse (X-direction) pulse equivalent 0.005mm/pulse, stepper motor drive components, transmission system Ball screw, knife holder with automatic indexing tool holder.
2.2 Argumentation of the overall plan
For the economical numerical control transformation of ordinary machine tools, when determining the overall design plan, it should be considered that under the premise of meeting the design requirements, changes to the machine tools should be as small as possible to reduce costs.
1) The determination of the numerical control system's movement mode The numerical control system can be divided into point control system, point position linear control system and continuous control system according to the movement mode. Because the CA6140 lathe is required to process complex contour parts, the microcomputer numerical control system adopts a two-axis linkage continuous control system.
2) Reformation of servo feed system The servo feed system of CNC machine tools is divided into open loop, semi-closed loop and closed loop. Open-loop control has the advantages of simple structure, easy design and manufacturing, good control accuracy, easy debugging, low price, convenient use and maintenance. Therefore, the design decided to use an open-loop control system.
3) The hardware circuit design of the numerical control system Any numerical control system is made up of hardware and software two parts. Hardware is the basis of numerical control system. The performance of the system directly affects the performance of the overall CNC system. With hardware, software can run effectively. In designing the numerical control device, the choice of CPU is the key, choose CPU should consider the following elements:
(1) Clock frequency and word length are closely related to the speed and precision of the controlled object;
(2) The capacity of the expandable memory is related to the strength of the numerical control function;
(3) The ability of the I/O port to expand is related to the ability to control the peripherals.
In addition, according to the application of the numerical control system, control objects and various performance, parameter requirements, etc., should be considered together to determine the CPU. In China, the general application of CNC machine tool transformation is Z80CPU and MCS-51 series single-chip microcomputers, mainly because their supporting chips are cheap, popular, versatile, easy to manufacture and maintain, and can fully meet the needs of economical CNC machine tools. Transformation needs. This design is based on the MCS-51 series single-chip microcomputer, 51 series relative to the 48 series of instructions more abundant, relatively cheaper than the 96 series, 51 series, is no ROM 8051, 8751 is the 8051 with EPROM instead of ROM. At present, the most widely used industrial computer is the 8031 ​​microcontroller. The design of the 8031 ​​chip as the core, increase the memory expansion circuit, interface and panel operation switch control system.
2.3 Determination of overall plan
After the demonstration of the overall design proposal, the economical NC transformation diagram of the CA6140 lathe was determined. The spindle speed of the CA6140 lathe part retains the function of the original machine tool, ie, manual shifting. Lathe longitudinal (Z-axis) and transverse (X-axis) feed motions are driven by stepper motors. Composed of 8031 ​​single-chip microcomputer as the core of the numerical control device, the I/O interface, the annular distributor and the power amplifier control the rotation of the stepping motor, and the gear screw drives the ball screw to rotate, thereby realizing the longitudinal and horizontal feed motion of the lathe. . The tool holder is changed to a computer-controlled, automatically controlled, automatic indexing toolholder driven by a motor. In order to maintain the function of the cutting thread, a spindle pulse generator must be installed. For this purpose, the spindle is rotated synchronously by a synchronous toothed belt to send out two signals: the number of pulses to be transmitted and a synchronization signal, via the isolation circuit. And I/O interface to the computer.
Third, computer numerical control system hardware circuit design
3.1 Overall Design of Microcomputer Numerical Control System Hardware Circuit
The system uses the 8031 ​​CPU as the central processor of the CNC system. An external 2764EPROM is used as a program memory for the monitoring program and a processing program for storing common parts. Then use a piece of 6264 RAM to store the parts program and working parameters that need to be modified randomly. The decoding method is used to address the extended chip and a 74LS138 decoder is used to complete this function. 8279 as the system's input and output port expansion, respectively, then the keyboard input, output display, 8255 connected stepper motor ring distributor, respectively, parallel control of the X-axis and Z-axis stepper motor. In addition, we must also consider the photoelectric isolation between the machine tool and the microcontroller, power amplifier circuit.
The pin functions are briefly described as follows:
1) Source pin VSS: Power ground. VCC: +5V power supply.
2) Input/output (I/O) port The 8031 ​​microcontroller has 4 ports P0, P1, P2, and P3 and 8 I/O lines for each port. When the system expands external memory, port P0 is used to output low-order 8-bit parallel data, port P2 is used to output high-order 8-bit address, P3 port can be used as an 8-bit quasi-bidirectional parallel port, and it also has a second function, each pin. The second function is defined as follows: P3.0 RXD: Serial data input. P3.1 TXD: Serial data output P3.2 INT0: External interrupt 0 request signal input. P3.3 INT1: External interrupt 1 request signal input. P3.4 T0: Timer/Counter 0 external input P3.5 T1: Timer/Counter 1 external input P3.6 WR: External data memory write strobe. P3.7 RD: External data memory read strobe. Before performing the second function operation, the output latch to the second function must be set by the program.
3) Signal control line RST/VPD: RST is the input pin of the reset signal line. After the clock circuit is working, a high level above two machine cycles appears on this pin to complete a reset operation. The 8031 ​​microcontroller uses two reset methods: one is power-up automatic reset and the other is switch reset. ALE/PROG:ALE is the address latch enable signal. Its role is to latch the CPU's low eight-bit address from the P0 port in an additional latch. External program memory read strobe signal. It is valid when it is low.
VPP: The CPU executes the program in internal program memory when EA is high and the PC value is less than 0FFFH. When EA is low, the CPU executes only programs in external program memory. XTAL1: The inverting amplifier input of the oscillator must be grounded when using the external oscillator; XTAL2: The inverting amplifier output of the oscillator, when using the external oscillator, receiving the external oscillator signal;
3.2 Off-chip three-bus architecture
In practical applications, single-chip microcomputers often have to expand external memory, I/O ports, and so on. The pin of the one-chip computer, besides the power, reset, clock input and user I/O mouth, other pin is all set up in order to realize systematic expansion, these pins make up the form of three buses:
1) Address bus AB
The address bus width is 16 bits. Therefore, the external memory direct address range is 64KB. P0 port through the address latch 16-bit address bus to provide the low 8-bit address (A7 ~ A0), P2 port directly provides the high 8-bit address (A15 ~ A8).
2) Data bus DB
The data bus width is 8 bits, provided by the P0 port.
3) Control Bus CB
The control bus consists of the P3 port in the second functional state and the four independent control lines RST, EA, ALE and PSEN. 8255A programmable parallel I/O port expansion chip 8255A programmable parallel I/O port expansion chip can be directly connected with the MCS series single-chip microcomputer system bus. It has three 8-bit parallel I/O ports and has three working modes. Programming can easily use the unconditional transfer, query transfer, or interrupt transfer to complete the information exchange between the CPU and peripheral devices.
8255A structure and pin functions: 8255A structure
The 8255A's internal architecture consists of three 8-bit parallel data I/O ports, two operating mode control circuits, a read/write control logic circuit, and an 8-bit data bus buffer. The functions of each part are described as follows:
(1) Three 8-bit parallel I/O ports A, B, C
Port A: It has an 8-bit data output latch/buffer and an 8-bit data input latch. Programmable as an 8-bit input, or an 8-bit output, or an 8-bit bidirectional register.
Port B: It has an 8-bit data output latch/buffer and an 8-bit input or output register, but it cannot be bidirectional input/output.
Port C: It has an 8-bit data output latch/buffer and an 8-bit data input buffer. The C port can be divided into two 4-bit ports for input or output, and can also be used as a port A and port B strobe State control signal when working in mode.
(2) Operating mode control circuit
A, B two groups of control circuit divides three ports into A, B two groups, A group controls A mouth everybody and C mouth high four, B group controls B mouth everybody and C mouth low four. Each of the two groups of control circuits has a control command register for receiving a control word written by the CPU to determine the operation of the two sets of ports. According to the requirements of the control word, the C port can be cleared to "0" or set to "1".
(3) Read/write control logic circuit It receives the address signal from the CPU and some control signals to control the working status of each port.
(4) Data Bus Buffer This is a tri-state bi-directional buffer that is directly connected to the system's data bus to enable the transfer of information between the CPU and the 8255A.