Safety protection control method and system for numerical control machine tool
By using an image acquisition device and a multimodal perception module for drive feedback data, combined with a digital twin model and spectrum analysis, the problem of the contradiction between safety and continuity in traditional five-axis CNC machine tools in consumer applications is solved. This enables accurate detection of safety faults and flexible deceleration control, reduces the false alarm rate, and ensures safety and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Filing Date
- 2026-04-15
- Publication Date
- 2026-07-14
Smart Images

Figure CN122386901A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of CNC machining safety control technology, and in particular to a CNC machine tool safety protection control method, system, computer equipment, readable storage medium and computer program product. Background Technology
[0002] Five-axis CNC machine tools, as a high-end CNC machining equipment, are capable of high-precision milling of complex curved workpieces and are now widely used in various manufacturing fields. Safety protection for five-axis CNC machine tools has become an important research direction in the field of CNC machining.
[0003] Traditional five-axis CNC machine tool safety protection mainly relies on physical isolation (such as enclosed sheet metal covers) and emergency stop buttons. However, in desktop five-axis CNC machine tool applications targeting consumer end users (C-end users, such as homes and maker spaces), the following challenges exist: The contradiction between safety and continuity: Simple physical switches (such as power off when the door is opened) can easily cause the spindle to rotate inertia and injure people, and direct power off can lead to the loss of machining paths, making it impossible to accurately detect fault breakpoints, thus preventing continued machining at the breakpoint and causing waste of workpieces or materials for C-end users. Limited monitoring methods and high false alarm rate: Relying solely on software limits or single current monitoring cannot cover complex collision scenarios (such as fixture interference) or minor tool breakage situations, and cannot accurately identify and detect fault breakpoints. Risk of user misoperation: Non-professional users may attempt to resume machining without troubleshooting, posing a risk of secondary injury.
[0004] It is evident that traditional five-axis CNC machine tool safety protection technologies, especially those designed for consumer-grade five-axis CNC machine tools, are unable to accurately and effectively detect safety malfunctions in CNC machine tools, thus failing to effectively protect and control them. Summary of the Invention
[0005] Therefore, it is necessary to provide a CNC machine tool safety protection and control method, system, computer equipment, readable storage medium, and computer program product that can accurately and effectively detect safety fault events of CNC machine tools, addressing the aforementioned technical problems.
[0006] In a first aspect, this application provides a safety protection and control method for a CNC machine tool. The CNC machine tool is equipped with an image acquisition device, which is used to capture images of the machining area of the CNC machine tool. The method includes the following steps:
[0007] The drive feedback data of the CNC machine tool's driver is obtained, and the image of the machining area corresponding to the machining area is obtained through the image acquisition device;
[0008] Based on the drive feedback data and the processing area image, it is detected whether the CNC machine tool has triggered a safety interruption event;
[0009] In response to the safety interruption event triggered by the CNC machine tool, the spindle and each motion axis of the CNC machine tool are decelerated according to a preset deceleration control method.
[0010] In one embodiment, the safety interruption event includes a tool collision event, the drive feedback data includes the drive current of the driver, and the image acquisition device includes a binocular camera; the step of detecting whether the CNC machine tool has triggered a safety interruption event based on the drive feedback data and the image of the machining area includes:
[0011] Based on the comparison result between the drive current and the preset current safety threshold, it is determined whether the driver has an abnormal drive current.
[0012] In the event of an abnormal drive current in the driver, the target spatial distance of the CNC machine tool is obtained based on the image of the machining area; the target spatial distance is the minimum of a first distance and a second distance, the first distance being the physical distance between the tool and the workpiece to be machined in the CNC machine tool, and the second distance being the physical distance between the tool and the fixture;
[0013] If the target space distance is greater than a preset distance safety threshold, then the safety interruption event triggered by the CNC machine tool is determined to be the tool collision event.
[0014] In one embodiment, obtaining the target spatial distance of the CNC machine tool based on the processing area image includes:
[0015] Based on the spatial information in the processing area image, obtain the point cloud data corresponding to the cutting tool, the workpiece to be processed, and the fixture respectively;
[0016] Based on the point cloud data, the pre-constructed digital twin model is updated, and according to the updated digital twin model, the actual three-dimensional spatial positions of the cutting tool, the workpiece to be processed, and the fixture are determined respectively; the digital twin model is used to characterize the spatial geometric relationship between the cutting tool, the workpiece to be processed, and the fixture.
[0017] The target spatial distance is determined based on the actual three-dimensional spatial positions of the cutting tool, the workpiece to be processed, and the fixture.
[0018] In one embodiment, the safety interruption event includes a tool breakage event; the drive feedback data includes the load power signal of the spindle motor of the CNC machine tool, and the machining area image includes the current tool image; the step of detecting whether the CNC machine tool has triggered a safety interruption event based on the drive feedback data and the machining area image includes:
[0019] Feature extraction is performed on the spectral information of the load power signal to obtain tool state feature parameters; the tool state feature parameters are used to characterize the state of the tool.
[0020] If the tool state feature parameter is greater than the preset tool breakage determination threshold, the current tool image is subjected to contour recognition to obtain the current geometric contour of the tool.
[0021] The current geometric profile of the tool is compared with the pre-stored reference geometric profile. If the comparison result indicates that the tool profile has defects, the safety interruption event triggered by the CNC machine tool is determined to be a tool breakage event.
[0022] In one embodiment, the CNC machine tool further includes a hardware safety circuit; the hardware safety circuit includes a door safety circuit and an emergency stop circuit, comprising:
[0023] When the machine door safety circuit detects that the machine door is open, it immediately cuts off the enable signal of the motor driver, causing the motor to lose driving force; at the same time, it sends an interrupt signal to the main control SoC to execute the step of responding to the safety interrupt event triggered by the CNC machine tool and decelerating the spindle and each motion axis of the CNC machine tool according to the preset deceleration control mode.
[0024] When the emergency stop circuit detects that the emergency stop switch has been triggered, the enable signal of the motor driver is immediately cut off, causing the motor to lose driving force; at the same time, an interrupt signal is sent to the main control SoC to execute the step of responding to the safety interruption event triggered by the CNC machine tool and decelerating the spindle and each motion axis of the CNC machine tool according to the preset deceleration control mode.
[0025] In one embodiment, after the step of controlling the deceleration of the spindle and each motion axis of the CNC machine tool according to a preset deceleration control method in response to the safety interruption event triggered by the CNC machine tool, the method further includes:
[0026] Obtain the breakpoint position of each motion axis in the CNC machine tool;
[0027] In response to the triggering operation of the reset confirmation button of the CNC machine tool, the coordinates corresponding to the breakpoint positions of each motion axis are corrected to obtain the corrected coordinates;
[0028] Based on the corrected coordinates, the workpiece to be processed continues from the breakpoint position.
[0029] In one embodiment, the breakpoint location includes a theoretical breakpoint location, and obtaining the breakpoint location of each motion axis in the CNC machine tool includes:
[0030] Obtain the theoretical command position of each motion axis when the feed speed of each motion axis is decelerated to zero; the theoretical command position is the position when the feed speed of each motion axis is commanded to be zero.
[0031] The theoretical command positions of each of the motion axes are mapped to theoretical breakpoint coordinates, breakpoint line numbers, and workpiece breakpoint coordinates; the theoretical breakpoint coordinates are the coordinates of each motion axis in the machine tool coordinate system corresponding to the theoretical command position; the breakpoint line number is the line number of the G-code program corresponding to the theoretical command position; and the workpiece breakpoint coordinates are the coordinates of the workpiece to be processed in the workpiece coordinate system corresponding to the theoretical command position.
[0032] The theoretical breakpoint coordinates, the breakpoint row number, and the workpiece breakpoint coordinates are used as the theoretical breakpoint location.
[0033] In one embodiment, the breakpoint location further includes the actual breakpoint location, and obtaining the breakpoint location of each motion axis in the CNC machine tool further includes:
[0034] When the feed speed of each of the motion axes is reduced to zero, the actual break point position of each of the motion axes is locked by the electronic brake of the CNC machine tool; the actual break point position is the position where each of the motion axes is actually locked by the electronic brake due to positional offset.
[0035] In one embodiment, correcting the coordinates corresponding to the breakpoint positions of each of the motion axes to obtain corrected coordinates includes:
[0036] Obtain the actual breakpoint coordinates corresponding to the actual breakpoint positions of each of the motion axes, and the theoretical breakpoint coordinates corresponding to the theoretical breakpoint positions;
[0037] For any of the motion axes, the position deviation of each motion axis is obtained based on the difference between the actual breakpoint coordinates and the theoretical breakpoint coordinates of the motion axis.
[0038] When the position deviation is within a preset allowable range, each of the motion axes is driven to move by the position deviation to restore each of the motion axes from the actual breakpoint coordinates to the theoretical breakpoint coordinates, and the theoretical breakpoint coordinates are used as the corrected coordinates; the corrected coordinates are used to continue processing the workpiece from the breakpoint position corresponding to the theoretical breakpoint coordinates.
[0039] Secondly, this application provides a safety protection control system for a CNC machine tool. The CNC machine tool is equipped with an image acquisition device, which is used to capture images of the machining area of the CNC machine tool. The system includes:
[0040] The multimodal sensing module is used to acquire drive feedback data from the driver of the CNC machine tool, and to acquire an image of the machining area corresponding to the machining area through the image acquisition device.
[0041] The safety interruption event detection module is used to detect whether the CNC machine tool has triggered a safety interruption event based on the drive feedback data and the processing area image;
[0042] The deceleration control module is used to respond to the safety interruption event triggered by the CNC machine tool and to decelerate the spindle and each motion axis of the CNC machine tool according to a preset deceleration control mode.
[0043] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described CNC machine tool safety protection control method.
[0044] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0045] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0046] The aforementioned CNC machine tool safety protection control method, system, computer equipment, readable storage medium, and computer program products, by acquiring drive feedback data from the CNC machine tool's driver and obtaining images of the corresponding machining area through an image acquisition device, can overcome the limitations of single data monitoring. Furthermore, based on the drive feedback data and the machining area image, it can detect whether the CNC machine tool has triggered a safety interruption event. Through multi-modal verification using multi-source information fusion, it can accurately and effectively perceive and detect safety fault events of the CNC machine tool, reducing the false alarm rate or missed alarm risk and improving the accuracy and reliability of safety event detection. In response to any safety interruption event triggered by the CNC machine tool, it controls the deceleration of the CNC machine tool's spindle and each motion axis according to a preset deceleration control method. This controlled deceleration of the CNC machine tool achieves safe and flexible stopping, reducing the impact damage of emergency equipment response and effectively protecting the CNC machine tool while ensuring the safety of personnel and equipment. Attached Figure Description
[0047] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0048] Figure 1 This is a flowchart illustrating a safety protection control method for a CNC machine tool in one embodiment;
[0049] Figure 2 This is a schematic diagram of the tool collision event detection and processing flow in one embodiment;
[0050] Figure 3 This is a schematic diagram of an interrupt recovery process in one embodiment;
[0051] Figure 4 This is a schematic diagram of a security recovery state mechanism in one embodiment;
[0052] Figure 5 This is a structural block diagram of a safety protection control system for a CNC machine tool in one embodiment;
[0053] Figure 6 This is an overall architecture diagram of a CNC machine tool safety protection control system in one embodiment;
[0054] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0056] In one exemplary embodiment, such as Figure 1 As shown, a safety protection control method for CNC machine tools is provided. This embodiment illustrates the application of this method to a CNC machine tool (Computer Numerical Control Machine Tools). For example, the CNC machine tool can be a consumer-grade desktop five-axis CNC machine tool. In this embodiment, the CNC machine tool includes a software control loop in a dual-redundant safety loop. The CNC machine tool is equipped with an image acquisition device for capturing images of the machining area of the CNC machine tool. The method includes the following steps S102 to S106. Wherein:
[0057] Step S102: Obtain drive feedback data from the CNC machine tool's driver, and obtain the image of the machining area corresponding to the machining area through the image acquisition device.
[0058] In practical applications, CNC machine tools can be equipped with a safety controller. This safety controller can be set in a software control loop managed by a System on Chip (SoC). When machining a workpiece using a CNC machine tool (such as a desktop five-axis CNC machine tool for end users), the safety controller can acquire drive feedback data from the drive circuit of the driver, which can be, for example, a hardware circuit electrically interlocked with the actuator, or through a drive data acquisition module (such as a current sensor) set in the multimodal sensing module of the CNC machine tool. This data can be the current or torque of the driver. The safety controller can also acquire images of the machining area corresponding to the machining area of the CNC machine tool (such as the area of the machining table in the machine bay) through an image acquisition device, such as a binocular camera.
[0059] Step S104: Based on the drive feedback data and the image of the machining area, detect whether the CNC machine tool has triggered a safety interruption event.
[0060] In practical implementation, the safety controller of a CNC machine tool can detect whether the CNC machine tool has triggered a safety interruption event by fusing current / torque feedback data from the drive feedback data and visual flow data from the machining area image, based on drive feedback data and machining area image.
[0061] Step S106: In response to a safety interruption event triggered by the CNC machine tool, deceleration control is performed on the spindle and each motion axis of the CNC machine tool according to a preset deceleration control method.
[0062] In practical implementation, the safety controller of a CNC machine tool can respond to a safety interruption event triggered by the CNC machine tool and control the deceleration of the spindle and each motion axis according to a preset deceleration control method, i.e., controlled deceleration and soft stop. For example, the controller of the CNC machine tool can gradually reduce the stepping frequency or feed rate of the spindle and each motion axis according to a preset deceleration slope or negative acceleration, so that each axis smoothly decelerates to zero speed. The deceleration slope or acceleration can be pre-calculated based on the current motion speed and inertia of each axis to ensure that no steps are lost during deceleration.
[0063] The aforementioned CNC machine tool safety protection and control method, by acquiring drive feedback data from the CNC machine tool's driver and obtaining images of the corresponding machining area through an image acquisition device, overcomes the limitations of single data monitoring. Furthermore, based on the drive feedback data and the machining area image, it detects whether the CNC machine tool has triggered a safety interruption event. Through multi-modal verification using multi-source information fusion, it can accurately and effectively perceive and detect safety fault events of the CNC machine tool, reducing the false alarm rate or missed alarm risk and improving the accuracy and reliability of safety event detection. In response to any safety interruption event triggered by the CNC machine tool, it decelerates the spindle and each motion axis of the CNC machine tool according to a preset deceleration control method. This controlled deceleration of the CNC machine tool achieves safe and flexible stopping, reducing the impact damage of emergency response and effectively protecting the CNC machine tool while ensuring the safety of personnel and equipment.
[0064] In an exemplary embodiment, the safety interruption event includes a tool collision event, the drive feedback data includes the drive current of the driver, and the image acquisition device may include a binocular camera. Detecting whether the CNC machine tool has triggered a safety interruption event based on the drive feedback data and the image of the machining area includes: determining whether the driver has an abnormal drive current based on a comparison between the drive current and a preset current safety threshold; if the driver has an abnormal drive current, obtaining the target spatial distance of the CNC machine tool based on the image of the machining area; if the target spatial distance is greater than a preset distance safety threshold, then determining that the safety interruption event triggered by the CNC machine tool is a tool collision event.
[0065] The target spatial distance can be the minimum of the first distance and the second distance. The first distance is the physical distance between the cutting tool and the workpiece to be processed in the CNC machine tool, and the second distance is the physical distance between the cutting tool and the fixture.
[0066] Understandably, spatial distance can include the tool-workpiece distance (i.e., the first distance): the closest distance between the tool cutting edge and the workpiece surface. During normal machining, this distance is zero or minimal; in abnormal situations, the focus is on unexpected approaches in non-cutting areas. The tool-fixture distance (i.e., the second distance): the closest distance between the tool (including the tool holder) and the fixture body. This is a high-risk area for collisions, especially in five-axis machining, where changes in the rotational axis posture can easily lead to interference between the tool holder and the fixture. The target spatial distance is the minimum safe distance between the tool and the workpiece, and between the tool and the fixture.
[0067] In practical applications, such as Figure 2 The flowchart shown illustrates the detection and handling process for tool collision events. The safety controller of the CNC machine tool can collect the drive current pulses of the drive motor. If the drive current pulse is greater than a preset current safety threshold, it is determined that an abnormal drive current has been detected in the driver. Then, based on the image of the machining area captured by the binocular camera, the target spatial distance of the CNC machine tool is obtained. Furthermore, by comparing the target spatial distance with a preset distance safety threshold, it is determined whether there is visual spatial interference. If the target spatial distance is greater than the preset distance safety threshold, the safety interruption event triggered by the CNC machine tool is determined to be a tool collision event.
[0068] When abnormal current fluctuations and visual spatial interference are matched simultaneously (the dual verification of abnormal current and visual interference is passed), it is determined that a tool collision event has occurred on the CNC machine tool, and the highest priority alarm needs to be triggered, that is, the controlled deceleration safety stop mechanism (Soft Stop) that decelerates the motion axis of the CNC machine tool is immediately triggered.
[0069] Understandably, if the abnormality of any drive feedback data signal is extremely severe, such as the current suddenly surging to more than three times the rated value, the safety controller of the CNC machine tool will trigger the controlled deceleration mechanism (Soft Stop) to provide fallback protection against extreme values in a single channel, even without visual matching for image verification.
[0070] When an abnormal current occurs, i.e. a current pulse exceeds the current safety threshold, the CNC machine tool's safety controller reduces the feed rate of each motion axis and issues a first-level alarm warning, but does not trigger controlled deceleration and shutdown, requiring visual verification.
[0071] Similarly, when visual interference occurs, i.e., when the target space distance exceeds the preset distance safety threshold, the CNC machine tool's safety controller reduces the feed rate of each motion axis and issues a first-level alarm warning, but does not trigger controlled deceleration and shutdown, and needs to wait for current verification.
[0072] The technical solution of this embodiment determines that an abnormal drive current is detected in the driver when the drive current exceeds a preset current safety threshold; it obtains the target spatial distance of the CNC machine tool based on the image of the machining area, enabling precise quantification of the spatial position between the tool, workpiece, and fixture; furthermore, it determines that the triggered safety interruption event is a tool collision event when the target spatial distance exceeds a preset distance safety threshold. Thus, through dual cross-verification of the abnormal current signal and the visual spatial distance, it achieves accurate determination of the tool collision event, significantly improving the detection accuracy and reliability of the tool collision event.
[0073] In an exemplary embodiment, obtaining the target spatial distance of the CNC machine tool based on the machining area image includes: obtaining point cloud data corresponding to the cutting tool, the workpiece to be machined, and the fixture based on the spatial information in the machining area image; updating the pre-constructed digital twin model based on the point cloud data, and determining the actual three-dimensional spatial positions of the cutting tool, the workpiece to be machined, and the fixture based on the updated digital twin model; and determining the target spatial distance based on the actual three-dimensional spatial positions of the cutting tool, the workpiece to be machined, and the fixture.
[0074] Among them, the digital twin model is used to characterize the spatial geometric relationship between the cutting tool, the workpiece to be processed, and the fixture.
[0075] In practical implementation, during the offline stage before CNC machining of the workpiece, the CNC machine tool can pre-construct a complete digital twin model of the equipment based on the machine tool's CAD model, the workpiece's 3D model, and the fixture's 3D model, using a safety controller or safety protection control system to establish the spatial geometric relationships of each component. During the online machining stage, the CNC machine tool can acquire real-time visual flow data (stereo image pairs) containing images of the machining area using a binocular camera. The binocular camera can then generate point cloud data or depth maps corresponding to the tool, workpiece, and fixture based on the spatial information in the machining area images and a stereo matching algorithm. Furthermore, the point cloud data acquired by the binocular camera can be registered and overlaid with the digital twin model to update the pre-constructed digital twin model. Based on the updated digital twin model, the actual 3D spatial positions of the tool, workpiece, and fixture are determined. Based on these actual 3D spatial positions, the Euclidean distance between the tool and workpiece (i.e., the first distance) and the Euclidean distance between the tool and fixture (the second distance) are calculated, and the minimum of the two distances is taken as the target spatial distance. Therefore, it can be understood that the role of binocular cameras is to correct the deviations between digital twin models and the actual physical world, such as slight offsets in workpiece clamping positions and geometric changes caused by tool wear, in order to ensure the accuracy of spatial distance calculations.
[0076] The technical solution of this embodiment obtains point cloud data corresponding to the cutting tool, the workpiece to be processed, and the fixture based on the spatial information in the processing area image, thereby achieving high-precision perception of the three-dimensional spatial position of the cutting tool, the workpiece, and the fixture. Then, based on the point cloud data, the pre-constructed digital twin model is updated, and based on the updated digital twin model, the actual three-dimensional spatial position of the cutting tool, the workpiece to be processed, and the fixture is determined. Then, based on the actual three-dimensional spatial position, the target spatial distance is determined. Thus, through the virtual dynamic simulation of the digital twin, the actual three-dimensional information perceived by the image and the simulation information of the virtual model can be calibrated by combining the virtual and real information, which improves the consistency of the spatial information of the cutting tool, the workpiece, and the fixture, and provides important data support for accurately perceiving cutting tool collision events.
[0077] In an exemplary embodiment, the safety interruption event includes a tool breakage event; the drive feedback data includes the load power signal of the CNC machine tool's spindle motor, and the machining area image includes the current tool image. Based on the drive feedback data and the machining area image, detecting whether the CNC machine tool has triggered a safety interruption event includes: extracting features from the spectral information of the load power signal to obtain tool state feature parameters; if the tool state feature parameters are greater than a preset tool breakage determination threshold, performing contour recognition on the current tool image to obtain the current geometric contour of the tool; comparing the current geometric contour of the tool with a pre-stored reference geometric contour, and if the comparison result indicates that the tool contour has defects, determining that the safety interruption event triggered by the CNC machine tool is a tool breakage event.
[0078] Tool state characteristic parameters, such as spectral amplitude, frequency, and symmetry, are used to characterize the tool state.
[0079] In practical applications, CNC machine tools can use a hardware circuit that is electrically interlocked with the spindle motor, or they can acquire the load power signal of the spindle motor in real time through the drive data acquisition module in a multimodal sensing module. This load power signal can be a time-domain signal calculated from the current and voltage feedback from the driver. The safety controller of the CNC machine tool can perform a Fast Fourier Transform (FFT) on the load power time-domain signal to convert it into a frequency-domain signal, i.e., the spectral information of the load power signal.
[0080] Furthermore, the safety controller of a CNC machine tool can extract features from the spectral information. During normal cutting, the spectral information exhibits a regular harmonic distribution with the tool speed multiplied by the number of cutting edges as the fundamental frequency. When the tool breaks or chipps, the spectral information of the load power signal will show the following characteristic changes: abrupt change in fundamental frequency amplitude: due to the uneven cutting force caused by the missing cutting edge, the amplitude of the fundamental frequency component will show a sudden step change; abnormal increase in high-frequency harmonics: the irregular cutting at the broken edge will excite high-frequency vibrations, and the energy proportion of higher harmonics in the spectrum will increase significantly; destruction of spectral symmetry: the spectrum of a normal multi-edged tool has good symmetry, which is destroyed after the tool breaks. Therefore, based on the spectral characteristics such as amplitude, frequency, and symmetry in the spectral information of the load power signal, the tool state characteristic parameters, i.e., spectral characteristic parameters, can be obtained.
[0081] The tool status characteristic parameters are compared with the preset tool breakage judgment threshold. If the tool status characteristic parameters are greater than the preset tool breakage judgment threshold, the current tool image is contour recognized. That is, by analyzing the spectrum of the spindle load power change characteristics, it is indirectly inferred whether the tool has been damaged. When the spectrum characteristic deviation exceeds the tool breakage judgment threshold, it can be preliminarily judged as a suspected tool breakage, and the CNC machine tool controller triggers the vision verification process.
[0082] Furthermore, the controller of the CNC machine tool can move the spindle to the visible area of the binocular camera, or take advantage of the moment when the tool passes through the camera's field of view during machining intervals to capture a stereo image of the tool (i.e., the current tool image) through the binocular camera. The current tool image can be contoured using an edge detection algorithm to obtain the current geometric contour of the tool. Then, the current geometric contour of the tool is compared with a pre-stored intact reference geometric contour using a contour matching algorithm. If the comparison result indicates that the tool contour has defects (such as missing cutting edge or chipped tool tip), the safety interruption event triggered by the CNC machine tool is finally determined to be a tool breakage event.
[0083] The main judgment is made by analyzing the spindle load power spectrum and the auxiliary verification is made by visual contour recognition. That is, by using the dual-modal fusion of "spectrum screening + visual confirmation" to identify broken tools, if no obvious defects are found by visual inspection, the spectrum abnormality is downgraded to the "monitoring and observation" state, and processing continues but the monitoring sensitivity is improved.
[0084] The technical solution of this embodiment extracts features from the spectral information of the load power signal to obtain tool state feature parameters. This allows for early screening of potential tool breakage risks based on the spectral characteristics of electrical signals. When the tool state feature parameters exceed a preset tool breakage judgment threshold, contour recognition is performed on the current tool image to obtain the current geometric contour of the tool. The current geometric contour of the tool is then compared with a pre-stored reference geometric contour. If the comparison result indicates that the tool contour is damaged, the safety interruption event triggered by the CNC machine tool is determined to be a tool breakage event. Thus, based on the initial screening using the load power spectrum, the combination of intuitive comparison of visual contours and physical confirmation significantly improves the accuracy and reliability of tool breakage event judgment.
[0085] In an exemplary embodiment, the dual-redundant safety loop further includes a hardware safety loop; the hardware safety loop includes a door safety loop, which includes a door detection switch connected in series in the drive circuit of the motion axis motor of the CNC machine tool. The opening of the door detection switch is linked to the opening action of the CNC machine tool door. The safety interruption event includes a door opening event. The method further includes: when the door detection switch is in the open state, in response to the hardware interruption signal sent by the door safety loop, determining that the safety interruption event triggered by the CNC machine tool is a door opening event; and performing a step of decelerating the spindle and each motion axis of the CNC machine tool according to a preset deceleration control mode in response to the safety interruption event triggered by the CNC machine tool.
[0086] The hardware safety circuit also includes an emergency stop circuit, which includes an emergency stop switch connected in series in the drive circuit of the motion axis motor of the CNC machine tool. The safety interruption event also includes an emergency stop event. The method further includes: when the emergency stop switch is triggered, in response to the hardware interruption signal sent by the emergency stop circuit, determining that the safety interruption event triggered by the CNC machine tool is an emergency stop event; and executing the step of decelerating the spindle and each motion axis of the CNC machine tool in response to the safety interruption event triggered by the CNC machine tool, according to a preset deceleration control mode.
[0087] The drive circuit can be a hardware circuit electrically interlocked with the motion axis motor, and does not rely on control software or main control system-level chips to identify and detect door opening events or emergency stop events.
[0088] In practical implementation, the CNC machine tool's drive circuit can determine whether the machine door is open via a door detection switch (such as a door switch sensor or door sensor switch). If the door detection switch is detected to be open, the CNC machine tool's safety controller receives a hardware interrupt signal from the door safety circuit, thus determining that the safety interruption event triggered by the CNC machine tool is a door open event. Similarly, the CNC machine tool's drive circuit can determine whether an emergency stop is needed via an emergency stop switch or emergency stop button. If the emergency stop switch is detected to be pressed, the CNC machine tool's safety controller receives a hardware interrupt signal from the emergency stop circuit, thus determining that the safety interruption event triggered by the CNC machine tool is an emergency stop event. Furthermore, after determining that a door open event or an emergency stop event has occurred, the safety controller executes a step in response to the CNC machine tool triggering a safety interruption event, performing deceleration control on the CNC machine tool's spindle and each motion axis according to a preset deceleration control method; that is, triggering the Soft Stop controlled deceleration mechanism.
[0089] Understandably, this application provides two independent and parallel safety control paths, namely a dual-loop redundant circuit, including a hardware circuit (also known as a hardware safety circuit or hardware safety loop) electrically interlocked with the actuators (spindle and each motion axis), and a software circuit (also known as a software control circuit) managed and controlled by the main control SoC (safety controller). The two circuits operate simultaneously, serve as backups for each other, and provide redundancy. Door opening events or emergency stop events are directly triggered by the hard-wired interlocked hardware circuit; tool collision events and tool breakage events are triggered by the software circuit after being identified by a software algorithm.
[0090] Upon detection of any of the aforementioned safety interruption events—namely, tool collision, tool breakage, machine door opening, or emergency stop—the CNC machine tool triggers a high-priority alarm. The machine tool's hardware safety loop sends an interrupt signal to the safety controller (SoC) in the software control loop. This interrupt signal instructs the safety controller to perform deceleration control on the CNC machine tool, triggering a Soft Stop controlled deceleration shutdown. The interrupt signal includes hardware interrupt signals: when the emergency stop button is pressed or the machine door is opened (i.e., when a machine door opening or emergency stop event occurs), the hardware safety loop sends a level interrupt signal (GPIO interrupt, i.e., General Purpose Input / Output interrupt) to the SoC via hardwired while simultaneously cutting off the motor enable; and software interrupt signals: when the collision detection algorithm or tool breakage identification algorithm confirms an anomaly within the SoC, i.e., when a tool collision or tool breakage event is confirmed, an interrupt signal is generated internally by the software.
[0091] The core design concept of the "dual-loop" system is that even if the software system fails completely (such as a crash or blue screen), the hardware loop, based on its fast response speed (microsecond level) and its immunity to software crashes or system failures, can still independently complete the safe shutdown action. Under normal software operation, the software loop can achieve a more elegant controlled deceleration shutdown, avoiding missed steps and workpiece scrap.
[0092] The technical solution of this embodiment forms a physical circuit of hardware interlocking by using a door detection switch and a stop switch connected in series with the drive circuit of the drive motor. This hardware circuit, together with the software circuit of the safety controller managed by the main control system-level chip, constitutes an independent and redundant dual-circuit design. This ensures that even if the software system fails, effective physical interlocking control can still be achieved, improving the reliability of safety event detection and anti-interference capability. Furthermore, by responding to the door detection switch being in the open state or the emergency stop switch being triggered, the triggered safety interruption event is determined to be a door opening event or an emergency stop event, thereby achieving comprehensive coverage of the perception and monitoring of various typical types of safety risk events.
[0093] In an exemplary embodiment, after the step of controlling the deceleration of the CNC machine tool's spindle and each motion axis according to a preset deceleration control method in response to a safety interruption event triggered by the CNC machine tool, as follows: Figure 3 The diagram illustrates the interrupt recovery process, and the method further includes:
[0094] Step S302: Obtain the breakpoint positions of each motion axis in the CNC machine tool;
[0095] Step S304: In response to the trigger operation of the reset confirmation button of the CNC machine tool, the coordinates corresponding to the breakpoint positions of each motion axis are corrected to obtain the corrected coordinates;
[0096] Step S306: Based on the corrected coordinates, continue machining the workpiece from the breakpoint position.
[0097] In practical applications, such as Figure 4The diagram illustrating the safety recovery mechanism shows that, in response to any safety interruption event triggered by the CNC machine tool, the machine tool's safety controller, upon receiving the interruption signal, performs controlled deceleration on each motion axis and safely stops the machine. It then obtains the breakpoint location of each motion axis and enters a "safety lockout state," awaiting manual reset. The CNC machine tool user (operator) needs to manually check the environmental safety, such as checking the tool's integrity, cleaning debris, and confirming the workpiece has not shifted, to troubleshoot and resolve the fault. After troubleshooting, the user closes the machine door (the door switch returns to the closed state). Upon detecting that the door is closed, the door detection switch in the CNC machine tool's hardware circuit triggers the safety controller or safety protection control system to enter a state awaiting reset confirmation.
[0098] Furthermore, after the user manually presses the physical reset button, a reset signal such as "Fault confirmed to be resolved, machining allowed" can be sent to the system. The safety controller of the CNC machine tool responds to the trigger operation of the reset confirmation button on the CNC machine tool. That is, after receiving the reset signal, it performs coordinate correction, corrects the coordinates corresponding to the breakpoint positions of each motion axis, and obtains the corrected coordinates. Based on the corrected coordinates, the machining coordinate system is restored from the breakpoint position, and subsequent G-code is executed to continue machining the workpiece.
[0099] Understandably, upon detecting any of the aforementioned safety interruption events—namely, tool collision, tool breakage, machine door opening, or emergency stop—the CNC machine tool's hardware circuitry will hardwire the enable signal (Enable terminal) of the electrode driver, causing the drive motors of each actuator to lose driving force and stop working. Simultaneously, the hardware circuitry sends an interrupt signal to the safety controller (main SoC). Upon receiving the interrupt signal, the safety controller executes a controlled deceleration program (Soft Stop), gradually reducing the stepping frequency of each axis at a preset slope to achieve a smooth stop. Once the axis speed drops to zero, the current breakpoint position is locked via mechanical braking or electronic brakes, entering a safety lock state and saving the current machining breakpoint coordinates (breakpoint position). After the user manually presses the physical reset button, coordinate correction is performed, resuming machining from the breakpoint position. In other words, regardless of the type of safety interruption event, the interruption recovery process follows a sequence of "controlled deceleration → breakpoint position locking → breakpoint continuation machining."
[0100] The technical solution of this embodiment, after triggering any safety interruption event and controlling deceleration and shutdown, obtains the breakpoint position of each motion axis in the CNC machine tool, thereby accurately recording the interruption position when the safety event occurs, providing precise positioning for subsequent recovery machining; then, in response to the triggering operation of the CNC machine tool's reset confirmation button, a physical reset button with manual confirmation can be used to prevent the system from automatically triggering recovery without confirmation, maximizing the safety of the CNC machine tool; then, the coordinates corresponding to the breakpoint positions of each motion axis are corrected, and based on the corrected coordinates, machining of the workpiece to be machined can continue from the breakpoint position, effectively ensuring the safe recovery and continuity of machining, realizing the precise continuation of the machining process after a safety interruption of the CNC machine tool, thus forming a complete closed-loop safety protection control process of "safety interruption event occurrence → controlled deceleration → breakpoint position locking → breakpoint continuation machining", achieving synergistic optimization and control of CNC machine tool efficiency and safety.
[0101] In an exemplary embodiment, the breakpoint location includes the theoretical breakpoint location. Obtaining the breakpoint location of each motion axis in the CNC machine tool includes: obtaining the theoretical command position of each motion axis when the feed speed of each motion axis is decelerated to zero; mapping the theoretical command position of each motion axis to theoretical breakpoint coordinates, breakpoint row number and workpiece breakpoint coordinates; and using the theoretical breakpoint coordinates, breakpoint row number and workpiece breakpoint coordinates as the theoretical breakpoint location.
[0102] Among them, the theoretical command position is the position when the feed speed of each motion axis is zero; the theoretical breakpoint coordinates are the coordinates of each motion axis in the machine tool coordinate system corresponding to the theoretical command position; the breakpoint line number is the line number of the G-code program corresponding to the theoretical command position; and the workpiece breakpoint coordinates are the coordinates of the workpiece to be processed in the workpiece coordinate system corresponding to the theoretical command position.
[0103] In practical implementation, the safety controller of the CNC machine tool can gradually reduce the stepping frequency / feed rate of the five motion axes according to a preset deceleration slope or negative acceleration, so that each axis can smoothly decelerate to zero speed. It then obtains the theoretical command position of each motion axis when the feed rate decelerates to zero. The theoretical command position of each motion axis is mapped to theoretical breakpoint coordinates (i.e., the target coordinates at the instant the controlled deceleration is completed, which are the theoretical coordinates controlled by the program command), breakpoint line number, and workpiece breakpoint coordinates. These theoretical breakpoint coordinates, breakpoint line number, and workpiece breakpoint coordinates are used as the theoretical breakpoint location. The safety controller saves the current machine coordinates of the five axes, the corresponding G-code program line number, and workpiece coordinate system parameters to non-volatile memory.
[0104] The technical solution of this embodiment obtains the theoretical command position of each motion axis when the feed speed of each motion axis is decelerated to zero; maps the theoretical command position of each motion axis to theoretical breakpoint coordinates, breakpoint row number, and workpiece breakpoint coordinates; and uses the theoretical breakpoint coordinates, breakpoint row number, and workpiece breakpoint coordinates as the theoretical breakpoint position. This enables the accurate recording of the breakpoint command position of the safety interruption event based on theoretical calculation. Thus, based on the safety shutdown process of the "controlled deceleration + position locking + breakpoint saving" action sequence, a complete controlled deceleration shutdown locking mechanism is formed, providing an important foundation for subsequent coordinate correction and breakpoint continuation machining.
[0105] In an exemplary embodiment, the breakpoint location also includes the actual breakpoint location. Obtaining the breakpoint location of each motion axis in the CNC machine tool also includes: locking the actual breakpoint location of each motion axis by means of the electronic brake of the CNC machine tool when the feed speed of each motion axis is reduced to zero.
[0106] Understandably, the actual breakpoint can be the positional offset of each motion axis due to inertial drive, mechanical backlash, or servo response delay, while the actual position locked by the electronic brake is the true physical position after the brake is locked.
[0107] In practical applications, when the safety controller responds to a safety interruption event triggered by the CNC machine tool, it decelerates each motion axis of the CNC machine tool according to the preset deceleration control mode. At the same time, it can also brake the spindle of the CNC machine tool. The spindle motor decelerates and stops, and the electronic brake is activated after the speed drops to zero. After the kinetic energy of each motion axis is exhausted, that is, after the feed speed returns to zero and stops, the current position is locked by the mechanical braking or electronic brake of the CNC machine tool, which is the actual break point position.
[0108] Therefore, it can be understood that the theoretical breakpoint location is the coordinate position of the five axes in the machine tool coordinate system (the three linear axes X, Y, and Z + the angle values of the two rotary axes A and C) when the interruption occurs, as well as the G-code program line number corresponding to the breakpoint and the position of the workpiece in the machining coordinate system (workpiece coordinate system). The controller reduces the feed rate / stepping frequency to the command speed of 0 according to the preset slope, marking the end of the deceleration process at the control program planning level, so as to support the subsequent breakpoint continuation machining.
[0109] However, due to inertia and response delays in the motor and transmission mechanism, the actual moment each axis stops physically lags behind the moment the controlled deceleration program command is executed. Therefore, a brake is needed to lock the axis when the actual movement stops to obtain the actual mechanical breakpoint location. This allows the safety controller to compare and correct the current actual breakpoint coordinates with the theoretical breakpoint coordinates during resuming machining (because there may be slight positional deviations during controlled deceleration); and continue execution of the subsequent machining path from the G-code line number corresponding to the breakpoint.
[0110] The technical solution of this embodiment locks the actual breakpoint position of each motion axis by using the electronic brake of the CNC machine tool when the feed speed of each motion axis is reduced to zero, so as to accurately record the actual stopping position of the physical entity, thereby further improving the accuracy of breakpoint positioning and providing an important foundation for subsequent coordinate correction and breakpoint continuation machining.
[0111] In an exemplary embodiment, the coordinates corresponding to the breakpoint positions of each motion axis are corrected to obtain corrected coordinates. This includes: obtaining the actual breakpoint coordinates corresponding to the actual breakpoint positions of each motion axis, and the theoretical breakpoint coordinates corresponding to the theoretical breakpoint positions; for any motion axis, obtaining the position deviation of each motion axis based on the difference between the actual breakpoint coordinates and the theoretical breakpoint coordinates of that motion axis; and, if the position deviation is within a preset allowable range, driving each motion axis to move the position deviation to restore each motion axis from the actual breakpoint coordinates to the theoretical breakpoint coordinates, and using the theoretical breakpoint coordinates as the corrected coordinates.
[0112] The corrected coordinates are used to continue processing the workpiece from the breakpoint position corresponding to the theoretical breakpoint coordinates.
[0113] In practical implementation, the safety controller of the CNC machine tool can read the theoretical breakpoint coordinates corresponding to the theoretical breakpoint positions of each motion axis protected during safe shutdown from the non-volatile memory, i.e., the theoretical breakpoint coordinate values; at the same time, it can obtain the actual breakpoint coordinates corresponding to the current actual breakpoint positions of each motion axis by using the actual mechanical positions fed back by the encoders or pulse counters of each axis or stepper motors.
[0114] Furthermore, for any one of the motion axes, the positional deviation of each motion axis is calculated based on the difference between the actual breakpoint coordinates and the theoretical breakpoint coordinates. It is then determined whether the positional deviation is within a preset allowable range; for example, the deviation for linear axes (X-axis, Y-axis, Z-axis) should be ≤0.05mm, and the deviation for rotary axes (A-axis, C-axis) should be ≤0.1°. If the positional deviation exceeds the preset allowable range, the safety control system will issue an alarm, prompting the user to re-set the tool.
[0115] When the position deviation is within a preset allowable range, the safety controller drives each motion axis to move by the position deviation at an extremely low rate (e.g., 1 mm / s). Through minute correction movements, the motion axes are precisely restored from the actual breakpoint coordinates to the theoretical breakpoint coordinates. After correction, the coordinate system parameters are reloaded to restore the mapping relationship between the machine tool coordinate system and the workpiece coordinate system to the state before the safety interruption event, ensuring that the coordinate interpretation of subsequent G-codes is consistent with that before the interruption, thus obtaining the corrected coordinates.
[0116] After coordinate correction is completed, the CNC machine tool enters the "breakpoint continuation machining ready" state, and the CNC machine tool's display screen can show a prompt such as "Coordinate correction completed, machining can continue". Then, the safety controller executes the G-code after the breakpoint line number in the G-code program to continue machining the workpiece from the breakpoint position corresponding to the theoretical breakpoint coordinates.
[0117] The technical solution of this embodiment accurately obtains the position deviation of each motion axis by comparing the actual breakpoint coordinates corresponding to the actual breakpoint positions with the theoretical breakpoint coordinates corresponding to the theoretical breakpoint positions. When the position deviation is within a preset allowable range, each motion axis is driven to move by the position deviation to restore each motion axis from the actual breakpoint coordinates to the theoretical breakpoint coordinates. The theoretical breakpoint coordinates are then used as the corrected coordinates to achieve precise breakpoint reset and alignment. This minimizes the possibility of minor offset errors caused by inertia or response delay, thereby ensuring the machining accuracy and continuity of the CNC machine tool. It also avoids dimensional deviations or workpiece scrap caused by position deviations, significantly reducing material and time waste and achieving zero machining loss as much as possible.
[0118] In one possible implementation, the CNC machine tool safety protection control method of this application provides a comprehensive protection architecture of "hard-wired interlocking + multi-source sensing + controlled locking", specifically including:
[0119] Dual-loop redundant hardware circuitry: The system is designed with a hardware safety loop independent of the main control SoC, which is hardware interlocked with the actuator drive motor. The hardware safety loop can detect door opening events or emergency stop events. When any fault event such as door opening / closing, emergency stop, tool collision, or tool breakage is triggered, the hard-wired interlock circuit directly intervenes at the motor enable terminal and simultaneously sends an interrupt signal to the controller.
[0120] Controlled deceleration (Soft Stop) locking mechanism: In response to any safety interruption event, the system does not immediately cut off the power. Instead, the controller controls the five motion axes to perform controlled deceleration at a preset slope. After the kinetic energy is exhausted, the position is locked by mechanical braking or electronic brake.
[0121] Multimodal collision detection algorithm: This algorithm fuses real-time current / torque feedback data from the driver with visual flow data from a binocular camera. The visual algorithm uses a pre-built digital twin model of the device to determine the spatial distance between the tool, workpiece, and fixture. When an abnormal current fluctuation matches the visual spatial interference, a tool collision event is detected, triggering the highest priority alarm.
[0122] Indirect tool breakage detection: Instead of directly measuring the tool's geometry (such as using a tool setter), it indirectly infers whether the tool has broken by observing the changes in spindle load power. Visual verification is then used to assist in confirmation. In other words, it combines the spectrum analysis of spindle load power with visual assistance to identify the tool's geometric integrity in order to detect tool breakage events.
[0123] Therefore, this application provides a hierarchical triggering strategy for security interruption events as shown in Table 1.
[0124] Table 1. Hierarchical Triggering Strategy for Security Interruption Events
[0125]
[0126] Safety recovery logic: After controlled deceleration and safe shutdown with the breakpoint location locked, a manual physical reset is performed to prevent automatic system recovery (unauthorized restart could cause injury) and to prevent accidental software-triggered recovery (it must be a physical action, not remote software triggering). Recovery is only initiated after ensuring the operator has left the danger zone and closed the machine door. Once the system detects the machine door is closed and the user confirms via physical buttons, the power-off coordinates are corrected, restoring the machining coordinate system from the breakpoint location.
[0127] Therefore, the technical solution of this application has at least the following effects: High security: Hardware redundancy ensures that even if the software system crashes, the physical interlock remains effective. Zero processing loss: Controlled deceleration avoids missed steps, supports breakpoint continuation of processing, and reduces material waste for end users. Intelligent disaster avoidance: Dual verification by current and vision greatly reduces the false alarm rate and can identify complex hidden dangers such as fixture interference. Compliance: Meets the appliance safety standards for consumer products, reducing the risk of accidental start-up.
[0128] It should be noted that the specific limitations of the above steps can be found in the specific limitations of a CNC machine tool safety protection and control method described above.
[0129] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0130] Based on the same inventive concept, this application also provides a CNC machine tool safety protection control device for implementing the aforementioned CNC machine tool safety protection control method. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more CNC machine tool safety protection control device embodiments provided below can be found in the limitations of the CNC machine tool safety protection control method described above, and will not be repeated here.
[0131] In one exemplary embodiment, such as Figure 5 As shown, this application provides a safety protection control system for CNC machine tools, which is applied to the software control loop in the dual redundant safety loop of a CNC machine tool. The CNC machine tool is equipped with an image acquisition device for capturing images of the machining area of the CNC machine tool. The system includes:
[0132] The multimodal sensing module 510 is used to acquire drive feedback data from the CNC machine tool's driver and to acquire the image of the machining area corresponding to the machining area through an image acquisition device.
[0133] The safety interruption event detection module 520 is used to detect whether the CNC machine tool has triggered a safety interruption event based on drive feedback data and machining area images.
[0134] The deceleration control module 530 is used to respond to a safety interruption event triggered by the CNC machine tool and to decelerate the spindle and each motion axis of the CNC machine tool according to a preset deceleration control mode.
[0135] In an exemplary embodiment, the system further includes a breakpoint safety recovery module 540, which is used to obtain the breakpoint position of each motion axis in the CNC machine tool; in response to the triggering operation of the reset confirmation button of the CNC machine tool, correct the coordinates corresponding to the breakpoint position of each motion axis to obtain the corrected coordinates; and based on the corrected coordinates, continue processing of the workpiece to be processed from the breakpoint position.
[0136] like Figure 6 The diagram shows the overall architecture of the CNC machine tool safety protection control system. This system includes a perception layer, a control layer, and an execution layer. The perception layer is a multimodal perception module, including a binocular camera, a drive data sampling module (current / torque sampling module), a door sensor switch, and an emergency stop switch. The control layer includes a safety controller (main control SOC) managed by the spindle core SOC, and dual-loop redundant hardware safety circuits (hardware loops) connected to the SOC main control. The safety controller includes a safety interruption event detection module, a deceleration control module, and a breakpoint safety recovery module. The safety interruption event detection module includes a vision perception module and a load analysis module. The safety controller can detect tool breakage events and tool collision events based on visual stream data and drive feedback data. The vision perception module receives video stream data collected by the binocular camera module to calculate the spatial distance (including tool-workpiece distance and tool-fixture distance) in tool collision events and to perform visual verification of tool contour matching in tool breakage events. The load analysis module receives current signals collected by the drive data sampling module to analyze the spindle load power in tool breakage events. The hardware safety circuit, independent of the SOC main controller's safety controller, is a pure hardware logic circuit hardwired and interlocked with door sensor switches, emergency stop switches, etc. It can detect door opening events and emergency stop events, with a response time in the microsecond range. The execution layer can include the actuator drivers for the spindle motor and motion axis drive motors. When the safety controller identifies and detects any safety interruption event such as tool breakage, collision, emergency stop, or door opening, it can urgently cut off the enable through the hardware safety circuit and send an interrupt signal to the safety controller. After receiving the interrupt signal, the safety controller sends a controlled deceleration stop (Soft Stop) frequency reduction control command to the spindle motor and motion axis motor to achieve a safe and smooth stop for the spindle and motion axis.
[0137] Each module in the aforementioned CNC machine tool safety protection and control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0138] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a safety protection control method for CNC machine tools. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device.
[0139] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0140] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the various embodiments of the above-described CNC machine tool safety protection control method.
[0141] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the various embodiments of the above-described CNC machine tool safety protection control method.
[0142] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the various embodiments of the above-described CNC machine tool safety protection control method.
[0143] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic resistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence processors, etc., and are not limited to these.
[0144] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0145] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A safety protection and control method for CNC machine tools, characterized in that, The CNC machine tool is equipped with an image acquisition device, which is used to capture images of the machining area of the CNC machine tool. The method includes: The drive feedback data of the CNC machine tool's driver is obtained, and the image of the machining area corresponding to the machining area is obtained through the image acquisition device; Based on the drive feedback data and the processing area image, it is detected whether the CNC machine tool has triggered a safety interruption event; In response to the safety interruption event triggered by the CNC machine tool, the spindle and each motion axis of the CNC machine tool are decelerated according to a preset deceleration control method.
2. The method according to claim 1, characterized in that, The safety interruption event includes a tool collision event, the drive feedback data includes the drive current of the driver, and the image acquisition device includes a binocular camera; the step of detecting whether the CNC machine tool has triggered a safety interruption event based on the drive feedback data and the image of the machining area includes: Based on the comparison result between the drive current and the preset current safety threshold, it is determined whether the driver has an abnormal drive current. In the event of an abnormal drive current in the driver, the target spatial distance of the CNC machine tool is obtained based on the image of the machining area; the target spatial distance is the minimum of a first distance and a second distance, the first distance being the physical distance between the tool and the workpiece to be machined in the CNC machine tool, and the second distance being the physical distance between the tool and the fixture; If the target space distance is greater than a preset distance safety threshold, then the safety interruption event triggered by the CNC machine tool is determined to be the tool collision event.
3. The method according to claim 2, characterized in that, The step of obtaining the target spatial distance of the CNC machine tool based on the processing area image includes: Based on the spatial information in the processing area image, obtain the point cloud data corresponding to the cutting tool, the workpiece to be processed, and the fixture respectively; Based on the point cloud data, the pre-constructed digital twin model is updated, and according to the updated digital twin model, the actual three-dimensional spatial positions of the cutting tool, the workpiece to be processed, and the fixture are determined respectively; the digital twin model is used to characterize the spatial geometric relationship between the cutting tool, the workpiece to be processed, and the fixture. The target spatial distance is determined based on the actual three-dimensional spatial positions of the cutting tool, the workpiece to be processed, and the fixture.
4. The method according to claim 1, characterized in that, The safety interruption event includes a tool breakage event; the drive feedback data includes the load power signal of the spindle motor of the CNC machine tool, and the machining area image includes the current tool image; the step of detecting whether the CNC machine tool has triggered a safety interruption event based on the drive feedback data and the machining area image includes: Feature extraction is performed on the spectral information of the load power signal to obtain tool state feature parameters; the tool state feature parameters are used to characterize the state of the tool. If the tool state feature parameter is greater than the preset tool breakage determination threshold, the current tool image is subjected to contour recognition to obtain the current geometric contour of the tool. The current geometric profile of the tool is compared with the pre-stored reference geometric profile. If the comparison result indicates that the tool profile has defects, the safety interruption event triggered by the CNC machine tool is determined to be a tool breakage event.
5. The method according to claim 1, characterized in that, The CNC machine tool further includes a hardware safety circuit; the hardware safety circuit includes a machine door safety circuit and an emergency stop circuit; the method further includes: When the machine door safety circuit detects that the machine door is open, it immediately cuts off the enable signal of the motor driver, causing the motor to lose driving force; at the same time, it sends an interrupt signal to the main control SoC to execute the step of responding to the safety interrupt event triggered by the CNC machine tool and decelerating the spindle and each motion axis of the CNC machine tool according to the preset deceleration control mode. When the emergency stop circuit detects that the emergency stop switch has been triggered, the enable signal of the motor driver is immediately cut off, causing the motor to lose driving force; at the same time, an interrupt signal is sent to the main control SoC to execute the step of responding to the safety interruption event triggered by the CNC machine tool and decelerating the spindle and each motion axis of the CNC machine tool according to the preset deceleration control mode.
6. The method according to claim 1, characterized in that, After the step of responding to the safety interruption event triggered by the CNC machine tool and decelerating the spindle and each motion axis of the CNC machine tool according to a preset deceleration control mode, the method further includes: Obtain the breakpoint position of each motion axis in the CNC machine tool; In response to the triggering operation of the reset confirmation button of the CNC machine tool, the coordinates corresponding to the breakpoint positions of each motion axis are corrected to obtain the corrected coordinates; Based on the corrected coordinates, the workpiece to be processed continues from the breakpoint position.
7. The method according to claim 6, characterized in that, The breakpoint location includes the theoretical breakpoint location. Obtaining the breakpoint location of each motion axis in the CNC machine tool includes: Obtain the theoretical command position of each motion axis when the feed speed of each motion axis is decelerated to zero; the theoretical command position is the position when the feed speed of each motion axis is commanded to be zero. The theoretical command positions of each of the motion axes are mapped to theoretical breakpoint coordinates, breakpoint line numbers, and workpiece breakpoint coordinates; the theoretical breakpoint coordinates are the coordinates of each motion axis in the machine tool coordinate system corresponding to the theoretical command position; the breakpoint line number is the line number of the G-code program corresponding to the theoretical command position; and the workpiece breakpoint coordinates are the coordinates of the workpiece to be processed in the workpiece coordinate system corresponding to the theoretical command position. The theoretical breakpoint coordinates, the breakpoint row number, and the workpiece breakpoint coordinates are used as the theoretical breakpoint location.
8. The method according to claim 6, characterized in that, The breakpoint location also includes the actual breakpoint location. Obtaining the breakpoint location of each motion axis in the CNC machine tool further includes: When the feed speed of each of the motion axes is reduced to zero, the actual break point position of each of the motion axes is locked by the electronic brake of the CNC machine tool; the actual break point position is the position where each of the motion axes is actually locked by the electronic brake due to positional offset.
9. The method according to claim 7 or 8, characterized in that, The step of correcting the coordinates corresponding to the breakpoint positions of each of the motion axes to obtain the corrected coordinates includes: Obtain the actual breakpoint coordinates corresponding to the actual breakpoint positions of each of the motion axes, and the theoretical breakpoint coordinates corresponding to the theoretical breakpoint positions; For any of the motion axes, the position deviation of each motion axis is obtained based on the difference between the actual breakpoint coordinates and the theoretical breakpoint coordinates of the motion axis. When the position deviation is within a preset allowable range, each of the motion axes is driven to move by the position deviation to restore each of the motion axes from the actual breakpoint coordinates to the theoretical breakpoint coordinates, and the theoretical breakpoint coordinates are used as the corrected coordinates; the corrected coordinates are used to continue processing the workpiece from the breakpoint position corresponding to the theoretical breakpoint coordinates.
10. A safety protection control system for CNC machine tools, characterized in that, The CNC machine tool is equipped with an image acquisition device, which is used to capture images of the machining area of the CNC machine tool. The system includes: The multimodal sensing module is used to acquire drive feedback data from the driver of the CNC machine tool, and to acquire an image of the machining area corresponding to the machining area through the image acquisition device. The safety interruption event detection module is used to detect whether the CNC machine tool has triggered a safety interruption event based on the drive feedback data and the processing area image; The deceleration control module is used to respond to the safety interruption event triggered by the CNC machine tool and to decelerate the spindle and each motion axis of the CNC machine tool according to a preset deceleration control mode.