A control method and device for AC shaft thermal switching of a numerical control machine tool

CN122386897BActive Publication Date: 2026-08-21JIER MACHINE TOOL GROUP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610875121.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-06-17
Publication Date
2026-08-21
Estimated Expiration
2046-06-17

AI Technical Summary

Technical Problem

[0005]本发明的目的在于,针对上述现有技术中无法实现A轴与C轴的实时、安全切换,且切换后易产生位置偏差导致加工中断的缺陷,提供设计一种数控机床AC轴热切换的控制方法及装置,以解决上述技术问题

Benefits of technology

通过精确获取万能铣头的A轴最小分度单位、摆动范围、C轴最小分度单位、旋转范围以及A轴电机编码器线数,实现了驱动控制与万能铣头机械特性的精准匹配,为后续Cs轮廓控制模式和热切换宏程序的稳定运行奠定了参数基础,避免了因参数不匹配导致的控制偏差或设备损坏。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122386897B_ABST
    Figure CN122386897B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of numerical control machine tool control, and relates to a control method and device for AC shaft hot switching of a numerical control machine tool; aiming at the problem that the A shaft and the C shaft of an automatic universal milling head share the same main shaft motor, only one is activated, and switching needs power-off and restart, the application switches the main shaft working mode to Cs contour control mode through a PMC signal, executes a hot switching macro program, dynamically modifies shaft selection parameters and motor distribution parameters by using a G10 L52 instruction, realizes instant switching of the main shaft motor control right from a current shaft to a target shaft, and does not need to power off or restart the system; after indexing is completed, an angle initialization program is automatically called to eliminate position monitoring alarm, and an automatic tool changing function is integrated; the application avoids the safety risk caused by main shaft zero return, eliminates the position deviation after switching, realizes real-time, safe and automatic hot switching of the A / C shaft, and improves the curved surface machining efficiency and system reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of CNC machine tool control technology, specifically relating to a control method and device for hot switching of the AC axis of a CNC machine tool. Background Technology

[0002] In the commissioning of FANUC CNC machine tools, spindle control is crucial. Actual machining often requires the use of external attachment heads. Machining complex curved surfaces often necessitates the simultaneous operation of two or more axes, and may even require the use of attachment heads with integrated motors or encoders, which places high demands on commissioning.

[0003] In existing technologies, traditional attachment heads, such as extended heads and right-angle heads, are purely mechanical structures. They are installed and removed via pressing contact points, offering a simple structure but unable to machine inclined surfaces. They require tooling to tilt the workpiece, posing safety risks and resulting in low precision. While manual universal milling heads have emerged, allowing manual indexing around the X-axis, their rotating structure must be locked during machining, limiting their application to fixed-angle inclined surfaces and preventing simultaneous cutting of curved surfaces. With the application of automatic universal milling heads, both A-axis and C-axis are integrated, sharing the same spindle motor, requiring only one to be activated. Therefore, achieving real-time and safe switching between the A-axis and C-axis without restarting the system or interrupting power, and automatically eliminating positional deviations, has become a pressing technical problem in this field.

[0004] In view of this, it is very necessary to provide a control method and device for hot switching of the AC axis of a CNC machine tool to solve the above-mentioned defects in the prior art. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of the prior art, which cannot achieve real-time and safe switching between the A-axis and C-axis and is prone to positional deviations after switching, leading to machining interruptions. This invention provides a control method and device for hot switching of the AC axis of a CNC machine tool to solve the above-mentioned technical problems.

[0006] To achieve the above objectives, the present invention provides the following technical solution: A control method for hot switching of the AC axis of a CNC machine tool includes the following steps: Step S1: Obtain the mechanical parameters of the automatic universal milling head and configure the drive control; Step S2: When it is necessary to switch from the current active axis to the target axis, the spindle's working mode is switched to Cs contour control mode via the PMC signal; Step S3: In Cs contour control mode, execute the hot-switching macro program to activate the target axis; Step S4: After the target axis is activated, the target axis is driven to rotate to the specified position by the position movement command according to the target angle given by the machining program, and the indexing program is executed to complete the indexing. Step S5: After indexing is completed, depending on the subsequent machining requirements, choose to keep the target axis active or switch back to the original axis by executing the hot-switching macro program again.

[0007] Preferably, the mechanical parameters of the automatic universal milling head in step S1 include: The minimum indexing unit of the A-axis, the swing angle range of the A-axis, the minimum indexing unit of the C-axis, the rotation angle range of the C-axis, and the number of encoder lines for the A-axis motor.

[0008] This step can achieve the following technical effects: By accurately acquiring the minimum indexing unit of the A-axis, the swing range, the minimum indexing unit of the C-axis, the rotation range, and the number of encoder lines of the A-axis motor of the universal milling head, a precise match between the drive control and the mechanical characteristics of the universal milling head is achieved. This lays the parameter foundation for the stable operation of the subsequent Cs contour control mode and hot-switching macro program, and avoids control deviations or equipment damage caused by parameter mismatch.

