Universal numerical control method and numerical control system

By performing lexical and syntactic analysis on the CNC system, combined with the speed look-ahead method and a 7-segment speed S-curve, precise control of simultaneous machining with multiple tools was achieved, solving the accuracy and efficiency problems of single-channel systems in complex machining, and improving the flexibility and openness of the CNC system.

CN120949689AInactive Publication Date: 2025-11-14CHUZHOU VOCATIONAL & TECHN COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511113351.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-11-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing single-channel CNC systems cannot meet complex machining needs, especially when multi-tool machining requires re-alignment, which affects machining accuracy.

Method used

A general CNC method and system is provided. The part machining program is analyzed by lexical and syntactic methods and converted into an execution queue. The speed transition point speed is calculated by the speed look-ahead method. Multiple CNC devices are controlled by a 7-segment speed S-curve. The devices exchange information and perform mutual exclusion operations by sharing global variables.

Benefits of technology

It enables simultaneous automatic loading and unloading and multi-tool machining without the need for re-alignment, improving machining accuracy and efficiency, and enhancing the flexibility and openness of the CNC system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120949689A_ABST
    Figure CN120949689A_ABST
Patent Text Reader

Abstract

The invention discloses a general numerical control method and a numerical control system, and relates to the technical field of core foundation equipment manufacturing industry, the method comprises the following steps: after lexical and grammatical analysis, converting a part processing program into an execution queue, and obtaining a processing track; calculating the speed of a curve transition point in the processing track; performing data point densification on the processing track by using a linear interpolation or arc interpolation mode to obtain a densified processing track; and finally, controlling a controlled object by adopting a seven-section speed S curve. Wherein the executing mechanism can control a plurality of pieces of numerical control equipment for processing at the same time, and information exchange and mutual exclusion operation are carried out among the equipment by sharing global variables. According to the method, the machining track is analyzed in advance, and data point densification is performed on the machining track, so that alignment of all the parts in the whole implementation process is very accurate, and automatic feeding and discharging or machining through different cutters can be achieved while machining is achieved on the basis that re-alignment is not needed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of core basic equipment manufacturing technology, and in particular to a general numerical control method and numerical control system. Background Technology

[0002] CNC machine tools belong to the core basic equipment manufacturing industry and are known as the "mother machine of industry." Their skill level represents a country's core competitiveness. In particular, five-axis linkage advanced CNC machine tools have an insignificant influence on a country's aviation, aerospace, military, scientific research, precision machinery, and high-precision medical equipment industries. The CNC system is the brain of the machine tool and a key factor determining its function, reliability, and cost. It is also a bottleneck restricting the development of my country's CNC machine tool industry.

[0003] A numerical control (NC) device is a computer system that executes some or all numerical control functions based on control programs stored in its memory, and is equipped with interface circuits and servo drive devices. It controls the movement of one or more mechanical devices using digital instructions composed of numbers, text, and symbols; the controlled quantities are typically mechanical quantities such as position, angle, and speed, as well as switching quantities.

[0004] With the development of economic globalization and the increasingly fierce market competition, single-channel CNC systems with only simple product processing functions can no longer meet the growing needs of customers. In current CNC machining and industrial automation applications, there are various complex control situations, such as automatic loading and unloading during machining, or workpieces requiring different tools for processing, but secondary clamping or tool changing necessitates re-alignment, affecting machining accuracy. Single-channel CNC systems can no longer meet the requirements of complex machining. Summary of the Invention

[0005] The purpose of this application is to provide a general CNC method and CNC system that can achieve automatic loading and unloading or machining using different cutting tools without the need for re-alignment.

[0006] To achieve the above objectives, this application provides the following solution:

[0007] Firstly, this application provides a subject-matter method, including:

[0008] A general numerical control method, characterized in that the general numerical control method includes:

[0009] Obtain the part machining program;

[0010] After lexical and syntactic analysis, the part processing program is converted into an execution queue;

[0011] Obtain the processing trajectory in the execution queue;

[0012] The velocity of the transition point of the curve in the machining trajectory is calculated using the velocity look-ahead method;

[0013] The machining trajectory is densified by using linear interpolation or circular interpolation to obtain a densified machining trajectory;

[0014] A seven-segment speed S-curve is used to control the controlled object based on the speed of the densified machining trajectory and the speed of the transition point of the curve; wherein, the actuator can control multiple CNC devices that process simultaneously, and the devices exchange information and perform mutual exclusion operations by sharing global variables.

[0015] Optionally, after lexical and syntactic analysis, converting the part processing program into an execution queue specifically includes:

[0016] Obtain keywords for each part of the part machining program;

