A tool changing method, device, equipment and medium for a CNC machine tool
By acquiring the motion information and trigger constraint information of the tool changing components of CNC machine tools in real time, and dynamically determining the triggering conditions of the tool changing task, the problem of inflexible tool changing methods of CNC machine tools is solved, and an efficient and safe tool changing process is achieved.
Patent Information
- Application Number
- CN202611509493.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-11-17
AI Technical Summary
The tool changing methods of existing CNC machine tools are inflexible, resulting in motion redundancy, wasted time, and low tool changing efficiency.
By acquiring the current motion information of each tool changing component of the CNC machine tool in real time, and judging whether the tool changing task meets the triggering conditions based on the preset triggering constraint information, the task that meets the constraint conditions is triggered in a loop until all tool changing components reach the target position, thus avoiding motion redundancy caused by fixed sequence execution.
It improves tool changing efficiency, reduces unnecessary waiting time, and enhances the flexibility and safety of the tool changing process.
Smart Images

Figure CN123103430A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of CNC machine tool technology, specifically relating to a tool changing method, device, equipment and medium for a CNC machine tool. Background Technology
[0002] During CNC machine tool machining, a tool change operation is required when the cutting tool wears out or needs to be replaced with a tool of a different specification. Tool change refers to the process of removing the current cutting tool from the spindle and placing it back into the tool magazine, while simultaneously retrieving the target cutting tool from the tool magazine and loading it into the spindle. Tool change efficiency directly affects the machine tool's machining cycle time and overall production efficiency. Therefore, how to perform efficient tool changes while ensuring safety has become a continuously important technical issue in this field.
[0003] Existing technologies primarily employ a preset, fixed sequence for tool changing, executing tool-changing actions according to pre-written macro programs. These actions include: Z-axis retraction to a safe height, X / Y-axis movement to the tool change point, tool magazine movement, and Z-axis descent to the tool change position. The entire tool-changing path and timing are fixed during the initial programming. However, fixed-sequence tool changing requires the same sequence of actions regardless of the spindle's initial position. Even when the spindle or table is close to the target tool change position, a complete retraction and movement process is still necessary, resulting in significant motion redundancy and wasted time. This leads to inflexible tool-changing methods and low efficiency. Summary of the Invention
[0004] The purpose of this application is to provide a tool changing method, device, equipment, and medium for CNC machine tools, which solves the problems of inflexible tool changing methods and low tool changing efficiency in the prior art. By judging whether the corresponding preset tool changing task meets the corresponding trigger constraint conditions based on the current motion information and the preset trigger constraint information, the triggering process of the triggerable tasks is cyclically repeated until the current position of all tool changing components reaches the target position, so as to realize the tool changing of the CNC machine tool. It can achieve the purpose of flexibly triggering multiple tool changing tasks based on real-time motion information and trigger constraints, avoiding the motion redundancy and time waste caused by fixed sequence execution, and improving tool changing efficiency.
[0005] In a first aspect, embodiments of this application provide a tool changing method for a CNC machine tool, the method comprising: Real-time acquisition of the current motion information of each tool changing component of the CNC machine tool; Determine the preset trigger constraint information and tool changing components corresponding to each preset tool change task; Based on the current motion information and the preset trigger constraint information, determine whether the corresponding preset tool change task meets the corresponding trigger constraint conditions. If there is a triggerable task among multiple preset tool change tasks that meets the corresponding triggering constraints, then trigger the triggerable task. The triggering process of the cyclical triggering task continues until the current position of each tool changing component reaches the corresponding preset tool changing target position, so as to realize the tool changing of the CNC machine tool.
[0006] Furthermore, the triggering constraints include no interference during current triggering and no interference during future triggering; Based on the current motion information and the preset trigger constraint information, determine whether the corresponding preset tool change task meets the corresponding trigger constraint conditions, including: Based on the current position in each current motion information, determine whether each preset tool change task satisfies the current trigger no interference, and select the preset tool change task that satisfies the current trigger no interference as the candidate tool change task; Identify the current tool change task that is in the execution state, and determine whether the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information; If the current tool change task and the candidate tool change task satisfy the condition that there is no interference in future triggering, the candidate tool change task is regarded as a triggerable task that satisfies the corresponding triggering constraint condition.
[0007] Furthermore, the preset trigger constraint information includes trajectory separation constraints; Based on the current motion information and the preset trigger constraint information, determine whether the current tool change task and the candidate tool change tasks satisfy the condition of no interference in future triggering, including: Determine the first motion information of the first tool changer corresponding to the current tool change task, and the second motion information of the second tool changer corresponding to the candidate tool change task; The first motion trajectory of the first tool changing component is determined based on the first position information and the first velocity data in the first motion information, and the second motion trajectory of the second tool changing component is determined based on the second position information and the second velocity data in the second motion information. If the first and second motion trajectories meet the trajectory separation constraint, it is determined that the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering.
[0008] Furthermore, there are multiple candidate tool-changing tasks; Before considering candidate tool-changing tasks as triggerable tasks that satisfy the corresponding triggering constraints, the method also includes: Based on the current motion information and preset triggering constraint information corresponding to each candidate tool change task, determine whether the future triggering is interference-free among multiple candidate tool change tasks. Accordingly, candidate tool-changing tasks are considered as triggerable tasks that satisfy the corresponding triggering constraints, including: If there is no interference between each candidate tool change task and the current tool change task in future triggering, and if there is no interference between multiple candidate tool change tasks in future triggering, then multiple candidate tool change tasks will be treated as triggerable tasks that satisfy the corresponding triggering constraints.
[0009] Furthermore, each preset trigger constraint information includes the task priority of the corresponding preset tool change task; After determining whether the current tool change task and the candidate tool change tasks satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information, the method further includes: If the current tool change task and the candidate tool change task do not satisfy the condition of no interference in future triggering, determine the interference position between the current tool change task and the candidate tool change task. The first priority of the candidate tool change task and the second priority of the current tool change task are determined based on the task priority of each preset tool change task. If the first priority is greater than the second priority, the candidate tool change task is treated as a triggerable task that meets the corresponding triggering constraint, and the current tool change task is stopped from being executed until the tool change component corresponding to the candidate tool change task passes the interference position.
[0010] Furthermore, after determining the first priority of the candidate tool change task and the second priority of the current tool change task based on the task priorities of each preset tool change task, the method also includes: If the first priority is less than or equal to the second priority, determine the minimum safe distance in the preset trigger constraint information corresponding to the current tool change task; The current maximum target position of the candidate tool change task is determined based on the interference position and the minimum safe distance; Trigger a candidate tool change task and use the current maximum target position as the current movement endpoint of the tool change component corresponding to the candidate tool change task.
[0011] Furthermore, after using the current maximum target position as the current motion endpoint of the tool changing component corresponding to the candidate tool changing task, the method also includes: The update results of each current motion information are acquired in real time, and the update results of the interference position are determined based on each update result and each preset trigger constraint information. Update the current maximum target position based on the interference position update result, and update the current motion endpoint based on the update result of the current maximum target position.
[0012] Secondly, embodiments of this application provide a tool changing device for a CNC machine tool, the device comprising: The information acquisition module is used to acquire the current motion information of each tool changing component of the CNC machine tool in real time; The constraint determination module is used to determine the preset trigger constraint information and tool changing components corresponding to each preset tool changing task; The constraint judgment module is used to determine whether the corresponding preset tool change task meets the corresponding trigger constraint conditions based on each current motion information and each preset trigger constraint information. The task triggering module is used to trigger a triggerable task when there is a triggerable task that meets the corresponding triggering constraints among multiple preset tool change tasks. The tool changing module is used to cycle through the triggering process of triggerable tasks until the current position of each tool changing component reaches the corresponding preset tool changing target position, so as to realize the tool changing of the CNC machine tool.
[0013] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0014] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0015] Fifthly, embodiments of this application also provide a computer program product comprising a computer program stored in a computer-readable storage medium, wherein at least one processor of the device reads from the computer-readable storage medium and executes the computer program, causing the device to perform the method described in the first aspect.
[0016] In this embodiment, the current motion information of each tool-changing component of the CNC machine tool is acquired in real time; preset trigger constraint information and tool-changing components corresponding to each preset tool-changing task are determined; based on the current motion information and preset trigger constraint information, it is determined whether the corresponding preset tool-changing task meets the corresponding trigger constraint conditions; if there is a triggerable task that meets the corresponding trigger constraint conditions among multiple preset tool-changing tasks, the triggerable task is triggered; the triggering process of the triggerable task is cyclical until the current position of each tool-changing component reaches the corresponding preset tool-changing target position, thereby realizing the tool changing of the CNC machine tool. Through the above-described tool changing method for CNC machine tools, the goal of flexibly triggering multiple tool-changing tasks based on real-time motion information and trigger constraints can be achieved, avoiding motion redundancy and time waste caused by fixed sequential execution, and improving tool-changing efficiency. Attached Figure Description
[0017] Figure 1 This is a flowchart of a tool changing method for a CNC machine tool provided in an embodiment of this application; Figure 2This is a flowchart of a method for determining triggering constraint conditions provided in an embodiment of this application; Figure 3 This is a flowchart of a tool change task switching method provided in an embodiment of this application; Figure 4 This is a structural block diagram of a tool changing device for a CNC machine tool provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a tool changing device for a CNC machine tool provided in an embodiment of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0019] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0020] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0021] Firstly, this solution can be applied to automatic tool changing control scenarios for CNC machine tools, especially vertical machining centers, horizontal machining centers, and mill-turn centers, where tool changing control is performed during machining. By breaking down the tool changing process into multiple motion tasks with independent safety trigger conditions and dynamically determining the trigger conditions of each task based on the real-time motion information of each tool changing component, the tool changing path can adaptively change with the starting position. Tasks that meet the trigger constraints are immediately executed without waiting for other unrelated tasks to complete, thus reducing unnecessary waiting time and improving tool changing efficiency and safety. Based on the above application scenarios, it can be understood that the executing entity of this solution can be the CNC system control terminal (CNC controller) of the CNC machine tool or a computing device equipped with a CNC system. This computing device refers to any electronic device with data computing, processing, and storage capabilities, such as a PC (Personal Computer) or other terminal devices, or even a server. This application embodiment does not limit this.
[0022] The following description, in conjunction with the accompanying drawings, details a tool changing method, apparatus, equipment, and medium for a CNC machine tool provided in this application, through specific embodiments and application scenarios.
[0023] Figure 1 This is a flowchart illustrating a tool changing method for a CNC machine tool according to an embodiment of this application. Figure 1 As shown, the specific steps include the following: S101 acquires the current motion information of each tool changing component of the CNC machine tool in real time.
[0024] The tool changing components can be any moving parts in a CNC machine tool involved in the tool changing process, including the spindle (Z-axis), X-axis feed mechanism, Y-axis feed mechanism, tool magazine rotation mechanism, tool magazine extension mechanism, robotic tool changing mechanism, and CNC machine tool table. Current motion information can be a set of parameters representing the current motion of each tool changing component, including its current position, current speed, current acceleration, current direction of motion, and current motion state (moving or stationary). The current position can be represented by the real-time coordinates of each tool changing component in the machine tool coordinate system, such as the current height coordinate of the Z-axis, the current horizontal coordinate of the X-axis, the current vertical coordinate of the Y-axis, and the current rotation angle and extension position of the tool magazine. The current speed can be the real-time linear velocity or angular velocity of each tool changing component along its respective direction of motion.
[0025] In one embodiment, the specific implementation of real-time acquisition of the current motion information of each tool changing component of a CNC machine tool can be as follows: The current position pulse count of each tool changing component is read from the servo encoder of each axis via a position feedback interface at a fixed control cycle (mainly set to 1 millisecond in this scheme). The pulse count is multiplied by the corresponding pulse equivalent to convert it into actual position coordinates. The current motion velocity of each tool changing component is obtained by differential calculation of the position coordinates of two adjacent control cycles, with the calculation formula v(t)=(p(t)-p(t-Δt)) / Δt. Where p(t) is the position coordinate of the current cycle, p(t-Δt) is the position coordinate of the previous cycle, and Δt is the control cycle. The current motion acceleration is obtained by differential calculation of the velocities of two adjacent control cycles, with the calculation formula a(t)=(v(t)-v(t-Δt)) / Δt. For example, when the control cycle is 1 millisecond, if the previous cycle position on the Z-axis was 120.500 mm and the current cycle position is 120.535 mm, then the current speed of the Z-axis is (120.535 - 120.500) / 0.001 = 35 mm / s. The current direction of movement of each tool-changing component is determined by the sign of the current speed: a positive speed indicates movement along the positive direction of the coordinate axis, a negative speed indicates movement along the negative direction of the coordinate axis, and a speed of zero indicates that the component is stationary.
[0026] S102, determine the preset trigger constraint information and tool changing components corresponding to each preset tool changing task.
[0027] The preset tool change tasks can be individual motion tasks derived from breaking down the complete tool change process into steps. Each preset tool change task corresponds to a segment of independent motion of a tool change component. Examples include: Z-axis lifting task, X-axis movement task, Y-axis movement task, tool magazine rotation task, tool magazine extension task, Z-axis descent task, tool release task, and robot arm tool change task. The preset trigger constraint information can be a pre-configured set of constraint parameters used to determine whether each preset tool change task can be safely triggered. This includes the safety distance threshold, prohibited area coordinate range, trajectory separation constraint parameters, task priority, minimum safety distance, and preset tool change target position for each preset tool change task. The tool change component can be the execution component corresponding to each preset tool change task. For example, the tool change component corresponding to the Z-axis lifting task is the main Z-axis, and the tool change component corresponding to the tool magazine rotation task is the tool magazine rotation mechanism.
[0028] In one embodiment, the specific implementation of determining the preset trigger constraint information and tool changing component corresponding to each preset tool changing task can be as follows: During the tool changing program initialization phase, the configuration information of all preset tool changing tasks is read from the tool changing task configuration table. The tool changing task configuration table is stored in a structured manner, and each record contains a task number, task name, corresponding tool changing component number, preset trigger constraint information pointer, and preset tool changing target position. For example, task number T01 is a Z-axis lifting task, the corresponding tool changing component is the Z-axis (component number AXIS_Z), the preset trigger constraint information includes a safety distance threshold of 5 mm, a prohibited area of 0 to 50 mm below the Z-axis (the area occupied by the worktable), a task priority of 3 (the larger the value, the higher the priority), a minimum safety distance of 3 mm, and a preset tool changing target position of 150 mm Z-axis safety height; task number T02 is an X-axis movement task, the corresponding tool changing component is the X-axis (component number AXIS_X), the preset trigger constraint information includes a safety distance The threshold is 5 mm, the restricted area is ±20 mm on both sides of the X-axis tool change point (the area occupied by the tool magazine), the task priority is 2, the minimum safe distance is 3 mm, and the preset tool change target position is the X-axis tool change point coordinate -200 mm; task number T03 is a tool magazine rotation task, the corresponding tool change component is the tool magazine rotation mechanism (component number MAG_ROT), the preset trigger constraint information includes a safe distance threshold of 10 mm, the restricted area is the space directly below the spindle, the task priority is 1, the minimum safe distance is 5 mm, and the preset tool change target position is the target tool position angle of 180 degrees. All records in the tool change task configuration table are traversed, and the preset trigger constraint information and the corresponding tool change component number in each record are mapped to the preset tool change task, stored in the task constraint mapping table, for quick lookup by task number when judging subsequent trigger constraint conditions.
[0029] S103, based on each current motion information and each preset trigger constraint information, determine whether the corresponding preset tool change task meets the corresponding trigger constraint conditions.
[0030] Among them, the trigger constraint condition can be a judgment condition for measuring whether the preset tool change task can be safely started and executed at the current moment. It is a Boolean judgment result obtained by combining the preset trigger constraint information with the current motion information.
[0031] In one embodiment, the specific implementation of determining whether the corresponding preset tool change task satisfies the corresponding trigger constraint condition based on each current motion information and each preset trigger constraint information can be as follows: Figure 2 As shown. Figure 2 This is a flowchart of a method for determining triggering constraints provided in an embodiment of this application. Triggering constraints include no interference during current triggering and no interference during future triggering, and specifically include the following steps: S201, based on the current position in each current motion information, determine whether each preset tool change task satisfies the current trigger no interference, and select the preset tool change task that satisfies the current trigger no interference as the candidate tool change task.
[0032] Specifically, "current trigger no interference" means that if a preset tool change task is immediately started at the current moment, there is no spatial overlap or collision risk between the current position of its corresponding tool change component and the current position of other tool change components. "Future trigger no interference" means that after a candidate tool change task that satisfies "current trigger no interference" is started, there will be no trajectory intersection or spatial collision between it and the currently executing tool change task during its future movement.
[0033] In one embodiment, determining whether each preset tool change task satisfies the current trigger-free interference condition based on the current position in each current motion information, and selecting preset tool change tasks that satisfy the current trigger-free interference condition as candidate tool change tasks, can be implemented as follows: For each preset tool change task that has not yet been started, read the current position coordinates of the corresponding tool change component and read the safety distance threshold in the preset trigger constraint information of the task. Calculate the Euclidean distance between the current position of the tool change component and the current positions of all other tool change components, and calculate the spatial distance between the current position of the tool change component and the current positions of all other tool change components: For two tool change components on the same motion axis, directly calculate the absolute value of the difference in axis coordinates; for two tool change components belonging to different motion axes, calculate the Euclidean distance based on the three-dimensional position coordinates of each tool change component in the machine tool coordinate system. The three-dimensional position coordinates of each tool change component are obtained by reading the current position pulse count from the servo encoder of each axis through the position feedback interface and multiplying it by the corresponding pulse equivalent; for rotary axes (tool magazine rotary axes), calculate the angle difference and convert it into arc length distance. The calculated minimum distance is compared with the safety distance threshold. If the minimum distance is greater than or equal to the safety distance threshold, the preset tool change task is determined to meet the current trigger-free interference requirement. For example, if the current Z-axis position is 80 mm and the current table position is 0 mm on the Y-axis, the distance between the Z-axis and the table in the Z-direction is 80 mm. The safety distance threshold for the Z-axis lifting task is 5 mm. Since 80 mm is greater than 5 mm, the Z-axis lifting task is determined to meet the current trigger-free interference requirement. All preset tool change tasks that have not yet been started are iterated through, and all tasks that meet the current trigger-free interference requirement are collected into a candidate tool change task set.
[0034] S202, identify the current tool change task that is in the execution state, and determine whether the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information.
[0035] The current tool change task can refer to a tool change task that has been triggered and is currently in execution (the corresponding tool change component is in motion).
[0036] In one embodiment, the specific implementation of identifying the current tool change task in the execution state can be as follows: Maintain a task status table, where each preset tool change task corresponds to a status field in the task status table. The value of the status field can be "not started", "in execution", or "completed". When a tool change task is triggered, its status field is updated to "in execution", and the motion control of the corresponding tool change component is started; when the corresponding tool change component reaches the preset tool change target position, the status field is updated to "completed". When identifying the current tool change task, the task status table is traversed, and tasks with the status field "in execution" are found and identified as the current tool change task. If there are multiple tasks with the status field "in execution", all tasks with the status field "in execution" are identified as the current tool change task.
[0037] In one embodiment, the specific implementation of determining whether the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information can be as follows: Obtain the current position, current velocity, and preset tool change target position of the tool change component corresponding to the current tool change task and the tool change component corresponding to the candidate tool change task, respectively. Predict the complete motion trajectory of the two tool change components from their current positions to their respective target positions based on a kinematic model. The kinematic model adopts trapezoidal velocity planning, that is, the motion process of each tool change component is divided into an acceleration segment, a constant velocity segment, and a deceleration segment. The acceleration of the acceleration and deceleration segments is taken as the rated acceleration of the axis (mainly 500 mm / s² in this scheme), and the velocity of the constant velocity segment is taken as the rated velocity of the axis (mainly 3000 mm / min in this scheme). The position coordinates of the two tool change components at each time point are calculated according to the trapezoidal velocity planning, forming two position curves that change with time. The spatial distance between the two tool-changing components is calculated at each time step (1 millisecond) throughout the entire movement time. If the spatial distance at all time points is greater than or equal to the safe distance threshold in the preset trigger constraint information, it is determined that the current tool-changing task and the candidate tool-changing task satisfy the requirement of no interference in future triggering. For example, the current tool-changing task is Z-axis lifting (from 80 mm to 150 mm), and the candidate tool-changing task is X-axis movement (from 0 mm to -200 mm). The Z-axis movement time is approximately 1.4 seconds, and the X-axis movement time is approximately 4 seconds. The spatial distance between the Z-axis and X-axis is calculated every millisecond throughout the 4-second time range. Since the Z-axis moves upward and the X-axis moves laterally, their movement directions are orthogonal, and the spatial distance is always greater than 50 mm, which is greater than the safe distance threshold of 5 mm. Therefore, it is determined that the requirement of no interference in future triggering is met.
[0038] In one embodiment, the preset trigger constraint information includes trajectory separation constraints; determining whether the current tool change task and the candidate tool change task satisfy the future trigger no-interference condition based on each current motion information and each preset trigger constraint information includes: determining the first motion information of the first tool change component corresponding to the current tool change task, and the second motion information of the second tool change component corresponding to the candidate tool change task; determining the first motion trajectory of the first tool change component based on the first position information and the first velocity data in the first motion information, and determining the second motion trajectory of the second tool change component based on the second position information and the second velocity data in the second motion information; and determining that the current tool change task and the candidate tool change task satisfy the future trigger no-interference condition if the first motion trajectory and the second motion trajectory satisfy the trajectory separation constraint.
[0039] The trajectory separation constraint can be a pre-set constraint used to determine whether two motion trajectories meet the conditions of no trajectory intersection or no collision. Specifically, it can include a minimum spatial distance threshold between the two trajectories, a trajectory intersection angle threshold (mainly set to 30 degrees in this scheme, meaning that when the angle between the motion directions of the two trajectories is less than 30 degrees, it is determined that there is a risk of trajectory intersection), and a minimum distance requirement within the trajectory time overlap interval (i.e., the minimum trajectory separation distance, mainly set to 10 mm in this scheme). The first motion information can be the current motion information of the first tool changing component corresponding to the current tool changing task, including first position information and first velocity data. The second motion information can be the current motion information of the second tool changing component corresponding to the candidate tool changing task, including second position information and second velocity data. The first motion trajectory can be the expected motion path of the first tool changing component from its current position to its preset tool changing target position, and the second motion trajectory can be the expected motion path of the second tool changing component from its current position to its preset tool changing target position.
[0040] In one embodiment, the specific implementation of determining the first motion information of the first tool changing component corresponding to the current tool changing task and the second motion information of the second tool changing component corresponding to the candidate tool changing task can be as follows: Based on the preset correspondence between tool changing tasks and tool changing components, determine the first tool changing component corresponding to the current tool changing task and the second tool changing component corresponding to the candidate tool changing task, and use the current motion information of each tool changing component obtained above as the motion information (first motion information and second motion information) of the corresponding tool changing component (first tool changing component and second tool changing component). The specific implementation of determining the first motion trajectory of the first tool changing component based on the first position information and the first velocity data in the first motion information, and determining the second motion trajectory of the second tool changing component based on the second position information and the second velocity data in the second motion information can be as follows: Starting from the first position information and ending at the preset tool changing target position of the first tool changing component, determine the initial velocity direction according to the first velocity data, and generate the first motion trajectory using an S-shaped acceleration / deceleration velocity planning algorithm. The S-shaped acceleration / deceleration planning divides the motion process into seven stages: acceleration, uniform acceleration, deceleration, uniform velocity, acceleration / deceleration, uniform deceleration, and deceleration / deceleration. The rate of change of acceleration (jerk) in each stage is set to 2000 mm / s³, a key value for this scheme. Based on the starting point, ending point, initial velocity, maximum velocity, maximum acceleration, and maximum jerk, the position coordinates at each time point are calculated through numerical integration, forming a discrete point sequence of the first motion trajectory, with a time step of 1 millisecond. Similarly, based on the second position information and second velocity data, the same S-shaped acceleration / deceleration planning is used to generate a discrete point sequence of the second motion trajectory.
[0041] In one embodiment, when the first and second motion trajectories meet the trajectory separation constraint, the specific implementation of determining the future trigger-free interaction between the current tool change task and the candidate tool change task can be as follows: Calculate the time overlap interval of the two trajectories, i.e., the intersection [t_overlap_start, t_overlap_end] of the time range [t1_start, t1_end] of the first motion trajectory and the time range [t2_start, t2_end] of the second motion trajectory. Within the time overlap interval, read the position coordinates of the two trajectories at the same moment point by time (step size 1 millisecond), and calculate the Euclidean distance between the two points d(t) = sqrt((x1(t) - x2(t))² + (y1(t) - y2(t))² + (z1(t) - z2(t))²). Find the minimum distance d_min = min(d(t)) within the entire time overlap interval. The trajectory separation constraint requires that d_min be greater than or equal to the preset minimum trajectory separation distance (mainly set to 10 mm in this scheme), and that the spatial paths of the two trajectories do not intersect (i.e., the line segments of the two trajectories do not intersect in three-dimensional space). The spatial path intersection judgment uses a line segment intersection detection algorithm, which discretizes each trajectory into continuous line segments and checks whether each line segment of the first trajectory intersects with each line segment of the second trajectory. If an intersecting line segment exists, it is determined that the trajectories intersect. If d_min is greater than or equal to the minimum trajectory separation distance and the two trajectories do not intersect, the first and second motion trajectories are determined to meet the trajectory separation constraint, meaning that the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering. For example: the first motion trajectory is a straight line segment from 80 mm to 150 mm along the Z-axis (X=0, Y=0, Z from 80 to 150), and the second motion trajectory is a straight line segment from the tool magazine extending from the retracted position to the tool change position (Z=100, X from -300 to -200, Y=0). The X coordinates of the two trajectories at Z=100 mm are 0 and -200 respectively, and the spatial distance is 200 mm, which is much greater than the minimum trajectory separation distance of 10 mm. Moreover, the two trajectories do not intersect in three-dimensional space. Therefore, it is determined that the trajectory separation constraint is met.
[0042] As described above, by generating precise motion trajectories based on the motion information of each tool-changing component and calculating the minimum spatial distance point by point within the time overlap interval, while detecting the intersection of trajectory spatial paths, it is possible to accurately determine whether two motion tasks will interfere with each other during future motion, thus ensuring the safety of parallel execution.
[0043] S203, if the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering, the candidate tool change task is regarded as a triggerable task that satisfies the corresponding triggering constraint condition.
[0044] In one embodiment, when the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering, the specific implementation of the candidate tool change task as a triggerable task that satisfies the corresponding triggering constraint can be as follows: when the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering, it means that the candidate tool change task will not collide with other tool change components when it starts at the current moment, nor will it collide with the currently moving tool change component during its movement. At this time, the candidate tool change task can be triggered to perform the corresponding action.
[0045] As described above, by first screening candidate tasks that are currently triggered without interference and then determining whether they will be triggered in the future with the currently executing task, the safety of task triggering can be ensured in a hierarchical manner, avoiding both immediate collisions at the current moment and trajectory intersections during future movements.
[0046] In one embodiment, there are multiple candidate tool change tasks. Before using a candidate tool change task as a triggerable task that satisfies the corresponding triggering constraint, the method further includes: determining whether the multiple candidate tool change tasks satisfy the condition of no interference in future triggering based on the current motion information and preset triggering constraint information corresponding to each candidate tool change task; correspondingly, using a candidate tool change task as a triggerable task that satisfies the corresponding triggering constraint includes: if the candidate tool change task satisfies the condition of no interference in future triggering with the current tool change task, and the multiple candidate tool change tasks satisfy the condition of no interference in future triggering, then the multiple candidate tool change tasks are used as triggerable tasks that satisfy the corresponding triggering constraint.
[0047] In one embodiment, the specific implementation of determining whether multiple candidate tool change tasks satisfy the future triggering no-interference requirement based on the current motion information and preset triggering constraint information corresponding to each candidate tool change task can be as follows: All candidate tool change tasks are paired to form a set of candidate task pairs. For each pair of candidate tool change tasks, the same method as described above for determining the future triggering no-interference requirement between the current tool change task and candidate tool change tasks is used. That is, the motion trajectories of the tool change components corresponding to the two candidate tasks are generated respectively. The spatial distance is calculated point-by-point within the time overlap interval, and trajectory intersections are detected to determine whether the pair of candidate tasks satisfies the future triggering no-interference requirement. If all candidate task pairs satisfy the future triggering no-interference requirement, then it is determined that multiple candidate tool change tasks satisfy the future triggering no-interference requirement. For example, if a candidate tool change task includes an X-axis movement task and a tool magazine rotation task, with the X-axis moving laterally and the tool magazine rotating around its own axis, and their motion spaces do not overlap, then pairwise determinations satisfy the future triggering no-interference requirement. Therefore, multiple candidate tool change tasks satisfy the future triggering no-interference requirement. When all candidate tool change tasks satisfy the condition of no interference in future triggering with the current tool change task, and multiple candidate tool change tasks satisfy the condition of no interference in future triggering, the specific implementation of treating multiple candidate tool change tasks as triggerable tasks that satisfy the corresponding triggering constraints can be as follows: the tool change task among the multiple candidate tool change tasks that satisfies the condition of no interference in future triggering with the current tool change task and no interference in future triggering with other candidate tool change tasks can be treated as a triggerable task that satisfies the corresponding triggering constraints.
[0048] As described above, by performing pairwise future triggering non-interference judgments on multiple candidate tool-changing tasks, it can be ensured that multiple tasks triggered simultaneously will not interfere with each other, thus avoiding the risk of collision when multiple tasks are running in parallel.
[0049] In one embodiment, the specific implementation of determining whether a corresponding preset tool change task meets the corresponding trigger constraint condition based on each current motion information and each preset trigger constraint information can be as follows: For each preset tool change task that has not yet been started, the expected motion space envelope of the corresponding tool change component in the next control cycle is calculated based on the current position and current speed of the tool change component corresponding to the task. The expected motion space envelope is calculated as follows: taking the current position as the starting point, along the current motion direction (or along the preset motion direction of the task if the current speed is zero, i.e., the direction from the current position to the preset tool change target position of the task), the expected position after one control cycle is calculated based on the uniform acceleration motion displacement formula: p_next=p_current+v_current×Δt+0.5×a_max×Δt². The line segment space between the current position and the expected position and the outer dimension envelope of the tool change component (e.g., the cylindrical envelope with a radius of 5 mm for the spindle end tool, and the cuboid envelope with a length of 80 mm, a width of 40 mm, and a height of 30 mm for the tool magazine claw) are merged to obtain the expected motion space envelope of the tool change component in the next control cycle. The expected motion space envelope is spatially intersected with the current occupied spaces of all other tool-changing components (calculated based on the current positions and dimensions of the other tool-changing components) and the forbidden areas in the preset trigger constraints. The spatial intersection operation uses the Axis Aligned Bounding Box (AABB) intersection detection method, representing each spatial region as a minimum bounding box. It determines whether the projection intervals of two bounding boxes overlap along the X, Y, and Z axes. If the projection intervals overlap along all three axes, a spatial intersection is determined. If the intersection result is empty (i.e., the expected motion space envelope has no intersection with the current occupied spaces of other tool-changing components and the forbidden areas) and the expected motion direction does not point to the current motion direction of other tool-changing components, the preset tool-changing task is determined to satisfy the corresponding trigger constraints. The determination that the expected motion direction does not point to the current motion direction of other tool-changing components is made by calculating the dot product of the expected motion direction vector of the tool-changing component corresponding to the task and the current motion direction vector of other tool-changing components. If the dot product is less than zero, it indicates that the two directions are relative (there is a risk of moving towards each other); if the dot product is greater than or equal to zero, it indicates that the directions are not relative. For example, if the current Z-axis position is 80 mm, the current speed is 0 (stationary), the preset motion direction of the Z-axis lifting task is positive (upward), and the current position of the tool magazine is retracted (not occupying the space directly below the spindle), then the expected position of the Z-axis lifting task in the next control cycle after it is triggered is 80 + 0 × 0.001 + 0.5 × 500 × (0.001)² = 80.00025 mm. The expected motion space envelope is a cylindrical area with a radius of 5 mm from 80 mm to 80.00025 mm on the Z-axis. This area does not intersect with the space currently occupied by the tool magazine, and the motion direction is upward and does not point towards the tool magazine. Therefore, it is determined that the Z-axis lifting task meets the trigger constraint conditions.
[0050] S104, if there is a triggerable task that meets the corresponding triggering constraints among multiple preset tool change tasks, trigger the triggerable task.
[0051] Among them, a triggerable task can refer to a preset tool change task that, after being judged by trigger constraint conditions, is determined to meet the trigger constraint conditions and can be safely started and executed. Triggering can be an operation that sends motion control commands to the servo driver of the tool change component corresponding to the triggerable task, causing it to start moving towards the preset tool change target position according to preset motion parameters.
[0052] In one embodiment, when there are triggerable tasks among multiple preset tool change tasks that satisfy the corresponding triggering constraints, the specific implementation of triggering the triggerable task can be as follows: Iterate through the triggering constraint judgment results of all preset tool change tasks and collect all triggerable tasks whose judgment results are "satisfied". For each triggerable task, read the corresponding tool changer part number, preset tool changer target position, motion speed parameters, and acceleration parameters from the task constraint mapping table to generate motion control instructions. The motion control instructions adopt G-code format or the motion control data structure inside the CNC system, including fields such as target position coordinates, feed rate, and acceleration type. Send the motion control instructions to the servo driver of the corresponding tool changer. After receiving the instructions, the servo driver controls the motor to operate according to the S-shaped acceleration and deceleration plan, driving the tool changer to move from the current position to the preset tool changer target position. At the same time, update the status of the triggerable task in the task status table from "not started" to "executing" and record the trigger timestamp. If there are multiple triggerable tasks, send their respective motion control instructions to the servo drivers of multiple tool changers simultaneously to achieve parallel triggering and execution of multiple tasks. For example, when the judgment result shows that both the Z-axis lifting task and the X-axis moving task meet the trigger constraint conditions, the Z-axis servo driver is simultaneously sent with the command "move to 150 mm, speed 3000 mm / min" and the X-axis servo driver is sent with the command "move to -200 mm, speed 3000 mm / min", and the Z-axis and X-axis start moving at the same time.
[0053] S105, the triggering process of the triggerable task is repeated until the current position of each tool changing component reaches the corresponding preset tool changing target position, so as to realize the tool changing of the CNC machine tool.
[0054] The triggering process for triggerable tasks can be a continuous, repetitive process of "acquiring current motion information, determining triggering constraints, and triggering the triggerable task," executed once per control cycle, until all tool-changing components reach their respective preset tool-changing target positions. The preset tool-changing target position can be the target position that each tool-changing component should reach after completing its tool-changing task; the entire tool-changing process is considered complete when all tool-changing components have reached their preset tool-changing target positions.
[0055] In one embodiment, the triggering process of the cyclic triggerable task continues until the current position of each tool-changing component reaches the corresponding preset tool-changing target position, thereby realizing the tool changing of the CNC machine tool. The specific implementation method can be as follows: A complete trigger judgment loop is executed once every control cycle (1 millisecond), including obtaining the latest current motion information of each tool-changing component; judging whether all preset tool-changing tasks that have not yet been started meet the trigger constraint conditions based on the latest motion information and preset trigger constraint information; and triggering all newly triggerable tasks that meet the conditions. In each loop, it checks whether the tool-changing components corresponding to all tool-changing tasks in the "in execution" state have reached the preset tool-changing target position. The judgment method is to calculate the difference between the current position and the preset tool-changing target position. If the absolute value of the difference is less than the positioning threshold (mainly set to 0.01 mm in this scheme) and the current speed is zero, it is determined that the tool-changing component has reached the preset tool-changing target position, and the corresponding task status is updated to "completed". The status of all preset tool-changing tasks is counted. When the status of all tasks is "completed", the loop terminates, and the tool changing process ends. If there are still tasks that have not been completed, the loop continues in the next control cycle. For example: the first control cycle triggers the Z-axis lifting task and the X-axis moving task, and the Z-axis and X-axis begin to move; the second control cycle detects that the tool magazine rotation task meets the triggering constraint condition (the Z-axis has been raised to a safe height), and triggers the tool magazine rotation task; subsequent control cycles continue to detect and trigger the tool magazine extension, Z-axis descent, tool release and other tasks in sequence until all tool changing components have reached the target position, the cycle terminates, and the tool changing is completed.
[0056] The process of triggering a tool change task based on task priority is as follows: Figure 3 As shown. Figure 3 This is a flowchart of a tool change task switching method provided in an embodiment of this application. Each preset trigger constraint includes the corresponding preset task priority for the tool change task, and specifically includes the following steps: S301, if the current tool change task and the candidate tool change task do not satisfy the condition of no interference in future triggering, determine the interference position between the current tool change task and the candidate tool change task.
[0057] The task priority can be a pre-assigned priority value for each preset tool change task, used to determine which task should be executed first when there is a task conflict; a larger value indicates a higher priority. The interference position can be the location where the movement trajectories of the current tool change task and the candidate tool change task spatially overlap at some point in the future.
[0058] In one embodiment, when the current tool change task and the candidate tool change task do not satisfy the requirement of no interference in future triggering, the specific implementation of determining the interference position between the current tool change task and the candidate tool change task can be as follows: when it is determined that the current tool change task and the candidate tool change task do not satisfy the requirement of no interference in future triggering, backtrack the point-by-point distance calculation results of the two motion trajectories, find the time point t_collision at which the spatial distance is first less than the safe distance threshold, read the position coordinates p1(t_collision) and p2(t_collision) corresponding to the two trajectories at this time point, and take the midpoint of the two position coordinates as the interference position p_interference=(p1(t_collision)+p2(t_collision)) / 2. For example: The current tool change task is Z-axis lifting (from 80 mm to 150 mm), and the candidate tool change task is tool magazine extension (from the retracted position to the tool change position). At t=0.8 seconds, the Z-axis position is 120 mm, and the tool magazine position is directly below the spindle. The spatial distance between the two is 3 mm, which is less than the safe distance threshold of 5 mm. At this time, the interference position is the spatial coordinate (0,0,120) directly below the spindle at a height of 120 mm on the Z-axis.
[0059] S302, determine the first priority of the candidate tool change task and the second priority of the current tool change task based on the task priority of each preset tool change task.
[0060] The first priority can be the task priority value of the candidate tool change task. The second priority can be the task priority value of the current tool change task.
[0061] In one embodiment, the specific implementation of determining the first priority of the candidate tool change task and the second priority of the current tool change task based on the task priority of each preset tool change task can be as follows: determine the first priority corresponding to the candidate tool change task and the second priority corresponding to the current tool change task according to the priority value pre-assigned to each preset tool change task.
[0062] In one embodiment, after determining the first priority of the candidate tool change task and the second priority of the current tool change task based on the task priorities of each preset tool change task, the method further includes: if the first priority is less than or equal to the second priority, determining the minimum safe distance in the preset trigger constraint information corresponding to the current tool change task; determining the current maximum target position of the candidate tool change task based on the interference position and the minimum safe distance; triggering the candidate tool change task, and using the current maximum target position as the current motion endpoint of the tool change component corresponding to the candidate tool change task.
[0063] The minimum safe distance can be the minimum spatial distance that two tool-changing components must maintain as specified in the preset trigger constraint information; it is a distance threshold to ensure that no collision occurs. The current maximum target position can be the position closest to the preset tool-changing target position that the tool-changing component corresponding to the candidate tool-changing task can safely reach under the current constraint conditions; that is, the farthest position that the component can reach without intruding into the safe area of the current tool-changing task.
[0064] In one embodiment, when the first priority is less than or equal to the second priority, the specific implementation of determining the minimum safe distance in the preset trigger constraint information corresponding to the current tool change task can be as follows: When the first priority is less than or equal to the second priority, it indicates that the candidate tool change task can only reach its corresponding target position after the current tool change task has been executed. At this time, the tool changing component corresponding to the candidate tool change task can be controlled to move forward as far as possible within a safe range, rather than stopping and waiting completely, thereby minimizing the waiting time while ensuring safety. The minimum safe distance in the preset trigger constraint information corresponding to the current tool change task can be read to ensure that the current maximum target position and the real-time position of the tool changing component corresponding to the current tool change task maintain a safe distance. The specific implementation of determining the current maximum target position of the candidate tool change task based on the interference position and the minimum safe distance can be as follows: Determine the movement direction of the tool changing component corresponding to the candidate tool change task, and offset the minimum safe distance from the interference position in the opposite direction of the component's movement direction to obtain the current maximum target position. The specific calculation formula is as follows: For linear motion axes, p_max = p_interference - d_safe × dir, where p_interference is the coordinate of the interference position, d_safe is the minimum safe distance, and dir is the unit vector of the movement direction of the candidate tool changer (+1 in the positive direction and -1 in the negative direction). For example, if the candidate tool changer task is X-axis movement (moving from 0 mm to -200 mm, in the negative direction, dir = -1), the interference position is X = -100 mm, and the minimum safe distance is 5 mm, then the current maximum target position p_max = -100 - 5 × (-1) = -95 mm. That is, the X-axis can only move up to -95 mm; moving further would intrude into the safe area of the current tool changer task. For rotary axes, the current maximum target position is the interference angle minus the minimum safe angle (mainly set to 2 degrees in this scheme). The specific implementation of triggering a candidate tool change task and using the current maximum target position as the current motion endpoint of the tool change component corresponding to the candidate tool change task can be as follows: write the current maximum target position into the motion control instruction of the candidate tool change task as the endpoint position of the motion, and trigger the corresponding tool change component to move from the current position to the current maximum target position and then stop.
[0065] As described above, by calculating the current maximum target position when low-priority tasks conflict and using it as a temporary endpoint, low-priority tasks can move forward as far as possible within a safe range, rather than stopping and waiting completely, thereby minimizing waiting time while ensuring safety.
[0066] In one embodiment, after setting the current maximum target position as the current motion endpoint of the tool changing component corresponding to the candidate tool changing task, the method further includes: acquiring the update results of each current motion information in real time, determining the interference position update result based on each update result and each preset trigger constraint information; updating the current maximum target position according to the interference position update result, and updating the current motion endpoint based on the update result of the current maximum target position.
[0067] In one embodiment, the specific implementation of acquiring the update results of each current motion information in real time and determining the interference position update result based on each update result and each preset trigger constraint information can be as follows: The update values of the current position, current speed, and other motion information of each tool-changing component are continuously acquired at a control cycle of 1 millisecond. As the tool-changing component corresponding to the current tool-changing task continues to move, its position changes continuously, causing the interference position between the current tool-changing task and the candidate tool-changing task to change accordingly. In each control cycle, based on the updated current motion information, the interference position is recalculated using the same method as described above for determining the interference position, resulting in the interference position update result. Based on the updated position and speed of the current tool-changing component, its remaining motion trajectory is regenerated, and a point-by-point distance calculation is performed between it and the remaining motion trajectory of the candidate tool-changing component. The time point at which the new first distance is less than the safe distance threshold and the corresponding position coordinates are found, which are used as the interference position update result.
[0068] In one embodiment, the specific implementation of updating the current maximum target position based on the interference position update result and updating the current motion endpoint based on the update result of the current maximum target position can be as follows: In each control cycle, using the same formula as described above for calculating the current maximum target position, the current maximum target position is recalculated based on the interference position update result and the minimum safety distance to obtain the updated value of the current maximum target position. The updated current maximum target position is compared with the current position of the candidate tool changing component. If the updated current maximum target position is ahead of the current position along the movement direction (i.e., the updated position is closer to the preset tool changing target position than the current position), a position update command is sent to the servo driver of the candidate tool changing component to update the current motion endpoint to the new current maximum target position, so that the component continues to move forward; if the updated current maximum target position coincides with the current position or is behind the current position, the component remains stationary. For example: The X-axis is currently stationary at -95 mm. The current tool change task (Z-axis lift) continues to rise, and the interference position gradually moves from X=-100 mm to X=-120 mm. The updated current maximum target position is -115 mm, which is in front of the current X-axis position of -95 mm (closer to the target of -200 mm). Therefore, the current motion endpoint is updated to -115 mm, and the X-axis continues to move from -95 mm to -115 mm. As the Z-axis continues to rise, the interference position continues to move, the current maximum target position is continuously updated, and the X-axis gradually advances forward. Finally, when the Z-axis completely leaves the interference area, the current maximum target position is updated to the preset tool change target position of -200 mm, and the X-axis completes all movement.
[0069] As described above, by updating the interference position and the current maximum target position in real time and dynamically adjusting the endpoint of the movement, the candidate tool changer can gradually advance during the movement of the current tool changer, achieving a "follow-up" safe approach instead of completely stopping and waiting, further reducing the total tool change time.
[0070] S303, if the first priority is greater than the second priority, the candidate tool change task is taken as a triggerable task that meets the corresponding triggering constraint conditions, and the current tool change task is stopped from being executed until the tool change component corresponding to the candidate tool change task passes the interference position.
[0071] In one embodiment, when the first priority is greater than the second priority, the candidate tool change task is treated as a triggerable task that meets the corresponding triggering constraints, and the execution of the current tool change task is stopped until the tool change component corresponding to the candidate tool change task passes the interference position. A specific implementation of this can be as follows: When the first priority is greater than the second priority, it indicates that the execution priority of the candidate tool change task is higher than that of the current tool change task. To ensure the correctness of the tool change process execution logic, a stop command needs to be sent to the servo driver of the tool change component corresponding to the current tool change task. The servo driver reduces the movement speed of the component to zero according to a preset deceleration slope (mainly set to 1000 mm / s² in this scheme). The tool change component corresponding to the candidate tool change task is triggered to start moving, and the status of the candidate tool change task is updated to "in execution". The current position of the tool change component corresponding to the candidate tool change task is continuously monitored. When the current position of the component passes the interference position (i.e., the movement trajectory of the component crosses the coordinates of the interference position, and the distance to the interference position continuously increases along the movement direction), a start command is resent to the previously stopped tool change component corresponding to the current tool change task, causing it to continue moving from the stopped position to the preset tool change target position. For example: The candidate tool change task is Z-axis lifting (priority 3), and the current tool change task is tool magazine extension (priority 1). The first priority 3 is greater than the second priority 1, so the tool magazine extension action is stopped, and Z-axis lifting is triggered. When the Z-axis rises past the interference position of 120 mm and continues to rise to 125 mm, the tool magazine extension action is restarted.
[0072] As described above, by comparing task priorities when there is a conflict and allowing high-priority tasks to be executed first while low-priority tasks are paused and waited, the execution order of critical tool-changing actions can be ensured while avoiding long waiting times caused by conflicts.
[0073] The technical solution provided in this application acquires the current motion information of each tool changing component of a CNC machine tool in real time; determines the preset trigger constraint information and tool changing components corresponding to each preset tool changing task; judges whether the corresponding preset tool changing task meets the corresponding trigger constraint conditions based on the current motion information and the preset trigger constraint information; if there is a triggerable task that meets the corresponding trigger constraint conditions among multiple preset tool changing tasks, the triggerable task is triggered; the triggering process of the triggerable task is cyclical until the current position of each tool changing component reaches the corresponding preset tool changing target position, thereby realizing the tool changing of the CNC machine tool. Through the above-described tool changing method for CNC machine tools, the purpose of flexibly triggering multiple tool changing tasks based on real-time motion information and trigger constraints can be achieved, avoiding the problems of motion redundancy and time waste caused by fixed sequential execution, and improving tool changing efficiency.
[0074] Figure 4 This is a structural block diagram of a tool changing device for a CNC machine tool provided in an embodiment of this application. Figure 4As shown, it specifically includes the following: The information acquisition module 401 is used to acquire the current motion information of each tool changing component of the CNC machine tool in real time; The constraint determination module 402 is used to determine the preset trigger constraint information and tool changing components corresponding to each preset tool changing task; The constraint judgment module 403 is used to determine whether the corresponding preset tool change task meets the corresponding trigger constraint conditions based on each current motion information and each preset trigger constraint information. The task triggering module 404 is used to trigger a triggerable task when there is a triggerable task that meets the corresponding triggering constraints among multiple preset tool change tasks. The tool changing module 405 is used to cycle through the triggering process of the triggerable task until the current position of each tool changing component reaches the corresponding preset tool changing target position, so as to realize the tool changing of the CNC machine tool.
[0075] The technical solution provided in this application includes an information acquisition module for acquiring the current motion information of each tool changing component of a CNC machine tool in real time; a constraint determination module for determining the preset trigger constraint information and tool changing components corresponding to each preset tool changing task; a constraint judgment module for judging whether the corresponding preset tool changing task meets the corresponding trigger constraint conditions based on the current motion information and the preset trigger constraint information; a task triggering module for triggering a triggerable task if there is one that meets the corresponding trigger constraint conditions among multiple preset tool changing tasks; and a tool changing module for cyclically executing the triggering process of the triggerable tasks until the current position of each tool changing component reaches the corresponding preset tool changing target position, thereby realizing the tool changing of the CNC machine tool. Through the above-mentioned tool changing device for a CNC machine tool, the purpose of flexibly triggering multiple tool changing tasks based on real-time motion information and trigger constraints can be achieved, avoiding the problems of motion redundancy and time waste caused by fixed sequential execution, and improving tool changing efficiency.
[0076] Furthermore, the triggering constraints include no interference during current triggering and no interference during future triggering; Constraint determination module 403 is specifically used for: Based on the current position in each current motion information, determine whether each preset tool change task satisfies the current trigger no interference, and select the preset tool change task that satisfies the current trigger no interference as the candidate tool change task; Identify the current tool change task that is in the execution state, and determine whether the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information; If the current tool change task and the candidate tool change task satisfy the condition that there is no interference in future triggering, the candidate tool change task is regarded as a triggerable task that satisfies the corresponding triggering constraint condition.
[0077] Furthermore, the preset trigger constraint information includes trajectory separation constraints; Constraint determination module 403 is specifically used for: Determine the first motion information of the first tool changer corresponding to the current tool change task, and the second motion information of the second tool changer corresponding to the candidate tool change task; The first motion trajectory of the first tool changing component is determined based on the first position information and the first velocity data in the first motion information, and the second motion trajectory of the second tool changing component is determined based on the second position information and the second velocity data in the second motion information. If the first and second motion trajectories meet the trajectory separation constraint, it is determined that the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering.
[0078] Furthermore, there are multiple candidate tool-changing tasks; The constraint judgment module 403 is also used for: Based on the current motion information and preset triggering constraint information corresponding to each candidate tool change task, determine whether the future triggering is interference-free among multiple candidate tool change tasks. Accordingly, candidate tool-changing tasks are considered as triggerable tasks that satisfy the corresponding triggering constraints, including: If there is no interference between each candidate tool change task and the current tool change task in future triggering, and if there is no interference between multiple candidate tool change tasks in future triggering, then multiple candidate tool change tasks will be treated as triggerable tasks that satisfy the corresponding triggering constraints.
[0079] Furthermore, each preset trigger constraint information includes the task priority of the corresponding preset tool change task; The constraint determination module 403 is also used for: If the current tool change task and the candidate tool change task do not satisfy the condition of no interference in future triggering, determine the interference position between the current tool change task and the candidate tool change task. The first priority of the candidate tool change task and the second priority of the current tool change task are determined based on the task priority of each preset tool change task. If the first priority is greater than the second priority, the candidate tool change task is treated as a triggerable task that meets the corresponding triggering constraint, and the current tool change task is stopped from being executed until the tool change component corresponding to the candidate tool change task passes the interference position.
[0080] Furthermore, the constraint judgment module 403 is also used for: If the first priority is less than or equal to the second priority, determine the minimum safe distance in the preset trigger constraint information corresponding to the current tool change task; The current maximum target position of the candidate tool change task is determined based on the interference position and the minimum safe distance; Trigger a candidate tool change task and use the current maximum target position as the current movement endpoint of the tool change component corresponding to the candidate tool change task.
[0081] Furthermore, the constraint judgment module 403 is also used for: The update results of each current motion information are acquired in real time, and the update results of the interference position are determined based on each update result and each preset trigger constraint information. Update the current maximum target position based on the interference position update result, and update the current motion endpoint based on the update result of the current maximum target position.
[0082] This application also provides an electronic device, which can integrate a tool changing device for a CNC machine tool provided in this application. Figure 5 This is a schematic diagram of the structure of a tool changing device for a CNC machine tool provided in an embodiment of this application. (Refer to...) Figure 5 The tool changing device of the CNC machine tool includes: an input device 53, an output device 54, a memory 52, and one or more processors 51; the memory 52 is used to store one or more programs; when one or more programs are executed by one or more processors 51, the one or more processors 51 implement the tool changing method of the CNC machine tool as provided in the above embodiment. The input device 53, output device 54, memory 52, and processors 51 can be connected via a bus or other means. Figure 5 Taking the example of a connection between China and Israel via a bus.
[0083] The memory 52, as a computing device readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the tool changing method of the CNC machine tool provided in any embodiment of this application. The memory 52 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device. Furthermore, the memory 52 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 52 may further include memory remotely located relative to the processor 51, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0084] Input device 53 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 54 may include display devices such as a display screen.
[0085] The processor 51 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 52, thereby realizing the tool changing method of the CNC machine tool described above.
[0086] The tool changing device, equipment, and computer of the CNC machine tool provided above can be used to execute the tool changing method of the CNC machine tool provided in any of the above embodiments, and have corresponding functions and beneficial effects.
[0087] This application embodiment also provides a storage medium for storing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to execute the tool changing method of the CNC machine tool provided in the above embodiment. The tool changing method of the CNC machine tool includes: acquiring the current motion information of each tool changing component of the CNC machine tool in real time; determining the preset trigger constraint information and tool changing component corresponding to each preset tool changing task; judging whether the corresponding preset tool changing task meets the corresponding trigger constraint condition based on each current motion information and each preset trigger constraint information; if there is a triggerable task that meets the corresponding trigger constraint condition among multiple preset tool changing tasks, triggering the triggerable task; and looping the triggering process of the triggerable task until the current position of each tool changing component reaches the corresponding preset tool changing target position, so as to realize the tool changing of the CNC machine tool.
[0088] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which a program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0089] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the tool changing method of the CNC machine tool as described above, but can also execute related operations in the tool changing method of the CNC machine tool provided in any embodiment of this application.
[0090] The tool changing device, equipment, and storage medium of the CNC machine tool provided in the above embodiments can execute the tool changing method of the CNC machine tool provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the tool changing method of the CNC machine tool provided in any embodiment of this application.
[0091] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.
Claims
1. A tool changing method for a numerically controlled machine tool, characterized by, The method includes: Real-time acquisition of the current motion information of each tool changing component of the CNC machine tool; Determine the preset trigger constraint information and tool changing components corresponding to each preset tool change task; Based on the current motion information and the preset trigger constraint information, determine whether the corresponding preset tool change task meets the corresponding trigger constraint conditions. If there is a triggerable task among multiple preset tool change tasks that meets the corresponding triggering constraints, then the triggerable task is triggered. The triggering process of the cyclic triggerable task continues until the current position of each tool changing component reaches the corresponding preset tool changing target position, so as to realize the tool changing of the CNC machine tool.
2. The tool changing method of a numerical control machine tool according to claim 1, characterized in that, The triggering constraints include no interference during current triggering and no interference during future triggering; The step of determining whether the corresponding preset tool change task meets the corresponding trigger constraint condition based on each of the current motion information and each of the preset trigger constraint information includes: Based on the current position in each of the current motion information, determine whether each of the preset tool change tasks satisfies the current trigger no interference, and take the preset tool change task that satisfies the current trigger no interference as the candidate tool change task; Identify the current tool change task that is in the execution state, and determine whether the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information; If the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering, the candidate tool change task is regarded as a triggerable task that satisfies the corresponding triggering constraint condition.
3. The tool changing method of a numerical control machine tool according to claim 2, characterized in that, The preset trigger constraint information includes trajectory separation constraints; The step of determining whether the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information includes: Determine the first motion information of the first tool changing component corresponding to the current tool changing task, and the second motion information of the second tool changing component corresponding to the candidate tool changing task; The first motion trajectory of the first tool changing component is determined based on the first position information and the first velocity data in the first motion information, and the second motion trajectory of the second tool changing component is determined based on the second position information and the second velocity data in the second motion information. If the first motion trajectory and the second motion trajectory meet the trajectory separation constraint, it is determined that the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering.
4. The tool changing method of a numerical control machine tool according to claim 2, characterized in that, The number of candidate tool change tasks is multiple; Before designating the candidate tool change task as a triggerable task that satisfies the corresponding triggering constraints, the method further includes: Based on the current motion information and preset trigger constraint information corresponding to each candidate tool change task, determine whether the multiple candidate tool change tasks satisfy the condition of no interference in future triggering. Accordingly, the step of treating the candidate tool change task as a triggerable task that satisfies the corresponding triggering constraints includes: If the candidate tool change tasks and the current tool change task satisfy the condition of no interference in future triggering, and the candidate tool change tasks satisfy the condition of no interference in future triggering, then the candidate tool change tasks are designated as triggerable tasks that satisfy the corresponding triggering constraints.
5. The tool changing method of a numerical control machine tool according to claim 2, characterized in that, Each of the preset trigger constraint information includes the task priority of the corresponding preset tool change task; After determining whether the current tool change task and the candidate tool change task satisfy the condition of no interference in future triggering based on the current motion information and the preset trigger constraint information, the method further includes: If the current tool change task and the candidate tool change task do not satisfy the condition of no interference in future triggering, determine the interference position between the current tool change task and the candidate tool change task; The first priority of the candidate tool change task and the second priority of the current tool change task are determined based on the task priority of each preset tool change task. If the first priority is greater than the second priority, the candidate tool change task is treated as a triggerable task that meets the corresponding triggering constraint, and the current tool change task is stopped from being executed until the tool change component corresponding to the candidate tool change task passes through the interference position.
6. The tool changing method for a CNC machine tool according to claim 5, characterized in that, After determining the first priority of the candidate tool change task and the second priority of the current tool change task based on the task priorities of each of the preset tool change tasks, the method further includes: If the first priority is less than or equal to the second priority, determine the minimum safe distance in the preset trigger constraint information corresponding to the current tool change task; The current maximum target position of the candidate tool change task is determined based on the interference position and the minimum safety distance; The candidate tool change task is triggered, and the current maximum target position is taken as the current motion endpoint of the tool change component corresponding to the candidate tool change task.
7. The tool changing method for a CNC machine tool according to claim 6, characterized in that, After setting the current maximum target position as the current motion endpoint of the tool changing component corresponding to the candidate tool changing task, the method further includes: The update results of each current motion information are acquired in real time, and the interference position update result is determined based on each update result and each preset trigger constraint information. The current maximum target position is updated based on the interference position update result, and the current motion endpoint is updated based on the update result of the current maximum target position.
8. A tool changing device for a CNC machine tool, characterized in that, The device includes: The information acquisition module is used to acquire the current motion information of each tool changing component of the CNC machine tool in real time; The constraint determination module is used to determine the preset trigger constraint information and tool changing components corresponding to each preset tool changing task; The constraint judgment module is used to determine whether the corresponding preset tool change task meets the corresponding trigger constraint conditions based on the current motion information and the preset trigger constraint information. The task triggering module is used to trigger the triggerable task when there is a triggerable task that meets the corresponding triggering constraints among multiple preset tool change tasks. The tool changing module is used to cycle through the triggering process of the triggerable task until the current position of each tool changing component reaches the corresponding preset tool changing target position, so as to realize the tool changing of the CNC machine tool.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the steps of a tool changing method for a CNC machine tool as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of a tool changing method for a CNC machine tool as described in any one of claims 1-7.