[0009] Preferably, in step S2: The activation axis and the target axis are respectively one of the A-axis and C-axis of the automatic universal milling head, and the A-axis and C-axis share the same spindle motor.

[0010] This step can achieve the following technical effects: The application scenario and technical challenge of this invention are clearly defined as follows: the currently active axis and the target axis are respectively the A-axis and the C-axis, and both share the same spindle motor. This limitation ensures that the hot-switching process has a clear target, avoiding control confusion that may occur in multi-axis systems, and also provides a clear logical basis for subsequent implementation of alternating activation of the two axes through the same set of drive hardware. In addition, it simplifies the control process and avoids overload alarms or mechanical damage caused by simultaneous activation of two axes, thus ensuring the safety of the equipment from the source.

[0011] Preferably, in step S2: Before switching to Cs contour control mode, the process also includes: setting the transmission ratio, gain, and speed parameters of the A-axis motor, and connecting the power cable and encoder cable to the driver for motion testing.

[0012] This step can achieve the following technical effects: Before switching to Cs contour control mode, the transmission ratio, gain, and speed parameters of the A-axis motor are preset, and the connection tests of the power cable and encoder cable are performed. This ensures that the hardware configuration and software parameters of the motor driver are completely consistent and detects wiring or parameter errors in advance. This reduces the risk of failure due to abnormal motor response or signal loss during hot switching and ensures that the switching action in subsequent Cs contour control mode can be executed smoothly and safely.

[0013] Preferably, the hot-switching macro program in step S3 specifically includes: Step S301: Before performing hot switching, read and temporarily store the current angle value of the currently active axis and the preset angle value of the target axis for position recovery after switching; Step S302: The axis selection parameters and motor allocation parameters of the CNC system are dynamically modified by the G10 L52 command, so that the CNC system can re-identify the active axis and realize the switch of spindle motor control from the currently active axis to the target axis. This switch takes effect immediately and does not require power outage or system restart. Step S303: After the switching is completed, the code is automatically output to lock the mechanical clamping mechanism of the automatic universal milling head; Step S304: If the switching fails or a timeout occurs, an alarm message is automatically sent and subsequent actions are stopped.

[0014] This step can achieve the following technical effects: By switching the spindle operating mode to Cs contour control mode, the safety hazard of accidental rotation of the universal milling head caused by the spindle rotation homing action in traditional spindle positioning mode is avoided. This allows for safe hot-switching without power interruption, eliminating the waiting time required for spindle homing and improving switching efficiency and operational safety. By temporarily storing the angle values ​​of the current and target axes before switching, position recovery after switching is achieved, avoiding machining interruption. Dynamically modifying axis selection parameters and motor allocation parameters using G10L52 commands enables hot-switching that takes effect immediately without power interruption, further improving machining efficiency. The mechanical clamping mechanism is automatically locked after switching to prevent loosening during machining. Automatic alarm and cessation of operation in case of switching failure ensure equipment and personnel safety. These mechanisms together constitute a reliable, efficient, and safe hot-switching control process.

[0015] Preferably, step S4 further includes: After indexing is completed, the angle initialization program is automatically invoked. The angle initialization program reads the deviation between the actual feedback value of the encoder and the mechanical zero point, and writes the zero point offset value using G10 L50 or G10 L52 to eliminate position monitoring alarms triggered by motor enable or mechanical backlash.

[0016] This step can achieve the following technical effects: After indexing is completed, the angle initialization program is automatically invoked. By reading the deviation between the actual encoder feedback value and the mechanical zero point, and using the G10 L50 or G10 L52 command to write the zero point offset value, the position monitoring alarm triggered by motor enable, mechanical backlash, or encoder errors accumulated over long-term operation can be eliminated. This automatic correction process completely replaces the traditional manual tool setting operation, which not only improves efficiency but also avoids human reading errors. In addition, since position monitoring alarms are usually triggered when the difference between the encoder feedback and the commanded position exceeds the monitoring window, the angle initialization program temporarily widens the monitoring window and then restores it after writing the zero point offset, thus smoothly eliminating the alarm without affecting the subsequent machining accuracy.

[0017] Preferably, in step S4: Before the angle initialization program is executed, it automatically determines whether the current angle is within the preset "allowed initialization range". If it exceeds the "allowed initialization range", it first performs a zero-return action.

[0018] This step can achieve the following technical effects: This safety mechanism, designed to prevent mechanical collisions or initialization failures due to angle overshoot, fully considers the physical limits of the universal milling head, avoiding equipment damage caused by misoperation or program errors, and enhancing the robustness and safety of the control method. Specifically, by automatically reading the current actual angle before executing the angle initialization program and comparing it with the preset allowable initialization range, this process avoids potential mechanical collisions caused by direct initialization in cases of angle overshoot due to encoder cumulative errors, position loss after power failure, or human error, such as collisions with the machine bed or workpiece when the A-axis swings beyond ±110°. Furthermore, it prevents machining interruptions caused by triggering the CNC system's "soft limit exceeded" alarm due to angle overshoot, allowing for automatic recovery without manual intervention. Therefore, this safety mechanism not only protects the mechanical structure of the universal milling head but also reduces equipment maintenance costs and improves the reliability of long-term unattended operation of the machine tool.

