Control method of CNC vertical lathe servo drive system considering adaptive time domain adjustment
Through the MPC control method of adaptive time domain adjustment, the problem of large amount of calculation and insufficient real-time performance in the CNC vertical vehicle servo drive system is solved, and efficient and high-precision servo drive control is realized, which is suitable for the spindle servo system of CNC vertical vehicle.
Patent Information
- Application Number
- CN202211195446.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-09-29
AI Technical Summary
Traditional MPC algorithms have large calculations in CNC servo drive control, affecting real-time and stability, and cannot adaptively adjust the time domain to compatible with the stability and real-time requirements of the system.
Adaptive time domain adjustment MPC control method is adopted to construct models and objective functions, combine particle swarm algorithm to optimize time domain parameters, adjust the control cycle according to system requirements and processing type, reduce the calculation complexity and improve control accuracy.
It realizes improving control accuracy and reducing calculation complexity in CNC vertical vehicle servo drive system, compatible with the stability and real-time nature of the system, and is suitable for efficient and high-precision servo drive control in a wide range of scenarios.
Smart Images

Figure CN115562170B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field related to servo drive control of CNC machine tools, and more specifically, to a control method for a servo drive system of a CNC vertical lathe taking into account adaptive time domain adjustment. Background Art
[0002] The servo drive system is a crucial component of CNC vertical lathes. The spindle servo control performance directly impacts technical indicators such as the accuracy and efficiency of CNC machine tools. Therefore, employing a robust control algorithm to regulate the servo system ensures rapid response and accurately and sensitively tracks the command signals from the CNC device. To effectively address the various constraints inherent in control, model predictive control (MPC) has been widely used in servo drive control systems for CNC vertical lathes. Unlike conventional discrete optimal control algorithms, the MPC algorithm employs a rolling finite-horizon optimization strategy. At each sampling moment, the optimal control law for a finite period of time is calculated based on the optimal performance indicator at that moment. The optimal control law is then recalculated at the next sampling moment, resulting in robustness and excellent control performance.
[0003] Currently, traditional MPC algorithms have problems such as improper controller parameter selection leading to decreased control accuracy and system instability. In order to improve the control accuracy of MPC, the MPC can be improved based on the desired trajectory fluctuation control period, which can effectively improve the stability of the controller; at the same time, accurate tracking control can be achieved by solving the optimal time domain value offline and then performing MPC optimization. In general, based on the idea of the improved MPC algorithm, accurate and stable control can be achieved by adjusting the controller parameters. However, considering the high-efficiency and high-precision servo drive control requirements of CNC vertical lathes, combined with the MPC algorithm, the following problems still need to be solved:
[0004] (1) The amount of MPC calculation is large. Therefore, when a larger time domain is selected, although it can effectively improve the stability of the controller, it will increase the calculation burden and even affect the real-time requirements of the CNC vertical lathe servo drive control;
[0005] (2) Since the system is in dynamic change, the use of a fixed time domain makes the MPC algorithm unable to effectively be compatible with the stability and real-time performance of the CNC vertical lathe servo drive control system.
[0006] Therefore, there is an urgent need for an MPC control method for CNC vertical lathe servo drive that can adaptively adjust the time domain and effectively reduce the computational complexity. Summary of the Invention
[0007] In response to the above defects or improvement needs of the prior art, the present invention provides a control method for a CNC vertical lathe servo drive system taking into account adaptive time domain adjustment, thereby solving the problem of adaptive adjustment of the servo drive system.
[0008] To achieve the above object, according to the present invention, a method for controlling a servo drive system of a CNC vertical lathe taking into account adaptive time domain adjustment is provided, the method comprising the following steps:
[0009] S1: For the drive system to be processed, a model of the drive system and an MPC model controller applied to the model are constructed, and then a constrained objective function of the drive system is established based on the model;
[0010] S2 sets the sampling time, k=1, obtains the maximum value and safety factor of the time domain parameters of the MPC model controller, constructs the relationship between the time domain parameters at the previous time and the time domain parameters at the current time, and calculates the time domain parameter value at time k using the time domain parameter value at time k-1;
[0011] S3 constructs a judgment condition for whether the application demand of the drive system has changed, and judges whether the application demand of the drive system has changed according to the preset expected trajectory of the drive system. When the application demand has changed, the time domain parameter value at the current time k is adjusted; otherwise, the time domain parameter value at the current time k is retained;
[0012] S4: the MPC model controller determines the current processing type according to the state speed of the drive system, and adjusts the cycle according to the processing type to obtain the cycle at the current moment;
[0013] S5 inputs the time domain parameters and period obtained in step S3 into the MPC model controller to calculate the control input quantity at the current moment, k+1, and returns to step S2 until the maximum number of iterations, so as to make the actual motion trajectory of the drive system closer to the desired trajectory.
[0014] Further preferably, in step S1, the objective function is performed according to the following relationship:
[0015]
[0016] sU min ≤U(k)≤U max
[0017] ΔU min ≤ΔU≤ΔU max
[0018] Among them, j and i represent the index of the prediction time domain and the control time domain respectively, k is the sampling time, J mpcis the objective function of the MPC controller, Q and S are the weight matrices of the objective function, Y represents the output variable, ΔU is the control increment, Np and Nc are the prediction time domain and the control time domain respectively, is the terminal penalty function, which is used to ensure the recursive feasibility of the function, P is the terminal penalty function weight matrix, ε is the relaxation factor, ρ is the weight coefficient, U is the control input, U min , U max are the upper and lower limits of the control input, ΔU min , ΔU max are the upper and lower limits of the control increment respectively.
[0019] Further preferably, in step S2, the maximum value and safety factor of the time domain parameter are determined as follows:
[0020]
[0021] Among them, Np is the predicted time domain value, Nc is the control time domain value, Np s ,Np max are the safety factor and maximum value of the prediction time domain, Nc s ,Nc max are the safety factor and maximum value of the control time domain respectively.
[0022] Further preferably, in step S2, at time k=0, the time domain parameter value is the maximum value of the time domain parameter.
[0023] Further preferably, in step S2, the relationship between the time domain parameters at the previous moment and the time domain parameters at the current moment is performed as follows:
[0024]
[0025] Among them, Round is the rounding function, Np k is the predicted time domain value at time k, Np k-1 is the predicted time domain value at time k-1, Nc k is the control time domain value at time k, Nc k-1 is the control time domain value at time k-1.
[0026] Further preferably, in step S3, the judgment condition is performed as follows:
[0027] |x k+1 -x k |≤γx k
[0028] Among them, x k+1 is the application requirement at time k, x k is the application demand at time k-1, and γ is the proportional coefficient.
[0029] Further preferably, in step S3, the time domain parameter value at the current time k is adjusted in the following manner:
[0030] At time k, the objective function in nonlinear model predictive control is used as the optimization objective function, the prediction time domain and the control time domain are used as optimization variables, and the optimal solution of the objective function is obtained through the particle swarm algorithm.
[0031] Further preferably, in step S4, the current processing type is determined in the following manner:
[0032]
[0033] Among them, v n is the critical speed and v is the velocity.
[0034] Further preferably, in step S4, the period is adjusted in the following manner:
[0035]
[0036] Among them, T is the reasonable control period updated by MPC, T 控 represents the MPC control cycle under rough machining, T max is the maximum value of the control period, T cal is the control period obtained by the algorithm, t PSO is the computational solution time of the particle swarm control algorithm, and ζ and λ are proportional coefficients.
[0037] Further preferably, the control input is calculated according to the following relationship:
[0038]
[0039] Among them, i represents the index of the control time domain, k is the sampling time, Δu * is the control increment obtained by solving the objective function, is the control increment optimized according to the optimal parameter vector, u * is the control input, β is the optimal parameter vector, and Nc is the control time domain.
[0040] In general, the above technical solutions conceived by the present invention have the following beneficial effects compared with the prior art:
[0041] 1. Based on the MPC algorithm, this paper invents a spindle servo drive control algorithm that can improve control accuracy and reduce computational complexity. The main algorithmic approach is to degrade the prediction time domain and control time domain in the controller parameters, and determine whether the time domain values need to be adaptively adjusted through an improved particle swarm algorithm based on changes in the scene. At the same time, a switching adjustment method is adopted to reduce the computational burden. Utilizing this algorithm, the stability and real-time requirements of the system can be simultaneously met, improving the convergence speed and tracking control accuracy.
[0042] 2. The improved MPC algorithm of the present invention first determines the range of time domain adjustment, and performs an initial assignment of the time domain at the previous moment by referring to the time domain parameters of the previous moment, while effectively reducing the computational complexity by reducing the time domain value.
[0043] 3. The MPC controller of the present invention determines the change of the scene based on the reference trajectory to decide whether the time domain value needs to be adaptively adjusted, thereby eliminating unnecessary calculations of the MPC controller;
[0044] 4. Use the particle swarm optimization algorithm to solve the appropriate prediction time domain and control time domain at that moment. Improve the particle swarm optimization algorithm by adaptively adjusting the inertia weight during iteration to increase the convergence speed, avoid falling into the problem of local optimality, and generate the optimal solution more quickly and accurately.
[0045] 5. The control system judges the CNC machining category based on speed information, and adopts different control cycles in rough machining and finishing modes to ensure that the computational burden of the MPC algorithm is reduced, with high stability and a wide range of applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a process flow of a servo drive control method for a CNC vertical lathe spindle constructed according to a preferred embodiment of the present invention;
[0047] Figure 2 It is a flow chart of an improved particle swarm optimization algorithm constructed according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0049] A control method for a CNC vertical lathe servo drive system considering adaptive time domain adjustment is characterized by comprising the following steps:
[0050] Step 1: Model construction: Design an MPC model controller based on the state space model of the spindle servo drive system and establish an objective function with constraints;
[0051] Step 2: Time domain assignment, determine the maximum value of the MPC controller's time domain parameters and the safety factor, and use the time domain parameter information of the previous moment and combine it with the method of reducing computational complexity to initially determine the time domain value at that moment.
[0052] Step 3: Time domain adjustment. Based on the expected trajectory of the system, determine whether the system scenario has changed significantly. If so, the time domain needs to be readjusted. The improved particle swarm control algorithm based on adjustable inertia weight is used to solve the optimal time domain value. The MPC controller cost function is used as the optimization objective function, and the prediction time domain and control time domain are used as optimization variables. The inertia weight is adjusted in continuous iteration. The particle's own historical optimal solution and the swarm's global optimal solution affect the particle's speed and direction, allowing the particle to explore and develop in the search space to obtain a suitable time domain value. Otherwise, the original system's time domain value is retained.
[0053] Step 4: Control cycle switching. The controller determines the processing type of the CNC vertical lathe based on the speed. In order to ensure the real-time performance of the control system, the controller switches and adjusts the control cycle according to rough processing and fine processing.
[0054] Step 5: Update the control cycle, prediction time domain and control time domain parameters in the control system, and use MPC optimization to obtain the control information at that moment to control the CNC vertical lathe spindle servo system.
[0055] Preferably, in step 1, the state space expression can be established according to the CNC vertical lathe servo drive system model as follows:
[0056]
[0057] Among them, x is the state variable, u is the input variable, y is the output variable, and A, B, and C are the equation coefficients.
[0058] In order to predict the state relationship and trend between the next moment and the current moment, the current state quantity and the control quantity of the previous moment are combined as the new state quantity input to form a prediction equation.
[0059]
[0060] Where k is the system time.
[0061] The expression is converted into discrete form by approximate discretization method and organized into linear homogeneous expression:
[0062]
[0063] in, Δu(k)=u(k)-u(k-1), m is the number of control variables, n is the number of state variables, Δu is the control increment, I m , I n denote the identity matrices of dimensions m and n respectively.
[0064] Combining the prediction time domain Np and the control time domain Nc, the discretized expression is written as the following vector:
[0065] Y(k)=Ψξ(k)+ΘΔU(k)
[0066]
[0067] Furthermore, step 1 also includes the design of the MPC objective function and related constraints, as follows:
[0068] The design of the objective function mainly needs to consider the system's ability to track the reference trajectory and the fluctuation of the control parameters, that is, the size of the predicted output error and the control increment. Therefore, the designed objective function is as follows:
[0069]
[0070] Among them, Q and S are the tracking weight matrix and the control quantity increment weight coefficient matrix respectively, satisfying Q>0,S≥0. Np and Nc are the prediction time domain and control time domain of the MPC controller respectively.
[0071] Because the control quantity is limited by its own physical factors, and in order to avoid the jump phenomenon of the control quantity, it is necessary to consider adding constraints on the control input and control increment, that is:
[0072] U min ≤U(k)≤U max
[0073] ΔU min ≤ΔU≤ΔU max
[0074] Among them, U min , U max are the upper and lower limits of the control input, ΔU min , ΔU max are the upper and lower limits of the control increment respectively
[0075] In summary, the rolling horizon control optimization problem is:
[0076]
[0077] sU min ≤U(k)≤U max
[0078] ΔU min ≤ΔU≤ΔU max
[0079] in, is the terminal penalty function, which is used to ensure the recursive feasibility of the function, P is the terminal penalty function weight matrix, ε is the relaxation factor, and ρ is the weight coefficient. ρε 2 It is introduced into the cost function to prevent infeasible solutions from occurring during the optimization problem.
[0080] Furthermore, in step 2, it also includes determining the range of the time domain parameters of the MPC controller, that is, setting the time domain maximum value and the safety factor:
[0081]
[0082] Among them, Np s ,Np max are the safety factor and maximum value of the prediction time domain, Nc s ,Nc max are the safety factor and maximum value of the control time domain respectively.
[0083] The initial value of the time domain at the control start time k0 is set to the maximum value. At the same time, in order to reduce the computational complexity, the time domain value at time k-1 is gradually reduced and assigned to the time domain at time k. The time domain stops when it is reduced to the safety factor, that is:
[0084]
[0085] Among them, Round is the rounding function.
[0086] Furthermore, in step 3, it is included to judge whether the scene of the expected trajectory has changed significantly, by judging the expected sequence x r =[x1 x2 ... x n ], for any item x k ∈R,i∈{1,2,...n-1}, whether the condition |x is satisfied k+1 -x k |≤γx k , where x k is the system state at time k-1, and γ is the proportional coefficient. If the condition is met, the system determines that the scene has not changed much, and the time domain value at time k in step 2 is retained; if the condition is not met, the system determines that the scene has changed significantly, and the time domain value needs to be adjusted.
[0087] Furthermore, in step 3, a method for adjusting the time domain value using an improved particle swarm optimization algorithm is also included. At time k, the objective function J in the nonlinear model predictive control is used as the optimization objective function, and the prediction time domain and the control time domain are used as optimization variables. The optimal solution of the objective function is obtained by solving the particle swarm algorithm, and the most ideal prediction time domain under this state is derived. The specific solution of the improved particle swarm optimization algorithm is as follows:
[0088] The system sets the target search dimension to 2, where there is a group of N particles, whose speeds are randomly generated. The coordinates of the θth particle are x θ =(x θ1 ,x θ2 ), the flying speed of each particle is v θ =(v θ1 ,v θ2 ). Calculate the objective function value J of each particle θ , where each particle has a fitness value determined by the optimization objective function.
[0089] According to the function value, the particle tracks its own historical optimal position and the global historical optimal position during the optimization process. For the θth particle, the best historical position it has passed is P best =(P θ1 ,P θ2 ); The global optimal position refers to the best position found by all particles in the entire group so far, which is g best =(g θ1 ,g θ2 ). The particle continuously updates its speed and position based on these two extreme values and iterates according to the given formula.
[0090]
[0091] Where θ represents the particle index, c1 and c2 are weight factors. c1 indicates that the particle learns from its own historical optimum, while c2 indicates that the particle learns from the global historical optimum. r1 and r2 are random numbers between [0, 1]. t represents the current iteration number, and w is the inertia weight.
[0092] According to the characteristics of the inertia weight, in order to improve the global search ability of the algorithm and avoid falling into the local optimal problem, the inertia weight is adaptively adjusted. For particles whose objective function value is better than the average target value, the corresponding inertia weight factor is reduced; for particles whose objective function value is lower than the average target value, the corresponding inertia weight factor is increased, that is:
[0093]
[0094] Among them, J avgis the average value of the objective function, and w0 is the reference value of the inertia weight factor.
[0095] The optimal solution of the objective function is obtained by solving the improved particle swarm algorithm, and the most ideal prediction time domain Np and control time domain Nc under this state are deduced.
[0096] Furthermore, in step 4, the controller determines the CNC vertical lathe processing category according to the speed, specifically: setting the critical speed v n , when the speed is less than the critical speed v n When the speed is greater than or equal to the critical speed v n When , the controller determines that the processing type is finishing, that is:
[0097]
[0098] At the same time, the calculation control cycle is adjusted according to the processing type. In the rough processing mode, the rolling time domain controller only needs to maintain the normal calculation control cycle T 控 ; When in the finishing mode, in order to ensure the real-time performance of the control system, the calculation control cycle of the rolling time domain controller will be based on the time t of the optimization algorithm in step 3 PSO , in the maximum control period T max and T 控 Among them, when the scene changes little in step 3, the optimization algorithm is not performed, that is, t PSO =0, the calculation control cycle should also be increased to improve the real-time control performance, that is:
[0099]
[0100] Wherein, λ and ζ are proportional coefficients and satisfy 0<ζ≤1.
[0101] Furthermore, in step 5, the calculated time domain value and the calculated control period are brought into the MPC controller, and the minimum value of the objective function is obtained by using MPC. The control input increment and relaxation factor are obtained in the control time domain Nc as follows:
[0102] [ΔU * (k),ε * (k)]=[Δu * (k) Δu * (k+1) ... Δu * (k+Nc-1) ε1 * (k) ε2 * (k)]
[0103] At the same time, a multi-step predictive control increment method is proposed to improve the MPC control algorithm, and the weight coefficient vector is designed to be βk+i =[β(k+i) β(k+i+1) ... β(k+Nc)], i∈[1,2,...D], where D is the number of predictive control increments, such that:
[0104]
[0105] Use the optimization solution method to find the optimal parameter vector β k+i for:
[0106]
[0107] Where σ is β k+i The weight factor of .
[0108] The control input is obtained by using the control increment calculation and is passed to the spindle servo drive system for control, namely:
[0109]
[0110] In order to achieve the above-mentioned object, according to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the MPC control method with adaptive time domain adjustment as described in any of the above items is implemented.
[0111] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A control method for a CNC vertical lathe servo drive system considering adaptive time domain adjustment, characterized in that: The method comprises the following steps: S1: For the drive system to be processed, a model of the drive system and an MPC model controller applied to the model are constructed, and then a constrained objective function of the drive system is established based on the model; S2 sets the sampling time, k=1, obtains the maximum value and safety factor of the time domain parameters of the MPC model controller, constructs the relationship between the time domain parameters at the previous time and the time domain parameters at the current time, and calculates the time domain parameter value at time k using the time domain parameter value at time k-1; S3 constructs a judgment condition for whether the application demand of the drive system has changed, and judges whether the application demand of the drive system has changed according to the preset expected trajectory of the drive system. When the application demand has changed, the time domain parameter value at the current time k is adjusted; otherwise, the time domain parameter value at the current time k is retained; S4: the MPC model controller determines the current processing type according to the state speed of the drive system, and adjusts the cycle according to the processing type to obtain the cycle at the current moment; S5 inputs the time domain parameters and period obtained in step S3 into the MPC model controller to calculate the control input quantity at the current moment, k+1, and returns to step S2 until the maximum number of iterations is reached, so as to make the actual motion trajectory of the drive system closer to the desired trajectory; In step S2, the maximum value and safety factor of the time domain parameter are determined as follows: Among them, Np is the predicted time domain value, Nc is the control time domain value, Np s ,Np max are the safety factor and maximum value of the prediction time domain, Nc s ,Nc max are the safety factor and maximum value of the control time domain respectively; The relationship between the time domain parameters at the previous moment and the time domain parameters at the current moment is as follows: Among them, Round is the rounding function, Np k is the predicted time domain value at time k, Np k-1 is the predicted time domain value at time k-1, Nc k is the control time domain value at time k, Nc k-1 is the control time domain value at time k-1; In step S3, the judgment conditions are as follows: |x k+1 -x k |≤γx k Among them, x k+1 is the application requirement at time k, x k is the application demand at time k-1, and γ is the proportional coefficient; In step S3, the time domain parameter value at the current time k is adjusted in the following manner: At time k, the objective function in nonlinear model predictive control is used as the optimization objective function, the prediction time domain and the control time domain are used as optimization variables, and the optimal solution of the objective function is obtained through the particle swarm algorithm.
2. A method for controlling a CNC vertical lathe servo drive system considering adaptive time domain adjustment according to claim 1, characterized in that: In step S1, the objective function is performed according to the following relationship: s.t.U min ≤U(k)≤U max ΔU min ≤ΔU≤ΔU max Among them, j and i represent the index of the prediction time domain and the control time domain respectively, k is the sampling time, J mpc is the objective function of the MPC controller, Q and S are the weight matrices of the objective function, Y(k+i|k) is the output variable at time k+i, ΔU(k+j|k) represents the control input increment at time k+j, Np and Nc are the prediction time domain and the control time domain respectively. is the terminal penalty function, which is used to ensure the recursive feasibility of the function, P is the terminal penalty function weight matrix, ε is the relaxation factor, ρ is the weight coefficient, U is the control input, U min , U max are the upper and lower limits of the control input, ΔU min , ΔU max are the upper and lower limits of the control increment respectively.
3. The method for controlling a CNC vertical lathe servo drive system considering adaptive time domain adjustment according to claim 2, characterized in that: In step S2, when k=0, the time domain parameter value is the maximum value of the time domain parameter.
4. A method for controlling a CNC vertical lathe servo drive system considering adaptive time domain adjustment according to claim 1 or 2, characterized in that: In step S4, the current processing type is determined in the following manner: Among them, v n is the critical speed and v is the velocity.
5. The method for controlling a CNC vertical lathe servo drive system considering adaptive time domain adjustment according to claim 4, characterized in that: In step S4, the period is adjusted in the following manner: Among them, T is the reasonable control period updated by MPC, T 控 represents the MPC control cycle under rough machining, T max is the maximum value of the control period, T cal is the control period obtained by the algorithm, t PSO is the computational solution time of the particle swarm control algorithm, and ζ and λ are proportional coefficients.
6. A method for controlling a CNC vertical lathe servo drive system considering adaptive time domain adjustment according to claim 1 or 2, characterized in that: The control input is calculated according to the following relationship: Among them, i represents the index of the control time domain, k is the sampling time, Δu * is the control increment obtained by solving the objective function, is the control increment optimized according to the optimal parameter vector, u * is the control input, β is the optimal parameter vector, and Nc is the control time domain.
Citation Information
Patent Citations
Under-actuated surface ship trace tracking control method based on model predication control
CN108897217A
Rectangular plane processing depth identification method for numerical control milling machine
CN109426216A