[0017] Based on the keywords, determine whether it is G-code; if it is G-code, use the G-code interpreter to extract information and check for errors, and record the distance of the motion pattern and motion curve, as well as the running speed information, to obtain the execution queue;

[0018] If it is not G code, then determine whether it is a variable operation; if it is a variable operation, then process it according to the corresponding variable operation.

[0019] If it is not a variable operation, then determine whether it is the first procedure; if it is the first procedure, then execute the first procedure; the first procedure includes: jump, subroutine call and condition judgment;

[0020] If it is not the first program, then a JSON expression check is performed; if it is, then the JSON parser processes it; otherwise, an unknown instruction is reported.

[0021] Optionally, the velocity of the transition point of the curve in the processing trajectory is calculated using a velocity look-ahead method, specifically including:

[0022] Using the speed look-ahead method, the entry and exit speeds of each motion instruction in the current command buffer are calculated based on the distance and speed of the current instruction in the execution queue.

[0023] The motion velocity at the transition point is calculated based on the parameters set in the configuration file, according to the acceleration and trajectory error strategy.

[0024] Secondly, this application provides a numerical control system, the numerical control system comprising:

[0025] A CNC code interpreter is used to obtain the part machining program and, after lexical and syntactic analysis, convert the part machining program into an execution queue.

[0026] The CNC system trajectory planner is used to acquire the machining trajectory in the execution queue and calculate the velocity of the curve transition point in the machining trajectory using a velocity look-ahead method.

[0027] The CNC system interpolator is used to densify the data points of the machining trajectory using linear interpolation or circular interpolation to obtain a densified machining trajectory.

[0028] The actuator is used to control the controlled object by employing a 7-segment speed S-curve based on the speed of the densified machining trajectory and the speed of the transition point of the curve; the actuator can control multiple CNC devices that process simultaneously, and the devices exchange information and perform mutual exclusion operations by sharing global variables.

[0029] Optionally, the actuator is further configured to:

[0030] The system records the current running time of the curve, and the current curve position is obtained from the functional relationship between the running time and the curve position constructed by the planner.

[0031] Optionally, the actuator is further configured to:

[0032] The current time is updated, with the time interval being the task cycle. The current curve position is obtained from the function relationship between the running time and the curve position constructed by the planner.

[0033] Determine if there is any remaining time after the current curve ends; if there is no remaining time, update the position information of each axis and return.

[0034] If there is remaining time, retrieve the next instruction from the buffer, update the time to the remaining time, calculate the path distance, and check again if there is remaining time.

[0035] Optionally, the actuator is further configured to:

[0036] Based on the current curve type, the current coordinates of each motion axis are calculated using the curve's characteristic parameters and the current curve position.

[0037] Using the current coordinates of each motion axis, the actual position of each motor axis is obtained according to the inverse kinematics of the mechanical structure.

[0038] Based on the actual position of each motor shaft, and using the transmission ratio and motor zero-point values, the pulse equivalent of the current motor is calculated.

[0039] Optionally, after obtaining the actual position of the motor shaft, the motion of the servo driver is controlled through a motion control interface; the motion control interface is an interface defined by PLCopenpart 3.

[0040] Optionally, the CNC code interpreter supports conditional judgment instructions, jump instructions, and subroutine call instructions.

[0041] Optionally, by modifying the configuration file, the actuator can control multiple CNC devices that are processing simultaneously, and the devices exchange information and perform mutual exclusion operations by sharing global variables;

[0042] The actuator receives processing programs, modifies parameters, and sends remote commands from the upper-level system; the upper-level system includes a MES system.

[0043] The actuator modifies the parameters of the CNC system and receives remote start / stop commands and sends the CNC system's own status data via TCP / IP transmission.

[0044] According to the specific embodiments provided in this application, the following technical effects are disclosed:

[0045] This application provides a general CNC method and system. The method includes: acquiring a part machining program; converting the part machining program into an execution queue after lexical and syntactic analysis; acquiring the machining trajectory in the execution queue; calculating the velocity of the curve transition points in the machining trajectory using a velocity look-ahead method; densifying the data points of the machining trajectory using linear interpolation or circular interpolation to obtain a densified machining trajectory; and controlling the controlled object using a 7-segment velocity S-curve based on the densified machining trajectory and the velocity of the curve transition points. The actuator can control multiple CNC devices that are machining simultaneously, and the devices exchange information and perform mutually exclusive operations by sharing global variables. This application analyzes the machining trajectory in advance and densifies the data points of the machining trajectory, ensuring accurate alignment between components throughout the entire process. This allows for simultaneous automatic loading and unloading or machining using different cutting tools without the need for re-alignment. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 A flowchart of the processing of a numerical control system interpreter provided in an embodiment of this application.

