Hydraulic clamping die optimization parameter control method and CIM system
Through the LightGBM decision tree model and prediction compensation mechanism, combined with the discrete PID controller algorithm, the hydraulic pressure parameters in the hydraulic clamping system are dynamically adjusted, which solves the problems of high energy consumption and unstable clamping under high-strength clamping force, and achieves accurate control of hydraulic pressure parameters and improves the stability of the production process.
Patent Information
- Application Number
- CN202411319647.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2044-09-23
AI Technical Summary
When the hydraulic clamping system maintains high-strength clamping force, the continuous operation of the oil pump leads to an increase in energy consumption, and unstable clamping affects the quality of injection molded parts. The existing technology is difficult to effectively solve this problem.
The LightGBM decision tree model is used to process the nonlinear relationship between mold weight and oil pressure, combined with the prediction compensation mechanism and the discrete PID controller algorithm, and dynamically adjust the poppet valve to achieve accurate control of oil pressure parameters.
By precisely controlling the hydraulic parameters, we can reduce fluctuations and errors in the production process, improve product stability and consistency, reduce energy consumption, improve production efficiency and reduce production interruptions and scrap rates due to hydraulic fluctuations.
Smart Images

Figure CN119200507B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of rapid mold change systems and CIM systems (computer integrated manufacturing), specifically to the technical field of hydraulic rapid mold change systems, and particularly to a hydraulic clamping die optimization parameter control method and a CIM system. Background Art
[0002] The hydraulic clamping optimization parameter control CIM system is an advanced manufacturing system that integrates computer technology, automatic control technology, and hydraulic transmission technology. The system accurately controls various parameters in the hydraulic clamping process, such as oil pressure and flow, to achieve the goal of rapid mold change and stable production of the injection molding machine. The system not only improves production efficiency, but also ensures the quality and consistency of injection molded products.
[0003] The hydraulic clamping system, as an important component of the efficient and fast mold change solution for large-scale automated injection molding machines, demonstrates its unique value and technical advantages. The system is designed to optimize the efficiency of injection molding machines in the production conversion process of diversified products. By pre-clamping the mold with hydraulic power, the time required for mold replacement is significantly shortened, thereby improving the response speed and production capacity of the entire production line.
[0004] The hydraulic clamping system not only innovates the traditional mold changing method, effectively solves the problem of mold deformation and loss caused by insufficient clamping force in the mechanical rotary pull system, but also overcomes the limitation of the magnetic suction cup system in the mold opening stroke, ensuring the accuracy and efficiency of the mold replacement process. The introduction of this technology is a vivid embodiment of the CIM system's pursuit of high automation, flexibility and production quality control concept.
[0005] However, while pursuing high efficiency, the hydraulic clamping system also faces the challenge of continuous operation of the hydraulic oil pump. Especially in situations where high-intensity clamping force needs to be maintained, the oil pump needs to provide pressure support uninterruptedly, which not only increases energy consumption, but may also affect the quality of injection molded parts due to unstable clamping. Therefore, how to optimize the energy consumption management and clamping stability of the hydraulic clamping system while maintaining the advantages of efficient mold change has become a key research direction for further integrating the intelligent control of the CIM system and improving overall production efficiency and quality. To this end, many existing technologies have attempted to improve this phenomenon, such as:
[0006] (1) Chinese utility model patent CN202020929325.9 discloses a boost cylinder with a variable boost ratio (publication date is January 8, 2021), which achieves the beneficial effect of adjusting the boost ratio; however, its step-by-step adjustment mode cannot adapt to the unstable fluctuations of the oil circuit.
[0007] (2) Chinese utility model patent CN201620188262.X discloses a pressurized self-compensating iron roughneck (published on August 31, 2016), which uses a pressurizing module to make the pressure of the clamping cylinder greater than the system pressure, thereby ensuring that during the punching process, the clamping cylinder can automatically compensate for the lost stroke and pressure and always maintain sufficient clamping force; although this mode achieves stepless adjustment, the continuous pressure is prone to fluctuations due to the instability of the oil circuit.
[0008] (3) On October 13, 2023, the applicant disclosed a Chinese invention patent for a heavy-duty clamp with a built-in booster device (grant number: CN114193706B). By adding a pressure-stabilizing device between the mold clamping device and the pneumatic oil pressure device, and using the linkage of the poppet valve and its pressure relief rod to close the oil circuit, the oil pressure in the clamping oil circuit is stabilized and not affected by the oil circuit fluctuations of the pneumatic oil pressure device, so as to provide better clamping force. However, after long-term application, the applicant found that the oil pressure of the clamping oil circuit locked by such a mode is a fixed value. When the clamped part (mold) has different weight variables, if the subjectively assigned oil pressure of the clamping oil circuit does not match it, another form of fluctuation will still occur in the clamping oil circuit; therefore, although the oil circuit fluctuations of the pneumatic oil pressure device will not affect the hydraulic quick mold change system, the hydraulic quick mold change system as a whole cannot solve this fluctuation phenomenon.
[0009] At the same time, the hydraulic clamping system is a complex dynamic system involving multiple links such as the interaction between oil circuits. These links are not simply linear relationships, but there are complex interactions and feedback mechanisms. Pure subjective control dependent variables (oil pressure in the clamping oil circuit) are often difficult to accurately correspond to the ideal dependent variables that the independent variable (mold weight) should correspond to. Subjective control is usually adjusted based on experience or preset fixed values, but this method cannot accurately reflect the actual changes within the system.
[0010] To this end, the present invention proposes a hydraulic clamping optimization parameter control method and a CIM system. Summary of the invention
[0011] In view of this, the present invention hopes to provide a hydraulic clamping optimization parameter control method and a CIM system;
[0012] First, the hydraulic clamping optimization parameter control method:
[0013] 1. Overview:
[0014] The present invention aims to solve the following technical problems: how to intelligently evaluate and predict the oil pressure of the clamping oil circuit according to the independent variable (mold weight), and then estimate the corresponding dependent variable (oil pressure of the clamping oil circuit) and perform intelligent adjustment;
[0015] The present invention chooses to use the LightGBM decision tree model to process the nonlinear relationship between the independent variable and the dependent variable, and predicts the dependent variable based on the known independent variable, and then corrects and compensates the predicted dependent variable based on the prediction compensation mechanism, and then introduces it into the PID controller algorithm to realize dynamic control of the poppet valve, so that the mold weight always corresponds to the ideal oil pressure parameters in the clamping oil circuit, thereby avoiding fluctuations.
[0016] (II) Ideas for improvement:
[0017] The poppet valve of the pressure stabilizing device is controlled based on the PLC program. Based on this hardware, the PID controller algorithm can be introduced into the pressure stabilizing device:
[0018]
[0019] Where: K p , K i and K d They are proportional gain, integral gain and differential gain in the concept of PID controller algorithm. The traditional concept of PID controller algorithm can be used for debugging and assignment. u(t) is the control electrical signal of the poppet valve. e(t) is the deviation between the set value and the actual value, that is, e(t) = r(t)-y(t), where r(t) is the set value and y(t) is the actual value. τ is an integral variable (time point) used to represent any time from the initial moment to the current moment t in the integral term.
[0020] 2.1 Discrete PID controller:
[0021] Considering that the voltage stabilization device should be a stepless adjustment mode, it is necessary to discretize the PID controller algorithm:
[0022]
[0023] Where: e(j) represents the deviation value at sampling time j. r(j) is the set value (expected value) at sampling time j, y(j) is the actual value at the same sampling time, and the deviation value e(j) is defined as e(j) = r(j) - y(j); u(k) is the control electrical signal of the poppet valve at sampling time k. e(k) is the deviation at sampling time k. e(k-1) is the deviation at sampling time k-1.
[0024] The time in the above discrete PID controller algorithm is divided into discrete sampling points instead of continuous. At these sampling points, the PLC controller is responsible for reading the actual value and calculating the deviation from the set value. Therefore, in practice, e(j) is the deviation between the set value and the actual value at a specific sampling time j. It plays a key role in the discrete PID control algorithm, helping the system adjust the output to reduce or eliminate this deviation, thereby adapting to this stepless adjustment mode of the voltage stabilization device.
[0025] 2.2 Intelligent discrete PID controller:
[0026] In order to further make the voltage stabilizing device dynamic at each sampling time k, that is, to dynamically adjust the poppet valve, a correction term that changes dynamically with the discrete step length needs to be introduced:
[0027]
[0028] Among them, α(k) is the dynamic correction factor, and it changes with the time k, so it can dynamically adjust the output u(k) of the PID controller. That is, the dynamic correction factor α(k) is actually a dynamic scaling of the output of the entire PID controller. The correction factor α(k) is updated at each sampling time k, thereby adjusting the output strength of the PID controller in real time.
[0029] This mode allows the hydraulic servo system to dynamically adjust according to the current independent variable (mold weight) and dependent variable (oil pressure in the clamping oil circuit) to optimize the control effect. For example, when the independent variable deviation is large, α(k) is increased to strengthen the control effect; conversely, α(k) can be reduced to avoid over-control.
[0030] At this point, the technical context of this solution has been made clear: how to intelligently evaluate and predict the oil pressure of the clamping oil circuit based on the independent variable (mold weight), and then estimate the corresponding dependent variable (oil pressure of the clamping oil circuit), and then dynamically assign the correction factor α(k).
[0031] (III) Technical solution:
[0032] This solution chooses to establish the LightGBM decision tree model (a variant of the gradient boosting decision tree): Compared with the traditional gradient boosting decision tree, the LightGBM decision tree model uses two new technologies of tree-based learning algorithms: single-side sampling (GOSS) and exclusive feature bundling (EFB) to reduce the number of features, thereby improving computational efficiency and training efficiency. It is preferred for the rapid production of large-scale industrial injection molding machines. In practice, for the injection molding machine and its supporting hydraulic clamping system, during the mold change process of the injection molding machine, the mold weight as the independent variable x is read in real time, and then the following steps S1 to S4 are executed.
[0033] 3.1 Step S1, read the LightGBM decision tree model:
[0034] It includes a regression model F(x) for fitting an independent variable x and a dependent variable y as the oil pressure of the clamping oil circuit, a loss function for constraining the regression model F(x), and a hyperparameter θ for gradient boosting the regression model F(x); the hyperparameter θ includes conditions for tree depth, leaf nodes, and split nodes.
[0035] The regression model F(x) fits the nonlinear relationship between the independent variable x (mold weight) and the dependent variable y (oil pressure of the clamping oil circuit), and the loss function is used to quantify the difference between the model prediction and the actual target variable. The hyperparameter θ determines the structural complexity of the decision tree in this process. It includes the following steps S100-S101.
[0036] 3.1.1 Step S100, perform gradient boosting:
[0037] A major feature of the LightGBM decision tree model is that it uses the gradient boosting method to gradually fit the regression model F(x). That is, in each step of the boosting iteration, it will build a new decision tree h m (x) is used to fit the residual error (i.e., the difference between the actual value and the current predicted value) of the current regression model F(x).
[0038] New decision tree h m Each leaf node of (x) is associated with a value; in order to facilitate subsequent iterations, the entire new decision tree h m The predicted value of (x) is regarded as the function T(x;θ) in this scheme. The new decision tree h m The predicted value of (x) is expressed as:
[0039]
[0040] Where J is the number of leaf nodes, w j is the value of the jth leaf node, R j is the feature space associated with the jth leaf node, and I(·) is the indicator function (1 if the condition holds, 0 otherwise).
[0041] Under the framework of gradient boosting, the final prediction function F of the LightGBM decision tree model m (x) is represented as the accumulation of multiple trees:
[0042]
[0043] Where M is the number of trees (i.e., the number of boosting iterations), θm is the hyperparameter of the mth tree.
[0044] 3.1.1 Step S101, establish a regression model (a prediction function F m (x)):
[0045] Prediction function F m (x) Perform regression tasks to predict the dependent variable y.
[0046] 1) First, apply the Gradient Boosted Tree (GBDT) algorithm to the regression model:
[0047]
[0048] Where: F0(x) is the initial model, which is the historical average of the independent variable x; M is the number of boosting iterations (equivalent to the number of decision trees); β m is the weight of the mth tree, which can be determined by an optimization algorithm (such as line search). m (x) is the new decision tree, which is the predicted output of the mth decision tree for the independent variable x.
[0049] 2) Then calculate the loss function: This solution chooses the mean squared error loss function (MSE); for a given independent variable x, the mean squared error loss function MSE(x) is:
[0050]
[0051] Among them, f(x i ) is the regression model F m (x) The predicted value of the ith independent variable x.
[0052] 3) Finally, use the regression model F m (x):
[0053] The new decision tree h m (x) is added to the regression model F(x) to form the prediction function F m (x), and introduce the mean square error loss function MSE(x) as a constraint to update the predicted value of the dependent variable y:
[0054]
[0055] Among them, F m-1 (x) is the cumulative prediction value of the sample by the first m-1 trees.
[0056] It should be pointed out that the above process simplifies the prediction function F m(x). Because in the actual prediction process, for a given input variable x, the LightGBM decision tree model will pass it to each tree T(x; θ m ), and calculate the corresponding output value based on the parameters of each tree (including the structure of the tree and the weight of the leaf nodes). Then, these output values are accumulated to obtain the final prediction result (i.e., F m (x), also regarded as the predicted value of the dependent variable y). Because each tree T(x; θ m ) is actually the weight of the leaf node where the input vector falls in the tree. Therefore, accumulating the output values of multiple trees is equivalent to accumulating the weights of multiple leaf nodes.
[0057] 3.2 Training LightGBM decision tree model:
[0058] Although 3.1 above builds a LightGBM decision tree model, it still needs to be trained before it can be actually deployed. The training method is as follows:
[0059] 3.2.1 The first step is to create a data set D:
[0060] Includes the values of the independent variable x and its corresponding dependent variable y in the historical data;
[0061] 3.2.2 The second step is to determine the training objective function as minimizing the error loss function MSE(D):
[0062] In each iteration, let the LightGBM decision tree model build a new decision tree h m (x), and calculate its corresponding leaf node weight w m,j Then, this new tree is added to the regression model F(x) to update the prediction function F m (x); After each iteration, the model’s predicted value is updated to the prediction function F m (x). After reaching the predetermined number of iterations, the iteration stops.
[0063] 3.2.3 The third step is to perform cross-validation training:
[0064] Repeat the following steps:
[0065] 3.2.3.1 Dataset D partitioning:
[0066] Divide the dataset D into k subsets of equal size, and then perform k training and validation. Each time, select a subset as the validation set D. val , the remaining k-1 subsets are used as training set D train .
[0067] 3.2.3.2 Using the training set Dtrain To train:
[0068] Using the training set D train Sample and training set D train Sample group, solve the content as described in 3.2.2. In each iteration, the new decision tree h m (x) is trained to fit the residual of the current model. The hyperparameter θ that minimizes the error loss function MSE(D) is considered the optimal hyperparameter for this round of training, including the conditions of tree depth, leaf nodes, and split nodes. Each new decision tree h is recorded. m (x).
[0069] 3.2.3.3 Verification Model:
[0070] Use cross validation to divide the test set D test , record the recall rate of each round of training.
[0071] 3.2.4 Step 4: Stop training:
[0072] When the preset number of training times or model fitting is reached, the iteration is stopped. Each new decision tree h is selected from all training rounds. m The optimal hyperparameter θ for (x) m .
[0073] 3.3 Step S2, perform prediction compensation:
[0074] For the currently calculated dependent variable y, the error feedback coefficient β is obtained by minimizing the residual sum of squares S through the least squares method. i , and then trace back the historical prediction errors of certain data to compensate for the prediction errors, forming the compensated dependent variable y';
[0075] Error feedback coefficient β i It can help the LightGBM decision tree model "remember" and "correct" past prediction errors, thereby improving the accuracy of the currently predicted dependent variable y.
[0076] 3.3.1 Step S200, calculate the residual sum of squares S:
[0077] Look back to the previous N historical data, including the actual value y of the dependent variable at that time i and predicted values Then the residual sum of squares S is:
[0078]
[0079] 3.3.2 Step S201, find error feedback:
[0080] Error feedback coefficient β iThis coefficient is solved by the least squares method to make the compensated forecast value closer to the actual value. First, calculate the historical forecast error ∈ i :
[0081]
[0082] Then construct a linear relationship to represent the compensated dependent variable y':
[0083]
[0084] in, is the predicted value after compensation, a i-1 is the prediction error of the previous data point. In order to solve β i , Substitute the above linear relationship into the calculation of the residual sum of squares S, and calculate β i Take the derivative and set it equal to 0 to find the β that minimizes the residual sum of squares S i value.
[0085] The smallest β i After the value is obtained, it can be used to update the dependent variable y':
[0086] y'=y+β i Δy;
[0087] Among them, Δy is the adjustment amount related to the historical prediction error. In this way, the LightGBM decision tree model is helped to "remember" and "correct" past prediction errors, thereby improving the accuracy of current predictions.
[0088] 3.4 Step S3, obtain dynamic correction factor:
[0089] Through the dependent variable y', the poppet valve is controlled based on the PID controller algorithm to adjust the target value that meets the ideal oil pressure parameters; and in order to achieve this goal, it is necessary to combine the current deviation of the dependent variable y', the accumulation of historical deviations, and the trend of deviation changes. The PID controller adjusts the control output by combining these three aspects to minimize the deviation between the dependent variable y' and the target value:
[0090]
[0091] Where: △α(k) is the dynamic correction factor at time step k; K p is the proportional gain, K i is the integral gain, K d is the differential gain, corresponding to the current deviation of the dependent variable y', the accumulation of historical deviations, and the change trend of the deviation; e(k) is the oil pressure deviation at time step k, that is, the target oil pressure P target The difference between the dependent variable y': e(k) = |Ptarget -y'|;
[0092] 3.5 Step S4, execute the discretized PID controller algorithm:
[0093] After obtaining the dynamic correction factor △α(k), the PID controller algorithm can be discretized to control the poppet valve, where the dynamic correction factor △α(k) plays a scaling function:
[0094]
[0095] Where: u(k) is the control electrical signal of the poppet valve at sampling time k. △k is the discrete time step; e(k-1) is the oil pressure deviation at the previous discrete time step k-1.
[0096] (IV) Mechanisms for resolving technical issues:
[0097] 4.1Application of LightGBM decision tree model:
[0098] The LightGBM decision tree model is used to fit the nonlinear relationship between the independent variable (mold weight) and the dependent variable (oil pressure parameter). The model is gradually optimized by the gradient boosting method, and a new decision tree is built at each step to fit the residual of the current model. The single-side sampling (GOSS) and exclusive feature bundling (EFB) techniques are used to improve the computational efficiency and training efficiency. The model is trained by cross-validation, the optimal hyperparameters are selected, and the results of each round of training are recorded.
[0099] The new decision tree is added to the regression model to form a prediction function, and the mean square error loss function is introduced as a constraint. For a given input independent variable, the LightGBM model of the present invention will calculate the corresponding prediction result.
[0100] 4.2 Prediction compensation mechanism:
[0101] The present invention can trace back historical data and calculate the residual sum of squares between the actual value and the predicted value. The error feedback coefficient is solved by the least square method to minimize the residual sum of squares. The error feedback coefficient is used to update the predicted value to form a compensated dependent variable.
[0102] 4.3 Application of PID controller algorithm:
[0103] The present invention calculates the deviation from the target value based on the compensated dependent variable, and calculates the dynamic correction factor through the PID controller algorithm in combination with the current value, historical accumulation and change trend of the deviation.
[0104] At the same time, the dynamic correction factor is discretized to obtain the control electrical signal of the poppet valve. The poppet valve is dynamically adjusted according to the control electrical signal to achieve accurate control of the oil pressure parameters.
[0105] Secondly, the hydraulic clamping optimization parameters control CIM system:
[0106] The system includes a voltage stabilizing device as disclosed in CN114193706B; and the system includes a processor and a memory connected to the processor, wherein the memory stores program instructions, and when the program instructions are executed by the processor, the processor executes the optimization parameter control method as described above, generates the control electrical signal u(k), and then hands it over to the PLC controller to control the poppet valve in the voltage stabilizing device, thereby adjusting the oil pressure of the closed oil circuit.
[0107] Compared with the prior art, the present invention has the following beneficial effects:
[0108] 1. Solve the nonlinear relationship and dynamically adjust the poppet valve: The present invention uses the LightGBM model to accurately capture the nonlinear relationship between the mold weight and the oil pressure parameters. Combined with the application of the predictive compensation mechanism and the discrete PLD controller algorithm, the system can achieve precise control of the oil pressure parameters. It helps to reduce fluctuations and errors in the production process and improve the stability and consistency of the product. At the same time, the dynamic adjustment poppet valve can adjust the oil pressure parameters in real time according to the control electrical signal to ensure that the oil pressure parameters in the production process are always kept within the optimal range, which helps to improve production efficiency and reduce production interruptions and scrap rates caused by oil pressure fluctuations.
[0109] 2. Beneficial effects of the prediction and compensation mechanism: The prediction and compensation mechanism introduced in the present invention can dynamically adjust the control strategy according to the real-time data and model prediction results to cope with the uncertainty and external interference in the system. In the oil pressure control system, the prediction and compensation mechanism can predict the changing trend of the oil pressure parameters and take corresponding compensation measures to ensure the stable control of the oil pressure parameters. At the same time, by combining the prediction results and real-time feedback data of the LightGBM model, the prediction and compensation mechanism can adjust the control parameters more accurately, thereby achieving precise control of the oil pressure parameters. It helps to improve product quality and production efficiency.
[0110] 3. Discretization of PLD controller algorithm: The present invention discretizes the traditional PLD controller algorithm, simplifies the control logic and calculation process, which not only reduces the complexity of the algorithm, but also improves the response speed and stability of the controller.
[0111] 4. LightGBM decision tree model: This invention selects the latest decision tree model, whose core adopts a histogram-based decision tree algorithm and a leaf-wise strategy, which greatly reduces the computational complexity and memory usage, making the model significantly better than traditional gradient boosting algorithms (such as XGBoost) in training speed. It makes it possible to train models on large-scale data sets and respond quickly to data changes. The histogram optimization strategy and the single-sided gradient sampling (GOSS) algorithm play a regularization role to a certain extent. By capturing subtle differences and complex patterns between features, LightGBM performs well in dealing with nonlinear relationships. In the nonlinear relationship between mold weight and oil pressure parameters, LightGBM can more accurately predict changes in oil pressure parameters, thereby improving the prediction accuracy of the overall system. BRIEF DESCRIPTION OF THE DRAWINGS
[0112] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0113] Figure 1 Schematic diagram of the process of the present invention;
[0114] Figure 2 This is a schematic diagram of the composition of an independent closed-loop subsystem according to Embodiment 6 of the present invention;
[0115] Figure 3 A schematic diagram of a training method for the LightGBM decision tree model of the present invention;
[0116] Figure 4 The comparison diagram of the test example of the present invention is shown in FIG. 1 , wherein the horizontal axis is time (unit: min) and the vertical axis is vibration intensity (unit: dmm / s 2 );
[0117] Figure 5 This is a schematic diagram of the composition of the CIM system according to the sixth embodiment of the present invention. DETAILED DESCRIPTION
[0118] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below;
[0119] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0120] Explanation of terms in this specific implementation:
[0121] (1) Number of leaf nodes J: When constructing each decision tree, the algorithm recursively divides the data space according to the characteristics of the data and the splitting conditions until the stopping condition is met (such as reaching the maximum depth). Each final node formed in the division process is a leaf node, so the number of leaf nodes J is determined in this process.
[0122] (2) The value w of the leaf node j :In each step of gradient boosting, the newly constructed decision tree will fit the residual of the current model. For each leaf node, its value w j It is calculated by minimizing a loss function that measures the difference between the predicted value at the leaf node and the actual residual.
[0123] (3) Feature space R associated with leaf nodes j : refers to the feature value range of all samples divided into the jth leaf node in the decision tree. In the process of building a decision tree, each node will be divided according to the value range of a certain feature, and this value range defines the feature space associated with the node.
[0124] (4) Hyperparameter θ: includes the tree depth, leaf nodes, and split node conditions, which together determine the structural complexity of the decision tree.
[0125] (5) Regression model F(x) and prediction function F m (x): The former establishes a nonlinear relationship between the independent variable x and the dependent variable y. It attempts to find a function form that can predict the expected value of the dependent variable y when the value of the independent variable x is given; the latter is a regression model that is "updated (optimized)" by iterating the regression model F(x) through the GBDT algorithm (gradually adding new decision trees), in which each new decision tree added is designed to fit the residual of the current model, thereby gradually approaching the true nonlinear relationship.
[0126] (6) Tree, new tree, new decision tree h m(x): It expresses different aspects of the same concept or specific instances in different iteration steps, and will be adaptively named according to the text structure of the specific implementation method. Its meaning is: during the training process (such as the solution disclosed in Example 2), each iteration will learn a new decision tree to fit the residual of the current model (for regression problems) or the misclassified samples (for classification problems). This newly learned decision tree is called h in the algorithm. m (x). Its goal is to minimize the loss function by fitting the previous step model F m-1 (x) is realized by the residual or error.
[0127] In the decision tree T(x;θ), T represents the decision tree model. Therefore, in a specific iteration step m, the newly learned decision tree h m (x) is considered as an instance of the decision tree T(x; θ). In each iteration of the gradient boosting tree, the new decision tree h m (x) is actually a specific implementation of the decision tree T(x; Θ). In other words, h m (x) is an instantiation of T(x; Θ) at a given iteration step m and a specific parameter set Θ. As the iteration steps proceed, the new decision tree h m (x) (or equivalently T(x; θ)) will continue to change to gradually approach the optimal regression or classification model. Each iteration will update the structure and parameters of the decision tree based on the residual or error of the previous step.
[0128] Embodiment 1: Figure 1 As shown, this embodiment discloses a method for controlling the optimized parameters of hydraulic clamping; the necessary hardware facilities for applying this method include a mold that needs to be changed, an injection molding machine that uses the mold to perform injection molding to produce a product, and a supporting hydraulic clamping system. The hydraulic clamping system is a hydraulic clamping system as disclosed in Chinese invention patent CN114193706B, which is equipped with a voltage stabilizing device, and the voltage stabilizing device has a poppet valve; during the process of changing the mold of the injection molding machine, the weight of the mold as an independent variable x is read in real time, and then the following steps S1 to S4 are executed.
[0129] In this embodiment, regarding step S1, the LightGBM decision tree model is read: including a regression model F(x) for fitting the independent variable x and the dependent variable y as the oil pressure of the clamping oil circuit, a loss function constraining the regression model F(x), and a hyperparameter θ for gradient boosting the regression model F(x); the hyperparameter θ includes the conditions of tree depth, leaf nodes, and split nodes. Among them:
[0130] (1) Regression model F(x): It is used to fit the nonlinear relationship between the independent variable x (mold weight) and the dependent variable y (oil pressure in the clamping oil circuit). It can predict the oil pressure parameters under a given mold weight by learning the patterns in the historical data. By learning the complex relationship between mold weight and oil pressure, the model can capture subtle changes and patterns that traditional linear models cannot capture.
[0131] (2) Loss function: The loss function is used to quantify the difference between the model prediction and the actual target variable. During the training process, it guides the model on how to adjust its parameters to reduce the prediction error. By minimizing the loss function, the model is able to obtain a better fit on the training data, thereby improving its ability to predict unknown data.
[0132] (3) Hyperparameter θ: This parameter needs to be set before model training and has a significant impact on the performance of the model. By adjusting the hyperparameter θ, the complexity of the model and the risk of overfitting can be controlled, thereby finding the best balance between prediction accuracy and generalization ability.
[0133] Specifically, step S100, performing gradient boosting: This step uses gradient boosting to gradually fit the regression model F(x) to accurately predict the nonlinear relationship between the mold weight and the oil pressure of the clamping oil circuit. This helps the subsequent intelligent control of the poppet valve to ensure that the oil pressure parameters are always kept within the optimal range.
[0134] Gradient boosting is an iterative method that builds a new decision tree at each step to fit the residual of the current regression model. The residual is the difference between the actual value and the current predicted value. By fitting the residual, the model can gradually approach the true nonlinear relationship. In each round of iteration, the new decision tree will supplement the deficiencies of the current model, thereby continuously improving the prediction accuracy of the model.
[0135] New decision tree h m Each leaf node of (x) is associated with a value; this value represents the prediction increment of the model when the input feature falls into the feature space corresponding to the leaf node. The prediction value of the entire new decision tree is regarded as a decision tree T(x; θ) in functional form in this scheme. In the framework of gradient boosting, the final prediction function F of the LightGBM decision tree model is m (x) is the accumulation of predictions from multiple trees. Each tree represents an improvement in the model in further iterations. By accumulating the predictions from multiple trees, the model is able to capture the complex nonlinear relationship between the input features and the target variable, thereby achieving accurate predictions:
[0136]
[0137] Where J is the number of leaf nodes, w jis the value of the jth leaf node, R j is the feature space associated with the jth leaf node. These three values need to be obtained through the training method disclosed in Example 2. Here, the concepts of these three values are first introduced:
[0138] Preferably, w j is the mean of all sample residuals on the leaf nodes.
[0139] Preferably, for a leaf node, its feature space R j It is the intersection of all samples that can reach the leaf in the feature space.
[0140] I(·) is the indicator function (1 if the condition is met, otherwise 0). In the framework of gradient boosting, the final prediction function F of the LightGBM decision tree model is m (x) is represented as the accumulation of multiple trees:
[0141]
[0142] Where M is the number of trees (i.e., the number of boosting iterations), θ m is the hyperparameter of the mth tree.
[0143] It is understandable that by gradually fitting the objective function through the gradient boosting method, the LightGBM decision tree model can more accurately capture the nonlinear relationship between mold weight and oil pressure, thereby improving the accuracy of the prediction. The gradient boosting method reduces the prediction error by gradually optimizing the model, which helps to avoid overfitting the model and thus enhances the generalization ability of the model. This means that the model can maintain good prediction performance even when facing unknown data.
[0144] Specifically, step S101, establish a regression model (a prediction function F m (x)): Aims to predict the nonlinear relationship between the dependent variable y (oil pressure in the clamping oil circuit) and the independent variable x (mold weight). By building an accurate regression model, the poppet valve can be intelligently controlled to ensure that the oil pressure parameters are always kept within the optimal range, thereby avoiding fluctuations in the oil circuit. The method is:
[0145] 1) First, apply the gradient boosted tree (GBDT) algorithm to the regression model: It is an iterative algorithm that optimizes the regression model by gradually adding new decision trees. Each new tree is designed to fit the residual of the current model, thereby gradually approaching the true nonlinear relationship:
[0146]
[0147] Where: F0(x) is the initial model, which is the historical average of the independent variable x; M is the number of boosting iterations (equivalent to the number of decision trees); βm is the weight of the mth tree, which can be determined by existing optimization algorithms (such as line search, cluster analysis or simulated annealing). If there is no specific weight requirement, it can also be assigned a mean value. m (x) is the new decision tree, which is the prediction output of the mth decision tree for the independent variable x. The meaning of the whole formula is to weight the prediction values of the initial model and multiple decision trees to obtain the final prediction result.
[0148] 2) Then calculate the loss function: This solution chooses the mean squared error loss function (MSE); for a given independent variable x, the mean squared error loss function MSE(x) is:
[0149]
[0150] Among them, f(x i ) is the regression model F m (x) is the predicted value of the ith independent variable x. The meaning of the whole formula is to calculate the average of the squares of the differences between the predicted values and the actual values of all samples as the loss of the model.
[0151] 3) Finally, use the regression model F m (x):
[0152] The new decision tree h m (x) is added to the regression model F(x) to form the prediction function F m (x), and introduce the mean square error loss function MSE(x) as a constraint to update the predicted value of the dependent variable y:
[0153]
[0154] Among them, F m-1 (x) is the cumulative prediction value of the first m-1 trees for the sample. The meaning of the whole formula is to add the prediction value of the new decision tree to the model under the constraint of keeping the mean square error minimum, so as to update the prediction value of the dependent variable y, which helps to avoid overfitting of the model and enhance the generalization ability of the model. This means that the model can maintain good prediction performance even when facing unknown data.
[0155] It is understandable that by gradually optimizing the regression model through the gradient boosting tree algorithm, the nonlinear relationship between mold weight and oil pressure can be captured more accurately, thereby improving the accuracy of the prediction. Accurate oil pressure prediction enables the poppet valve to adjust the oil pressure more accurately, thereby keeping the oil pressure parameters within the optimal range. This helps to reduce oil circuit fluctuations and improve the stability and efficiency of the production process. At the same time, by continuously optimizing the regression model, the accuracy and stability of oil pressure control can be further improved.
[0156] Furthermore, the Python execution program of step S1 (using the LightGBM library) is as follows:
[0157]
[0158]
[0159]
[0160]
[0161] In the above program, the TrainedLightGBM class encapsulates a trained LightGBM model and provides functions for obtaining hyperparameters, the number of trees, making predictions, and obtaining leaf node information. The hyperparameters and number of trees of the model can be obtained through the get_params and get_num_trees methods. The predict method uses the model to predict new data. The get_leaf_info method obtains the number, value, and feature space of leaf nodes.
[0162] In this embodiment, regarding step S2, prediction compensation is performed: for the currently predicted dependent variable y, the residual sum of squares S is minimized by the least squares method to obtain the error feedback coefficient β i , and then trace back the historical prediction errors of certain data to compensate for the prediction errors, forming the compensated dependent variable y';
[0163] Error feedback coefficient β i It can help the LightGBM decision tree model "remember" and "correct" past prediction errors, thereby improving the accuracy of the currently predicted dependent variable y.
[0164] Specifically, step S200 calculates the residual sum of squares S: look back at the previous N historical data, including the actual value y of the dependent variable at that time i and predicted values Then the residual sum of squares S is:
[0165]
[0166] Specifically, in step S201, find the error feedback: the error feedback coefficient β i This coefficient is solved by the least squares method to make the compensated forecast value closer to the actual value. First, calculate the historical forecast error ∈ i :
[0167]
[0168] Then construct a linear relationship to represent the compensated dependent variable y':
[0169]
[0170] in, is the predicted value after compensation, a i-1 is the prediction error of the previous data point. In order to solve β i , substitute the above linear relationship into the calculation of the residual sum of squares S:
[0171]
[0172] In order to find β that minimizes S i , derive S with respect to β, and set the derivative equal to 0. That is:
[0173]
[0174] Taking the derivative of S, we get:
[0175]
[0176] Let the above formula be equal to 0 and solve for β i :
[0177]
[0178] The smallest β i After the value is obtained, it can be used to update the dependent variable y':
[0179] y'=y+β i Δy;
[0180] Among them, Δy is the adjustment amount related to the historical prediction error, which is a pre-set fixed scalar. In this way, the LightGBM decision tree model is helped to "remember" and "correct" past prediction errors, thereby improving the accuracy of the current prediction.
[0181] Furthermore, the Python execution program of step S2 is as follows:
[0182] import numpy as np
[0183] #y_actual and y_pred are the calculated actual and predicted value arrays
[0184] y_actual = np.array([...]) #actual value array
[0185] y_pred = np.array([...]) #prediction value array
[0186] # Calculate residual
[0187] residuals = y_actual - y_pred
[0188] #Calculate the prediction error a_i-1 of the previous data point
[0189] a_prev = residuals[:-1] # Remove the last element because the last data point has no "previous" data point
[0190] #Construct the design matrix X and response vector Y for least squares solution
[0191] X = np.vstack([a_prev]).T # Convert a_prev to a design matrix in column vector form
[0192] Y = residuals[1:] # Remove the first residual because the first data point does not have the "previous" prediction error to compensate
[0193] #Use the least squares method to solve the error feedback coefficient beta
[0194] beta=np.linalg.lstsq(X,Y,rcond=None)[0]
[0195] #Use beta to update the predicted value to form the compensated predicted value y'
[0196] y_pred_compensated = y_pred[:-1] + beta*a_prev # Note that the length of y_pred_compensated will be 1 less than y_pred
[0197] #If you need to compensate all predicted values, you can consider processing the last predicted value separately
[0198] In the above program, the residuals between the actual value and the predicted value are first calculated, that is, residuals = y_actual-y_pred. In order to use the least squares method to solve the error feedback coefficient β, it is necessary to construct the design matrix X and the response vector Y. The design matrix X is a column vector consisting of the prediction error of the previous data point, and the response vector Y is a vector consisting of the residuals with the first element removed. Use the np.linalg.lstsq function to solve the least squares problem and obtain the error feedback coefficient β. Use the obtained β to update the predicted value to form the compensated predicted value y_pred_compensated. Note that since the first residual and the last predicted value are removed (because it does not have the "previous" prediction error to compensate), the length of y_pred_compensated will be 1 less than y_pred.
[0199] In this embodiment, regarding step S3, the dynamic correction factor is obtained: the poppet valve is controlled based on the PID controller algorithm through the dependent variable y' to adjust the target value that meets the ideal oil pressure parameter; and in order to achieve this goal, the current deviation of the dependent variable y', the accumulation of historical deviations, and the change trend of the deviation need to be combined. The PID controller adjusts the control output by combining these three aspects to minimize the deviation of the dependent variable y' from the target value:
[0200]
[0201] Where: △α(k) is the dynamic correction factor at time step k; e(k) is the oil pressure deviation at time step k, that is, the target oil pressure P target The difference between the dependent variable y': e(k) = |P target -y'|;τ is an integral variable. K p is the proportional gain, K i is the integral gain, K d is the differential gain, which corresponds to the current deviation of the dependent variable y', the accumulation of historical deviations, and the changing trend of the deviation. The principle is:
[0202] (1) Proportional gain K p : Directly reflects the impact of the current deviation e(t) (i.e., the difference between the target value and the actual value) on the controller output. When a deviation occurs, proportional control immediately generates a control signal proportional to the deviation to reduce the deviation. The characteristic of proportional control is that it responds quickly to deviations, but excessive proportional gain may cause system overshoot or even oscillation.
[0203] (2) Integral gain K i : Accumulate all deviations of the system from the initial moment to the current moment, with the purpose of eliminating the static error (that is, the deviation that still exists after the system enters the steady state). Through the integral action, even if the deviation is very small, as long as it persists, the integral term will gradually increase until sufficient control signal is output to eliminate the deviation.
[0204] (3) Differential gain K d : It reflects the impact of the change rate of the deviation signal de(k) / dk on the controller output, which is equivalent to the differential control being able to foresee the future change trend of the deviation, so as to make adjustments before the deviation actually occurs, reducing overshoot and oscillation.
[0205] In this embodiment, regarding step S4, a discretized PID controller algorithm is executed: after the dynamic correction factor △α(k) is obtained, the PID controller algorithm can be discretized to control the poppet valve, wherein the dynamic correction factor △α(k) plays a scaling function:
[0206]
[0207] Where: u(k) is the control electrical signal of the poppet valve at sampling time k. △k is the discrete time step; e(k-1) is the oil pressure deviation at the previous discrete time step k-1.
[0208] Specifically, the logic of the discretized PID controller algorithm is:
[0209] 1) At each sampling time k, calculate the current oil pressure deviation e(k).
[0210] 2) Use a dynamic correction factor △α(k) to scale the output of the PID controller.
[0211] 3) Calculate the proportional term K p e(k), which reflects the impact of the current deviation on the controller output.
[0212] 4) Calculate the integral term All deviations from the initial moment to the current moment are accumulated to eliminate static deviations.
[0213] 5) Calculate the differential term It reflects the changing trend of the deviation and is used to predict future deviations and make early adjustments.
[0214] 6) Add the proportional term, integral term and differential term to get the output of the PID controller, and multiply it by the dynamic correction factor △α(k) to get the final control electrical signal u(k).
[0215] 7) Apply the control electrical signal u(k) to the poppet valve to adjust its opening, thereby controlling the oil pressure parameters.
[0216] Furthermore, the Python execution program of steps S3 to S4 is as follows:
[0217]
[0218]
[0219]
[0220] In the above program, the control electric signal u(k) of the poppet valve is calculated using the discrete PID controller algorithm. The control electric signal u(k) is transmitted to the PLC controller through serial communication. After receiving the control signal, the PLC controller controls the poppet valve to adjust the oil pressure parameters of the hydraulic clamp. Step S3 calculates the dynamic scaling factor for adjusting the output of the PID controller. Step S4 executes the discrete PID controller algorithm, calculates the control electric signal of the poppet valve, and transmits it to the PLC controller. The PLC controller controls the poppet valve according to the received control signal to achieve precise control and optimal adjustment of the hydraulic clamp oil pressure parameters.
[0221] It can be understood that the control electrical signal u(k) can be calculated more accurately through the discretization PID controller algorithm, making the adjustment of the poppet valve more accurate. It helps to control the oil pressure parameters near the target value and improve the control accuracy. The integral term can eliminate static deviations and improve the steady-state accuracy of the system. The differential term can predict future deviations and make advance adjustments to reduce overshoot and oscillation of the system. It makes the system more stable when facing external interference or parameter changes. The introduction of the dynamic correction factor △α(k) enables the PID controller to adapt to different mold weights and process requirements. By adjusting the dynamic correction factor, accurate control of oil pressure parameters under different mold weights can be achieved.
[0222] It should be pointed out that the calculation of the dynamic scaling factor △α(k) in step S3 is to adjust the output of the PID controller according to the real-time state of the system or external conditions to adapt to different control requirements or optimize the control effect. The purpose of the dynamic scaling factor is to use the proportional gain, integral gain and differential gain of the PID controller, and then scale the output to adjust the intensity or direction of the control signal to better meet the control target. The purpose of executing the discretized PID controller algorithm in step S4 is to calculate the control electrical signal u(k) according to the current deviation signal e(k) and the system state to adjust the opening of the poppet valve, thereby controlling the oil pressure parameters. The dynamic scaling factor △α(k) is used as a scaling factor for the output of the PID controller at this time, that is, the PID controller first calculates the unscaled control signal according to the deviation signal and the system parameters, and then obtains the final control electrical signal u(k) by multiplying it by the dynamic scaling factor. The specific assignment strategy of the proportional gain, integral gain and differential gain can be obtained by step-by-step actual debugging using traditional debugging techniques.
[0223] Example 2: Although Example 1 discloses the LightGBM decision tree model, the LightGBM decision tree model still needs to be trained before it can be deployed. Therefore, this example discloses the LightGBM decision tree model training method as described in Example 1, which includes the following four steps: Figure 3 As shown:
[0224] In this embodiment, the first step of the training method is to establish a data set D:
[0225] Including the values of the independent variable x and its corresponding dependent variable y in the historical data, which are:
[0226] D=[(x1,y1),(x2,y2),...,(x n ,y n )];
[0227] Among them, (x i ,y i ) is the i-th historical sample, and n is its number;
[0228] In this embodiment, regarding the second step of the training method, the training objective function is determined to minimize the error loss function MSE(D):
[0229]
[0230] in, Yes i The predicted value of .
[0231] In each iteration, let the LightGBM decision tree model build a new decision tree h m (x), and calculate its corresponding leaf node weight w m,j , that is, the value w as described in step S100 is obtained j , and then we can find the corresponding feature space R m,j , that is, the feature space R described in step S100 is obtained j :
[0232]
[0233] Among them, I j Dt+1 is the index set of all training samples on leaf node j (the total number is J). i is the target value of the current sample i (the target value of sample i in the t+1th iteration). j ∣ is the number of samples on leaf node j. Because the leaf node weight w m,j It is set to minimize the mean square error (MSE). Therefore, for regression tasks, the weight of a leaf node represents the average or weighted average of the target values of all training samples on the node.
[0234] Then, this new tree is added to the regression model F(x) to update the prediction function F m (x):
[0235] F m (x) = Fm-1 (x)+β m h m (x);
[0236] After each iteration, the model's predicted value is updated to the prediction function F m (x). After reaching the predetermined number of iterations, the iteration stops.
[0237] It is understandable that by minimizing the MSE loss function, the model can gradually reduce the difference between the predicted value and the actual value, thereby improving the accuracy of the prediction. Moreover, the leaf node weight represents the average or weighted average of the target values of all training samples on the node, which is the model's predicted value for the sample on the node. Then, each iteration will build a new decision tree and update the prediction function, so that the model can gradually approach the optimal solution.
[0238] Therefore, by minimizing the MSE loss function for training, the LightGBM decision tree model can more accurately predict the oil pressure of the clamping oil circuit. At the same time, the iterative update process enables the model to be gradually optimized, thereby improving the stability and reliability of the model. Moreover, an accurate prediction model can ensure that the poppet valve is intelligently controlled so that the oil pressure of the clamping oil circuit is always kept within the optimal range, thereby avoiding fluctuations in the oil circuit and improving the stability and efficiency of the production process.
[0239] In this embodiment, regarding the third step of the training method, cross-validation training is performed:
[0240] Repeat the following steps:
[0241] (1) Dataset D partitioning:
[0242] Divide the dataset D into k subsets of equal size, and then perform k training and validation. Each time, select a subset as the validation set D. val , the remaining k-1 subsets are used as training set D train This process is repeated k times, and each subset is used as a validation set D val The performance of the model is the average of k validation results.
[0243] (2) Using training set D train To train:
[0244] (2.1) Using the gradient-based single-side sampling (GOSS) technique:
[0245] First, according to the training set D train The absolute value of the gradient of the samples is used to sort them. Then the first a% of the training set D is retained. train samples, and from the remaining training set D trainFinally, these two parts of the training set D train Samples are merged for training. When calculating information gain, the weights of the sampled samples are adjusted to compensate for the deviation caused by sampling.
[0246] (2.2) Using Exclusive Feature Bundling (EFB) technology:
[0247] In EFB, we first construct a graph in which each node represents a training set D. train Samples, each edge connects mutually exclusive training sets D train Then use the greedy algorithm to find the training set D that can be bundled together train Finally, these training sets D train The sample group is regarded as a new feature for training the LightGBM decision tree model.
[0248] (2.3) Solve the training objective function:
[0249] Using the training set D train Sample and training set D train Sample group, solve the content as described in 3.2.2. In each iteration, the new decision tree h m (x) is trained to fit the residual of the current model:
[0250] r mI =y I -F m-1 (x i );
[0251] Where: I is the training set D train Any sample in . mI is the residual of the I-th sample at the m-th iteration; y I is the true dependent variable value of the Ith sample; F m-1 (x i ) is the cumulative prediction value of the first m-1 trees for the i-th dependent variable x in the I-th sample.
[0252] The hyperparameter θ that minimizes the error loss function MSE(D) is considered the optimal hyperparameter for this round of training, including the conditions of tree depth, leaf nodes, and split nodes. And record each new decision tree h m (x).
[0253] (3) Verification model:
[0254] Use cross validation to divide the test set D test , record the recall rate of each round of training.
[0255] It is understandable that through cross-validation training, the model can be trained and validated on different subsets, thereby improving its generalization ability. The prediction accuracy of the model can be further improved by optimizing the hyperparameters by minimizing the error loss function MSE(D). The use of GOSS technology and EFB method can reduce the number of training samples and the number of features, thereby improving the training efficiency of the model. Through the above training steps, the LightGBM decision tree model can more accurately predict the oil pressure parameters of the clamping oil circuit, providing strong support for the intelligent control of the poppet valve.
[0256] In this embodiment, regarding the fourth step of the training method, the training is stopped:
[0257] When the preset number of training times or model fitting is reached, the iteration is stopped. Each new decision tree h is selected from all training rounds. m The optimal hyperparameter θ for (x) m .
[0258] Specifically, in this embodiment, the Python execution program of the above training method is as follows:
[0259]
[0260]
[0261]
[0262]
[0263] leaf_info=trained_model.get_leaf_info(0)
[0264] In the above program, the dataset, number of iterations, learning rate, number of leaf nodes, maximum depth, feature sampling ratio, data sampling ratio, and L1 and L2 regularization coefficients are received as parameters.
[0265] Use KFold for cross validation in the _train method. For each round of cross validation, create a LightGBM dataset, set parameters, and train the model. Save the optimal number of iterations and the corresponding model.
[0266] After training, the tree information, leaf node weights, and feature space are obtained from the trained model and saved in the class attributes. The predict method uses the trained LightGBM model and the optimal number of iterations for prediction. The get_leaf_info method provides the leaf node information of the specified tree, including left and right child nodes, leaf node values, split features, split gains, and split thresholds.
[0267] The trained LightGBM model is encapsulated in the TrainedLightGBM class and called by the program in Example 1.
[0268] It should be noted that in the initialization method of the TrainedLightGBM class, hyperparameters (such as tree depth max_depth, number of leaf nodes num_leaves, learning rate learning_rate) are set as class attributes. These hyperparameters are used to configure the LightGBM model in the subsequent training process.
[0269] It should be noted that the number of trees is controlled by the number of iterations num_iterations, which determines how many trees to train. During the training process, the corresponding number of decision trees will be generated according to the number of iterations.
[0270] It should be pointed out that after the LightGBM model training is completed, all decision tree information of the model can be obtained by calling the dump_model() method. m,j It is extracted from the leaf_value attribute of each tree.
[0271] It should be pointed out that the feature space R m,j It is defined by the split feature split_feature and split threshold threshold of each tree. This information is used to determine the feature space area corresponding to each leaf node.
[0272] It should be noted that using the trained LightGBM model, you can call the predict() method for prediction. When predicting, the corresponding number of trees will be used for prediction according to the optimal number of iterations best_iteration.
[0273] It should be noted that the get_leaf_info() method provides the function of obtaining the leaf node information of the specified tree. It returns the leaf node information including left and right child nodes, leaf node value, split feature, split gain and split threshold.
[0274] Embodiment 3: Based on step S101 of embodiment 1, this embodiment further provides two methods to improve the regression model F. m (x) Computational efficiency technology - introducing single-side sampling (GOSS) and exclusive feature bundling (EFB) technology:
[0275] In this embodiment, the implementation method of the GOSS technology is:
[0276] for Do the following:
[0277] S1010, calculate gradient: calculate the gradient of its loss function.
[0278] S1011, divide samples: divide the samples of the independent variable x into a large gradient set and a small gradient set according to the absolute value of the gradient.
[0279] S1012, random sampling: randomly sample a portion of samples from the small gradient set and merge them with the large gradient set.
[0280] S1013, construct a decision tree: construct a decision tree using the merged sample set.
[0281] It improves the regression model F m (x) The mechanism of computational efficiency is that GOSS reduces the amount of computation while maintaining the accuracy of the model by retaining all samples with larger gradients and randomly sampling samples with smaller gradients, because samples with larger gradients contribute more to information gain.
[0282] In this embodiment, the implementation method of the EFB technology is:
[0283] for Do the following:
[0284] S1014, feature analysis: analyzing the frequency of occurrence of each feature in the large gradient set.
[0285] S1015, feature bundling: according to the frequency of occurrence of the features, multiple features in the large gradient set are bundled into a new feature (this can be achieved by transforming or encoding the original features).
[0286] S1016, update the large gradient set and build a decision tree.
[0287] It improves the regression model F m (x) The mechanism of computational efficiency is that EFB improves computational efficiency by reducing the number of features. It uses the mutual exclusivity between features (i.e., features are rarely non-zero at the same time, as reflected by the frequency of occurrence) to bundle multiple features into one feature, thereby reducing the complexity of the model.
[0288] Preferably, in order to prevent overfitting and improve the regression model F m To improve the generalization ability of (x), feature subsampling technology is introduced.
[0289] Embodiment 4: In step S201 of embodiment 1, the minimum β is obtained. i After the value is obtained, it can be used to update the dependent variable y': y' = y + β iΔy; Δy is an adjustment value related to the historical prediction error, and is a preset fixed scalar. However, this rigid assignment method may not be ideally robust in a dynamic environment, so this embodiment further discloses a method for dynamically assigning a value to the adjustment value Δy:
[0290] P1. Initialize Δy to a preset initial value, such as 1.0, and set a smoothing coefficient δ, whose value is between 0 and 1, to control the decay speed of historical information.
[0291] P2. For each new forecast error, use exponential smoothing to update the value of Δy:
[0292] Δy new =δ*|error|+(1-δ)*Δy old ;
[0293] Among them, Δy new is the updated Δy value, |error| is the absolute value of the current prediction error, Δy old is the Δy value before updating.
[0294] P3. Repeat P2 so that Δy is updated every time there is a new prediction error.
[0295] This method combines the absolute value of the current forecast error and the smoothing coefficient δ, as well as the value of the previous Δy, to calculate the new Δy value. Every time there is a new forecast error, we will update Δy based on the absolute value of the error and the smoothing coefficient δ. In this way, Δy will gradually adapt to the changing trend of historical forecast errors, thereby improving the adaptability of the model and the accuracy of forecasts.
[0296] The Python execution program of the assignment method of this embodiment is as follows:
[0297] import numpy as np
[0298] #Read a series of historical forecast errors
[0299] prediction_errors = np.array([...]) # historical prediction error array
[0300] # Initialize Δy and smoothing coefficient alpha
[0301] delta_y=1.0#initial value, can be adjusted according to actual situation
[0302] alpha=0.1#smoothing coefficient, used to control the decay speed of historical information
[0303] #Dynamically update Δy
[0304] for error in prediction_errors:
[0305] delta_y=alpha*np.abs(error)+(1-alpha)*delta_y
[0306] Embodiment 5: In Embodiment 1, the main function of the correction factor △α(k) is to control the degree of scaling, and the solution adopted in Embodiment 1 is to output a fixed constant as the value of the correction factor △α(k). This method is simple to implement, but lacks flexibility and objectivity when facing different problems. To this end, this embodiment further provides a preferred solution, which is to borrow the concept of entropy weight method.
[0307] The so-called entropy weight method is a multi-index evaluation method based on information entropy. The traditional entropy weight method is not suitable for assigning correction factors △α(k) due to its algorithm characteristics, but a similar entropy weight method concept can be implemented based on historical degree differences, that is, dynamically adjusting the correction factor △α(k) value, so that the assignment of correction factor △α(k) is more reasonable and effective. It includes the following steps:
[0308] P1. Calculate fitness entropy: First, calculate the historical correction factor set P (P = [△α(k)1,△α(k)2,...,△α(k) N , where N is the amount of data in the historical correction factor set P) for each individual x i The fitness value of the historical correction factor set P is calculated based on the fitness entropy. The fitness entropy reflects the discrete degree of individual fitness in the historical correction factor set P. For example, if there are N individuals in the historical correction factor set P, the i-th individual x i The fitness value is f i (i=1,2,...,N), then the fitness entropy E is expressed as:
[0309] in, is the ratio of the fitness value of individual i to the total fitness value of the population, k is a constant (k = 1 / N); f j is the fitness value of the jth individual.
[0310] P2. Determine the value range of the correction factor △α(k): According to the size of the fitness entropy E, dynamically adjust the value range of the correction factor △α(k). When the fitness entropy E is large, it means that the fitness differences of individuals in the population are large. At this time, the value range of F can be increased to expand the search space; when the fitness entropy E is small, it means that the fitness differences of individuals in the population are small. At this time, the value range of F can be reduced to conduct a more detailed search. Then, the value range of the correction factor △α(k) can be dynamically adjusted according to the size of the fitness entropy E.
[0311] For example, a base value F is set base and an adjustment coefficient α, so that: F = F base +α(EE min )
[0312] Among them, E min is the minimum possible value of fitness entropy (obtained when all individuals have the same fitness), and α is a positive number used to control the sensitivity of the correction factor △α(k) to changes in E.
[0313] It can be understood that the entropy weight method can dynamically adjust the value of the correction factor △α(k) according to the fitness differences of individuals in the population. This is equivalent to the correction factor △α(k) automatically adapting to the search state of the current population at different stages of the algorithm, thereby guiding the search process more effectively. By adjusting the correction factor △α(k) through the entropy weight method, a better balance can be achieved between global search and local search. When the historical correction factor set P shows a high diversity in history, it indicates that the uncertainty of the actual environment is high, and there may be unfavorable factors affecting the decision tree. Increasing the F value can expand the search range and enhance the global search capability; when the diversity is low, it indicates that the uncertainty of the actual environment is low and tends to be stable. Reducing the F value can perform more detailed local searches and improve search accuracy. Moreover, the entropy weight method used in this scheme dynamically adjusts △α(k) according to the fitness entropy, which can make the algorithm more efficient in the search process. Fitness entropy reflects the discrete degree of each individual's fitness. By adjusting △α(k) through this indicator, more targeted searches can be carried out to reduce invalid searches and repeated searches. At the same time, using the entropy weight method to assign △α(k) can enhance the adaptability and robustness of the algorithm to different problems. Because the entropy weight method is an evaluation method based on information entropy, it can dynamically adjust △α(k) according to the specific characteristics of the problem, so that the algorithm can show better performance when facing different optimization problems.
[0314] Embodiment 6: This embodiment discloses a hydraulic clamping optimized parameter control CIM system: through integrated processor technology, intelligent program instructions and efficient PLC (programmable logic controller) control, precise regulation of the oil pressure in the hydraulic clamping system is achieved, further improving the mold changing efficiency and injection molding quality of the injection molding machine.
[0315] (I) System architecture: Figure 5 As shown in the figure, the core components of the CIM system include a high-performance processor, a memory connected to it, and a program instruction set. The program instructions stored in the memory can intelligently calculate the optimal control electrical signal u(k) when the processor executes it. This signal is then transmitted to the PLC controller as the instruction core, instructing the PLC how to accurately control the poppet valves of each pressure stabilizing device in the hydraulic clamping system.
[0316] (II) Voltage stabilization device and PLC control: In the system, each independent closed-loop subsystem (such as Figure 2 The PLC controller, as the command center of the system, can receive the control signal of the processor in real time and accurately regulate the pressure stabilizing device in each independent closed-loop subsystem accordingly. By controlling the opening and closing of the poppet valve, the PLC realizes the flexible regulation of the oil pressure of N closed oil circuits, thereby meeting the clamping force requirements of the hydraulic clamp under different working conditions.
[0317] Specifically, in the hydraulic clamping die optimization parameter control CIM system, the independent closed-loop subsystem is an important component, and each subsystem includes:
[0318] (1) Each subsystem is a relatively independent control unit that can independently complete specific tasks, such as controlling a single pressure stabilizing device, monitoring and regulating oil pressure, etc. This independence makes the system highly reliable and fault-tolerant.
[0319] (2) Each subsystem adopts a closed-loop control strategy to monitor and adjust the system status through a real-time feedback mechanism. This control method can ensure that the system can maintain a stable working state when it is subject to external interference or internal changes, and improve the control accuracy and response speed of the system.
[0320] Test example:
[0321] 1. Overview
[0322] This example aims to explore the application effect of the optimized parameter control method in the hydraulic quick mold change system, especially its effect on the vibration intensity of the clamping oil circuit. The experiment uses a PT-2500DM injection molding machine and its 400T hydraulic quick mold change system to compare the vibration performance of the experimental group (using the optimized parameter control method) and the control group (using manual adjustment) under specific working conditions.
[0323] (II) Experimental equipment and materials:
[0324] 2.1 Experimental group and control group shared equipment:
[0325] FA-450 two-platen large injection molding machine;
[0326] QMCS-400T hydraulic quick mold change system (provided by Suzhou Jinghou Intelligent Equipment Co., Ltd.), the main parameters are shown in Table 1.
[0327]
[0328] Table 1. Main parameters of QMCS-400T hydraulic quick mold change system.
[0329] Mould and material: JS008 standard bus plastic seat mould, injection moulding material is PE.
[0330] Vibration detection: iSensor three-axis vibration intelligent sensor and its supporting software.
[0331] 2.2 Experimental group-specific equipment:
[0332] It includes a KF32A150MQV MCU processor and a P41 / solidigm P44 memory connected thereto. The memory stores program instructions. When the program instructions are executed by the processor, the processor executes the optimization parameter control method described in embodiments 1 to 4. After generating the control electrical signal u(k), it is handed over to the Siemens S7-1200 PLC controller to control the poppet valve in the voltage stabilizing device, thereby adjusting the oil pressure of the closed oil circuit. The main implementation parameters are as follows:
[0333] 1) The pressure increase ratio of the pneumatic pump on the pump station is 1:50, and the oil output is greater than 2.4L / min;
[0334] 2) The operating noise of the pneumatic booster pump shall not exceed 80 decibels;
[0335] 3) Maximum oil circuit pressure resistance: 39.2MPa (400kgf / cm2);
[0336] 4) Maximum air supply pressure: 0.58MPa (6kgf / cm2);
[0337] 5) Normal operating pressure: 250kgf / cm2--280kgf / cm2;
[0338] 6) Gas supply pressure range: 0.4~0.6MPa (4~6kgf / cm2);
[0339] 7) Operating temperature range: -10~70℃;
[0340] 8) Solenoid valve operating voltage: DC24V;
[0341] 9) Use 32# or 46# anti-wear high-pressure hydraulic oil;
[0342] 10) The control valves of the circuits are all leak-free hydraulic reversing valves controlled by single electromagnetic pneumatic reversing valves;
[0343] 11) The pump has an automatic pressure replenishment function. When the system oil pressure is lower than the set pressure (190Kgf / cm2), the system will automatically replenish the pressure;
[0344] 12) Each hydraulic circuit has a pressure detection function. When any circuit is lower than the safety pressure of 190Kgf, it will stop immediately.
[0345] (III) Experimental methods:
[0346] The experimental group used the processor to execute the optimized parameter control program in the memory to generate the control electrical signal u(k). The PLC controller adjusted the opening and closing degree of the poppet valve in the hydraulic quick mold change system, thereby controlling the oil pressure in the closed oil circuit.
[0347] The control group relied on manual adjustment of the opening and closing degree of the poppet valve.
[0348] The total duration of the experiment for both the experimental group and the control group was 9.4 minutes, divided into five stages:
[0349] 1) Shutdown (0th minute to 2nd minute);
[0350] 2) Start the hydraulic quick mold change system (2nd minute to 4th minute);
[0351] 3) Start the poppet valve to start supplying oil (4th minute to 6th minute);
[0352] 4) Clamping the mold (6th minute to 8th minute);
[0353] 5) Control the oil pressure to change the mold (8th minute to 9.4th minute);
[0354] The iSensor triaxial vibration intelligent sensor recorded and plotted the vibration of the clamping oil circuit of the two sets of experiments.
[0355] (IV) Experimental results and analysis:
[0356] According to the iSensor three-axis vibration intelligent sensor Figure 4 , where line 1 is the experimental group and line 2 is the control group:
[0357] 1) Minute 0-minute 2: There is no vibration in the clamping oil circuit of the experimental group and the control group because the hydraulic quick mold change system is in standby mode.
[0358] 2) Minute 2 to Minute 4: The experimental group and the control group experienced basically the same slight vibration, which was presumably caused by the start-up of the hydraulic quick mold change system and the vibration transmission caused by the operation of other mechanisms.
[0359] 3) Minute 4-6: The poppet valves of the experimental and control groups began to work, and their vibrations began to increase, but the extents were basically the same;
[0360] 4) Minute 6-8: The control group broke through the preset threshold (150 dmm / s) at around minute 6.5 2), peak value up to 350dmm / s 2 , showing the risk of damage to the pipelines clamping the oil circuit;
[0361] However, the vibration of the experimental group was always below the threshold and decreased in a step-like manner over time, which was presumably attributed to the control period of the optimized parameter control method or the sampling period of the PLC controller.
[0362] 5) Minute 8 to minute 9.4: The vibration of both groups gradually decreased to 50 dmm / s 2 , but the experimental group performed more stably.
[0363] (V) Conclusion:
[0364] This example shows that the experimental group using the optimized parameter control method described in Examples 1 to 4 showed significant advantages in controlling the vibration of the clamping oil circuit of the hydraulic quick mold change system, effectively reducing the vibration intensity and keeping it below the safety threshold, and having higher stability and efficiency than the manual adjustment method. This method is expected to reduce mechanical wear, extend the service life of equipment, and improve production efficiency in practical applications.
[0365] The above specific embodiments only express the embodiments of the relevant practical applications of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A method for controlling optimized parameters of hydraulic clamping, comprising an injection molding machine and a supporting hydraulic clamping system, wherein during the mold changing process of the injection molding machine, the mold weight as an independent variable x is read in real time, and the method is characterized in that: During the mold change process, the hydraulic clamping system performs the following steps: S1, read the LightGBM decision tree model: including a regression model F(x) for fitting the independent variable x and the dependent variable y as the oil pressure of the clamping oil circuit, a hyperparameter θ for gradient boosting the regression model F(x), and a loss function for constraining the regression model F(x); S2, perform prediction compensation: minimize the residual square sum S of the dependent variable y by the least squares method to obtain the error feedback coefficient β i , and then look back on the historical forecast errors to compensate for the forecast errors, forming the compensated dependent variable y'; S3, combining the current deviation of the dependent variable y', the accumulation of historical deviations and the variation trend of the deviations, to obtain a dynamic correction factor △α(k); S4, based on the dynamic correction factor △α(k), a discrete PID controller algorithm is applied to obtain the control electrical signal u(k) of the poppet valve in the hydraulic clamping system at the sampling time k, and then the poppet valve is controlled.
2. The optimization parameter control method according to claim 1, characterized in that: In S1, the gradient boosting method is: Where J is the number of leaf nodes, w j is the value of the jth leaf node, R j is the feature space associated with the jth leaf node, I(·) is the indicator function; the function T(x; θ) is the new decision tree h m (x), the new decision tree h m (x) is the residual used to fit the regression model F(x); In S1, the prediction function F used by the regression model F(x) m (x) represents the accumulation of multiple trees: Where M is the number of trees, θ m is the hyperparameter of the mth tree.
3. The optimization parameter control method according to claim 2, characterized in that: In S1, the prediction function F m (x) Perform the regression task to predict the dependent variable y, the method is: Among them, F m-1 (x) is the cumulative prediction value of the sample by the first m-1 trees; MSE(x) is the loss function, which is the mean square error loss function; β m is the weight of the mth tree.
4. The optimization parameter control method according to any one of claims 1 to 3, characterized in that: The training method of the LightGBM decision tree model described in S1 is: The first step is to establish a data set D: including the value of the independent variable x and the corresponding dependent variable y in the historical data; The second step is to determine the training objective function as minimizing the error loss function MSE (D); The third step is to perform cross-validation training and solve the training objective function; Step 4: Stop training: When the preset number of training times or model fitting is reached, stop iteration; and select the optimal hyperparameter θ from all training rounds.
5. The optimization parameter control method according to claim 4, characterized in that: In the third step, when solving the training objective function, a gradient-based single-side sampling technique is introduced to train the training set D train The samples are sorted and the weights of the sampled samples are adjusted when calculating the information gain to compensate for the deviation caused by sampling; At the same time, an exclusive feature bundling technique is introduced to obtain the bundled training set D train The sample group was trained with the LightGBM decision tree model as described in S1.
6. The optimization parameter control method according to any one of claims 1 to 3, characterized in that: In S2, the residual sum of squares S is calculated as follows: Look back to the previous N historical data, including the actual value y of the dependent variable at that time i and predicted values The calculation method of the historical forecast error is: Among them, ∈ i is the historical forecast error.
7. The optimization parameter control method according to claim 6, characterized in that: In S2, the method for updating the dependent variable y' is: Construct a linear relationship to represent the compensated dependent variable y': in, is the predicted value after compensation, a i-1 is the prediction error of the previous data point; Substitute the linear relationship into the calculation of the residual sum of squares S, take its derivative and set the derivative equal to 0 to find the error feedback coefficient β that minimizes the residual sum of squares S i value, and obtain the dependent variable y': y'=y+β i Δy; Here, Δy is the adjustment associated with the historical forecast error.
8. The optimization parameter control method according to any one of claims 1 to 3, characterized in that: In S3, the method for obtaining the dynamic correction factor Δα(k) is: Where: △α(k) is the dynamic correction factor at time step k; K p is the proportional gain, K i is the integral gain, K d is the differential gain, corresponding to the current deviation of the dependent variable y', the accumulation of the historical deviation and the change trend of the deviation respectively; e(k) is the oil pressure deviation at time step k; τ is an integral variable.
9. The optimization parameter control method according to claim 8, characterized in that: In S4, the method for acquiring the control electrical signal u(k) is: Where △k is the discrete time step; e(k-1) is the oil pressure deviation at the previous discrete time step k-1.
10. Hydraulic clamping optimized parameter control CIM system, including a voltage stabilizing device, characterized in that: The system includes a processor and a memory connected to the processor, wherein program instructions are stored in the memory. When the program instructions are executed by the processor, the processor executes the optimization parameter control method as described in any one of claims 1 to 9, and after generating the control electrical signal u(k), the control signal is handed over to the PLC controller to control the poppet valve to adjust the oil pressure of the closed oil circuit.
Citation Information
Patent Citations
A heavy-duty clamp with built-in pressure boosting device
CN114193706B
Pressure boost self compensating formula anvil worker
CN205533488U
Pressure cylinder with variable pressure ratio
CN212318400U
Meal replacement nourishment production line production control method and system
CN118134334A
Apparatus and method for hydraulically clamping mold of injection molding machine as well as apparatus and method for regulating mold thickness using the same apparatus and method
JP2002225103A