Application of PLC in Point Position Control of CNC Lathe System

I. Introduction

CNC technology has been developed by comprehensively applying modern science and technology achievements such as electronic technology, computational technology, automatic control and automatic detection. At present, it is widely used in many fields, especially in the machining industry.
The numerical control system is divided into a bit position control system, a linear control system and a continuous control system according to its control mode. In machining, the position control of the CNC system is generally used on hole machining machines (such as drilling, reaming, boring CNC machines), which is characterized in that the moving parts of the machine tool can be realized from one position to another. Accurate movement, that is, accurate control of the end position of the moving part, but does not consider its movement trajectory, the tool does not cut the workpiece during the movement.
There are two common methods for implementing point control of the numerical control system: one is to use a full-function numerical control device, which is very functional, but its price is very expensive, and many functions are redundant for point control; The second is to use single-board machine or single-chip control. In addition to software development, this method must also design hardware circuits, interface circuits, and drive circuits. In particular, consider the anti-interference problem in industrial sites.
Because the programmable controller (PLC) is an industrial control computer designed for industrial applications, it has excellent anti-interference ability, high reliability, small size, and is an ideal control device for mechatronics. Advantages, therefore, through practice and in-depth study, this paper puts forward the relevant insights and methods of using PLC to control stepping motor to realize the point control function of numerical control system, introduces some problems that need to be recognized and solved in the development of control system, and gives the control system. The design ideas of the scheme and the software and hardware structure have high application and reference value for the industrial and mining enterprises to realize the related machine tool transformation.

Second, several problems need to be recognized and solved in the development of control systems

  1. Prevent out-of-step and error when stepping motor is running
    The stepping motor is a kind of digital actuator with good performance. In the point control of the numerical control system, the stepping motor can be used as the driving motor. In open loop control, the stepper motor is controlled by pulses of a certain frequency. The direct generation of pulses by the PLC to control the stepper motor can effectively simplify the hardware circuit of the system and further improve the reliability. Since the PLC works in a cyclic scan mode, its scanning period is generally between several milliseconds and tens of milliseconds. Therefore, the stepping motor cannot work at high frequencies due to the limitation of the PLC working mode and the scanning cycle. For example, if the pulse frequency of the stepping motor is controlled to 4000HZ, the pulse period is 0.25 milliseconds, so that the pulse period is much smaller than the scan period, and the frequency is used to control the stepping motor. Then the PLC has issued many control pulses when the output refresh task has not been completed, but the stepper motor still does not move, and there is a serious out-of-step phenomenon. If the pulse frequency of the stepping motor is controlled to be 100 Hz, the pulse period is 10 milliseconds, which is about the same order of magnitude as the scanning period of the PLC, and a large error may occur when the stepping motor is running. Therefore, when using the PLC to drive the stepping motor, in order to prevent the stepping motor from running out of step and error, the stepping motor should be operated at low frequency, and the pulse signal frequency is selected to be about ten to several tens of hertz, which can be realized by programming. .
  2. Guarantee the contradiction between positioning accuracy and increasing positioning speed
    The speed of the stepper motor is proportional to the frequency of its control pulse. When the stepper motor is running at very low frequencies, its speed must be very low. In order to ensure the positioning accuracy of the system, the pulse equivalent is the distance that the tool or the table moves when the stepping motor rotates to a step angle. The two factors together bring a prominent problem: the positioning time is too long. . For example, if the working frequency of the stepping motor is 20HZ, that is, 50ms one step, and the pulse equivalent is δ=0.01mm/step, the distance of the tool or table moving in 1 second is 20x0.01=0.2mm, 1 minute moving The distance is 60x0.2=12mm. If the positioning distance is 120mm, the positioning time takes 10 minutes. Such slow positioning speed is unbearable in actual operation.
    In order to ensure the positioning accuracy, the pulse equivalent can not be too large, but it affects the positioning speed. Therefore, how to improve the positioning speed while ensuring the positioning accuracy is a problem that needs to be seriously considered and effectively solved.
  3. Online modification of variable control parameters
    When PLC is applied to point control, the user obviously hopes that when the field conditions change, some control parameters of the system can be modified accordingly, such as the step number of stepping motor and the speed adjustment. In order to meet the continuity of production, modifications to the variable parameters of the control system are required to be performed online. Although the programmer can easily and quickly change the original setting parameters, the programmer can't be used by the field operator. Although the PLC input button can be used together with the software design to realize the online modification of the control parameters, the PLC does not provide the digital. The display unit, so the digital input display circuit needs to be separately designed for this, which will greatly occupy the input point of the PLC, resulting in an increase in hardware cost, inconvenience in operation, and slow data input. Therefore, consideration should be given to developing other simple and effective methods to realize the online modification of the variable control parameters of the PLC.
  4. other problems
    In order to realize the display of digital changes and the display of fault output codes during the point control process, it is also necessary to separately design the digital output display circuit of the PLC. Since the current price of PLC I/O points is still high, it is important to consider the appropriate method for compressing the display output points. In addition, in order to ensure the safe and stable operation of the control system, the safety protection of the control system should also be solved, such as the stroke protection of the system and the automatic detection of faulty components.