[0048] Figure 2 This is a flowchart illustrating the processing of a numerical control system interpolator provided in an embodiment of this application.

[0049] Figure 3 This is a schematic diagram of a numerical control system interface provided in an embodiment of this application.

[0050] Figure 4 This is a flowchart illustrating the dynamic scaling adjustment process of a CNC system according to an embodiment of this application. Detailed Implementation

[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0052] This application provides a general CNC method and system. The method includes: the CNC system providing multi-channel operation, with each channel operating independently, and information transfer and mutual exclusion operations achieved through shared global variables. The CNC system interpreter interprets the machining program's actions; after lexical and syntactic analysis, it obtains the data structures required by the operation and trajectory planning modules and places them in a queue; the trajectory planning module uses a speed-lookahead algorithm to calculate the entry and exit speeds of all motion commands in the queue; during operation, the interpolator records the current curve's running time, obtains the current curve position from the function relationship between running time and curve position constructed by the planner, and calculates the corresponding motor position using the motion type, inverse kinematics, and transmission ratio. During operation, the multiplier can be adjusted at any time to change the running speed. To improve system openness and flexibility, an FTP server, TCP / IP command channel, and Web Service are provided to respond to files and commands from upper-layer systems such as MES. Through the solution of this application, a highly open and general-purpose CNC system can be realized.

[0053] The input data processing program receives the input part machining program, decodes and processes the machining instructions and data represented by standard codes, and stores them in a prescribed format. Some systems also perform compensation calculations or pre-calculations for interpolation operations and speed control. Typically, the input data processing program includes three parts: input, decoding, and data processing.

[0054] A trajectory planner maps displacement, velocity, and acceleration curves during the motion of a CNC system, relating to the kinematics and dynamics of the mechanism. To reduce equipment vibration and improve operational smoothness, a minimum requirement for trajectory planning is a continuous acceleration curve. Traditional CNC trajectory planning is performed on a single NC program segment, resulting in low machining efficiency.

[0055] Interpolation controllers refer to the coordinated process that determines the sequence, displacement, direction, and velocity of each coordinate axis during linkage. The most important factor affecting the interpolation effect in CNC systems is real-time performance. Because CNC interpolation operations not only require high real-time performance but also involve large amounts of data, a better approach is to implement the interpolation operations of the master station within a real-time operating system environment. Currently, research on real-time operating systems is relatively mature, and many mature products are available on the market, such as RTX, VxWorks, uC / OS-II, RT-Linux, QNX, and KRMotion.

[0056] The CNC system performs interpolation and densification calculations on intermediate output points based on data provided in the workpiece machining program, such as the type of curve, start point, end point, and predetermined speed. This densification calculation must not only strictly adhere to the given trajectory requirements but also meet the requirements for smooth acceleration and deceleration of the mechanical system. Based on the calculation results, position commands to form feed motions are issued to each coordinate axis. This process is called interpolation.

[0057] The position command of the feed motion is calculated by interpolation calculation and controlled and adjusted by the position closed loop, speed loop and current loop in the CNC or servo system. The output current drives the motor to drive the worktable or tool to make corresponding movements and complete the machining task specified in the program. In terms of real-time communication between the interpolation controller and the key servo drive device, pulse technology is still the main technology. As a replacement technology for pulse technology, real-time Ethernet bus technology, the most prominent one is EtherCAT, which has become the next technology development trend and is in a rapid development stage. Real-time Ethernet bus technology has the following advantages: (1) fast transmission speed, large data packet capacity and long transmission distance; (2) high cost performance using general Ethernet components.

[0058] Traditional CNC systems lack a unified, effective, and high-speed channel for interconnection with other control and network devices. Information is locked in a "black box," making each piece of equipment an "island" of automation, hindering the networking and informatization development of enterprises. A trend in manufacturing is to increase equipment flexibility. Machine tool flexibility refers to the ability of a machine tool to be modified to adapt to processing different workpieces. The development of flexible technology and the continuous evolution of the concept of flexibility are due to the diversity of social demands for products and the variability of products themselves. As the era of mass production is gradually being replaced by production that adapts to dynamic market changes, the survivability and competitiveness of a manufacturing automation system largely depend on its ability to produce a variety of low-cost, high-quality products within a short development cycle. Flexibility has thus acquired a significant position.

[0059] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0060] Example 1:

[0061] In one exemplary embodiment, a general CNC method is provided, including the following steps S1 to S6. Wherein:

[0062] S1. Obtain the part machining program.

[0063] S2. After lexical and syntactic analysis, the part processing program is converted into an execution queue.