[0019] Preferably, step S5 specifically includes: After indexing is completed, a clamping command is output to lock the corresponding axis, and the command angle of this indexing is stored in a variable; The spindle exits Cs contour control mode; When switching back to the original axis is selected, the spindle is positioned to the current angle value of the active axis temporarily stored in step S301 by a quick positioning command.

[0020] This step can achieve the following technical effects: After indexing is completed, the corresponding axis is locked by clamping command to prevent angular deviation caused by vibration or external force during machining, thus ensuring indexing accuracy. The angle of this command is stored in a variable, providing a data basis for subsequent position recovery and realizing traceability of the machining process. The spindle exits the Cs contour control mode, avoiding the adverse effects on spindle life caused by prolonged contour control and releasing system resources. When it is necessary to switch back to the original axis, the spindle is directly positioned to the angle value temporarily stored in step S301 by quick positioning command, without the need to re-execute zeroing or manual tool setting, shortening the auxiliary time for axis switching and improving machining continuity.

[0021] Preferably, the control method for hot switching of the AC axis of a CNC machine tool further includes a tool changing step: When performing a tool change, the angle of the currently active axis is automatically identified; If the current angle is not within the preset tool change angle range, the indexing program will be automatically executed to rotate the current axis to the preset tool change angle before performing the tool change operation. After the tool change is completed, the previously activated axis and angle will be automatically restored according to the machining requirements.

[0022] This step can achieve the following technical effects: The entire tool change process requires no manual zeroing or intervention. It automatically judges angular deviations and calls the corresponding indexing subroutine, achieving full automation of the tool change process. This reduces operation time and human error, while avoiding the risk of collisions caused by improper angles, thus improving machining efficiency and safety. Moreover, this process is completely consistent with normal machining indexing, requiring no additional logic. After the tool change is complete, the program automatically restores the original axis angle and activation state based on previously stored variable values, allowing machining to continue seamlessly. Since the entire process does not require manual zeroing of the universal milling head or adjustment of the angle with a wrench, it avoids collisions between the milling head and the tool magazine during tool changes due to human negligence in forgetting to zero the head. This is particularly suitable for complex surface machining or mold manufacturing scenarios requiring frequent changes of multiple tools, improving the automation level and production efficiency of the machine tool.

[0023] Furthermore, the present invention also provides a control device for hot switching of the AC axis of a CNC machine tool, comprising: The parameter configuration module contains: Obtain the mechanical parameters of the automatic universal milling head and configure the drive control; The control mode switching module contains: When it is necessary to switch from the currently active axis to the target axis, the spindle's working mode is switched to Cs contour control mode via the PMC signal; The hot-switching module contains: In Cs contour control mode, execute the hot-switching macro program to activate the target axis; The indexing module contains: After the target axis is activated, according to the target angle given by the machining program, the target axis is driven to rotate to the specified position by the position movement command, and the indexing program is executed to complete the indexing. The axis management module contains: After indexing is completed, depending on the subsequent machining requirements, you can choose to keep the target axis active or switch back to the original axis by executing the hot-switching macro program again.

[0024] The beneficial effects of this invention are as follows: Real-time hot-switching between A-axis and C-axis is achieved without power outages or system restarts: Through the Cs contour control mode and a hot-switching macro program based on G10 L52 instructions, the spindle motor control can be switched instantly during machining, avoiding the inefficient operation of power outages or manual intervention required by traditional methods, thus improving machining continuity and production efficiency; specifically, the G10L52 instructions can dynamically modify the axis selection parameters and motor allocation parameters of the CNC system, allowing the system to re-identify and activate axes while running. The entire switching process takes only milliseconds and does not require interruption of the machining program, shortening the auxiliary time for A / C axis switching; Eliminating safety hazards caused by spindle homing: The Cs contour control mode replaces the traditional spindle positioning mode, avoiding the risk of the universal milling head accidentally rotating during the spindle homing process, thus ensuring safety during hot-switching and subsequent machining. In the traditional spindle positioning mode, the system often automatically performs a reference point homing operation each time the control mode is switched. This action drives the spindle motor to rapidly rotate the universal milling head to find the zero point, which is highly prone to collisions with the workpiece, fixture, or worktable. This solution forces the spindle to switch to Cs contour control mode via PMC signals. In this mode, the spindle acts as a servo axis for position control, directly receiving angle commands without needing to perform homing, thereby eliminating safety accidents caused by accidental rotation. The Cs contour control mode also supports higher precision position interpolation, providing a precise position reference for subsequent indexing programs. Automatically eliminates positional deviations and prevents machining interruptions: The angle initialization program automatically reads the deviation between the actual encoder feedback value and the mechanical zero point, and writes the zero point offset value using the G10 L50 or G10 L52 instructions. This eliminates position monitoring alarms triggered by motor enable, mechanical backlash, or encoder cumulative errors, ensuring indexing accuracy after switching and avoiding machining interruptions. In actual operation, the angle initialization program calculates the deviation by comparing the encoder feedback with the mechanical zero point in real time and writes it to the system offset register, enabling the system to re-establish an accurate workpiece coordinate system without manual tool resetting or resetting. This avoids unplanned downtime caused by position alarms and ensures the reliability of long-term continuous machining.

