Multi-spindle concurrent processing obstacle avoidance system and method based on digital twinning and CBF

By combining digital twins with high-order control barrier functions, the workpiece geometry is updated in real time and high-order control barrier function constraints are constructed. The spindle posture is adjusted analytically using zero-space redundancy, which solves the collision interference problem of multi-spindle CNC machine tools, realizes safe and dynamic obstacle avoidance control, and improves machining safety and accuracy.

CN122018436APending Publication Date: 2026-05-12HANBA INTELLIGENT TECHNOLOGY (TAIZHOU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANBA INTELLIGENT TECHNOLOGY (TAIZHOU) CO LTD
Filing Date
2025-12-31
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

When multi-spindle CNC machine tools move concurrently within a limited workspace, there is a risk of collision and interference between spindles and between spindles and dynamically changing workpieces. Existing obstacle avoidance methods cannot respond to changes in the machining process in real time and do not make full use of the kinematic redundancy of the machine tool, which affects machining safety and accuracy.

Method used

A multi-spindle concurrent machining obstacle avoidance system based on digital twins and higher-order control barrier functions (CBF) is adopted. The workpiece geometry is updated in real time through a digital twin mapping unit. Combined with hierarchical state observation and safety barrier control unit, a quadratic programming solver is embedded to construct higher-order control barrier function constraints. The spindle attitude is adjusted using a zero-space redundancy analytical module to achieve dynamic obstacle avoidance.

Benefits of technology

It achieves real-time, safe, and dynamic obstacle avoidance in multi-spindle concurrent machining processes, improving machining safety and accuracy, avoiding collisions and jitter caused by inertia, optimizing intelligent collaborative decision-making for multi-objective conflicts, and ensuring machining continuity and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018436A_ABST
    Figure CN122018436A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of large multi-axis linkage numerical control machining, particularly relates to a multi-spindle concurrent machining obstacle avoidance system and method based on digital twinning and CBF, and solves the problem that multi-spindle dynamic obstacle avoidance behaviors cannot be intelligently coordinated. The system comprises a digital twin mapping unit which is used for simulating a material removal process in real time and updating a dynamic geometric model of a workpiece; the hierarchical state observation unit is used for calculating the minimum directed distance between each main shaft and a workpiece and between the main shafts and the gradient of the minimum directed distance in real time by adopting algorithms such as an octree and GJK; and the safety barrier control unit is embedded in an interpolation period of the numerical control system, constructs a high-order control barrier function constraint with the relative order being two by using the distance information, and generates a correction control instruction which is safe and is as close as possible to an original instruction by solving a quadratic programming problem on the premise of fully considering the dynamic limitation of a machine tool shaft system. And the real-time, dynamic and collision-free machining effect is achieved when the multiple spindles cooperatively work in the narrow space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of large-scale five-axis linkage CNC machining technology, and specifically relates to a multi-spindle concurrent machining obstacle avoidance system and method based on digital twin and CBF. Background Technology

[0002] With the development of intelligent manufacturing, multi-spindle CNC machine tools have been widely used because they can simultaneously process multiple surfaces of a workpiece, significantly improving processing efficiency. However, the concurrent movement of multiple spindles within a limited workspace greatly increases the risk of collisions and interference between spindles and between spindles and dynamically changing workpieces. This severely restricts the realization of the equipment's potential and the safety of the processing.

[0003] Traditional obstacle avoidance methods are mainly divided into two categories: 1. Offline pre-planning: Collision detection and trajectory adjustment are performed through simulation software before generating CNC code. This method cannot cope with sudden situations during machining, real-time changes caused by tool wear or workpiece clamping errors, and has poor flexibility. 2. Real-time control based on low-order barrier functions: The obstacle avoidance problem is transformed into real-time control constraints. However, traditional (first-order) control barrier functions only consider position and velocity, and do not fully consider the dynamic characteristics of machine tool servo axes such as acceleration and inertia. In high-speed and high-dynamic scenarios, the obstacle avoidance response may lag due to system inertia, thereby causing collisions or severe vibrations, affecting machining accuracy and equipment lifespan.

[0004] Furthermore, existing technologies lack the ability to accurately and in real-time perceive dynamically changing workpiece geometry, and also fail to effectively utilize the kinematic redundancy present in multi-axis machine tools, especially composite machine tools and robotic milling systems, to achieve disturbance-free obstacle avoidance through attitude self-adjustment.

[0005] Therefore, there is an urgent need for a dynamic obstacle avoidance control system and method that can deeply integrate real-time environmental perception, consider system dynamics, and intelligently coordinate multi-axis behavior. Summary of the Invention

[0006] The purpose of this invention is to address the aforementioned problems in the existing technology by proposing a multi-spindle concurrent machining obstacle avoidance system based on digital twin and CBF.

[0007] The objectives of this invention can be achieved through the following technical solutions: A multi-spindle concurrent machining obstacle avoidance system based on digital twin and CBF includes: The digital twin mapping unit is used to acquire real-time joint status data of the physical machine tool and perform voxel-level or mesh-level Boolean subtraction operations based on preset cutting parameters and tool geometry model to update the dynamic geometric representation of the workpiece in real time. The hierarchical state observation unit is configured to roughly divide the machine tool workspace using an octree structure, and combine the GJK algorithm and the extended polyhedron algorithm to calculate the minimum directed distance h(x) between each machining spindle and the dynamic workpiece, as well as between the spindles themselves, and its gradient ∇h(x) with respect to the state variables. The safety barrier control unit is embedded in the interpolation cycle of the CNC system and is used to solve quadratic programming optimization problems with slack variables. The digital twin mapping unit includes predictive material removal logic. Before performing collision detection calculations, it pre-calculates the tool sweep volume for the next N control cycles based on the current CNC code instructions and logically removes this volume from the current workpiece model, thereby eliminating the expected cutting contact area in collision detection. The safety barrier control unit uses the minimum directed distance h(x) to construct a higher-order control barrier function (CBF) constraint with a relative order of 2. The constraint includes the first and second derivative terms of the distance function to take into account the inertial dynamics constraints of each axis of the machine tool. The quadratic programming solver minimizes the deviation between the actual output command and the nominal processing command, and generates the corrected safety control command u, under the premise of satisfying the constraints of the higher-order control barrier function. The objective function of the quadratic programming solver is: ,in The nominal instructions obtained from G-code parsing. Let Q be a slack variable, and let Q and p be weight matrices.

[0008] This invention is a control scheme based on high-order control barrier functions and digital twin technology to achieve real-time, safe, and dynamic obstacle avoidance for multiple spindles during concurrent machining processes, wherein: The digital twin mapping unit communicates with the physical machine tool controller to acquire real-time joint status data of each spindle, such as position and speed. This unit incorporates an initial workpiece CAD model, a tool geometry model, and preset cutting parameters. Utilizing a GPU parallel computing architecture, the digital twin mapping unit performs Boolean subtraction operations. Within each control cycle, it performs voxel-level or mesh-level Boolean subtraction operations based on the current tool pose, accurately simulating the material removal process. This allows for real-time updates and output of the workpiece's dynamic 3D geometric representation, providing an accurate environmental model for collision detection. Furthermore, the digital twin mapping unit includes predictive material removal logic. Before calculating collision detection, this logic, based on the current CNC code segment, pre-determines the sweep volume of the tool over a preset number of N control cycles and temporarily removes this volume from the current workpiece model. This enables the system to distinguish between "expected cutting contact" and "unexpected dangerous interference," avoiding misjudging normal cutting processes as collisions.

[0009] The hierarchical state observation unit receives the dynamic workpiece model and the real-time state of each spindle from the digital twin mapping unit, but it only updates the voxel state and calculates the gradient within a local region of interest centered on the tool tip with a radius of R. The hierarchical state observation unit adopts a two-level collision detection architecture. The coarse detection layer uses an octree structure to quickly divide and search the entire machine tool workspace, rapidly filtering out object pairs that may interfere, and significantly narrowing the fine detection range. The fine detection layer, for the potential interference pairs output by the coarse layer, combines the GJK algorithm and the extended polyhedron algorithm to accurately calculate the minimum directed distance h(x) between each machining spindle and the dynamic workpiece, as well as between each spindle and each other, and simultaneously calculates the gradient ∇h(x) of this distance with respect to the system state variable x. h(x) > 0 indicates safety, and h(x) ≤ 0 indicates a collision.

[0010] The safety barrier control unit is embedded within the real-time interpolation cycle of the CNC system. Its core is a quadratic programming solver with slack variables. This solver minimizes the difference between the actual output control command u and the nominal machining command u. des The deviation is the optimization objective, and its key constraint is the high-order control barrier function constraint constructed by h(x) and ∇h(x) output by the hierarchical state observation unit.

[0011] In the obstacle avoidance system described above, the higher-order control barrier function constraint satisfies the following differential inequality form: Where x is the machine tool joint state vector, δ is a non-negative relaxation variable used to ensure the feasibility of the solution, and k1 and k2 are gain coefficients adaptively adjusted based on the maximum braking or acceleration capability of the servo axis. The values ​​of k1 and k2 are related to the maximum acceleration a of each axis. max and maximum jerk j max They are directly proportional.

[0012] Furthermore, h(x) is the safety distance function, representing the Euclidean distance between the tool and the obstacle surface. Obstacle avoidance is triggered when h(x) reaches 0. ḣ(x) is the distance change rate, referring to the relative speed at which the tool approaches or moves away from the obstacle. When ḣ(x) < 0, it indicates a dangerous approach.

[0013] The higher-order control barrier function extends the relative order of the distance function h(x) to 2, and its constraint form includes the first and second derivative terms of h(x), thus incorporating the system's acceleration capability. Here, k1 and k2 are positive gain coefficients adaptively adjusted according to the maximum acceleration / braking capability of each servo axis, and δ is a non-negative relaxation variable used to ensure the feasibility of the optimization problem in extreme cases and prevent unsolvable problems. By solving this quadratic programming problem online, the system can generate a modified safety control command u, which, while strictly ensuring all higher-order safety constraints, approximates the original machining intention as closely as possible.

[0014] In the obstacle avoidance system described above, the higher-order control barrier function constraint satisfies the following cascaded form: The following inequalities must be satisfied. .

[0015] Where L f L g For Li's derivative; As a first-order barrier constraint, the maximum approach velocity is limited to decrease as the distance decreases; The second-order barrier constraint limits the maximum braking acceleration to prevent overshooting due to inertia; k1 and k2 are gain coefficients that determine the braking stiffness of the system. It needs to be set according to the torque curve of the servo motor.

[0016] The obstacle avoidance system described above also includes a zero-space redundancy analysis module. This module activates when the kinematic chain of the machining spindle has redundant degrees of freedom. When a collision risk is detected, the module calculates the zero-space projection matrix of the Jacobian matrix of each spindle's kinematic chain and generates an attitude reconstruction velocity vector within this zero space. This attitude reconstruction velocity vector is superimposed on the safety control command, allowing the spindle to change its spatial positioning attitude while maintaining the tool tip trajectory and tool axis vector unchanged. Further, a Jacobian matrix J is constructed, and the zero-space projection matrix N = I−J†J is calculated; the joint velocity vector generated by the obstacle avoidance task... Additional control laws are generated by mapping the projection matrix onto the null space.

[0017] When a collision risk is detected, the null-space redundancy analysis module first determines whether the main axis kinematic chain with the risk has redundant degrees of freedom. If so, it calculates the null-space projection matrix N = IJ^†J of the main axis kinematic Jacobian matrix J, where J^† is the pseudo-inverse. Subsequently, an attitude reconstruction velocity vector is generated to adjust the main axis body attitude to avoid obstacles without affecting the tool tip position and tool axis direction. This vector is projected into the null space to obtain an additional control law, which is then superimposed on the safety control command u to achieve "disturbance-free obstacle avoidance".

[0018] A multi-spindle concurrent machining obstacle avoidance method based on digital twin and CBF, applicable to the aforementioned obstacle avoidance system, performs the following steps when a potential interference risk is detected: S1: Attitude negotiation and redundancy resolution, determine whether there are redundant degrees of freedom in the system; if so, avoid physical interference by rotating non-critical branch axes or redundant axes while keeping the tool tip contact point and tool vector unchanged. S2: Priority dynamic scheduling, which allocates master and slave priorities according to the cutting load or accuracy level of the current machining task; the machining head with lower priority actively performs large-range attitude deflection or feed rate reduction; S3: Execute early warning and avoidance. If there are no redundant degrees of freedom or attitude negotiation is limited, then proceed according to task priority W. i Reduce the feed rate of the slave machining head and perform forced avoidance along the direction of the escape vector generated by the extended polyhedron algorithm.

[0019] The control method of this invention is matched with the control system. In step S1, the zero-space redundancy analysis module is invoked first to determine whether the spindle involved can avoid the obstacle by adjusting its posture through its own redundant degrees of freedom. If so, while keeping the tool tip trajectory and tool axis vector absolutely unchanged, the spatial position of the spindle head is changed by rotating the non-critical branch axis to safely avoid the interference. In step S2, if the redundancy adjustment cannot completely avoid the collision, or the system has no redundant degrees of freedom, priority arbitration is initiated. Based on the current machining stage, cutting load, or process importance, the master and slave priorities are dynamically allocated. The machining stages include finishing > semi-finishing > roughing > idle. The lower priority machining head needs to assume more avoidance responsibility, such as performing a larger range of trajectory deflection or feed rate reduction. In step S3, if the above measures are still insufficient to eliminate the risk, the task priority weight W is used to determine the appropriate action. i The feed rate of the slave machining head is proportionally reduced. At the same time, based on the minimum separation vector direction generated by the extended polyhedron algorithm, an additional speed command away from the obstacle is applied to the slave machining head to perform forced avoidance until the safe distance is restored.

[0020] In the above obstacle avoidance method, the redundancy elimination is for systems with three rotary axes or redundant linear axes. It utilizes the zero-space projection characteristics of the Jacobian matrix to adjust the spatial occupancy of the spindle head overhang arm without interrupting the machining path.

[0021] Redundancy resolution is specifically designed for high-degree-of-freedom machine tool systems with three rotary axes or redundant linear axes. Its core lies in utilizing the zero-space projection characteristics of the kinematic Jacobian matrix, enabling the system to avoid collisions by adjusting the spatial attitude of the main body structure such as the spindle head and cantilever arm without interrupting the predetermined tool path. This achieves "undisturbed obstacle avoidance" at the physical level, transforming redundant degrees of freedom into intelligent resources that ensure machining continuity and accuracy. It is particularly suitable for precision machining scenarios with complex curved surfaces.

[0022] In the obstacle avoidance method described above, the priority scheduling sets the machining head with high precision requirements as high priority during the finishing stage, so that the trajectory does not fluctuate due to obstacle avoidance, and the other machining head in the roughing or idle state undertakes the main avoidance action.

[0023] Priority scheduling mechanism is a dynamic intelligent decision-making mechanism based on real-time process status. During the machining process, the system will actively identify the task stage of each spindle, such as finishing, roughing, or idle, and set the spindle performing high-precision and high-surface-quality processes as high priority to ensure that its trajectory is not interfered with by any obstacle avoidance actions; while the spindle in the roughing or idle state assumes the main responsibility for avoidance. This optimizes multi-objective conflicts at the system level and prioritizes the most critical machining quality while ensuring overall safety.

[0024] Compared with the prior art, the present invention has the following main advantages: 1. By introducing a higher-order control barrier function, the obstacle avoidance constraint is elevated from the geometric level to the dynamic level, enabling the control system to "anticipate" dangers caused by inertia and utilize the system's maximum braking / acceleration capability for smoother and more reliable obstacle avoidance. This fundamentally avoids collisions caused by response lag, resulting in high safety and a response that conforms to dynamics.

[0025] 2. This invention pioneered the application of zero-space projection to multi-spindle obstacle avoidance. By prioritizing the adjustment of redundant attitudes for obstacle avoidance, risks can be eliminated without interrupting or altering the predetermined toolpath (G-code trajectory), maximizing the quality of machined surfaces and the continuity of processes, which is crucial for finishing.

[0026] 3. Based on digital twin-level voxel-level material removal simulation, it provides a dynamic workpiece model synchronized with the physical world, making collision detection results extremely accurate. Combined with predictive material removal logic, it can intelligently distinguish between cutting and interference, reduce false alarms, and ensure accurate and real-time environmental perception.

[0027] 4. Through a dynamic priority scheduling mechanism, the multi-spindle system can intelligently allocate obstacle avoidance tasks according to the real-time process status, optimize the overall processing efficiency, avoid the inefficiency or conflict that may be caused by the traditional fixed priority strategy, and achieve intelligent collaboration and decision optimization.

[0028] 5. The system is based on quadratic programming, which provides a fast solution speed and meets the millisecond-level real-time requirements of CNC systems. The introduction of slack variables ensures the robustness of the system under extreme boundary conditions, guaranteeing that a solution is always available and ensuring its practicality in engineering applications. Attached Figure Description

[0029] Figure 1 This is a simplified schematic diagram of the dynamic obstacle avoidance control system provided by the present invention; Figure 2This is a simplified flowchart of the dynamic obstacle avoidance control method provided by the present invention. Detailed Implementation

[0030] The following are specific embodiments of the present invention, which are described in conjunction with the accompanying drawings. However, the present invention is not limited to these embodiments.

[0031] Specific implementation examples Figure 1 As shown, this multi-spindle concurrent machining obstacle avoidance system based on digital twin and CBF includes: The digital twin mapping unit is used to acquire real-time joint state data of the physical machine tool and perform voxel-level or mesh-level Boolean subtraction operations based on preset cutting parameters and tool geometry model to update the dynamic geometric representation of the workpiece in real time. The digital twin mapping unit includes predictive material removal logic. Before performing collision detection calculation, it pre-calculates the tool sweep volume in the next N control cycles based on the current CNC code instructions and logically removes the volume from the current workpiece model, thereby excluding the expected cutting contact area in collision detection. The hierarchical state observation unit is configured to roughly divide the machine tool workspace using an octree structure, and combine the GJK algorithm and the extended polyhedron algorithm to calculate the minimum directed distance h(x) between each machining spindle and the dynamic workpiece, as well as between the spindles themselves, and its gradient ∇h(x) with respect to the state variables. The safety barrier control unit is embedded in the interpolation cycle of the CNC system and is used to solve quadratic programming optimization problems with slack variables. The digital twin mapping unit includes predictive material removal logic. Before performing collision detection calculations, it pre-calculates the tool sweep volume for the next N control cycles based on the current CNC code instructions and logically removes this volume from the current workpiece model, thereby eliminating the expected cutting contact area in collision detection. The safety barrier control unit uses the minimum directed distance h(x) to construct a higher-order control barrier function constraint with a relative order of 2. The constraint includes the first and second derivative terms of the distance function to take into account the inertial dynamics constraints of each axis of the machine tool. The quadratic programming solver minimizes the deviation between the actual output command and the nominal processing command, and generates the corrected safety control command u, under the premise of satisfying the constraints of the higher-order control barrier function. The objective function of the quadratic programming solver is: ,in The nominal instructions obtained from G-code parsing. Let Q be a slack variable, and let Q and p be weight matrices.

[0032] Specifically, this invention is a control scheme based on high-order control barrier functions and digital twin technology to achieve real-time, safe, and dynamic obstacle avoidance for multiple spindles during concurrent machining, wherein: The digital twin mapping unit communicates with the physical machine tool controller to acquire joint status data of each spindle in real time, such as position and speed. This unit incorporates an initial CAD model of the workpiece, a tool geometry model, and preset cutting parameters. Within each control cycle, it performs voxel-level or mesh-level Boolean subtraction operations based on the current tool pose to accurately simulate the material removal process, thereby updating and outputting the dynamic three-dimensional geometric representation of the workpiece in real time, providing an accurate environmental model for collision detection. Furthermore, the digital twin mapping unit includes predictive material removal logic. Before calculating collision detection, this logic, based on the current CNC code segment, pre-determines the sweep volume of the tool within a preset number of N control cycles and temporarily removes this volume from the current workpiece model. This allows the system to distinguish between "expected cutting contact" and "unexpected dangerous interference," avoiding misjudging normal cutting processes as collisions.

[0033] The hierarchical state observation unit receives the dynamic workpiece model and the real-time status of each spindle from the digital twin mapping unit. It adopts a two-level collision detection architecture. The coarse detection layer uses an octree structure to quickly divide and search the entire machine tool workspace, rapidly filtering out object pairs that may interfere, and significantly narrowing the fine detection range. The fine detection layer, for the potential interference pairs output by the coarse layer, combines the GJK algorithm and the extended polyhedron algorithm to accurately calculate the minimum directed distance h(x) between each machining spindle and the dynamic workpiece, as well as between each spindle and each other, and simultaneously calculates the gradient ∇h(x) of this distance with respect to the system state variable x. h(x) > 0 indicates safety, and h(x) ≤ 0 indicates a collision.

[0034] The safety barrier control unit is embedded within the real-time interpolation cycle of the CNC system. Its core is a quadratic programming solver with slack variables. This solver minimizes the difference between the actual output control command u and the nominal machining command u. des The deviation is the optimization objective, and its key constraint is the high-order control barrier function constraint constructed by h(x) and ∇h(x) output by the hierarchical state observation unit.

[0035] In this embodiment, the higher-order control barrier function constraint satisfies the following differential inequality form: Where x is the machine tool joint state vector, δ is a non-negative relaxation variable used to ensure the feasibility of the solution, and k1 and k2 are gain coefficients that are adaptively adjusted based on the maximum braking or acceleration capability of the servo axis.

[0036] Specifically, the higher-order control barrier function extends the relative order of the distance function h(x) to 2, and its constraint form includes the first and second derivative terms of h(x), thus incorporating the system's acceleration capability. Here, k1 and k2 are positive gain coefficients adaptively adjusted according to the maximum acceleration / braking capability of each servo axis, and δ is a non-negative relaxation variable used to ensure the feasibility of the optimization problem in extreme cases and prevent unsolvable problems. By solving this quadratic programming problem online, the system can generate a modified safety control command u, which, while strictly ensuring all higher-order safety constraints, approximates the original machining intention as closely as possible.

[0037] As an optimization, this dynamic obstacle avoidance control system also includes a zero-space redundancy analysis module. When a collision risk is detected, the zero-space redundancy analysis module calculates the zero-space projection matrix of the Jacobian matrix of each principal axis kinematic chain, and generates an attitude reconstruction velocity vector within this zero space. The attitude reconstruction velocity vector is superimposed on the safety control command, enabling the principal axis to change its spatial positioning attitude while maintaining the tool tip trajectory and tool axis vector unchanged. Further, a Jacobian matrix J is constructed, and the zero-space projection matrix N = I−J†J is calculated; the joint velocity vector generated by the obstacle avoidance task... Additional control laws are generated by mapping the projection matrix onto the null space.

[0038] Specifically, when a collision risk is detected, the null-space redundancy analysis module first determines whether the main axis kinematic chain with the risk has redundant degrees of freedom. If so, it calculates the null-space projection matrix N = IJ^†J of the main axis kinematic Jacobian matrix J, where J^† is the pseudo-inverse. Subsequently, an attitude reconstruction velocity vector is generated to adjust the main axis body attitude to avoid obstacles without affecting the tool tip position and tool axis direction. This vector is projected into the null space to obtain an additional control law, which is then superimposed on the safety control command u to achieve "disturbance-free obstacle avoidance".

[0039] like Figure 2 As shown, the multi-spindle concurrent machining obstacle avoidance method based on digital twin and CBF is applicable to the obstacle avoidance system of this embodiment. When a potential interference risk is detected, the following steps are performed: S1: Attitude negotiation and redundancy resolution, determine whether there are redundant degrees of freedom in the system; if so, while keeping the tool tip contact point and tool vector unchanged, avoid physical interference by rotating non-critical branch axes or redundant axes. The redundancy resolution is for systems with three rotation axes or redundant linear axes. The Jacobian matrix null space projection characteristics are used to adjust the space occupancy of the spindle head overhang arm without interrupting the machining path. S2: Priority dynamic scheduling, which allocates master and slave priorities according to the cutting load or accuracy level of the current machining task; the machining head with lower priority actively performs large-range attitude deflection or feed speed reduction. In the finishing stage, the priority scheduling sets the machining head with high precision requirements as high priority, and the trajectory does not fluctuate due to obstacle avoidance. Instead, the other machining head in the roughing or idle state undertakes the main avoidance action. S3: Execute early warning and avoidance. If there are no redundant degrees of freedom or attitude negotiation is limited, then proceed according to task priority W. i Reduce the feed rate of the slave machining head and perform forced avoidance along the direction of the escape vector generated by the extended polyhedron algorithm.

[0040] Specifically, the control method of this invention is matched with the control system. In step S1, the zero-space redundancy analysis module is invoked first to determine whether the spindle involved can avoid the obstacle by adjusting its posture through its own redundant degrees of freedom. If so, while keeping the tool tip trajectory and tool axis vector absolutely unchanged, the spatial position of the spindle head is changed by rotating the non-critical branch axis to safely avoid the interference. In step S2, if the redundancy adjustment cannot completely avoid the collision, or the system has no redundant degrees of freedom, priority arbitration is initiated. Based on the current machining stage, cutting load, or process importance, the master and slave priorities are dynamically allocated. The machining stages include finishing > semi-finishing > roughing > idle. The lower priority machining head needs to assume more avoidance responsibility, such as performing a larger range of trajectory deflection or feed rate reduction. In step S3, if the above measures are still insufficient to eliminate the risk, the task priority weight W is used to determine the appropriate action. i The feed rate of the slave machining head is proportionally reduced. At the same time, based on the minimum separation vector direction generated by the extended polyhedron algorithm, an additional speed command away from the obstacle is applied to the slave machining head to perform forced avoidance until the safe distance is restored.

[0041] The specific embodiments described herein are merely illustrative of the spirit of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to substitute them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.

Claims

1. A multi-spindle concurrent machining obstacle avoidance system based on digital twin and CBF, characterized in that, include: The digital twin mapping unit is used to acquire real-time joint status data of the physical machine tool and perform voxel-level or mesh-level Boolean subtraction operations based on preset cutting parameters and tool geometry model to update the dynamic geometric representation of the workpiece in real time. The hierarchical state observation unit is configured to roughly divide the machine tool workspace using an octree structure, and combine the GJK algorithm and the extended polyhedron algorithm to calculate the minimum directed distance h(x) between each machining spindle and the dynamic workpiece, as well as between the spindles themselves, and its gradient ∇h(x) with respect to the state variables. The safety barrier control unit is embedded in the interpolation cycle of the CNC system and is used to solve quadratic programming optimization problems with slack variables. The digital twin mapping unit includes predictive material removal logic. Before performing collision detection calculations, it pre-calculates the tool sweep volume for the next N control cycles based on the current CNC code instructions and logically removes this volume from the current workpiece model, thereby eliminating the expected cutting contact area in collision detection. The safety barrier control unit uses the minimum directed distance h(x) to construct a higher-order control barrier function constraint with a relative order of 2. The constraint includes the first and second derivative terms of the distance function to take into account the inertial dynamics constraints of each axis of the machine tool. The quadratic programming solver minimizes the deviation between the actual output command and the nominal processing command, and generates the corrected safety control command u, under the premise of satisfying the constraints of the higher-order control barrier function. The objective function of the quadratic programming solver is: ,in The nominal instructions obtained from G-code parsing. Let Q be a slack variable, and let Q and p be weight matrices.

2. The obstacle avoidance system according to claim 1, characterized in that: The higher-order control barrier function constraint satisfies the following differential inequality form: Where x is the machine tool joint state vector, δ is a non-negative relaxation variable used to ensure the feasibility of the solution, and k1 and k2 are gain coefficients adaptively adjusted based on the maximum braking capacity of the servo axis. The values ​​of k1 and k2 are related to the maximum acceleration a of each axis. max and maximum jerk j max They are directly proportional.

3. The obstacle avoidance system according to claim 1, characterized in that, The higher-order control barrier function constraint satisfies the following cascaded form: The following inequalities must be satisfied. L f L g For Li Daoshu.

4. The obstacle avoidance system according to claim 1, characterized in that, It also includes a zero-space redundancy analysis module, which is activated when the kinematic chain of the machining spindle has redundant degrees of freedom. When a collision risk is detected, the zero-space redundancy analysis module calculates the zero-space projection matrix of the Jacobian matrix of each spindle kinematic chain and generates an attitude reconstruction velocity vector in the zero space. The attitude reconstruction velocity vector is superimposed on the safety control command, so that the spindle changes its spatial positioning attitude while keeping the tool tip trajectory and tool axis vector unchanged.

5. The obstacle avoidance system according to claim 4, characterized in that, Construct the Jacobian matrix J, and calculate the null projection matrix N = I−J†J; Joint velocity vectors generated by obstacle avoidance task Additional control laws are generated by mapping the projection matrix onto the null space.

6. The obstacle avoidance system according to claim 1, characterized in that, The digital twin mapping unit utilizes a GPU parallel computing architecture to perform Boolean subtraction operations.

7. The obstacle avoidance system according to claim 1, characterized in that, The hierarchical state observation unit updates the voxel state and calculates the gradient only within a local region of interest centered on the knife tip and with a radius of R.

8. A multi-spindle concurrent machining obstacle avoidance method based on digital twin and CBF, applicable to the obstacle avoidance system according to any one of claims 1-7, characterized in that, When a potential risk of interference is detected, the following steps are performed: S1: Attitude negotiation and redundancy resolution, determine whether there are redundant degrees of freedom in the system; if so, avoid physical interference by rotating non-critical branch axes or redundant axes while keeping the tool tip contact point and tool vector unchanged. S2: Priority dynamic scheduling, which allocates master and slave priorities according to the cutting load or accuracy level of the current machining task; the machining head with lower priority actively performs large-range attitude deflection or feed rate reduction; S3: Execute early warning and avoidance. If there are no redundant degrees of freedom or attitude negotiation is limited, then proceed according to task priority W. i Reduce the feed rate of the slave machining head and perform forced avoidance along the direction of the escape vector generated by the extended polyhedron algorithm.

9. The obstacle avoidance method according to claim 8, characterized in that, The redundancy resolution is for systems with three rotary axes or redundant linear axes. It utilizes the zero-space projection characteristics of the Jacobian matrix to adjust the spatial occupancy of the spindle head overhang without interrupting the machining path.

10. The obstacle avoidance method according to claim 8, characterized in that, The priority scheduling sets the machining head with high precision requirements as high priority during the finishing stage, so that the trajectory does not fluctuate due to obstacle avoidance, and the other machining head in the roughing or idle state undertakes the main avoidance action.