[0064] Specifically: First, obtain the keywords of each part in the part processing program; determine whether the keywords are G-code; if they are G-code, use a G-code interpreter to extract information and check for errors, and record the distance of the motion mode and motion curve, as well as the running speed information, to obtain the execution queue; if they are not G-code, determine whether they are variable operations; if they are variable operations, process them according to the corresponding variable operations; if they are not variable operations, determine whether they are the first program; if they are the first program, execute them according to the first program; the first program includes: jump, subroutine call, and condition judgment; if they are not the first program, perform JSON expression judgment; if they are, process them with a JSON parser, otherwise report an unknown instruction error.

[0065] S3. Obtain the processing trajectory in the execution queue.

[0066] S4. Using the speed look-ahead method, calculate the speed of the transition point of the curve in the processing trajectory.

[0067] In this embodiment, the velocity look-ahead method is first used to calculate the entry and exit velocities of each segment of motion commands in the current command buffer based on the distance and velocity of the current command in the execution queue; then, the motion velocity of the transition point is calculated based on the parameters set in the configuration file and the acceleration and trajectory error strategy.

[0068] S5. The machining trajectory is densified by using linear interpolation or circular interpolation to obtain the densified machining trajectory.

[0069] S6. A 7-segment speed S-curve is adopted to control the controlled object based on the speed of the densified machining trajectory and the transition point of the curve; wherein, the actuator can control multiple CNC devices that process simultaneously, and the devices exchange information and perform mutual exclusion operations by sharing global variables.

[0070] As a specific implementation method, this embodiment can realize instruction interpretation, trajectory planning, interpolation, and dynamic scaling adjustment. The operating modes include automatic, MDI, JOG, and single-step mode. It opens FTP server, TCP / IP command channel and WebService to respond to files and instructions from upper-layer systems such as MES. The hardware platform only needs to be under the real-time system.

[0071] The CNC code interpreter is crucial to machining efficiency and quality; it is an essential means of parsing user code and plays a vital role. The level and efficiency of CNC program compilation are significant factors affecting CNC machining efficiency. The interpreter interprets the input part machining program, performs lexical and syntactic analysis, and then obtains the data structures needed by other modules of the CNC system, placing them in a queue.

[0072] It can interpret commonly used G-codes, such as instructions for fast positioning, linear interpolation, circular interpolation, delay, and coordinate system transformation.

[0073] Building on this, the interpreter supports variable operations for scenarios involving the same instruction at different coordinate positions and regular cyclical movements.

[0074] In order to achieve different execution effects based on different external environmental conditions during the processing, the interpreter supports conditional judgment instructions, jump instructions, and subroutine calls.

[0075] To achieve the above objectives, this embodiment develops a trajectory planner for a CNC system, comprising:

[0076] The planner uses a speed look-ahead algorithm based on acceleration and trajectory error strategies to ensure that the speed of the machining curve does not drop to zero during the transition process. This effectively achieves high-speed connection of transition speeds between continuous trajectories, greatly shortens the machining time, and improves machining efficiency.

[0077] Speed ​​look-ahead involves analyzing the machining trajectory in advance for each instruction sent by the interpreter, and determining the speed of the curve transition point based on the analysis.

[0078] The planner uses a 7-segment speed S-curve. The core idea of ​​the S-curve algorithm is to prevent sudden changes in acceleration, thereby enabling the speed control of the controlled object to have fast and smooth characteristics.

[0079] To achieve the above objectives, this embodiment develops a numerical control system interpolator, comprising:

[0080] The process by which a machine tool CNC system determines the tool's motion trajectory according to a certain method. It can also be described as the method of calculating the intermediate points between known points using a certain algorithm based on some data on a known curve; this is also called "data point densification." Basic requirements for an interpolator: (1) The amount of raw data required for interpolation is relatively small. (2) It has high interpolation accuracy, with no cumulative error in the interpolation results, and local deviations cannot exceed the allowable error (generally, it should be less than the specified resolution). (3) Along the feed path, the feed speed is constant and meets the machining requirements. (4) The hardware implementation is simple and reliable, the software algorithm is concise, and the calculation speed is fast.

[0081] To achieve the above objectives, this embodiment develops a CNC system operation mode processing method, including: For better and more convenient use of the CNC system, the CNC system should have multiple modes. The system modes include automatic mode, MDI mode, JOG mode, single-step mode, and homing mode.

[0082] To achieve the above objectives, this embodiment develops a dynamic magnification adjustment method for CNC systems. This method includes: the magnification of the CNC machine tool primarily changes the operating speed of rapid motion and linear / circular interpolation. For ease of debugging, during normal machining, the corresponding operating speed can be changed by switching the magnification knob on the operating interface.

