Share this

Inching control of CNC system

2026-04-06 07:29:53 · · #1
Abstract: Jogging control is an indispensable function in the manual adjustment process of CNC system. The jogging process requires automatic speed increase and decrease. When the jogging time is short and the maximum speed has not been reached, the speed should be reduced from this speed. At the same time, it is necessary to detect in real time whether the soft limit set by the user and the hard limit of the machine tool are reached. If they are reached, the machine tool is prohibited from running in the overtravel direction. Therefore, the hardware structure and software structure principle of jogging control are described in detail. The specific jogging control scheduling algorithm and interrupt service program control block diagram are given. Keywords: CNC system, jogging control, interrupt limit. No matter what kind of CNC system, there is automatic machining and manual machining. The most important part of manual machining is jogging control. It directly affects the convenience and reliability of CNC system operation. Whether it is a CNC system based on PC [1] or a CNC system based on microcontroller, data is input by keyboard. Keyboard input has a series of processing such as debouncing. When a key is pressed and held, the computer cannot accurately detect that the key is pressed continuously, so it is not suitable for jogging control. Therefore, only the input port of the input board can be used for jogging control. In order to increase the reliability and anti-interference of the system, the input board is equipped with an opto-isolator to avoid external interference impacting the CNC system. This paper takes the three-coordinate CNC system as an example to study the hardware and software structure of the jog control. 1 Hardware structure The jog control of the three-coordinate CNC system is set on the control panel with three coordinate axes of X, Y, and Z, and a total of 7 buttons, as shown in Figure 1. Among them, the wavy button in the middle "~" is the fast run button. When any one of the six keys of x, y, z is pressed and held, the computer runs at a preset low speed (such as 1000 mm·min-1). When the wavy button in the middle is pressed at the same time, the CNC system runs at a preset high speed (such as 6000 mm·min). During the operation, the CNC system automatically increases speed[2] and judges in real time whether the current position is about to reach the soft limit. If it is about to reach the soft limit, it automatically decreases speed. When the soft limit or hard limit is reached, an alarm is automatically triggered, and the machine tool can only be controlled by pressing the opposite direction button. When the button is released before reaching the soft limit, the CNC system automatically slows down. The hardware wiring is shown in Figure 2. Assume the input address value is 300H, and the corresponding bits for each jog button and input are as follows: All buttons are normally open contacts. When no button is pressed, the optocoupler of the opto-isolator is cut off, and the computer detects a high level (1) through the input port. When a button is pressed, a circuit is formed at the input terminal, current flows, causing the optocoupler to conduct, and the computer detects a low level (0) for the corresponding bit through the input. If the input board has a Darlington transistor as a driver amplifier outside the optocoupler input terminal, it can be used to directly drive the relay and invert the signal. That is, when a button is pressed, the corresponding bit is 1; and when released, the corresponding bit is 0. 2. Software Structure Jog control can be set as an independent subroutine module for use by any CNC system, denoted as int POINT(void). Jog control is not simply about controlling the movement and stopping of the coordinate axis; it also needs to consider various possible situations. Regardless of the size of a CNC machine tool, each axis has a certain range of travel. To prevent the operator from exceeding the travel range during jogging control, soft and hard limits need to be set. Soft limits control the machine tool's axis to operate within a given range, which can be set and adjusted by the operator. When the soft limit is set too large or incorrectly, hard limits can be used to restrict the movement of the machine tool's axis to avoid accidents. Therefore, in the jogging control process, it is necessary to continuously detect and judge the soft and hard limits, stopping the machine tool's axis movement and triggering an alarm when they are reached. The POINT subroutine returns the limit flag; if the return parameter is 0, it means that no limit was exceeded during the jogging process. To facilitate jogging control in any menu state, the POINT subroutine is placed in a loop waiting for key presses: `int getkey(void)`. The working principle of the subroutine is shown in Figure 3. Since all interpolation movements of the machine tool use 08H timer interrupts for foreground and background control, jogging control is also implemented. Furthermore, acceleration and deceleration control is performed each time a key is pressed and released. The jog control subroutine mainly includes two modules: the jog control scheduling module and the interrupt service program for controlling the movement of the coordinate axes. The jog control scheduling program mainly determines whether the jog button is pressed. If not, it returns; if so, it sets the interrupt service program for the corresponding coordinate axis direction movement to the interrupt service program called by the 08H interrupt timer. Its control block diagrams are shown in Figures 4 and 5 respectively. [align=center] [/align] 3 Conclusion Based on this jog control principle, the number of jog control coordinate axes can be increased arbitrarily, including the control of rotary axes. It has good practicality when applied to CNC systems such as three-coordinate CNC milling machines, stone column cap and column base CNC machine tools, and double rocker arm engraving machines. References 1 Xie Minghong Zero-error thread processing software design method [J]. Manufacturing Technology and Machine Tool, 1998, (4): 16-17 2 Xie Minghong Xiao Benxian, Wang Zhisen. Stepper motor speed control [J]. Journal of Nanjing University, 1995, (8): 178-181 3 Liu Leshan Ye Jizhong. Principles and Applications of Microcomputer Interconnection Technology [M]. Wuhan: Huazhong University of Science and Technology Press, 1996. 72-106 4 Lin Yihong Machine Tool CNC Technology and Its Application [M]. Beijing: Machinery Industry Press, 1994. 97-143
Read next

Green lighting and intelligent lighting energy-saving control system

1. Overview According to statistics, lighting electricity consumption accounts for about 12% of China's total electr...

Articles 2026-02-22