Modular design of typical CNC milling machine control software (2)


Initialize task %INI: The system executes once each time it is powered on.

Cyclic task %TS: The system first executes %TS0, and then executes TS1~4. The execution period of %TS0 is equal to each RTC (Real Time Clock Control) period, that is, 20ms, %TS1~4 every 5 RTC cycles (100ms) Execute once.

The background task %TS has a lower priority than the cyclic task %TS and the interrupt task %TH and can be used to wait for the task to be used. Background tasks can last for several RTC cycles and can be interrupted by cyclic tasks.

The interrupt (real-time) task %TH is used for higher priority events without having to wait for the end of the RTC loop. The interrupt (real-time) task %TH has a higher priority than the cyclic task %TS and the background task %TF.

Error message table %9999.9: Machine error message file.

4 Design and implementation of PLC program for three-axis CNC milling machine

The design of the PLC program is inseparable from the good software platform and hardware environment. The NUM1050 CNC system provides the machine manufacturer with rich software resources and powerful software development tools. Such as PLCTOOL, SETTOOL, PCTOOLKIT and so on. They are all based on the WINDOWS platform, which brings great convenience to the development of machine tool electrical control system. Among them, PLCTOOL can conveniently program PLC ladder or high-level language C, and has a rich instruction set and timer, counter unit, graphical interface, flexible operation and convenient operation. The PLC program of this three-axis CNC milling machine is developed and designed on the PLCTOOL software platform. Taking into account the practical application, this three-axis machine tool uses a ladder language to design the PLC program. Its advantages are intuitive, dynamic display, easy to debug and maintain.

With the input/output modules and machine operator panels provided by the NUM1050 CNC system, the movement and other functions of the machine can be easily controlled, as the machine operator panel has customizable keys for programming. The machine operator panel provided by the NUM system is connected to the system via fiber optic cable for increased reliability.

According to the PLC program structure characteristics of NUM1050, when designing the PLC program of this three-axis machine tool, the functions of the machine tool are assigned to different module controls. Because the machine has no special interrupt task, the scan cycle of the initialization task %INI, the cyclic task %TS and the subroutine module %SP.%TS0 is designed to be 20ms, so the important subroutine is called in %TS0. The auxiliary functions of the machine tool such as hydraulic, cooling and lubrication are controlled in the task modules %TS1~3. The control of the coordinates, spindle and related parts of the machine tool is carried out by the subroutine %SP module of the ladder diagram. The PLC program structure of the three-axis CNC milling machine and each module are introduced as follows:

%INI: The system is called before other tasks are executed. It is only executed once when the PLC is powered on. It is not controlled by the PTC cycle and mainly initializes some variables.

%TS0: Call the subroutine. %TS1: Controls the machine tool auxiliary function rail lubrication and hydraulic system. The rail lubrication cycle is controlled by a timer in the PLC program. %TS2: Controls the machine cooling system. Automatic cooling and manual cooling can be selected on the machine operator panel. %TS3: Controls the looseness of the machine spindle and the tool clamping.

%SP0: Used to control the flashing of the indicator light on the machine's operation panel. Most of the custom buttons on the machine operation panel provided by the NUM1050 system are equipped with indicators. When using some functions that require special reminder, the buttons are flashed by the indicator to show eye-catching, such as machine fault reset button, tool change. Finish the keys and more. %SP2: Controls the custom buttons of the machine's operation panel. The custom keys of the operation panel must be programmed by the PLC to take effect, and the function of the keys is defined according to the needs of the machine. According to the requirements of the user, the operation panel of the three-axis CNC milling machine is designed with functions such as machine start, cooling control, spindle start and stop, tool change completion, and machine fault reset. %SP3: Controls the coordinate movement and the safety check of the coordinate limit. %SP4: M function decoding, this module is used to define the M06 function at the end of the tool change. %SP5: Control axis servo enable. %SP6: This module controls all functions of the spindle part, including spindle cooling, spindle lubrication, tool clamping, spindle motor, spindle inverter and so on. %SP20: Display control of machine fault information. When the machine tool fails, the fault number and fault content need to be displayed in time on the display page. When there are multiple faults in the machine, the system can display the faults in sequence. The time of each fault display is set in this subroutine module. This module is called by other related modules.

Previous Next

3527 LED Chip

3527 Led Chip,3527 Led Light Chip,3527 Smd Led Chip,Adjustable 3527 Led Chip

Shenzhen Huangtai Photoelectric Co.,Ltd. , https://www.ht-led.com

Posted on