[0083] To achieve the above objectives, this embodiment develops a multi-channel processing method for CNC systems, including: As CNC machine tools develop towards larger and more complex sizes, the number of control axes of CNC machine tools is increasing, the required functions are also increasing, and the requirements for the simultaneity of processing are becoming higher and higher. Often, it is required that the machine tool can process different parts and perform different operations at the same time, and that they are independent of each other and do not affect each other. This requires the CNC system to have multi-channel technology.

[0084] By modifying the configuration file, the system can control multiple CNC machines that are processing simultaneously. The machines can exchange information and perform mutual exclusion operations by sharing global variables.

[0085] To achieve the above objectives, this embodiment develops a flexible processing method for CNC system machining instructions, including: a trend in manufacturing is to improve equipment flexibility. The CNC system should be able to receive machining programs from upper-level systems such as MES systems, modify parameters, and send remote commands.

[0086] This embodiment provides an open file transfer interface to receive machining programs sent by the upper-level system; through TCP / IP transmission, the parameters of the CNC system can be modified, remote start / stop commands can be received, and the system's own status data can be sent.

[0087] Example 2:

[0088] In one exemplary embodiment, a numerical control system is provided, the numerical control system comprising:

[0089] A CNC code interpreter is used to acquire part machining programs and, after lexical and syntactic analysis, convert the part machining programs into an execution queue. The CNC code interpreter supports conditional statements, jump instructions, and subroutine call instructions.

[0090] The CNC system trajectory planner is used to obtain the machining trajectory in the execution queue and calculate the velocity of the curve transition point in the machining trajectory using a velocity look-ahead method.

[0091] The CNC system interpolator is used to densify the data points of the machining trajectory using linear interpolation or circular interpolation to obtain a densified machining trajectory.

[0092] The actuator is used to control the controlled object by employing a 7-segment speed S-curve based on the speed of the densified machining trajectory and the speed of the transition point of the curve; the actuator can control multiple CNC devices that process simultaneously, and the devices exchange information and perform mutual exclusion operations by sharing global variables.

[0093] The actuator is also used to: record the running time of the current curve in the running system, and obtain the current curve position from the functional relationship between the running time and the curve position constructed by the planner.

[0094] The actuator is also used to: update the current time, with the time interval being the task cycle, and obtain the current curve position from the function relationship between the running time and the curve position constructed by the planner; determine whether there is remaining time after the current curve ends, and if there is no remaining time, update the position information of each axis and return; if there is remaining time, retrieve the next instruction from the buffer, update the time to the remaining time, calculate the path distance, and determine again whether there is remaining time.

[0095] The actuator is also used to: calculate the current coordinates of each motion axis based on the curve type, the characteristic parameters of the curve, and the current curve position; obtain the actual position of each motor axis using the current coordinates of each motion axis according to the inverse kinematics process of the mechanical structure; and calculate the pulse equivalent of the current motor based on the actual position of each motor axis, the transmission ratio, and the value of the motor zero point.

[0096] Please see Figure 1In general, the interpreter of this CNC system first normalizes the input instruction in block 102, and extracts the keywords of each part in block 104. If it is determined to be G-code in block 106, it is handed over to the G-code interpreter in block 108 for information extraction and error checking. The G-code interpreter records the motion mode, calculates the distance of the motion curve, running speed, and other information, and then calls the trajectory planning module to perform speed look-ahead related calculations. The result is written to the command buffer and inserted into the command queue. If it is not G-code, it checks whether it is a variable operation in block 110. If it is, the corresponding variable operation processing in block 112 is executed. If it is not a variable operation, it checks whether it is a jump, subroutine call, or conditional judgment in block 114. If it is, it synchronizes with the command execution buffer until there is a command that has not been executed before executing the content of block 116. If it is not a jump, subroutine call, or conditional judgment, it performs JSON expression judgment in block 118. If it is, it is processed by the JSON parser in block 112; otherwise, an unknown instruction error is reported.

[0097] The planner uses a 7-segment speed S-curve with a maximum acceleration limit to ensure continuous acceleration without abrupt changes. Based on the starting and ending speeds of the line segments, the maximum permissible speed or running time, the maximum allowable acceleration of the mechanical structure, and the length of the running curve, the planner first calculates the actual maximum running speed, then determines the running time of each of the 7 curve segments, and constructs a functional relationship between running time and curve position. The basic formula is as follows:

[0098]

[0099] Speed ​​look-ahead calculates the entry and exit velocities of each motion command segment in the current command buffer based on the distance and speed of the current command. The system uses relevant parameters set in the configuration file to calculate the motion velocity at transition points based on acceleration and trajectory error strategies, thereby improving processing efficiency.