[0025] Achieving a fully automated tool changing and indexing process: The current angle is automatically identified during the tool changing step. If it is not within the preset tool changing range, the indexing program is automatically invoked to rotate it into position. After the tool change, the previous axis and angle are automatically restored. No manual zeroing or intervention is required throughout the process, reducing operational errors and auxiliary time. This not only avoids tool changing collision accidents caused by forgetting to zero, but also saves the time of manual indexing, improving the automation level and processing efficiency of the machine tool.

[0026] Enhance system robustness and equipment safety: The hot-switching macro program has a fault self-check function. It will automatically alarm and stop the operation when the switching fails or timeout occurs. Before the angle initialization program is executed, it will automatically determine whether the angle is within the allowable range. If it exceeds the range, it will return to zero first, which can prevent mechanical collisions and equipment damage.

[0027] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0029] Figure 1 This is a flowchart of a control method for hot switching of the AC axis of a CNC machine tool provided by the present invention.

[0030] Figure 2 This is a schematic diagram of a control device for hot switching of the AC axis of a CNC machine tool provided by the present invention.

[0031] Figure 3 This is a schematic diagram of the hot-switching macro program provided by the present invention.

[0032] Figure 4 This is a schematic diagram of the indexing procedure provided by the present invention.

[0033] Figure 5 This is a schematic diagram of the tool changing program provided by the present invention.

[0034] Among them, 1-parameter configuration module, 2-control mode switching module, 3-hot switching module, 4-indexing module, and 5-axis management module. Detailed Implementation

[0035] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. The following embodiments are explanations of the present invention, but the present invention is not limited to the following implementation methods.

[0036] Example 1: like Figure 1 As shown, this embodiment provides a control method for hot switching of the AC axis of a CNC machine tool, which switches the spindle and the active axis based on the FANUC CNC system, including the following steps: Step S1: Obtain the mechanical parameters of the automatic universal milling head and configure the drive control; The mechanical parameters of the automatic universal milling head in step S1 include: The A-axis has a minimum indexing unit of 1° and a swing range of ±110°; the C-axis has a minimum indexing unit of 2.5° and a rotation range of ±180°; the A-axis motor encoder has 5256 pulses per revolution. Parameters 4361, 4001, and 4002 are set in the FANUC system to match the encoder specifications.

[0037] After completing the hardware configuration, perform spindle head initialization: use a measuring tape to perform mechanical zero-point calibration on the A-axis and C-axis, and then call the angle initialization program. This program includes M295C# (C-axis angle initialization) and M297A# (A-axis angle initialization), and uses the G10 L50 command to write the current encoder feedback value into the zero-point offset parameter to establish the workpiece coordinate system.

[0038] It should be noted that the minimum indexing unit of the A-axis determines the minimum step size for A-axis angle control; a resolution of 1° is sufficient to meet the accuracy requirements of most curved surface machining. The 2.5° resolution of the C-axis matches the C-axis rotation range of ±180°, ensuring the feasibility of positioning the workpiece at any angle in the horizontal plane. The encoder line count of 5256 corresponds to generating 5256 pulses per revolution. Combined with the setting of FANUC system parameter 4361, accurate feedback of the spindle motor angular displacement can be achieved. Parameter 4001 is used to select the spindle motor type and control mode, and 4002 is used to set the encoder specifications. Proper configuration of these parameters is a prerequisite for the normal operation of the Cs contour control mode. Without matching these parameters, motor vibration, positioning deviation, or even alarm shutdown may occur.

[0039] This step can achieve the following technical effects: By accurately acquiring the minimum indexing unit of the A-axis, the swing range, the minimum indexing unit of the C-axis, the rotation range, and the number of encoder lines of the A-axis motor of the universal milling head, a precise match between the drive control and the mechanical characteristics of the universal milling head is achieved. This lays the parameter foundation for the stable operation of the subsequent Cs contour control mode and hot-switching macro program, and avoids control deviations or equipment damage caused by parameter mismatch.

[0040] Step S2: In this embodiment, when switching from the currently active axis C to the target axis A, the spindle's working mode is switched to Cs contour control mode via the PMC signal, and the G95 command is executed to enter the position control state. To avoid the safety hazard of the attachment head rotating due to the spindle returning to zero in the traditional spindle positioning mode, this step forces the use of Cs contour control mode. This step can achieve the following technical effects: The application scenario and technical challenge of this invention are clearly defined as follows: the currently active axis and the target axis are respectively the A-axis and the C-axis, and both share the same spindle motor. This limitation ensures that the hot-switching process has a clear target, avoiding control confusion that may occur in multi-axis systems, and also provides a clear logical basis for subsequent implementation of alternating activation of the two axes through the same set of drive hardware. In addition, it simplifies the control process and avoids overload alarms or mechanical damage caused by simultaneous activation of two axes, thus ensuring the safety of the equipment from the source.

