Share this

Intelligent processing unit for CNC machine tool panel based on microcontroller control

2026-04-06 08:01:06 · · #1
1 Introduction In CNC machine tools, manual operation panels are always indispensable. Their characteristics are: 1. Some input quantities are mutually exclusive, and misoperation is not allowed. The requirements are guaranteed by mechanical interlocking relationships; 2. The on/off state of the keys is triggered by level, rather than by edge triggering; 3. Multiple states can be input simultaneously and respond reliably; 4. Necessary prompts can be made for the current status of the equipment, such as using indicator lights, LEDs, or LCD screens. Most existing designs treat the input/output of the manual operation panel as part of the switch I/O, and are uniformly controlled by a built-in or external programmable controller (PLC). CNC machine tool manufacturers purchase CNC systems according to the process characteristics of their own machine tools, and after secondary development, form CNC machine tool products with different process performance and operation. The majority of the workload of secondary development lies in the design of switch I/O, and more than 60% of the work is to design the manual operation panel according to the process performance and operation [1]. In fact, the input/output of the manual operation panel is only a control signal switching I/O, and its driving capability requirements are very low. It is a special type of CNC machine tool switching I/O. If the input/output of the manual operation panel is not distinguished from other switching I/O of the CNC machine tool, it will greatly increase the workload of secondary development of the CNC system. The manual operation panel of the CNC machine tool cannot be standardized and modularized, and its economy will also be greatly affected. This paper proposes an intelligent processing unit for the CNC machine tool panel based on the 89C51/52 microcontroller. This processing unit exchanges information with the CNC system through a standard serial port, and can display the basic status of the CNC machine tool and perform manual operation on it. This work is part of the research content of the National 863 Program "Research on PC Peripheral Type Complete Digital Machine Tool and its Key Technologies", and has been used in a three-axis CNC milling machine. 2 Working principle The 89C51/52 microcontroller has on-chip ROM, 16-bit counter and standard serial port [2]. In the intelligent processing unit of a CNC machine tool panel, which is composed of an 89C51/52 microcontroller, external ROM and RAM expansion are generally not required. One bit of the microcontroller's I/O port corresponds to one input/output quantity. If the microcontroller's I/O ports are insufficient, they can be expanded. The microcontroller detects inputs using timer interrupts. Once a change in input level is detected, it sends the corresponding new state to the CNC system via serial port. On the other hand, the CNC system sends the information to be displayed to the microcontroller via serial port. Due to the use of serial communication, the interface between the CNC system and the intelligent processing unit of the panel is standard. The information processing of the operation panel basically does not occupy the CPU time of the CNC system, and the intelligent processing unit of the panel itself becomes a standardized module. Figure 1 is a schematic diagram of the intelligent processing unit of the CNC milling machine panel. The input/output information of the CNC milling machine's manual operation panel can be roughly categorized as follows: [align=center] Figure 1 Schematic diagram of the intelligent processing unit on the CNC milling machine panel[/align] 1) Working mode selection: Manual/Automatic/Return to origin 2) Single-step feed selection 3) Continuous feed speed selection 4) Feed speed multiplier selection 5) Feed coordinate selection 6) On/off control of spindle motor, pump, electromagnetic clutch brake, etc. 7) Emergency stop 8) Pause and display 9) Feed coordinate overtravel display 10) Fault display The selection of working mode, single-step feed, and continuous feed speed, as well as the feed speed multiplier selection, are switched between different states using switch 1 and switch 2, respectively. The states controlled by the same switch are mechanically interlocked, preventing the simultaneous activation of two or more interlocked states due to misoperation. The remaining input/output quantities in Figure 1 are directly controlled by the microcontroller's I/O ports, ensuring reliable input/output of multiple states simultaneously. 3. System Software After power-on reset and initialization, the intelligent processing unit of the 89C51/52 microcontroller CNC machine tool panel enters the interrupt working state, allowing timer interrupts and serial interrupts. In the timer interrupt, it detects whether there is a change in the input state and sends the changed input state to the CNC system via the serial port; the CNC system needs to send information displayed on the manual operation panel to the microcontroller via the serial port, and the microcontroller's serial interrupt service program performs the corresponding processing. Its program flowchart is shown in Figure 2, where Figure 2(a) is the main program flowchart, Figure 2(b) is the timer interrupt service program flowchart, and Figure 2(c) is the serial interrupt service program flowchart. [align=center] Figure 2 Program Flowchart[/align] The microcontroller's power-on reset and initialization can be completed in a very short time, while the initialization of the CNC system requires a longer time. Serial communication cannot work when the CNC system initialization is not completed. Therefore, after the microcontroller's main program completes initialization, it must wait for the CNC system to send a "READY" signal from the serial port, and start controlling the input/output of the operation panel after receiving the "READY" signal. In the timer interrupt service routine, the state of each key is checked one by one. If a change in the state of a key is detected, the new state is sent to the CNC system via the serial port, and the interrupt service routine exits. Otherwise, the interrupt service routine exits after checking all keys. To detect changes in key state, the original state of the key must be stored in memory, with 00H representing the key in the ON state and FFH representing the key in the OFF state. When a key is read as ON, the value in memory is first checked to see if it is greater than 80H or less than 80H. If the value in memory is greater than 80H, it means the key was originally in the OFF state. The value is decremented by 1. If the value is greater than FFH, it is stored in memory. If it is less than FFH, it indicates that the key has been read as ON three times consecutively, meaning the key state has changed from OFF to ON. The memory is then cleared to 00H (ON state). If the value in memory is less than 80H, it means the key was originally in the ON state, and the key state has not changed. The memory is then cleared to 00H (due to various disturbances, the value in memory may be less than 03H). When a key is read as being in an off state, the system first checks whether the value in memory is greater than or less than 80H. If the value in memory is greater than 80H, it means the key was originally in an off state, and the key's state has not changed. The memory value is then set to FFH (due to various disturbances, the value in memory may be greater than FCH). If the value in memory is less than 80H, it means the key was originally in an on state. The value is incremented by 1; if the result is less than 0.4H, the value is stored in memory. If the result is greater than 0.4H, it indicates that the key has been read as off three times consecutively, meaning the key's state has changed from on to off. The memory value is then set to FFH (on state). This effectively avoids misjudgments caused by key bounce and other interference. These processes can be accurately described by the state transitions shown in Figure 3. [align=center] Figure 3 State Transition Diagram[/align] 4 Conclusions This paper proposes a new intelligent processing unit for CNC machine tool panels based on the 89C51/52 microcontroller. From theoretical analysis and practical application, the following conclusions can be drawn: (1) The intelligent processing unit for the panel meets the functional requirements of the manual operation panel of the CNC machine tool. The hardware and software design is reasonable and the reliability is high; (2) Serial communication is used to make the manual operation panel a simple and standard module; (3) This paper proposes a software algorithm to eliminate key bounce. The algorithm has the advantages of reliability and simplicity; (4) The intelligent processing unit for the panel has good scalability. It can easily expand single-point input/output ports and can also drive digital or LCD displays.
Read next

CATDOLL Kara TPE Head

This head is made of TPE material. This link can also be used to order any other TPE head. Just include the name of the...

Articles 2026-02-22