[0100] To meet the precise positioning requirements of CNC systems, the operating system records the current curve's running time and derives the current curve position from the functional relationship between running time and curve position constructed by the planner. This position ensures accuracy and eliminates inaccuracies caused by accumulated computer errors. Since the time gap before the curve's end may not be fully utilized, the system will plan the next curve segment, using the remaining time to calculate the current position on the new segment. This effectively prevents mechanical vibrations caused by sudden acceleration changes.

[0101] In order to achieve the above objectives, Figure 2This is a flowchart illustrating an example method of the interpolator system in this CNC system. The interpolator first updates the current time, with the time interval being the task cycle. The current curve position is obtained from the function relationship between the running time and the curve position constructed by the planner, as shown in block 202. The absolute time used here ensures position accuracy and avoids cumulative errors. At block 204, it checks if there is remaining time due to the current curve's completion. If there is no remaining time (usually because the current curve is not yet complete), it updates the position information of each axis and returns. If there is remaining time, at block 208, it retrieves the next instruction from the buffer, updates the time to the remaining time at block 210, calculates the path distance, and again checks for remaining time at block 212. This is a loop operation.

[0102] Based on the current curve type (straight line or circular arc), the current coordinates of each motion axis are calculated using the curve's characteristic parameters and the current curve position.

[0103] After obtaining the current coordinates of each motion axis, the actual position of each motor axis can be obtained through the inverse kinematics process related to the mechanical structure.

[0104] After obtaining the actual position of each motor shaft, the pulse equivalent of the current motor is calculated based on the transmission ratio and the motor zero-point value. This is controlled by a servo motor.

[0105] Considering the characteristics of general-purpose CNC systems, we should not be bound by certain specific hardware. No specific implementation is defined for the actual position of the calculated motor shaft and the actuator (stepper motor or servo motor, etc.).

[0106] Optionally, for stepper motor microcontroller control, the DDA algorithm can be used to implement the interpolation of tiny line segments.

[0107] Optionally, for PC real-time systems, bus control can be added, and the actual position of the motor shaft can be obtained and sent to the servo driver via communication, such as EtherCAT.

[0108] Optionally, for PC systems, a board-based pulse control can be added. After obtaining the actual position of the motor shaft, the position can be sent to the board's buffer through the board's API function, thereby controlling the movement of the servo drive.

[0109] Optionally, for a motion controller, after obtaining the actual position of the motor shaft, the motion of the servo drive can be controlled through a motion control interface (such as the interface defined by PLCopenpart 3).

[0110] The system has the following modes: automatic mode, MDI mode, JOG mode, single-step mode, and zero-return mode. Figure 3 This displays the user interface of this CNC system.

[0111] Automatic mode is a mode in which, after selecting a machining program file, the process runs automatically according to the instructions in the file until the machining is completed.

[0112] MDI (Manual Data Input) mode is a manual input program control mode. In MDI mode, codes are manually entered in the MDI input area of ​​the interface, such as G28 zeroing, tool change, chuck unclamping, power head tool change, power head rotation, etc., and then the start button is pressed to execute the code. It can generally be used in conjunction with manual mode (handwheel) for tasks such as alignment, tool setting, and inspection.

[0113] JOG mode is a "jog" function, primarily emphasizing manual operation by the user for point-and-click operations in CNC systems. Specifically, there are two jog operation modes: continuous jog, the most common, where pressing the jog button causes the corresponding axis to rotate continuously at a set speed, stopping immediately upon releasing the button; and incremental jog, where pressing the jog button causes the axis to rotate at a set speed and a fixed angle (or distance), stopping once this angle is reached, regardless of whether the button is held down. Releasing and pressing the button again initiates the same movement.

[0114] Single-step mode is a mode in which, after selecting a machining program file, one statement is executed according to the instructions in the file. After the statement ends, the start button is pressed again to execute another statement, and so on until the machining is completed.

[0115] There are multiple homing modes, primarily designed to provide the CNC system with a position reference point. Depending on the application, each system has a different homing method, which can be selected through a configuration file. These include sensor-based homing, encoder absolute position homing, and current position homing.

[0116] The magnification of a CNC machine tool primarily alters the operating speed of rapid motion and linear / circular interpolation. For ease of adjustment, during normal machining, the magnification knob on the operating interface can be used to change the corresponding operating speed. When modifying the magnification, it is crucial to avoid abrupt changes in the current motion acceleration; a new path planning operation must be performed based on the current speed, acceleration, remaining distance, etc.

[0117] In order to achieve the above objectives, Figure 4 This is a flowchart illustrating an example method of the dynamic scaling adjustment system of this CNC system.

[0118] The dynamic feed rate adjustment system of this CNC system operates after a change in feed rate, obtaining the new feed rate value at block 402. At block 404, it determines initial velocity, displacement, and other parameters based on the current motion state and modifies the instruction buffer contents. At block 406, it re-plans the path for all contents in the instruction buffer. At block 408, it modifies the current motion parameters.