Third, the control system program

  1. Divide the positioning process into two phases with different pulse equivalents
    To achieve high positioning speed and to ensure positioning accuracy, the entire positioning process can be divided into two phases: the coarse positioning phase and the fine positioning phase. Both stages use pulse-controlled stepper motors of the same frequency, but with different pulse equivalents. Coarse positioning stage: Since the tool does not cut the workpiece during the point process, a larger pulse equivalent can be used at this stage, such as 0.1 mm/step or 1 mm/step, or even higher. For example, the stepping motor control pulse frequency is 20HZ, the pulse equivalent is 0.1mm/step, and the positioning distance is 120mm, then the time required to take the full course is 1 minute, so the speed is obviously satisfactory. Fine positioning stage: When a large pulse equivalent is used to quickly move the tool or table to the approaching point (ie, the coarse positioning stage is completed), in order to ensure the positioning accuracy, the smaller pulse equivalent is used to enter the fine positioning stage. Let the tool or table slowly approach the positioning point, for example, taking a pulse equivalent of 0.01 mm/step. Although the pulse equivalent becomes small, since the fine positioning stroke is short (can be set to about one-fifth of the full stroke), the positioning speed is not affected.
    In order to achieve the above objectives, in the mechanical aspect, two sets of shifting mechanisms should be used. In the coarse positioning phase, the stepper motor directly drives the tool or the table drive, and in the fine positioning phase, the downshift drive is used. Which one of the two sets of shifting mechanisms is used is controlled by an electromagnetic clutch.
  2. Application function instruction to realize BCD code dial data input
    At present, more advanced PLCs not only have basic logic instructions that meet the requirements of sequential control, but also provide a wealth of functional instructions. If the basic logic instruction is an abstract improvement of the relay control principle, then the functional instruction is like an abstraction of assembly language. The BCD code data dial is a decimal dial data input device commonly used in computer control systems. There are 0~9+ positions in the dial, and each position has a corresponding number indication. A dial can represent a decimal data. If you need to input multiple bits of data, you can use multiple BCD code dials in parallel.
    The author chooses BCD code dial device for PLC control system, which eliminates the need to design digital input display circuit, effectively saves PLC input point, simplifies hardware circuit, and uses advanced function instructions to realize data storage and transmission. Therefore, it is very convenient to realize online input or modification of data (such as modification of counter setting value). If a simple hardware decoding circuit is used, dynamic changes of related parameters (such as decreasing step of motor steps) can be displayed. . In order to avoid fluctuations caused by the dialing of the dial during system operation, it is best to set an input button. When it is confirmed that each disc dial is in place and then press this button, the data is read and processed by the PLC.
  3. "Software coding, hardware decoding"
    In order to meet the precondition of compressing the output point, the digital output display circuit of PLC is designed by the method of "software coding and hardware decoding". For example, for 9 kinds of fault status display and below, 8-4 software coding can be used, 4-8 hardware decoding can be used to compress the output point of display failure into 4, and the hardware circuit includes 74LS04, 74LS48, common digital tube, etc. Device.
  4. Automatic detection of PLC external component failure
    Due to the high reliability of the PLC, most of the faults in the PLC control system are not caused by the PLC itself, but by external component failures. For example, the common welding or oxidation of the button or stroke switch contacts corresponds to Short circuit fault and open circuit fault. Once the system automatically detects a component failure, it should not only have an audible and visual alarm function, but also immediately display the fault code so that the user can quickly determine the cause of the fault. In order to save space, the programming ideas for this content can be found in the references.

Fourth, the hardware and software structure of the control system

  1. Software structure
    The software structure is designed according to the control requirements, and is mainly divided into five major modules: stepper motor control module, positioning control module, data dial input and data transmission module, digital output display module, component fault automatic detection and alarm module.
    Because the whole software structure is relatively large, the pulse controller generates a 0.1 second control pulse, shifting the shift register, providing six-shot timing pulses, and making the three output relays Y430, Y431, Y432 according to the single-phase three-shot ring-shaped splitter. The power-on mode of the double six-shot controls the stepper motor. In order to realize the positioning control, different counters are used to control the coarse positioning stroke and the fine positioning stroke respectively, and the setting value of the counter is determined according to the stroke. For example, if the tool or table is to be moved from point A to point C, AC=200mm is known, and AC is divided into two sections AB and BC, AB=196mm, BC=4mm, and section AB is the coarse positioning stroke, using 0.1mm. The pulse equivalent of the / step is fast moving, using a 6-bit counter (C660/C661), while the BC segment is a fine positioning stroke, using a pulse equivalent of 0.01 mm/step for precise positioning, using a 3-bit counter C460, entering at the end of the coarse positioning. At the same time of precise positioning, the PLC automatically turns on the electromagnetic clutch output point Y433 to realize the replacement of the shifting mechanism.

V. Conclusion

The system test shows that the method proposed by the application of PLC to control the stepping motor to realize the point control function of the numerical control system can meet the control requirements and is practical in practical operation. The developed control system has clear programming ideas, simple and practical hardware circuit, high reliability, strong anti-interference ability, good performance and price ratio, etc. Its software and hardware design ideas can be applied to the relevant machine tool transformation of industrial and mining enterprises. .

Butterfly Valve

Zhejiang Heshuo Technology Co., Ltd , https://www.hosuocn.com