[0041] Before switching to the Cs contour control mode, step S2 further includes: Set the transmission ratio, gain, and speed parameters of the A-axis motor, and connect the power cable and encoder cable to the driver for motion testing; Release the clamping mechanism of the corresponding axis according to the current needs: if the C axis needs to be activated, output M88 (C axis released); if the A axis needs to be activated, output M86 (A axis released). The soft limit parameters can be dynamically modified, with ±110° for the A-axis and ±180° for the C-axis.

[0042] It should be noted that the transmission ratio parameter is used to match the proportional relationship between the spindle motor speed and the actual angular velocity of the A-axis; the gain parameters, including speed gain and position gain, determine the motor's response speed and stability to commands; too high a gain can easily cause oscillation, while too low a gain will lead to lag; the speed parameters include acceleration and deceleration time constants, which directly affect the smoothness of A-axis start-up and stopping. Physical connection tests of the power cable and encoder cable include: checking whether the wiring sequence is correct, whether the shielding is good, and whether the connectors are tight, and observing whether the encoder feedback value changes continuously by manually rotating the A-axis. These pre-verification steps can eliminate serious faults such as motor stalling and runaway caused by loose cable connections, incorrect phase sequence, or unreasonable parameter settings, providing a reliable hardware foundation for subsequent hot-swapping operations.

[0043] This step can achieve the following technical effects: Before switching to Cs contour control mode, the transmission ratio, gain, and speed parameters of the A-axis motor are preset, and the connection tests of the power cable and encoder cable are performed. This ensures that the hardware configuration and software parameters of the motor driver are completely consistent and detects wiring or parameter errors in advance. This reduces the risk of failure due to abnormal motor response or signal loss during hot switching and ensures that the switching action in subsequent Cs contour control mode can be executed smoothly and safely.

[0044] Step S3: In Cs contour control mode, execute the hot-switching macro program to activate the target axis; like Figure 3 As shown, the hot-switching macro program in step S3 specifically includes: Step S300: Define macro program number O9004 as the dedicated subroutine entry point for AC axis hot switching; execute the M96 instruction to enable macro program interrupt function, ensuring that machine tool PMC signals and fault signals can be responded to in real time during hot switching, providing underlying support for handling abnormalities such as switching failure and timeout alarm. Step S301: Before performing hot switching, read and temporarily store the real-time angle value of the currently active axis and the preset angle value of the target axis, and store them in system variables for position recovery after switching; Step S302: Dynamically modify the axis selection parameters and motor allocation parameters of the CNC system using the G10L52 command; N4001P1R00000001: Rewrites the spindle control bit parameters of spindle 4001 corresponding to axis 1 of the CNC system, configures the basic control mode of the spindle motor, and adapts to the running logic of the currently activated axis. N4002P1R00001111: Rewrite the feedback bit parameters of encoder No. 4002, which is dedicated to the spindle of the CNC system corresponding to axis 1, and complete the basic configuration matching of encoder and servo mode. N4361P1R5256: Write the A-axis motor encoder line count as 5256, match the mechanical parameters pre-collected and entered in step S1, and ensure the accuracy of angle feedback. N4950P1R00000101: Modify motor allocation parameters and adjust the rules for allocating the right to use the spindle motor; N3700R00000010: Rewrite the global control bit parameters shared across axes to complete the switching configuration of A / C axis hardware channels; N1020P4R65, N1005P4R00000001: Servo response, limit, and axis recognition parameters are modified to switch the spindle motor control from the currently active axis to the target axis, taking effect immediately without power failure or system restart. Step S303: After the switching is completed, execute the G11 command to close the G10L52 parameter writing mode, lock all modified CNC system parameters to prevent accidental parameter tampering; execute #1100=1 as a marker for successful axis hot switching; read the marker, automatically output control code, drive the mechanical clamping mechanism of the automatic universal milling head to complete the locking, and prevent the axis from loosening during the machining process; Step S304: Based on the pre-enabled M96 macro program interrupt function, the switching status is monitored in real time throughout the process: if parameter rewriting timeout, parameter error, or axis recognition failure occurs, an interrupt is triggered, alarm information is automatically pushed, and all subsequent actions are terminated to protect equipment safety. Execute the M99 instruction to end the current macro subroutine O9004, automatically return to the breakpoint in the main program, and continue executing subsequent machining processes such as indexing.

[0045] This step can achieve the following technical effects: By switching the spindle operating mode to Cs contour control mode, the safety hazard of the universal milling head accidentally rotating due to the spindle rotation homing action in traditional spindle positioning mode is avoided. This allows for safe hot-switching without power interruption, eliminating the waiting time required for spindle homing and improving switching efficiency and operational safety. By temporarily storing the angle values ​​of the current and target axes before switching, position recovery after switching is achieved, avoiding machining interruption. Dynamic modification of axis selection parameters and motor allocation parameters using G10L52 commands enables hot-switching that takes effect immediately without power interruption, further improving machining efficiency. Automatic locking of the mechanical clamping mechanism after switching prevents loosening during machining. Automatic alarm and cessation of operation in case of switching failure ensure equipment and personnel safety. These mechanisms together constitute a reliable, efficient, and safe hot-switching control process.