[0119] The system organizes each channel's CNC system into a separate structure, with all system-related configurations, parameters, and states operating independently. This allows multiple systems to run independently without interfering with each other. It's worth noting that motor position parameters, due to high real-time requirements, are typically one cycle slower. At the beginning of the current cycle, the motor position calculated in the previous cycle is sent to the driver or other real-time modules; at the end of the current cycle, the motor position to be achieved in the next cycle is calculated.

[0120] Devices with multiple channels typically need to exchange information, such as data and mutual exclusion operations. This can be achieved by sharing global variables within the system.

[0121] A trend in manufacturing is to increase equipment flexibility, facilitating the reception of processing programs from upper-level systems such as MES, parameter modification, and the sending of remote commands. This system provides an FTP file transfer server interface, allowing upper-level systems to log in to the FTP server using a username and password to transfer files to be processed. It also provides a TCP / IP command interface, enabling the control of system startup, shutdown, pause, and file loading operations using custom protocols.

[0122] The system has developed a JSON parser, which allows the upper-level system to use JSON expressions to modify system parameters such as speed limits, acceleration limits, jerk parameter limits, and software limits via a network command interface.

[0123] Compared with existing technologies, this embodiment discloses a CNC system structure; it implements a CNC system interpreter, including commonly used G-codes, conditional judgment instructions, jump instructions, and subroutine calls, and discloses the interpreter system program flowchart; it develops a CNC system trajectory planner, realizing a 7-segment speed S-curve with speed look-ahead function; it discloses the CNC system interpolator program flowchart and provides a method for obtaining the current time motor axis position; it develops the CNC system's automatic mode, MDI mode, JOG mode, single-step mode, and homing mode, and provides the software interface; it discloses the CNC system dynamic scaling program flowchart; it provides a multi-channel implementation method for the CNC system and the use of shared variables; it emphasizes the flexibility of the CNC system, which is also an important foundation of Industry 4.0, and develops an FTP file transfer server interface, a Web Service service interface, a TCP / IP command interface, and a JSON parser for the upper layer, enabling the upper-layer system to easily remotely control and monitor the equipment, greatly improving the overall flexibility of the equipment.

[0124] Example 3:

[0125] This embodiment provides a general CNC method, including: a multi-channel operation mode, a system interpreter, a trajectory planning module, an interpolator, dynamic scaling adjustment, a TP server, a TCP / IP command channel, and a Web Service. Its key features include: providing a multi-channel operation mode; the trajectory planning module employs a speed-lookahead algorithm to calculate the entry and exit speeds of all motion commands in the queue; the interpolator calculates the current position during runtime; dynamic scaling adjustment allows for real-time scaling to change the operating speed; and to improve equipment flexibility, an FTP server, a TCP / IP command channel, and a Web Service are provided to respond to files and commands from upper-layer systems such as MES.

[0126] The CNC system offers a multi-channel operation mode, with each channel operating independently. Information can be transferred and mutually exclusive through the sharing of global variables, enabling the system to be used in more complex working conditions.

[0127] Dynamic scaling allows for adjusting the scaling factor at any time to change the running speed, and an implementation diagram is provided.

[0128] To enhance system openness and flexibility, an FTP server, TCP / IP command channel, and Web Service are provided to respond to files and commands from upper-layer systems such as the MES system. This invention enables the development of a highly open and universal CNC system, laying the hardware foundation for Industry 4.0.

[0129] This embodiment develops a simple CNC system that runs in a Windows real-time environment, using EtherCAT to drive servo motors and I / O. It features a 1ms loop cycle, S-curve acceleration (Jerk and maximum acceleration limits), speed look-ahead, dynamic scaling, variable operations, conditional statements and jumps, subroutine calls, and modes including Auto / MDI / JOG / Single Step. Supported G-codes include G0, G1, G2, G3, G4, G10, G17, G18, G19, G20, G21, G28, G28.1, G28.3, G30, G30.1, G53, G54, G55, G56, G57, G58, G59, G61, G61.1, G64, G80, G90, G91, G92, G92.1, G92.2, G92.3, G93, G94, CALL, and RET.

[0130] 2d2 S1}4g6 v,^9m.

[0131] Later, we will add features such as zeroing, PROBE, radius compensation, improved alarm functions, multi-channel functionality, and HSC functionality.

[0132] Here's an example of drawing a five-pointed star:

[0133] #0 = 5;

[0134] #1 = 10;

[0135] #2 = 90;

[0136] #3 = 0;

[0137] F700;

