A numerical control tapping machine cutting parameter control method and system
By obtaining the cutting resistance distribution curve and response time constant, the speed ratio function of the spindle and feed axis is optimized, which solves the problem of insufficient coordinated control of path planning and cutting parameters in CNC tapping, improves machining accuracy and stability, and extends tool life.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANXI PROVINCE WEIDA MASCH MFG CO LTD
- Filing Date
- 2026-03-18
- Publication Date
- 2026-06-12
AI Technical Summary
In existing CNC tapping technology, the lack of coordinated control between path planning and cutting parameters leads to a decrease in machining accuracy under scenarios with variable cross-sections or sudden changes in material hardness. This results in a mismatch between the spindle and feed axis responses, increases the risk of tap wear and breakage, and reduces tool life.
By acquiring the cutting resistance distribution curve, a speed multiplier function that varies with time is generated. Combined with the response time constants of the spindle and feed axis, pre-compensation command optimization is performed to achieve linkage control of spindle speed and feed speed, eliminate dynamic response differences, and ensure stable cutting load.
It achieves the linkage optimization of tapping path geometry planning and cutting process mechanical control, which improves thread machining accuracy and forming quality, reduces tap wear risk, extends tool life, and reduces production costs.
Smart Images

Figure CN122194839A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial control systems, and more specifically, to a method and system for controlling cutting parameters of a CNC tapping machine. Background Technology
[0002] In existing CNC tapping technology, there is a common problem of insufficient coordinated control of path planning and cutting parameters. Traditional CNC systems generally treat the geometric planning of the machining path and the mechanical control of the cutting process separately. The path planning stage is designed only around the smoothness of the geometric trajectory, and core cutting parameters such as spindle speed and feed rate are mostly preset fixed values. The two lack a linkage optimization mechanism. At the same time, the synchronization of feed rate and spindle speed relies only on fixed electronic gear matching, without considering the dynamic response characteristics of each axis of the machine tool, especially the difference in inertial lag between the spindle and feed axes.
[0003] In actual machining scenarios involving variable cross-section tapping, complex path tapping, or sudden changes in workpiece material hardness, the impact of the aforementioned defects is further amplified. When the cutting load changes abruptly, the system will forcibly and drastically reduce the feed rate to avoid tap breakage. However, due to the large moment of inertia of the spindle, the spindle speed cannot be reduced synchronously and quickly, resulting in a momentary loss of synchronization between the spindle and the feed axis. This leads to a significant deviation between the actual machining pitch and the set value, directly causing a deterioration in thread accuracy. At the same time, the mismatch between the spindle and the feed axis response will also exacerbate the wear and breakage risk of the tap, significantly reduce tool life, and increase production costs. Summary of the Invention
[0004] To address the problems existing in the prior art, the present invention aims to provide a method and system for controlling cutting parameters of a CNC tapping machine. This method can achieve the linkage optimization of tapping path geometric planning and cutting process mechanical control, so that the feed rate and cutting resistance are inversely related, ensuring that the cutting load remains stable throughout the tapping stroke, effectively avoiding machining abnormalities caused by sudden load changes, and simultaneously taking into account both machining efficiency and machining stability.
[0005] To solve the above problems, the present invention adopts the following technical solution: Firstly, a method for controlling cutting parameters of a CNC tapping machine includes: Obtain the cutting resistance distribution curve along the tapping path; Based on the cutting resistance distribution curve, a speed multiplier function that varies with time is generated. The speed multiplier function is used to adjust both the spindle speed and the feed rate. Measure the response time constants of the spindle and feed axis to speed commands; Based on the response time constant, the speed ratio function is pre-compensated to generate independent pre-compensation commands for the spindle and feed axis. Trial machining was performed using pre-compensation commands, the actual cutting resistance was recorded, and the deviation was obtained by comparing it with the cutting resistance distribution curve. The pre-compensation commands were then iteratively corrected based on the deviation. The pre-compensation instructions after iterative convergence are solidified for subsequent processing.
[0006] Furthermore, the cutting resistance distribution curve along the tapping path is obtained, including: Acquire the first electrical signal along the tapping path in the no-run state, acquire the second electrical signal along the tapping path in the machining state, and obtain the pure cutting load component along the tapping path based on the decoupling of the first and second electrical signals. Based on the tap's geometric parameters and the current tapping depth, the instantaneous contact area along the tapping path is calculated, and the instantaneous cutting pressure along the tapping path is obtained based on the pure cutting load component and the instantaneous contact area. Based on the maximum instantaneous cutting pressure, the instantaneous cutting pressure at each point along the tapping path is normalized to obtain the cutting resistance distribution curve.
[0007] Furthermore, the time-varying velocity multiplier function is generated, including: Based on the cutting resistance distribution curve, the initial feed rate at each position point is set according to the principle of constant cutting load, so that the initial feed rate is inversely proportional to the value on the cutting resistance distribution curve, and the feed rate-position curve along the tapping path is obtained. Based on the scaling-position curve and the basic feed rate, iterative coordinate transformation is performed with the scaling-position curve as the reference to map the scaling value to the time axis and generate a speed scaling function that changes with time.
[0008] Furthermore, the response time constants of the spindle and feed axis to speed commands are measured, including: With the spindle and feed axis stationary, apply a sequence of speed commands that include rising, steady-state, and falling phases, and record the complete response trajectory of the actual speed of each axis over time. The complete response trajectory is segmented and analyzed to extract the acceleration limit in the rising phase, the steady-state fluctuation amplitude in the steady-state phase, and the deceleration characteristics in the falling phase, forming a set of characteristic parameters for each axis.
[0009] Furthermore, determining the response time constants of the spindle and feed axis to speed commands also includes: During the synchronous movement of the spindle and feed axis according to the actual tapping speed ratio, the time difference between the actual positions of the two axes reaching the same commanded position is continuously recorded, and the relative hysteresis coupling degree of the two axes is obtained based on the correspondence between the time difference and the resistance value at the corresponding position on the cutting resistance distribution curve. The characteristic parameter sets of each axis are associated with the relative hysteresis coupling degree of the two axes to establish a response benchmark table with the resistance value of each point on the cutting resistance distribution curve as the index and the corresponding dual-axis compensation parameters as the content.
[0010] Furthermore, pre-compensation is performed on the speed ratio function, including: Based on the time boundaries of the rising, steady-state, and falling phases corresponding to the characteristic parameter sets of each axis in the response benchmark table, the velocity multiplier function is divided into independent component sequences corresponding to the rising, steady-state, and falling phases on the time axis. For each stage component, the waveform of each component is reverse-shaped according to the acceleration limit, fluctuation amplitude, and deceleration characteristics of the corresponding stage in the characteristic parameter set, so as to obtain the shaped stage components. The spindle components obtained after shaping are recombined in chronological order to obtain the initial pre-compensation ratio function of the spindle. The feed axis components obtained after shaping are also recombined in chronological order to obtain the initial pre-compensation ratio function of the feed axis.
[0011] Furthermore, independent pre-compensation commands are generated for the spindle and feed axes, including: Based on the relative hysteresis coupling degree of the two axes, with the main axis as the reference, the feed axis initial pre-compensation ratio function is applied with a reverse offset corresponding to the coupling degree on the time axis to obtain the corrected feed axis pre-compensation ratio function; The spindle pre-compensation ratio function and the corrected feed axis pre-compensation ratio function are discretized to generate independent pre-compensation command sequences for the spindle and feed axis, respectively.
[0012] Furthermore, the pre-compensation instructions based on the deviation iteration correction include: Trial machining was performed using independent pre-compensation command sequences for the spindle and feed axis. The actual cutting resistance at each position along the tapping path was recorded and compared point by point with the cutting resistance distribution curve to obtain the difference and acquire the actual deviation distribution curve along the tapping path. Based on the time boundaries of the rising, steady-state, and falling stages corresponding to the characteristic parameter sets of each axis in the response benchmark table, the actual deviation distribution curve is mapped onto the time axis and decomposed into the stage deviation components corresponding to the rising segment, steady-state segment, and falling segment. Based on the stage deviation components, the reverse shaping parameters are adjusted respectively, and the speed ratio function is re-compensated according to the adjusted reverse shaping parameters. Independent pre-compensation commands for the main spindle and feed axis are generated, and a new pre-compensation command sequence is generated.
[0013] Furthermore, the pre-compensation instructions after iterative convergence are solidified for subsequent processing, including: The pre-compensation command after iterative convergence, the corresponding cutting resistance distribution curve, and the response reference table are associated and stored in the machining parameter library; During subsequent workpiece machining, the corresponding pre-compensation instruction is called from the machining parameter library for machining, and the actual cutting resistance is recorded. The real-time deviation is obtained by comparing it with the corresponding cutting resistance distribution curve in the machining parameter library. If the real-time deviation exceeds the threshold set according to the stage boundary in the response benchmark table, the real-time deviation is decomposed into stage deviation components corresponding to the rising segment, steady-state segment, and falling segment according to the stage boundary in the response benchmark table. The corresponding reverse shaping parameters are adjusted according to each stage deviation component to generate a corrected pre-compensation instruction, and the corresponding pre-compensation instruction in the machining parameter library is updated with the corrected instruction.
[0014] Secondly, the present invention also provides a CNC tapping machine cutting parameter control system, comprising: The resistance acquisition module is used to acquire the cutting resistance distribution curve along the tapping path; The speed function generation module is used to generate a speed multiplier function that varies with time based on the cutting resistance distribution curve. The speed multiplier function is also used to adjust the spindle speed and feed rate. The time measurement module is used to measure the response time constant of the spindle and feed axis to speed commands; The pre-compensation generation module is used to pre-compensate the speed ratio function based on the response time constant and generate independent pre-compensation commands for the spindle and feed axis. The trial correction module is used to perform trial machining using pre-compensation commands, record the actual cutting resistance, and compare it with the cutting resistance distribution curve to obtain the deviation. The pre-compensation commands are then iteratively corrected based on the deviation. The instruction solidification module is used to solidify the pre-compensation instructions after iterative convergence for subsequent processing.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) This scheme generates a speed ratio function that synchronously controls the spindle speed and feed rate by generating the cutting resistance distribution curve along the tapping path. This realizes the linkage optimization of the geometric planning of the tapping path and the mechanical control of the cutting process, so that the feed ratio and the cutting resistance form an inverse relationship, ensuring that the cutting load remains stable throughout the tapping stroke, effectively avoiding the machining abnormalities caused by sudden load changes, while taking into account both machining efficiency and machining stability.
[0016] (2) This scheme measures the dynamic response time constant of the spindle and feed axis, the characteristic parameters of the single axis stage and the relative lag coupling degree of the two axes, and performs phased reverse shaping pre-compensation and time axis reverse offset correction on the speed ratio function to generate independent pre-compensation commands for the two axes. This accurately offsets the inertial lag difference between the spindle and feed axis, avoids instantaneous loss of synchronization of the two axes during the machining process, and greatly improves the pitch control accuracy and forming quality of thread machining.
[0017] (3) This scheme collects the actual cutting resistance through trial processing, compares it with the theoretical cutting resistance distribution curve to obtain the deviation, and corrects the pre-compensation command in stages based on the deviation. This effectively eliminates the adaptation deviation between the no-load dynamic characteristic test and the actual loaded processing condition, so that the pre-compensation command can accurately match the actual processing scenario.
[0018] (4) This scheme will solidify and store the pre-compensation instruction associated with the reference data after iterative convergence in the machining parameter library, which can be directly used for batch machining under the same working conditions, greatly reducing the time spent on repeated testing and optimization. At the same time, a real-time deviation monitoring and closed-loop correction mechanism is set up during batch machining, which can adaptively compensate for machining deviations caused by tool wear, machine tool state drift, and batch differences in workpiece materials, ensuring the consistency of batch machining accuracy, reducing the risk of tap wear and breakage, extending tool life, and reducing machining production costs. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0020] Figure 1 This is a flowchart of a CNC tapping machine cutting parameter control method according to the present invention; Figure 2 This is a data flow diagram between various modules in the CNC tapping machine cutting parameter control system of the present invention. Detailed Implementation
[0021] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.
[0022] Example 1: Please see Figure 1 A method for controlling cutting parameters of a CNC tapping machine, the method specifically includes: Step 1: Obtain the cutting resistance distribution curve along the tapping path. The specific operation is as follows: The tapping path of the CNC tapping machine is pre-planned by the CNC system. This path covers the entire stroke from the moment the tap contacts the workpiece surface until the tap exits the workpiece after thread machining is completed. The cutting resistance distribution curve along the tapping path is used to characterize the relative change of cutting resistance at different positions during the entire tapping stroke. By collecting, decoupling, and normalizing the physical quantities related to the cutting load on the tapping path, a cutting resistance distribution curve corresponding to each position on the tapping path is obtained. This ensures that subsequent speed ratio adjustments can accurately match the actual load changes during the tapping process, avoiding a decrease in machining accuracy and tool damage caused by sudden load changes.
[0023] Step 1 also includes the following steps: Step 11: Obtain the first electrical signal along the tapping path in the no-load state, and the second electrical signal along the tapping path in the machining state. Based on the first and second electrical signals, decouple to obtain the pure cutting load component along the tapping path. The specific operation is as follows: The no-load running state refers to the tapping machine completing its full stroke according to the preset tapping path at the spindle speed and feed rate, and the tap does not contact the workpiece during the operation, so there is no cutting action. In the no-load running state, the CNC system collects the first electrical signal corresponding to each position along the tapping path through the servo drive device. This electrical signal is the torque current signal corresponding to the output torque of the servo motor. Its value only reflects the load component generated by non-cutting factors such as the frictional inertia and transmission resistance of each axis of the machine tool during operation. The machining state refers to the tapping machine completing its full stroke according to the tapping path at the same spindle speed and feed rate as the no-load running state, and the tap continuously contacts the workpiece and completes the cutting operation during the operation.
[0024] In the machining state, the CNC system, through the same servo drive device, collects the second electrical signal corresponding to each position along the tapping path at the same sampling frequency as in the no-load state. This electrical signal is the torque current signal corresponding to the output torque of the servo motor. Its value simultaneously includes the load component generated by the non-cutting factors of the machine tool itself, as well as the cutting load component generated by the tap cutting the workpiece. The CNC system performs a difference decoupling operation between the second electrical signal corresponding to the same tapping path position and the first electrical signal to eliminate the load component generated by the non-cutting factors of the machine tool itself, and obtains the pure cutting load component corresponding to each position along the tapping path. This component only reflects the actual cutting load generated during the tap cutting the workpiece, eliminating the interference of the machine tool's own operating characteristics on the load detection results, and ensuring the accuracy of subsequent cutting resistance calculation.
[0025] Step 12: Based on the tap's geometric parameters and the current tapping depth, calculate the instantaneous contact area along the tapping path, and obtain the instantaneous cutting pressure along the tapping path based on the pure cutting load component and the instantaneous contact area. The specific operation is as follows: The geometric parameters of the tap are pre-entered into the CNC system, including the nominal diameter of the tap, the pitch, the half-cone angle of the cutting cone, the number of cutting edges, and the rake and clearance angles. These parameters determine the contact boundary between the tap and the workpiece at different tapping depths. The CNC system obtains the current tapping depth in real time based on the axial position of the tapping path, calculates the contact length between the cutting edge and the workpiece material at the current tapping depth by combining the half-cone angle of the cutting cone, and then calculates the instantaneous contact area between the tap and the workpiece by combining the number of cutting edges and the pitch parameters. The instantaneous contact area changes with the tapping depth. In the initial stage when the tap enters the workpiece, the contact area increases with the increase of the tapping depth. After the tap cutting cone has completely entered the workpiece, the contact area enters a stable range. In the stage when the tap exits the workpiece, the contact area decreases with the increase of the tapping depth.
[0026] The CNC system divides the pure cutting load component corresponding to each position along the tapping path by the instantaneous contact area corresponding to the same position to obtain the instantaneous cutting pressure corresponding to each position along the tapping path. The instantaneous cutting pressure characterizes the cutting load per unit contact area, which can eliminate the influence of contact area changes on the cutting load value and accurately reflect the changes in cutting resistance caused by factors such as changes in workpiece material properties and path.
[0027] Step 13: Based on the maximum instantaneous cutting pressure, normalize the instantaneous cutting pressure at each point along the tapping path to obtain the cutting resistance distribution curve. The specific operation is as follows: The CNC system iterates through the instantaneous cutting pressure values corresponding to all sampling positions along the tapping path, extracts the maximum value, which is the peak value of the cutting pressure during the entire tapping stroke, and uses it as the reference value for normalization. The CNC system divides the instantaneous cutting pressure values corresponding to each sampling position along the tapping path by this reference value to obtain the normalized cutting resistance coefficient corresponding to each position. The value of this coefficient ranges from 0 to 1 and corresponds one-to-one with the position of the tapping path. The CNC system uses the stroke position of the tapping path as the abscissa and the normalized cutting resistance coefficient of the corresponding position as the ordinate to generate a cutting resistance distribution curve along the tapping path. This curve can intuitively and accurately reflect the relative change of cutting resistance at different positions during the entire tapping stroke.
[0028] In a preferred embodiment of the present invention, step 2 is further included: generating a speed multiplier function that varies with time based on the cutting resistance distribution curve. The speed multiplier function is used to adjust both the spindle speed and the feed rate. The specific operation is as follows: The servo control system of the CNC tapping machine issues motion control commands based on a time sequence. The cutting resistance distribution curve generated based on the position domain cannot be directly used for real-time control of the servo system. This step completes the conversion from the cutting resistance characteristics in the position domain to the control function in the time domain, generating a speed ratio function that varies with time. This speed ratio function acts on the adjustment of both the spindle speed and the feed rate throughout the entire tapping cycle, ensuring that the speed ratio of the spindle speed and the feed rate always meets the theoretical pitch requirements of the tapped thread, avoiding thread machining deviations caused by mismatch in their basic speed ratios. The numerical change of the speed ratio function completely follows the change law of the cutting resistance distribution curve, realizing stable control of the cutting load during the tapping process, and providing a unified reference control signal for subsequent pre-compensation processing of the dynamic response differences between the spindle and the feed axis.
[0029] Step 2 also includes the following steps: Step 21: Based on the cutting resistance distribution curve and the principle of constant cutting load, set the initial feed rate at each position point so that the initial feed rate is inversely proportional to the value on the cutting resistance distribution curve, thus obtaining the feed rate-position curve along the tapping path. The specific operation is as follows: The principle of constant cutting load means that throughout the entire tapping stroke, the cutting load exerted by the tap on the workpiece remains within a preset stable range, avoiding significant load fluctuations. The CNC system reads the cutting resistance values at each point along the tapping path on the cutting resistance distribution curve and matches a corresponding initial feed rate for each point. The value of the initial feed rate is inversely proportional to the value on the cutting resistance distribution curve at the same point. When the cutting resistance value at a certain point on the tapping path is too high, the corresponding initial feed rate is too low, thereby reducing the feed rate at that point and decreasing the amount of workpiece material removed by the tap per unit time. The material volume is controlled to suppress the increase of cutting load. When the cutting resistance value at a certain position on the tapping path is relatively small, the corresponding initial feed rate value is relatively large, thereby increasing the feed speed at that position and improving machining efficiency while maintaining a stable cutting load. The CNC system uses the stroke position of the tapping path as the abscissa and the initial feed rate matched at each position along the tapping path as the ordinate to generate a feed rate-position curve along the tapping path. This curve establishes a one-to-one correspondence between each stroke position and the corresponding initial feed rate within the entire tapping stroke, completing the mapping and conversion from cutting resistance characteristics to feed rate within the position domain.
[0030] Step 22: Based on the scaling-position curve and the base feed rate, perform iterative coordinate transformation using the scaling-position curve as a reference to map the scaling value to the time axis, generating a speed scaling function that varies with time. The specific operations are as follows: The base feed rate is the tapping reference feed rate preset by the CNC system. This rate matches the spindle reference speed set by the CNC system, and their ratio is completely consistent with the theoretical pitch of the thread to be machined. The ratio-position curve is a mapping relationship within the position domain and cannot be directly adapted to the servo command issuance logic based on time sequence. Therefore, it is necessary to map the ratio value in the position domain to the time axis to complete the coordinate domain transformation. The CNC system takes the starting position of the tapping path as the time zero point, reads the initial feed ratio corresponding to the starting position of the base feed rate and the ratio-position curve, calculates the actual feed rate corresponding to that position, and calculates the time required for the tap to traverse that segment of the path by combining the path distance between two adjacent position points. This completes the time and ratio calculation for the first position interval. Matching: Since the feed rate of adjacent position intervals changes with the initial feed rate, the time it takes for the tap to travel through each segment of the path is affected by the feed rate value of the preceding interval. It is impossible to complete the mapping of the entire stroke in a single calculation. Therefore, the CNC system uses the feed rate-position curve as a reference and performs iterative coordinate transformation according to the travel order of the tapping path to complete the time matching of all position intervals in the entire tapping stroke in sequence. The initial feed rate corresponding to each position point is mapped to the corresponding time node. After the iterative calculation is completed, the CNC system uses the continuously changing time as the independent variable and the feed rate value matched at each time node as the dependent variable to generate a speed rate function that changes continuously with time. This function can be directly read by the servo control module of the CNC system and used to synchronously adjust the spindle speed and feed rate.
[0031] In a preferred embodiment of the present invention, step 3 is further included, which involves measuring the response time constants of the spindle and feed axis to speed commands. The specific operation is as follows: After receiving a speed command, the spindle and feed axis of a CNC tapping machine cannot perfectly follow the instantaneous changes in the speed command due to factors such as their own rotational inertia, transmission chain stiffness, and servo drive ring bandwidth. Their dynamic response characteristics inherently differ, leading to motion mismatch between the spindle and feed axis during actual machining, resulting in pitch deviation and tool damage. By conducting independent single-axis dynamic response tests and dual-axis synchronous coupling tests, the response time constants of the spindle and feed axis to speed commands are determined. Characteristic parameters representing the dynamic response characteristics of each axis are extracted, the relative lag characteristics during dual-axis synchronous motion are quantified, and a response benchmark system related to cutting resistance is established. This provides accurate quantitative basis for subsequent pre-compensation processing of the speed ratio function, ensuring that the compensated control command can offset the machining deviation caused by the difference in dynamic response between the two axes.
[0032] Step 3 also includes the following steps: Step 31: With the spindle and feed axis stationary, apply a sequence of speed commands including rising, steady-state, and falling phases, and record the complete response trajectory of the actual speed of each axis over time. The specific operation is as follows: The test is conducted with both the spindle and feed axis stationary, representing a zero-speed initial state. This avoids interference from the initial motion state on the test results. During the test, the spindle and feed axis are tested independently. The feed axis remains stationary when the spindle is tested, and vice versa, to prevent mutual interference between the two axes. The CNC system applies a sequence of speed commands to the tested axis, comprising three phases: ascent, steady state, and descent. The ascent phase involves linearly increasing the speed from a stationary state to the target steady-state speed at a set slope. The steady-state phase maintains the target steady-state speed for a preset duration. The descent phase involves linearly decreasing the speed from the target steady-state speed back to a stationary state at a set slope. The speed variation range of the entire command sequence covers the actual working speed range of the spindle and feed axis during the tapping process, ensuring that the response characteristics obtained by the test are consistent with the actual machining conditions. The CNC system uses the position encoder and speed detection module built into the servo drive device to continuously record the complete data of the actual speed of the measured axis changing over time from the moment the speed command is issued, at a sampling frequency higher than the tapping control cycle. This forms a complete response trajectory that is completely aligned with the time axis of the command sequence. The complete response trajectory fully covers the entire stage of the command sequence, including the rise, steady state, and fall, and fully preserves all dynamic characteristic information of the measured axis, such as response lag, overshoot, and fluctuation, to the speed command.
[0033] Step 32: Segment the complete response trajectory for analysis, extracting the acceleration limit during the ascent phase, the steady-state fluctuation amplitude during the steady-state phase, and the deceleration characteristics during the descent phase to form a set of characteristic parameters for each axis. The specific operations are as follows: The CNC system segments the acquired complete response trajectory along the time axis according to the time boundaries of the three stages of the speed command sequence: rise, steady state, and fall. This results in rise, steady state, and fall response trajectories, each corresponding to one of the three stages of the command sequence. The CNC system analyzes the rise stage response trajectory, extracting the maximum slope of the actual speed change over time within this stage. This maximum slope is the acceleration limit of the measured axis. The acceleration limit characterizes the maximum acceleration capability that the measured axis can achieve during speed increase. Limited by the axis rotational inertia and the maximum output torque of the servo drive, it directly determines the measured axis's response capability to the rising edge of the speed command. The CNC system analyzes the steady state response trajectory, calculating the maximum and minimum deviations of the actual speed relative to the commanded steady-state speed within this stage. Half of the difference is the steady-state fluctuation amplitude of the measured axis. The steady-state fluctuation amplitude characterizes the speed holding accuracy of the measured axis under a constant speed command. Influenced by transmission chain friction fluctuations and the steady-state adjustment accuracy of the servo loop, it directly determines the speed stability of the measured axis during steady-state operation.
[0034] The CNC system analyzes the response trajectory during the descent phase, extracting the absolute value of the maximum slope of the actual speed change over time within this phase. Combined with the slope of the falling edge of the speed command, the deceleration characteristics of the measured axis are obtained. These deceleration characteristics characterize the measured axis's response and braking capabilities during speed descent. Limited by the axis system's rotational inertia and the performance of the servo braking circuit, they directly determine the measured axis's response to the falling edge of the speed command. The CNC system integrates the acceleration limit, steady-state fluctuation amplitude, and deceleration characteristics extracted from single-axis testing to form a set of characteristic parameters corresponding to that axis. This set of characteristic parameters fully quantifies the dynamic response characteristics of a single axis throughout the entire speed command phase.
[0035] Step 33: During the synchronous movement of the spindle and feed axis according to the actual tapping speed ratio, continuously record the time difference between the actual positions of the two axes reaching the same commanded position. Based on the correspondence between the time difference and the resistance value at the corresponding position on the cutting resistance distribution curve, obtain the relative hysteresis coupling degree of the two axes. The specific operation is as follows: The actual tapping speed ratio is determined by the theoretical pitch of the thread to be machined. This speed ratio is completely consistent with the matching relationship between the spindle speed and feed rate during the tapping process, ensuring the consistency between the test conditions and the actual machining conditions. The CNC system synchronously issues continuous motion commands that conform to this speed ratio to the spindle and feed axis, enabling the two axes to complete synchronous operation according to the actual tapping motion relationship. The speed variation range during operation covers the speed adjustment range of the entire tapping stroke. During the synchronous movement of the two axes, the CNC system continuously collects the actual position data of the two axes at the same sampling frequency through the position encoders of the two axes. For each preset command position, the system records the time when the actual position of the spindle reaches the command position and the time when the actual position of the feed axis reaches the command position, calculates the difference between the two times, and obtains the time difference when the two axes reach the same command position.
[0036] The CNC system establishes a one-to-one correspondence between the full stroke of the synchronous motion and the tapping path, creating a mapping relationship between each command position and the resistance value at the corresponding position on the cutting resistance distribution curve. This yields the correspondence between the time difference at each position and the corresponding cutting resistance value. The CNC system then performs fitting processing on the time difference and cutting resistance value corresponding to all positions within the full stroke to obtain the influence coefficient of the change in cutting resistance value on the dual-axis time difference. This influence coefficient is the dual-axis relative hysteresis coupling degree. The dual-axis relative hysteresis coupling degree quantifies the coupling influence of the change in cutting resistance on the hysteresis characteristics of the synchronous motion of the spindle and feed axis, fully characterizing the relative hysteresis characteristics of the dual axes under actual machining load variation conditions.
[0037] Step 34: Associate the characteristic parameter sets of each axis with the relative hysteresis coupling degree of the two axes, and establish a response reference table with the resistance values at each point on the cutting resistance distribution curve as the index and the corresponding dual-axis compensation parameters as the content. The specific operation is as follows: The CNC system associates the characteristic parameter sets corresponding to the spindle and the feed axis with the relative hysteresis coupling degree of the two axes to establish a correspondence among the three, ensuring that the dynamic response characteristics of the two axes corresponding to each set of cutting resistance values can be matched with the corresponding single-axis characteristic parameters and dual-axis coupling parameters. The CNC system uses the resistance values of each point on the cutting resistance distribution curve as index entries, sorts them according to the magnitude of the resistance values, and matches the corresponding spindle compensation parameters and feed axis compensation parameters for each index entry. The spindle compensation parameters include the acceleration limit, steady-state fluctuation amplitude, and deceleration characteristics in the spindle characteristic parameter set, and the feed axis compensation parameters include the acceleration limit, steady-state fluctuation amplitude, deceleration characteristics in the feed axis characteristic parameter set, as well as the relative hysteresis coupling degree of the two axes corresponding to the resistance value. The CNC system integrates and stores all index entries and their corresponding dual-axis compensation parameters to form a response reference table. The response reference table establishes a one-to-one correspondence between cutting resistance values and dual-axis dynamic response compensation parameters. In the subsequent pre-compensation process, the CNC system can directly retrieve the corresponding compensation parameters from the response reference table based on the resistance values on the cutting resistance distribution curve to complete the pre-compensation process of the speed ratio function. This eliminates the need for repeated dynamic response testing, improving the efficiency and accuracy of the compensation process.
[0038] As a preferred implementation, the response reference table is stored using a two-dimensional sparse matrix combined with a linear interpolation data structure. The table is structured with row indexes representing the resistance values at each point on the cutting resistance distribution curve, and column fields representing the spindle acceleration limit, spindle steady-state fluctuation amplitude, spindle deceleration characteristics, feed axis acceleration limit, feed axis steady-state fluctuation amplitude, feed axis deceleration characteristics, and the relative hysteresis coupling degree between the two axes. For cases where the measured cutting resistance value does not directly fall on an index node, the CNC system performs piecewise linear interpolation based on the compensation parameters of two adjacent index nodes, or uses cubic spline interpolation to improve the continuity of the compensation parameters. Simultaneously, to improve lookup efficiency, the response reference table is cached internally within the CNC system in key-value pair format, and adjacent index entries are dynamically loaded based on the range of cutting resistance changes during machining, ensuring real-time compensation response speed.
[0039] In a preferred embodiment of the present invention, step 4 is further included: based on the response time constant, pre-compensation is performed on the speed multiplier function to generate independent pre-compensation commands for the spindle and the feed axis. The specific operation is as follows: Due to the limitations of their own dynamic response characteristics, the spindle and feed axes of a CNC tapping machine will deviate from the ideal command when control commands are issued directly using the uncompensated speed ratio function. Furthermore, the deviation characteristics will differ, leading to motion mismatch between the two axes and deviations in thread machining. Based on previously measured response time constants of the spindle and feed axes to speed commands, and combined with the single-axis dynamic characteristic parameters and dual-axis coupling characteristic parameters in the response reference table, feedforward pre-compensation processing is performed on the speed ratio function to offset the command following deviation caused by the lag in the axis dynamic response. Simultaneously, independent pre-compensation commands are generated for the spindle and feed axes based on their different response characteristics, ensuring that the two axes can synchronously follow the ideal speed change during actual machining, maintaining a fixed speed ratio that meets the requirements of thread machining, and avoiding motion loss and abnormal fluctuations in cutting load.
[0040] Step 4 also includes the following steps: Step 41: Based on the time boundaries of the rising, steady-state, and falling phases corresponding to the characteristic parameter sets of each axis in the response benchmark table, the velocity multiplier function is divided into independent component sequences corresponding to the rising, steady-state, and falling phases on the time axis, respectively. The specific operation is as follows: The response reference table stores the characteristic parameter sets of each axis, corresponding to the independent dynamic characteristics of the speed command's rise, steady state, and fall stages. Each stage is matched with a corresponding time boundary, which is perfectly aligned with the time axis reference of the speed ratio function. The CNC system retrieves the time boundaries of the rise, steady state, and fall stages corresponding to the characteristic parameter sets of the spindle and feed axes from the response reference table. Using these time boundaries as the dividing reference, the speed ratio function is segmented on a continuous time axis, splitting the complete speed ratio function into independent component sequences corresponding to the rise, steady state, and fall stages, respectively. Each component sequence remains continuous on the time axis without time overlap or intervals, completely preserving all the numerical information of the original speed ratio function. Only the stage division in the time domain is completed, so that targeted compensation processing can be carried out on the dynamic characteristics of different stages in the future.
[0041] Step 42: For each stage component, based on the acceleration limit, fluctuation amplitude, and deceleration characteristics of the corresponding stage in the feature parameter set, perform inverse morphological adjustment on the waveform of each component to obtain the shaped stage components. The specific operation is as follows: The CNC system retrieves characteristic parameters from the corresponding axis feature parameter set for the ascending, steady-state, and descending component sequences obtained from the cutting process. Specifically, the ascending segment matches the acceleration limit, the steady-state segment matches the steady-state fluctuation amplitude, and the descending segment matches the deceleration characteristics. The system then performs reverse morphological adjustments on the waveforms of each component. For the ascending component, the CNC system uses the axis's acceleration limit as a constraint to preprocess the leading edge of the component waveform and adjusts the waveform's slope. This ensures that the actual speed waveform output after the adjusted command undergoes dynamic response of the axis system perfectly matches the ascending waveform of the original speed multiplier function, compensating for the response lag caused by insufficient axis acceleration. For the steady-state component, the CNC system uses the axis's steady-state fluctuation amplitude as a constraint. Based on this, the component waveforms are pre-corrected in reverse to offset speed fluctuations during the steady-state operation of the shaft system, ensuring that the actual output speed of the shaft system can be stably maintained at the steady-state value corresponding to the original speed multiplier function. For the descending component, the CNC system uses the shaft's deceleration characteristics as a constraint to pre-process the trailing edge of the component waveform and adjust the descending slope of the waveform. This ensures that after the adjusted command passes through the shaft system's dynamic response, the output actual speed waveform can completely coincide with the descending waveform of the original speed multiplier function, offsetting the response lag caused by the shaft system's deceleration capability limitation. After the reverse morphological adjustment of each stage component is completed, the shaped components of each stage are obtained. The shaped components can directly offset the command following deviation caused by the corresponding stage's shaft system dynamic response characteristics.
[0042] Specifically, the reverse shape adjustment is implemented using a reverse feedforward compensation algorithm based on the axis dynamic response identification model, which offsets the dynamic lag at each stage through segmented processing: Rising Segment Reverse Shaping: Based on the acceleration limit parameters extracted in step 32, the rising edge of the original velocity multiplier function is regarded as an inertial element with response lag. To compensate for this lag, the compensated command is advanced in time. At the same time, the rate of change of the command is proportionally corrected according to the acceleration limit, so that the advance amount and the corrected slope work together to ensure that the actual speed of the shaft system coincides with the rising segment waveform of the original command. The values of the advance amount and the correction coefficient are determined by fitting the measured response trajectory using the least squares method.
[0043] Steady-state segment reverse shaping: For the amplitude of velocity fluctuations during steady-state operation, fluctuation suppression compensation is adopted. By performing spectral analysis on the steady-state response trajectory, the main fluctuation frequencies and amplitudes are identified. Then, a small correction signal with the same amplitude but opposite phase is superimposed on the original command to cancel out periodic velocity fluctuations. If the fluctuations exhibit random characteristics, a real-time estimation algorithm is introduced to dynamically adjust the correction amount to ensure that the steady-state velocity remains constant.
[0044] Inverse shaping of the descent phase: Using deceleration characteristic parameters, such as maximum deceleration, a compensation strategy symmetrical to that of the ascent phase is adopted. The compensated command is moderately delayed in time, and the descent rate of the command is proportionally corrected according to the deceleration to ensure that the command starts deceleration in advance and avoids overshoot caused by inertia. The lag and correction coefficient are also obtained based on the fitting of the measured response trajectory.
[0045] The waveforms after each stage of shaping are synthesized by time-series superposition to finally form a pre-compensation command that can completely offset the dynamic lag of the shaft system.
[0046] Step 43: Reassemble the spindle components obtained after shaping in chronological order to obtain the initial pre-compensation ratio function of the spindle. Similarly, reassemble the feed axis components obtained after shaping in chronological order to obtain the initial pre-compensation ratio function of the feed axis. The specific operations are as follows: The characteristic parameter sets of the spindle and feed axis are independent of each other. The reverse shape adjustment process of each stage component is completed using the characteristic parameters of the corresponding axis. Therefore, the shaped stage components are also divided into two independent sequences: the spindle and the feed axis. The CNC system continuously reassembles the shaped spindle rising segment component, steady-state segment component, and falling segment component on the time axis according to the original cutting time sequence. Adjacent stage components are seamlessly connected at the time boundary, without time overlap or interval, forming a complete and continuously changing initial pre-compensation ratio function of the spindle. The CNC system uses the same processing method to continuously reassemble the shaped feed axis rising segment component, steady-state segment component, and falling segment component according to the original cutting time sequence, forming a complete and continuously changing initial pre-compensation ratio function of the feed axis. The two sets of initial pre-compensation ratio functions respectively complete the cancellation processing of the dynamic response deviation of the corresponding axis system, which can ensure that when the corresponding axis system runs alone, the actual speed output can accurately follow the change law of the original speed ratio function.
[0047] Step 44: Based on the relative hysteresis coupling degree of the two axes, and taking the main axis as the reference, apply a reverse offset corresponding to the coupling degree to the initial pre-compensation ratio function of the feed axis on the time axis to obtain the corrected feed axis pre-compensation ratio function. The specific operation is as follows: Single-axis reverse shaping can only compensate for the dynamic response deviations of each axis itself, but cannot eliminate the relative lag in the synchronous motion of the spindle and feed axis. This relative lag characteristic is fully quantified by the dual-axis relative lag coupling degree. The CNC system uses the spindle's time axis as the synchronization reference and retrieves the previously measured dual-axis relative lag coupling degree. This coupling degree corresponds one-to-one with the resistance value at each position on the cutting resistance distribution curve, fully characterizing the motion lag time of the feed axis relative to the spindle under different load conditions. The CNC system applies a reverse offset corresponding to the coupling degree to the feed axis's initial pre-compensation ratio function on the time axis. The offset amount perfectly matches the dual-axis relative lag coupling degree value at the corresponding position. By offsetting ahead on the time axis, the motion lag of the feed axis relative to the spindle is compensated. The reverse offset processing is carried out continuously along the entire time axis. The offset amount corresponding to different time nodes is adjusted synchronously with the change of coupling degree to ensure that the actual motion of the feed axis and the spindle remains synchronized throughout the entire stroke, and their speed ratio always meets the theoretical requirements of thread machining. After the reverse offset processing is completed, the corrected feed axis pre-compensation ratio function is obtained.
[0048] Step 45: Discretize the spindle pre-compensation ratio function and the corrected feed axis pre-compensation ratio function to generate independent pre-compensation command sequences for the spindle and feed axis respectively. The specific operation is as follows: The servo drive of a CNC tapping machine can only receive discrete digital commands issued according to a fixed control cycle. Continuously changing multiplier functions cannot be directly used for servo control. Therefore, the compensated multiplier function needs to be discretized. The CNC system retrieves the system control cycle used for tapping, which is completely consistent with the command receiving cycle of the servo drive. Using this as the sampling interval, the spindle pre-compensation multiplier function is sampled at equal intervals on the time axis. The multiplier value corresponding to each sampling time node is extracted and arranged in chronological order to form an independent pre-compensation command sequence for the spindle. The CNC system uses the same control cycle and sampling method to sample the corrected feed axis pre-compensation multiplier function at equal intervals. The multiplier value corresponding to each sampling time node is extracted and arranged in chronological order to form an independent pre-compensation command sequence for the feed axis. The time axes of the two sets of command sequences are completely aligned, and the sampling intervals are completely consistent, corresponding to the servo control requirements of the spindle and feed axis, respectively, and can be directly issued to the servo drive of the corresponding axis for execution.
[0049] In a preferred embodiment of the present invention, step 5 is further included: performing trial machining using a pre-compensation command, recording the actual cutting resistance, comparing it with the cutting resistance distribution curve to obtain the deviation, and iteratively correcting the pre-compensation command based on the deviation. The specific operation is as follows: Previous pre-compensation processing was based on the dynamic response characteristics of the shaft system measured under no-load conditions. However, in actual tapping processes, changes in cutting load, load-related changes in transmission chain stiffness, and load disturbance adjustment characteristics of the servo system can all lead to deviations between the actual execution effect of the theoretical pre-compensation command and the expected result. This deviation can cause the actual cutting load to deviate from the preset constant range, and at the same time cause synchronization errors between the spindle and the feed axis.
[0050] By conducting trial machining, cutting resistance data under actual machining conditions is obtained and compared with the cutting resistance distribution curve of the theoretical benchmark. The control deviation in the actual machining process is quantified, and then closed-loop iterative correction is carried out based on the deviation to optimize and adjust the pre-compensation command. This eliminates the deviation between the theoretical pre-compensation and the actual machining conditions, so that the final pre-compensation command can adapt to the full working condition characteristics of actual machining and ensure the stability of the cutting load and the synchronization accuracy of the dual-axis motion during actual machining.
[0051] Step 5 also includes the following steps: Step 51: Perform trial machining using independent pre-compensation command sequences for the spindle and feed axis, record the actual cutting resistance at each position along the tapping path, and compare the difference with the cutting resistance distribution curve point by point to obtain the actual deviation distribution curve along the tapping path. The specific operation is as follows: The trial machining uses the same workpiece material, tap specifications, and machine tool fixtures as the subsequent batch machining to ensure consistency between the trial machining conditions and the actual machining conditions. The CNC system synchronously sends the previously generated spindle independent pre-compensation command sequence and feed axis independent pre-compensation command sequence to the corresponding axis servo drive device to control the machine tool to complete the complete tapping trial machining process. During the entire stroke of the trial machining, the CNC system continuously collects the servo motor torque current signal corresponding to each position along the tapping path through the torque acquisition module of the servo drive device at the same sampling frequency as the pre-compensation command sequence. Using the same decoupling processing method as in step 11, the non-cutting load component of the machine tool itself is eliminated to obtain the actual cutting resistance corresponding to each position along the tapping path. The CNC system compares the actual cutting resistance obtained from the trial machining at each position along the tapping path with the theoretical cutting resistance value corresponding to the same position on the previously generated cutting resistance distribution curve point by point, calculates the difference between the actual cutting resistance and the theoretical cutting resistance at the same position, and obtains the deviation value corresponding to each position along the tapping path. The CNC system uses the stroke position of the tapping path as the horizontal axis and the deviation value corresponding to each position as the vertical axis to generate an actual deviation distribution curve along the tapping path. This curve fully represents the deviation distribution between the actual cutting state and the theoretical expected state during the trial machining process.
[0052] Step 52: Based on the time boundaries of the rising, steady-state, and falling stages corresponding to the characteristic parameter sets of each axis in the response benchmark table, the actual deviation distribution curve is mapped onto the time axis and decomposed into stage deviation components corresponding to the rising segment, steady-state segment, and falling segment. The specific operation is as follows: The actual deviation distribution curve represents the deviation mapping relationship within the position domain, while the correction of the pre-compensation command is based on the stage characteristics within the time domain. Therefore, it is necessary to first map the actual deviation distribution curve in the position domain onto the time axis. Based on the actual motion data of the spindle and feed axis during trial machining, the CNC system establishes a one-to-one correspondence between the tapping path stroke position and machining time, mapping the deviation values corresponding to each position along the tapping path to the corresponding machining time nodes to obtain the continuous deviation curve in the time domain. The CNC system retrieves the time boundaries of the rising, steady-state, and falling stages corresponding to the characteristic parameter sets of each axis from the response reference table. These time boundaries are perfectly aligned with the time axis of the pre-compensation command sequence. Using this as a segmentation reference, the continuous deviation curve in the time domain is segmented, decomposing the complete deviation curve into stage deviation components corresponding to the rising, steady-state, and falling stages, respectively. Each stage deviation component remains continuously connected on the time axis without time overlap or intervals, fully preserving the deviation characteristics of different motion stages throughout the entire machining cycle, and achieving a precise correspondence between the deviation and the dynamic response stage of the axis system.
[0053] Step 53: Adjust the reverse shaping parameters according to the stage deviation components, and re-execute the pre-compensation of the speed ratio function and the generated independent pre-compensation commands for the spindle and feed axis based on the adjusted reverse shaping parameters. Then generate a new pre-compensation command sequence. The specific operation is as follows: The CNC system matches the corresponding reverse shaping parameters for the stage deviation components of the decomposed ascending, steady-state, and descending segments. The stage deviation component of the ascending segment corresponds to the reverse shaping parameter related to the acceleration limit, the stage deviation component of the steady-state segment corresponds to the reverse shaping parameter related to the steady-state fluctuation amplitude, and the stage deviation component of the descending segment corresponds to the reverse shaping parameter related to the deceleration characteristics. According to the magnitude and variation law of each stage deviation component, the CNC system adjusts the reverse shaping parameter of the corresponding stage in the same direction. When the stage deviation component is positive, it indicates that the actual cutting resistance of the stage is greater than the theoretical expectation, and the reverse shaping adjustment amplitude of the corresponding stage needs to be increased to further reduce the speed ratio of the stage. When the stage deviation component is negative, it indicates that the actual cutting resistance of the stage is less than the theoretical expectation, and the reverse shaping adjustment amplitude of the corresponding stage needs to be decreased to appropriately increase the speed ratio of the stage.
[0054] After the reverse shaping parameters are adjusted, the CNC system uses the adjusted reverse shaping parameters as a benchmark to re-execute the entire pre-compensation process of the speed ratio function. This includes stage cutting of the speed ratio function, reverse shape adjustment of each stage component, reorganization of the initial pre-compensation ratio functions of the spindle and feed axis, correction of the time axis reverse offset of the feed axis ratio function, and final discretization processing. This generates a brand-new independent pre-compensation instruction sequence for the spindle and feed axis, completing one iterative correction process. The corrected new pre-compensation instruction sequence can be directly used for the next trial machining verification, forming a closed-loop iterative optimization process to gradually eliminate actual machining deviations.
[0055] To determine whether the iteration has converged, the following quantization criterion is introduced: Deviation amplitude criterion: When the maximum absolute value of the actual deviation distribution curve over the entire tapping stroke is less than a preset threshold, such as five percent of the rated cutting load, it is considered that the pre-compensation command has met the machining accuracy requirements, and the iteration terminates.
[0056] Change rate criterion: If the overall difference between the pre-compensation instruction sequences generated in two consecutive iterations is less than the set limit, for example, if the change in instruction amplitude is less than one percent, it indicates that the parameter adjustment has entered the stable range and is also considered as convergence.
[0057] Stage adaptive threshold: Different allowable deviation ranges are set for the rising segment, steady-state segment, and falling segment. For example, the allowable deviation for the rising segment is slightly larger to avoid shocks, while the steady-state segment has strict requirements. Global convergence is only determined when the deviations of each stage fall within their respective thresholds.
[0058] In each iteration, the CNC system adjusts the inverse shaping parameters using the gradient descent approach, based on the sign and magnitude of the deviation component at the current stage. Specifically, it gradually corrects the compensation coefficients along the direction of reducing deviation, based on the integral square index of the deviation. The correction step size is automatically optimized through multiple trial machining operations until the convergence criterion is met. Only the converged pre-compensation instructions can be stored permanently.
[0059] In a preferred embodiment of the present invention, step 6 is further included, which involves solidifying the pre-compensation instruction after iterative convergence for subsequent processing. The specific operation is as follows: During batch processing of CNC tapping machines, the tapping requirements under the same working conditions are highly consistent. The pre-compensation instructions, after iterative optimization and convergence, are adapted to the comprehensive processing conditions of the current workpiece, tool, machine tool, and fixture. They can stably achieve constant control of the cutting load and synchronous movement of the spindle feed axis. The iteratively converged pre-compensation instructions are solidified and stored to avoid repeatedly performing processes such as generating cutting resistance curves, dynamic response testing, pre-compensation calculation, and trial processing iterations during batch processing, which greatly improves the production efficiency of batch processing. At the same time, this step establishes a real-time deviation monitoring and closed-loop correction mechanism during batch processing. It can cope with changes in processing status caused by factors such as tool wear, machine tool state drift, and batch differences in workpiece materials during batch processing, continuously optimize the pre-compensation instructions, and ensure the consistency of thread processing accuracy and tool use safety throughout the entire batch processing cycle.
[0060] Step 6 also includes the following steps: Step 61: Link and store the pre-compensation command after iterative convergence, the corresponding cutting resistance distribution curve, and the response reference table to the machining parameter library. The specific operation is as follows: The criterion for iterative convergence is that after multiple trial machining iterations, the maximum deviation value of the actual deviation distribution curve obtained from the trial machining falls within a preset allowable range. This allowable range is set according to the accuracy grade requirements of the thread to be machined and the safe load limit of the tap. The CNC system associates and binds the pre-compensation command after iterative convergence that meets the convergence criterion with the cutting resistance distribution curve and response reference table corresponding to the command. During the binding process, the system simultaneously matches the workpiece material grade, tap specification, nominal thread parameters, machine tool model, and tooling clamping method, etc., corresponding to the set of machining parameters, to ensure that each set of parameters can be accurately matched and retrieved through the working condition identifier. The CNC system stores all parameter data that has been associated and bound into the structured machining parameter library built into the CNC system. The machining parameter library can realize the classified storage and quick retrieval of multiple sets of machining parameters under different working conditions, while completely retaining the reference data corresponding to each set of parameters, providing a unified reference for deviation monitoring and command correction in subsequent batch machining processes. Step 62: During subsequent workpiece machining, the corresponding pre-compensation instruction is retrieved from the machining parameter library for machining, and the actual cutting resistance is recorded. The real-time deviation is obtained by comparing it with the corresponding cutting resistance distribution curve in the machining parameter library. The specific operation is as follows: Subsequent workpiece machining refers to batch tapping operations that are completely consistent with a set of parameter condition identifiers stored in the machining parameter library. Before batch machining begins, the CNC system receives the current machining condition identifier information input by the operator. Based on this information, it retrieves and matches the corresponding pre-compensation command, cutting resistance distribution curve, and response reference table from the machining parameter library, and directly calls up the pre-compensation command and sends it to the servo drive devices of the spindle and feed axis to control the machine tool to complete the tapping of a single workpiece, without repeating the previous parameter testing and iterative optimization process. During the entire tapping stroke of each workpiece, the CNC system uses the servo drive device... The torque acquisition module continuously acquires the torque current signal of the servo motor at the same sampling frequency as the pre-compensation command sequence. It adopts a decoupling method that is completely consistent with the pre-processing to eliminate the non-cutting load component of the machine tool itself and obtain the actual cutting resistance corresponding to each position along the tapping path in real time. The CNC system compares the real-time acquired actual cutting resistance with the corresponding cutting resistance distribution curve stored in the machining parameter library point by point in real time, calculates the difference between the actual cutting resistance and the reference cutting resistance at the same position, and obtains the real-time deviation along the tapping path. This real-time deviation can directly reflect the degree of deviation between the current machining state and the reference optimized state.
[0061] Step 63: If the real-time deviation exceeds the threshold set according to the stage boundary in the response benchmark table, the real-time deviation is decomposed into stage deviation components corresponding to the rising segment, steady-state segment, and falling segment according to the stage boundary in the response benchmark table. The corresponding reverse shaping parameters are adjusted according to each stage deviation component to generate a corrected pre-compensation command. The corrected command is then used to update the corresponding pre-compensation command in the machining parameter library. The specific operation is as follows: The CNC system pre-sets corresponding deviation thresholds for each stage based on the time boundaries of the rise, steady state, and fall phases corresponding to the characteristic parameter sets of each axis in the response reference table. The deviation thresholds are set according to the accuracy requirements of the thread to be processed and the safe load limit of the tap, ensuring that the deviation exceeding the threshold will not cause thread accuracy deviation or tool damage risk. During batch processing, the CNC system judges in real time whether the real-time deviation within the entire processing cycle exceeds the threshold set for the corresponding stage. If the real-time deviation does not exceed the corresponding threshold, the pre-compensation instructions stored in the processing parameter library are used to continue processing the subsequent workpieces without performing correction operations.
[0062] If the real-time deviation corresponding to a certain machining stage exceeds the threshold set for that stage, the CNC system first maps the real-time deviation onto the time axis based on the correspondence between the tapping path position and machining time in the current machining process. Then, according to the stage time boundary in the response reference table, it decomposes the real-time deviation in the time domain into stage deviation components corresponding to the rising segment, steady-state segment, and falling segment, respectively, to achieve a precise correspondence between the deviation and the dynamic characteristics of each motion stage. Based on the decomposed stage deviation components, the CNC system adjusts the reverse shaping parameters of the corresponding stage, keeping the adjustment logic consistent with the parameter adjustment logic in the trial machining iteration process. Then, based on the adjusted reverse shaping parameters, it re-executes the entire pre-compensation process of the speed ratio function to generate a corrected pre-compensation instruction. The CNC system uses the corrected pre-compensation instruction to update the corresponding pre-compensation instruction originally stored in the machining parameter library, and simultaneously updates the associated cutting resistance distribution curve. Subsequent workpiece machining directly calls the updated pre-compensation instruction, realizing closed-loop adaptive correction in the batch machining process and ensuring machining stability and accuracy consistency throughout the entire batch machining cycle.
[0063] Example 2: Please see Figure 2 Based on Example 1, this embodiment provides a CNC tapping machine cutting parameter control system, including: a resistance acquisition module, used to acquire the cutting resistance distribution curve along the tapping path; The speed function generation module is used to generate a speed multiplier function that varies with time based on the cutting resistance distribution curve. The speed multiplier function is also used to adjust the spindle speed and feed rate. The time measurement module is used to measure the response time constant of the spindle and feed axis to speed commands; The pre-compensation generation module is used to pre-compensate the speed ratio function based on the response time constant and generate independent pre-compensation commands for the spindle and feed axis. The trial correction module is used to perform trial machining using pre-compensation commands, record the actual cutting resistance, and compare it with the cutting resistance distribution curve to obtain the deviation. The pre-compensation commands are then iteratively corrected based on the deviation. The instruction solidification module is used to solidify the pre-compensation instructions after iterative convergence for subsequent processing.
[0064] The above description is merely a preferred embodiment of the present invention; however, the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and its improved concepts, should be covered within the scope of protection of the present invention.
Claims
1. A method for controlling cutting parameters of a CNC tapping machine, characterized in that, include: Obtain the cutting resistance distribution curve along the tapping path; Based on the cutting resistance distribution curve, a speed multiplier function that varies with time is generated. The speed multiplier function is used to adjust both the spindle speed and the feed rate. Measure the response time constants of the spindle and feed axis to speed commands; Based on the response time constant, the speed ratio function is pre-compensated to generate independent pre-compensation commands for the spindle and feed axis. Trial machining was performed using pre-compensation commands, the actual cutting resistance was recorded, and the deviation was obtained by comparing it with the cutting resistance distribution curve. The pre-compensation commands were then iteratively corrected based on the deviation. The pre-compensation instructions after iterative convergence are solidified for subsequent processing.
2. The method for controlling cutting parameters of a CNC tapping machine according to claim 1, characterized in that, Obtain the cutting resistance distribution curve along the tapping path, including: Acquire the first electrical signal along the tapping path in the no-run state, acquire the second electrical signal along the tapping path in the machining state, and obtain the pure cutting load component along the tapping path based on the decoupling of the first and second electrical signals. Based on the tap's geometric parameters and the current tapping depth, the instantaneous contact area along the tapping path is calculated, and the instantaneous cutting pressure along the tapping path is obtained based on the pure cutting load component and the instantaneous contact area. Based on the maximum instantaneous cutting pressure, the instantaneous cutting pressure at each point along the tapping path is normalized to obtain the cutting resistance distribution curve.
3. The method for controlling cutting parameters of a CNC tapping machine according to claim 2, characterized in that, Generate a velocity multiplication function that varies with time, including: Based on the cutting resistance distribution curve, the initial feed rate at each position point is set according to the principle of constant cutting load, so that the initial feed rate is inversely proportional to the value on the cutting resistance distribution curve, and the feed rate-position curve along the tapping path is obtained. Based on the scaling-position curve and the basic feed rate, iterative coordinate transformation is performed with the scaling-position curve as the reference to map the scaling value to the time axis and generate a speed scaling function that changes with time.
4. The method for controlling cutting parameters of a CNC tapping machine according to claim 3, characterized in that, Determine the response time constants of the spindle and feed axis to speed commands, including: With the spindle and feed axis stationary, apply a sequence of speed commands that include rising, steady-state, and falling phases, and record the complete response trajectory of the actual speed of each axis over time. The complete response trajectory is segmented and analyzed to extract the acceleration limit in the rising phase, the steady-state fluctuation amplitude in the steady-state phase, and the deceleration characteristics in the falling phase, forming a set of characteristic parameters for each axis.
5. The method for controlling cutting parameters of a CNC tapping machine according to claim 4, characterized in that, Measuring the response time constants of the spindle and feed axis to speed commands also includes: During the synchronous movement of the spindle and feed axis according to the actual tapping speed ratio, the time difference between the actual positions of the two axes reaching the same commanded position is continuously recorded, and the relative hysteresis coupling degree of the two axes is obtained based on the correspondence between the time difference and the resistance value at the corresponding position on the cutting resistance distribution curve. The characteristic parameter sets of each axis are associated with the relative hysteresis coupling degree of the two axes to establish a response benchmark table with the resistance value of each point on the cutting resistance distribution curve as the index and the corresponding dual-axis compensation parameters as the content.
6. The method for controlling cutting parameters of a CNC tapping machine according to claim 5, characterized in that, Pre-compensation of the speed ratio function includes: Based on the time boundaries of the rising, steady-state, and falling phases corresponding to the characteristic parameter sets of each axis in the response benchmark table, the velocity multiplier function is divided into independent component sequences corresponding to the rising, steady-state, and falling phases on the time axis. For each stage component, the waveform of each component is reverse-shaped according to the acceleration limit, fluctuation amplitude, and deceleration characteristics of the corresponding stage in the characteristic parameter set, so as to obtain the shaped stage components. The spindle components obtained after shaping are recombined in chronological order to obtain the initial pre-compensation ratio function of the spindle. The feed axis components obtained after shaping are also recombined in chronological order to obtain the initial pre-compensation ratio function of the feed axis.
7. The method for controlling cutting parameters of a CNC tapping machine according to claim 6, characterized in that, Generate independent pre-compensation commands for the spindle and feed axes, including: Based on the relative hysteresis coupling degree of the two axes, with the main axis as the reference, the feed axis initial pre-compensation ratio function is applied with a reverse offset corresponding to the coupling degree on the time axis to obtain the corrected feed axis pre-compensation ratio function; The spindle pre-compensation ratio function and the corrected feed axis pre-compensation ratio function are discretized to generate independent pre-compensation command sequences for the spindle and feed axis, respectively.
8. The method for controlling cutting parameters of a CNC tapping machine according to claim 7, characterized in that, Pre-compensation instructions based on deviation iteration correction include: Trial machining was performed using independent pre-compensation command sequences for the spindle and feed axis. The actual cutting resistance at each position along the tapping path was recorded and compared point by point with the cutting resistance distribution curve to obtain the difference and acquire the actual deviation distribution curve along the tapping path. Based on the time boundaries of the rising, steady-state, and falling stages corresponding to the characteristic parameter sets of each axis in the response benchmark table, the actual deviation distribution curve is mapped onto the time axis and decomposed into the stage deviation components corresponding to the rising segment, steady-state segment, and falling segment. Based on the stage deviation components, the reverse shaping parameters are adjusted respectively, and the speed ratio function is re-compensated according to the adjusted reverse shaping parameters. The independent pre-compensation commands for the spindle and feed axis are generated, and a new pre-compensation command sequence is formed.
9. A method for controlling cutting parameters of a CNC tapping machine according to claim 8, characterized in that, The pre-compensation instructions after iterative convergence are solidified for subsequent processing, including: The pre-compensation command after iterative convergence, the corresponding cutting resistance distribution curve, and the response reference table are associated and stored in the machining parameter library; During subsequent workpiece machining, the corresponding pre-compensation instruction is called from the machining parameter library for machining, and the actual cutting resistance is recorded. The real-time deviation is obtained by comparing it with the corresponding cutting resistance distribution curve in the machining parameter library. If the real-time deviation exceeds the threshold set according to the stage boundary in the response benchmark table, the real-time deviation is decomposed into stage deviation components corresponding to the rising segment, steady-state segment, and falling segment according to the stage boundary in the response benchmark table. The corresponding reverse shaping parameters are adjusted according to each stage deviation component to generate a corrected pre-compensation instruction, and the corresponding pre-compensation instruction in the machining parameter library is updated with the corrected instruction.
10. A CNC tapping machine cutting parameter control system, applied to the CNC tapping machine cutting parameter control method according to any one of claims 1-9, characterized in that, include: The resistance acquisition module is used to acquire the cutting resistance distribution curve along the tapping path; The speed function generation module is used to generate a speed multiplier function that varies with time based on the cutting resistance distribution curve. The speed multiplier function is also used to adjust the spindle speed and feed rate. The time measurement module is used to measure the response time constant of the spindle and feed axis to speed commands; The pre-compensation generation module is used to pre-compensate the speed ratio function based on the response time constant and generate independent pre-compensation commands for the spindle and feed axis. The trial correction module is used to perform trial machining using pre-compensation commands, record the actual cutting resistance, and compare it with the cutting resistance distribution curve to obtain the deviation. The pre-compensation commands are then iteratively corrected based on the deviation. The instruction solidification module is used to solidify the pre-compensation instructions after iterative convergence for subsequent processing.