[0046] Step S4: After the target axis is activated, execute the indexing program according to the target angle given in the machining program, such as... Figure 4 As shown. The program reads the target angle value, stores the C-axis target angle in variable #3, and the A-axis target angle in variable #1. It executes the absolute value angle command C#3 or A#1 to drive the target axis to rotate to the specified position, completing the indexing. Step S4 further includes: After indexing is completed, the angle initialization program is automatically invoked. The angle initialization program reads the deviation between the actual feedback value of the encoder and the mechanical zero point, and writes the zero point offset value using G10 L50 or G10 L52 to eliminate the MC3010 out-of-position alarm triggered by motor enable or mechanical backlash.

[0047] This step can achieve the following technical effects: After indexing is completed, the angle initialization program is automatically invoked. By reading the deviation between the actual encoder feedback value and the mechanical zero point, and using the G10 L50 or G10 L52 command to write the zero point offset value, the position monitoring alarm triggered by motor enable, mechanical backlash, or encoder errors accumulated over long-term operation can be eliminated. This automatic correction process completely replaces the traditional manual tool setting operation, which not only improves efficiency but also avoids human reading errors. In addition, since position monitoring alarms are usually triggered when the difference between the encoder feedback and the commanded position exceeds the monitoring window, the angle initialization program temporarily widens the monitoring window and then restores it after writing the zero point offset, thus smoothly eliminating the alarm without affecting the subsequent machining accuracy.

[0048] In step S4: Before execution, the angle initialization program automatically determines whether the current angle is within the preset "allowed initialization range": A-axis ±110°, C-axis ±180°; if it exceeds the "allowed initialization range", then the zeroing action of G280C (C-axis return to reference point) or G280A (A-axis return to reference point) is executed first before angle initialization.

[0049] For example, when the actual angle of the A-axis is +115°, it exceeds the allowable initialization range of ±110° in this embodiment. Forcibly performing zero-point calibration at this point could cause damage due to mechanical limit collisions. Therefore, the program first calls the G280A instruction to return the A-axis to the reference point at a safe speed, typically near 0°, before performing angle initialization. For the C-axis, the allowable initialization range is ±180°. If the current angle is -200°, the program will automatically execute G280C to return to zero. This range judgment mechanism not only protects the mechanical structure of the universal milling head but also avoids the "exceeding soft limit" alarm triggered by angle exceeding the limit, giving the entire control system better fault tolerance and user-friendliness.

[0050] This step can achieve the following technical effects: This safety mechanism, designed to prevent mechanical collisions or initialization failures due to angle overshoot, fully considers the physical limits of the universal milling head, avoiding equipment damage caused by misoperation or program errors, and enhancing the robustness and safety of the control method. Specifically, by automatically reading the current actual angle before executing the angle initialization program and comparing it with the preset allowable initialization range, this process avoids potential mechanical collisions caused by direct initialization in cases of angle overshoot due to encoder cumulative errors, position loss after power failure, or human error, such as collisions with the machine bed or workpiece when the A-axis swings beyond ±110°. Furthermore, it prevents machining interruptions caused by triggering the CNC system's "soft limit exceeded" alarm due to angle overshoot, allowing for automatic recovery without manual intervention. Therefore, this safety mechanism not only protects the mechanical structure of the universal milling head but also reduces equipment maintenance costs and improves the reliability of long-term unattended operation of the machine tool.

[0051] Step S5: After indexing is completed, output M89 or M87 to clamp the corresponding axis, and record the current command angle in the variable #ATT_C or #ATT_A, for example, #ATT_C = #3, #ATT_A = #1; execute G96 to exit Cs contour control mode; After indexing is completed, depending on the subsequent machining requirements, you can choose to keep the target axis active or switch back to the original axis by executing the hot-switching macro program again. If you need to return to the previous machining position, execute the GO#ATT_# command to quickly position the spindle to the current angle value of the active axis recorded in step S301.

[0052] The variable storage mechanism, such as #ATT_C = #3 and #ATT_A = #1, utilizes the common variables of the FANUC macro program. These variables retain their data even after a power outage, allowing for quick recovery of the previous machining state even if the machine unexpectedly restarts after a power failure. After executing the G96 command to exit the Cs contour control mode, the spindle reverts to speed control mode, avoiding position loop integral saturation or overheating issues caused by prolonged engagement in contour control mode. The rapid positioning command GO#ATT_# actually utilizes the G00 rapid traverse function to move the spindle head to a temporarily stored angular coordinate at maximum speed. Since this coordinate is a verified safe position, there is no need to perform zeroing or intermediate point checks, thus shortening the waiting time after axis switching and improving the machine's machining efficiency.