[0138] N100 G1 X[#1*COS(#2)]Y[#1*sin(#2)];

[0139] G04 p0.5;

[0140] #3 = [#3 + 1];

[0141] #2 = [#2 + 2 * 360 / #0];

[0142] IF#3LE 5GOTO O100;

[0143] M30.

[0144] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0145] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0146] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0147] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A general numerical control method, characterized in that, The general numerical control method includes: Obtain the part machining program; After lexical and syntactic analysis, the part processing program is converted into an execution queue; Obtain the processing trajectory in the execution queue; The velocity of the transition point of the curve in the machining trajectory is calculated using the velocity look-ahead method; The machining trajectory is densified by using linear interpolation or circular interpolation to obtain a densified machining trajectory; A seven-segment speed S-curve is used to control the controlled object based on the speed of the densified machining trajectory and the speed of the transition point of the curve; wherein, the actuator can control multiple CNC devices that process simultaneously, and the devices exchange information and perform mutual exclusion operations by sharing global variables.

2. The general numerical control method according to claim 1, characterized in that, After lexical and syntactic analysis, the part processing program is converted into an execution queue, specifically including: Obtain keywords for each part of the part machining program; Based on the keywords, determine whether it is G-code; if it is G-code, use the G-code interpreter to extract information and check for errors, and record the distance of the motion pattern and motion curve, as well as the running speed information, to obtain the execution queue; If it is not G code, then determine whether it is a variable operation; if it is a variable operation, then process it according to the corresponding variable operation. If it is not a variable operation, then determine whether it is the first procedure; if it is the first procedure, then execute the first procedure; the first procedure includes: jump, subroutine call and condition judgment; If it is not the first program, then perform a JSON expression check; if it is, then process it using the JSON parser; otherwise, report an unknown instruction error.

3. The general numerical control method according to claim 1, characterized in that, The velocity of the transition point of the curve in the machining trajectory is calculated using the velocity look-ahead method, specifically including: Using the speed look-ahead method, the entry and exit speeds of each motion instruction in the current command buffer are calculated based on the distance and speed of the current instruction in the execution queue. The motion velocity at the transition point is calculated based on the parameters set in the configuration file, according to the acceleration and trajectory error strategy.

4. A numerical control system, characterized in that, The numerical control system includes: A CNC code interpreter is used to obtain the part machining program and, after lexical and syntactic analysis, convert the part machining program into an execution queue. The CNC system trajectory planner is used to acquire the machining trajectory in the execution queue and calculate the velocity of the curve transition point in the machining trajectory using a velocity look-ahead method. The CNC system interpolator is used to densify the data points of the machining trajectory using linear interpolation or circular interpolation to obtain a densified machining trajectory. The actuator is used to control the controlled object by employing a 7-segment speed S-curve based on the speed of the densified machining trajectory and the speed of the transition point of the curve; the actuator can control multiple CNC devices that process simultaneously, and the devices exchange information and perform mutual exclusion operations by sharing global variables.

5. The CNC system according to claim 4, characterized in that, The actuator is also used for: The system records the current running time of the curve, and the current curve position is obtained from the functional relationship between the running time and the curve position constructed by the planner.

6. The CNC system according to claim 4, characterized in that, The actuator is also used for: The current time is updated, with the time interval being the task cycle. The current curve position is obtained from the function relationship between the running time and the curve position constructed by the planner. Determine if there is any remaining time after the current curve ends; if there is no remaining time, update the position information of each axis and return. If there is remaining time, retrieve the next instruction from the buffer, update the time to the remaining time, calculate the path distance, and check again if there is remaining time.

7. The CNC system according to claim 4, characterized in that, The actuator is also used for: Based on the current curve type, the current coordinates of each motion axis are calculated using the curve's characteristic parameters and the current curve position. Using the current coordinates of each motion axis, the actual position of each motor axis is obtained according to the inverse kinematics of the mechanical structure. Based on the actual position of each motor shaft, and using the transmission ratio and motor zero-point values, the pulse equivalent of the current motor is calculated.

8. The CNC system according to claim 7, characterized in that, After obtaining the actual position of the motor shaft, the motion of the servo driver is controlled through the motion control interface; the motion control interface is the interface defined in PLCopen part 3.

9. The CNC system according to claim 4, characterized in that, The CNC code interpreter supports conditional judgment instructions, jump instructions, and subroutine call instructions.

10. The CNC system according to claim 7, characterized in that, By modifying the configuration file, the actuator can control multiple CNC machines that are processing simultaneously, and the machines exchange information and perform mutual exclusion operations by sharing global variables. The actuator receives processing programs, modifies parameters, and sends remote commands from the upper-level system; the upper-level system includes a MES system. The actuator modifies the parameters of the CNC system and receives remote start / stop commands and sends the CNC system's own status data via TCP / IP transmission.