[0053] This step can achieve the following technical effects: After indexing is completed, the corresponding axis is locked by clamping command to prevent angular deviation caused by vibration or external force during machining, thus ensuring indexing accuracy. The angle of this command is stored in a variable, providing a data basis for subsequent position recovery and realizing traceability of the machining process. The spindle exits the Cs contour control mode, avoiding the adverse effects on spindle life caused by prolonged contour control and freeing up system resources. When it is necessary to switch back to the original axis, the spindle is directly positioned to the previously stored angle value by quick positioning command, without the need to re-execute zeroing or manual tool setting, shortening the auxiliary time for axis switching and improving machining continuity.

[0054] like Figure 5 As shown, the control method for hot switching of the AC axis of a CNC machine tool further includes a tool changing step: When performing a tool change, the tool change program is executed, automatically identifying the angle of the currently active axis (#ATT_A or #ATT_C) and determining whether it is within the preset tool change angles (A-axis 0°, C-axis 0°). If the current angle is not within the preset tool change angle range, the indexing program M284C# or M285A# is automatically called to rotate the current axis to the preset tool change angle and execute the M06 tool change command. After the tool change is completed, the original axis and position are automatically restored according to the previous angle recorded in the variables, without the need for manual zeroing throughout the process.

[0055] It should be noted that the tool change program first reads the variable #ATT_A or #ATT_C to obtain the actual angle of the currently active axis. The preset tool change angle is usually 0°, meaning both the A-axis and C-axis are at zero. This is because the universal milling head has the smallest profile at this angle, preventing interference with the tool magazine or tool changer. If the current angle is not 0°, the program automatically calls the indexing program M284C# or M285A# to rotate the axis to 0°. This process is exactly the same as the indexing operation in normal machining, requiring no additional logic. After the tool change is completed, the program calls the hot-switching macro program again and restores the original angle using the stored variables. The entire process realizes a sequential automated chain of "automatic zeroing before tool change, tool change, and automatic recovery," suitable for manufacturing complex molds or aerospace structural parts that require frequent tool changes during machining.

[0056] This step can achieve the following technical effects: The entire tool change process requires no manual zeroing or intervention. It automatically judges angular deviations and calls the corresponding indexing subroutine, achieving full automation of the tool change process. This reduces operation time and human error, while avoiding the risk of collisions caused by improper angles, thus improving machining efficiency and safety. Moreover, this process is completely consistent with normal machining indexing, requiring no additional logic. After the tool change is complete, the program automatically restores the original axis angle and activation state based on previously stored variable values, allowing machining to continue seamlessly. Since the entire process does not require manual zeroing of the universal milling head or adjustment of the angle with a wrench, it avoids collisions between the milling head and the tool magazine during tool changes due to human negligence in forgetting to zero the head. This is particularly suitable for complex surface machining or mold manufacturing scenarios requiring frequent changes of multiple tools, improving the automation level and production efficiency of the machine tool.

[0057] Example 2: like Figure 2 As shown in the figure, this embodiment provides a control device for hot switching of the AC axis of a CNC machine tool, comprising: Parameter configuration module 1, in which: Obtain the mechanical parameters of the automatic universal milling head and configure the drive control; Control mode switching module 2, in which: When it is necessary to switch from the currently active axis to the target axis, the spindle's working mode is switched to Cs contour control mode via the PMC signal; Hot-switching module 3, in which: In Cs contour control mode, execute the hot-switching macro program to activate the target axis; Indexing module 4, in which: After the target axis is activated, according to the target angle given by the machining program, the target axis is driven to rotate to the specified position by the position movement command, and the indexing program is executed to complete the indexing. Axis management module 5, in which: After indexing is completed, depending on the subsequent machining requirements, you can choose to keep the target axis active or switch back to the original axis by executing the hot-switching macro program again.

[0058] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The methods disclosed in the embodiments are described simply because they correspond to the systems disclosed in the embodiments; relevant details can be found in the method section.

[0059] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0060] In the embodiments provided by this invention, it should be understood that the disclosed systems, methods, and approaches can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between systems or units may be electrical, mechanical, or other forms.

[0061] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0062] In addition, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit.

[0063] Similarly, in the various embodiments of the present invention, each processing unit can be integrated into a functional module, or each processing unit can exist physically, or two or more processing units can be integrated into a functional module.

[0064] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0065] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0066] The above-disclosed embodiments are merely preferred embodiments of the present invention, but the present invention is not limited thereto. Any non-creative variations that can be conceived by those skilled in the art, as well as any improvements and modifications made without departing from the principles of the present invention, should fall within the protection scope of the present invention.

Claims

1. A control method for hot switching of the AC axis of a CNC machine tool, characterized in that, Includes the following steps: Step S1: Obtain the mechanical parameters of the automatic universal milling head and configure the drive control; The mechanical parameters of the automatic universal milling head in step S1 include: The minimum division unit of the A-axis, the swing angle range of the A-axis, the minimum division unit of the C-axis, the rotation angle range of the C-axis, and the number of encoder lines for the A-axis motor; Step S2: When it is necessary to switch from the current active axis to the target axis, the spindle's working mode is switched to Cs contour control mode via the PMC signal; In step S2: The activation axis and the target axis are respectively one of the A-axis and C-axis of the automatic universal milling head, and the A-axis and C-axis share the same spindle motor; Step S3: In Cs contour control mode, execute the hot-switching macro program to activate the target axis; In the hot-switching macro program in step S3, the axis selection parameters and motor allocation parameters of the CNC system are dynamically modified through the G10 L52 instruction, so that the CNC system can re-identify and activate the axis. Step S4: After the target axis is activated, the target axis is driven to rotate to the specified position by the position movement command according to the target angle given by the machining program, and the indexing program is executed to complete the indexing. Step S5: After indexing is completed, depending on the subsequent machining requirements, choose to keep the target axis active or switch back to the original axis by executing the hot-switching macro program again.

2. The control method for hot switching of the AC axis of a CNC machine tool according to claim 1, characterized in that, Before switching to the Cs contour control mode, step S2 includes setting the transmission ratio, gain, and speed parameters of the A-axis motor, and connecting the power cable and encoder cable to the driver for motion testing.

3. The control method for hot switching of the AC axis of a CNC machine tool according to claim 1, characterized in that, The hot-switching macro program in step S3 specifically includes: Step S301: Before performing hot switching, read and temporarily store the current angle value of the currently active axis and the preset angle value of the target axis; Step S302: The spindle motor control is switched from the currently active axis to the target axis; Step S303: After the switching is completed, the code is automatically output to lock the mechanical clamping mechanism of the automatic universal milling head; Step S304: If the switching fails or a timeout occurs, an alarm message is automatically sent and subsequent actions are stopped.

4. The control method for hot switching of the AC axis of a CNC machine tool according to claim 1, characterized in that, Step S4 further includes: After indexing is completed, the angle initialization program is automatically invoked. The angle initialization program reads the deviation between the actual feedback value of the encoder and the mechanical zero point, and writes the zero point offset value using G10 L50 or G10 L52 to eliminate the position monitoring alarm.

5. A control method for hot switching of the AC axis of a CNC machine tool according to claim 1 or 4, characterized in that, In step S4: Before the angle initialization program is executed, it automatically determines whether the current angle is within the preset "allowed initialization range". If it exceeds the "allowed initialization range", it first performs a zero-return action.

6. The control method for hot switching of the AC axis of a CNC machine tool according to claim 1, characterized in that, It also includes the tool changing step: When performing a tool change, the angle of the currently active axis is automatically identified; If the current angle is not within the preset tool change angle range, the indexing program will be automatically executed to rotate the current axis to the preset tool change angle before performing the tool change operation. After the tool change is completed, the previously activated axis and angle will be automatically restored according to the machining requirements.

7. The control method for hot switching of the AC axis of a CNC machine tool according to claim 3, characterized in that, Step S5 specifically includes: After indexing is completed, a clamping command is output to lock the corresponding axis, and the command angle of this indexing is stored in a variable; The spindle exits Cs contour control mode; When switching back to the original axis is selected, the spindle is positioned to the current angle value of the active axis temporarily stored in step S301 by a quick positioning command.

8. A control device for hot switching of the AC axis of a CNC machine tool, characterized in that, The device is used to implement the control method for hot switching of the AC axis of a CNC machine tool as described in any one of claims 1 to 7; The device includes: a parameter configuration module, a control mode switching module, a hot-switching module, an indexing module, and a shaft management module; The parameter configuration module includes: Obtain the mechanical parameters of the automatic universal milling head and configure the drive control; The mechanical parameters of the automatic universal milling head include: the minimum indexing unit of the A-axis, the swing angle range of the A-axis, the minimum indexing unit of the C-axis, the rotation angle range of the C-axis, and the number of encoder lines of the A-axis motor. The control mode switching module includes: When it is necessary to switch from the currently active axis to the target axis, the spindle's working mode is switched to Cs contour control mode via the PMC signal; The activation axis and the target axis are respectively one of the A-axis and C-axis of the automatic universal milling head, and the A-axis and C-axis share the same spindle motor; The hot-switching module includes: In Cs contour control mode, execute the hot-switching macro program to activate the target axis; In the aforementioned hot-switching macro program, the axis selection parameters and motor allocation parameters of the CNC system are dynamically modified through the G10 L52 instruction, so that the CNC system can re-identify and activate the axis. The indexing module includes: After the target axis is activated, according to the target angle given by the machining program, the target axis is driven to rotate to the specified position by the position movement command, and the indexing program is executed to complete the indexing. The aforementioned axis management module includes: After indexing is completed, depending on the subsequent machining requirements, you can choose to keep the target axis active or switch back to the original axis by executing the hot-switching macro program again.

Citation Information

Patent Citations

  • Numerical control device

    CN105051630A

  • Shaft mode switching method and device and related equipment

    CN116820034A