Foaming machine control method based on combination of fuzzy control and MPC and related device
By combining fuzzy control and model prediction control, the foaming machine system complex control and slow reaction speed in the prior art is solved, precise control and efficient production are achieved, and suitable for automated scenarios.
Patent Information
- Application Number
- CN202510149782.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing foaming machine system is complex in control, which leads to high operational difficulty, high training cost, insufficient stability and slow reaction speed, which affects production efficiency.
The foaming machine control method based on a combination of fuzzy control and model predictive control (MPC) is adopted. By obtaining the defined parameters of the foaming machine, the target weight is calculated, the feedback adjustment signal is calculated using the fuzzy control algorithm, and the control input signal is optimized through MPC to achieve adaptive control.
It realizes precise control of the material weight output by the foaming machine, reduces waste of raw material output, reduces human errors of operators, enhances quality control, improves production efficiency, and is suitable for automation scenarios and improves production capacity.
Smart Images

Figure CN119987207A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automation control technology, and in particular to a foaming machine control method and related devices based on the combination of fuzzy control and MPC. Background Art
[0002] The foaming machine displacement controller is a control system used on foaming machine equipment to ensure that the foaming process is carried out according to the predetermined process requirements, so as to produce qualified products. The current foaming machine detection controller has some shortcomings, mainly reflected in the existing foaming machine system control is relatively complex, increasing the operator's training cost and operation difficulty.
[0003] Some control systems lack stability during operation, which may cause quality fluctuations in the production process; the control system has a slow response speed, which may affect production efficiency, especially in an automated production environment that requires rapid response. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art. The present invention provides a foaming machine control method and related devices based on the combination of fuzzy control and MPC, which can achieve precise control of the weight of the material output by the foaming machine, reduce excessive raw material output waste, reduce operator human errors, enhance quality control, and improve production efficiency; and realize adaptive control, which is conducive to improving production capacity and application in automation scenarios.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a foaming machine control method based on the combination of fuzzy control and MPC, the method comprising:
[0006] Obtaining definition parameters of the foaming machine defined during foaming, and calculating a first target weight of the first material and a second target weight of the second material based on the definition parameters;
[0007] Based on the first target weight and the second target weight, a fuzzy control algorithm is used to calculate and obtain a feedback adjustment signal corresponding to each moment;
[0008] Based on model predictive control, the feedback adjustment signal is optimized for control input to form an optimized control input signal;
[0009] Adaptive control processing of the foaming machine during foaming is performed based on the optimized control input signal.
[0010] Optionally, the calculating the first target weight of the first material and the second target weight of the second material based on the defined parameters includes:
[0011] Obtaining the target total mass output by the foaming machine, the first material ratio and the second material ratio in the defined parameters;
[0012] A first target weight of the first material and a second target weight of the second material are calculated based on the target total mass, the first material ratio and the second material ratio.
[0013] Optionally, the step of calculating the feedback adjustment signal corresponding to each moment based on the first target weight and the second target weight by using a fuzzy control algorithm includes:
[0014] Calculating and obtaining a corresponding error and error change rate of the material when it is output based on the first target weight and the second target weight;
[0015] The error and the error change rate are input into the fuzzy control algorithm for calculation and processing to obtain the feedback adjustment signal corresponding to each moment.
[0016] Optionally, the step of inputting the error and the error change rate into the fuzzy control algorithm for calculation and processing to obtain a feedback adjustment signal corresponding to each moment includes:
[0017] Performing fuzzy reasoning on the error and the error change rate based on fuzzy rules to obtain a fuzzy reasoning result;
[0018] The fuzzy inference result is transformed based on the centroid method to obtain the feedback adjustment signal corresponding to each moment.
[0019] Optionally, the optimizing processing of the control input of the feedback adjustment signal based on the model predictive control to form an optimized control input signal includes:
[0020] Constructing a linear model of the material output and the servo motor frequency of the foaming machine;
[0021] Constructing an objective function corresponding to the predictive control optimization problem based on the linear model;
[0022] The objective function is solved based on preset conditions to obtain an optimized control input signal, wherein the optimized control input signal is used to optimally control the foaming machine to be at an optimal private service motor frequency and a discharge amount at a corresponding moment.
[0023] Optionally, constructing a linear model of the discharge amount and servo motor frequency of the foaming machine includes:
[0024] The state of the foaming machine at time t is set to x(t)=[Q1(t), Q2(t), f1(t), f2(t)]; Q1(t), Q2(t) respectively represent the discharge amounts of the first material and the second material; f1(t), f2(t) respectively represent the servo motor frequencies corresponding to the first material and the second material;
[0025] The linear model is constructed based on the state of the foaming machine as follows:
[0026] x(t+1)=A*x(t)+B*u(t);
[0027] Among them, A is the state transfer matrix of the foaming machine; B is the control input matrix; u(t) is the control input at time t, that is, the frequency of the servo motor at time t.
[0028] Optionally, the objective function is as follows:
[0029]
[0030] Among them, W predicted (t+i) represents the future output predicted based on the control input at time t; λ is the regularization coefficient, which is used to control the smoothness of the input; W target Indicates the target output amount.
[0031] In addition, an embodiment of the present invention further provides a foaming machine control device based on the combination of fuzzy control and MPC, the device comprising:
[0032] Calculation module: used for obtaining definition parameters of the foaming machine defined during foaming, and calculating a first target weight of the first material and a second target weight of the second material based on the definition parameters;
[0033] Fuzzy control module: used for calculating and obtaining the corresponding feedback adjustment signal at each moment based on the first target weight and the second target weight by using a fuzzy control algorithm;
[0034] Control optimization module: used for optimizing the control input of the feedback adjustment signal based on model predictive control to form an optimized control input signal;
[0035] Foaming machine control module: used for adaptive control processing of the foaming machine during foaming based on the optimized control input signal.
[0036] In addition, an embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the processor runs a computer program or code stored in the memory to implement the foaming machine control method as described in any one of the above.
[0037] In addition, an embodiment of the present invention further provides a computer-readable storage medium for storing a computer program or code. When the computer program or code is executed by a processor, the foaming machine control method described in any one of the above is implemented.
[0038] In an embodiment of the present invention, by obtaining definition parameters of the foaming machine defined during foaming, a first target weight of the first material and a second target weight of the second material are calculated based on the definition parameters; a feedback adjustment signal corresponding to each moment is calculated using a fuzzy control algorithm based on the first target weight and the second target weight; the feedback adjustment signal is optimized for control input based on model predictive control to form an optimized control input signal; adaptive control processing of the foaming machine during foaming is performed based on the optimized control input signal; precise control of the output material weight of the foaming machine is achieved, and excessive raw material output waste is reduced, operator human errors are reduced, quality control is enhanced, and production efficiency is improved; and adaptive control is achieved, which is conducive to improving production capacity and application in automation scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is a flow chart of a foaming machine control method based on the combination of fuzzy control and MPC in an embodiment of the present invention;
[0041] Figure 2 is a flow chart of a foaming machine control method based on the combination of fuzzy control and MPC in another embodiment of the present invention;
[0042] Figure 3 Schematic diagram of the structure of a foaming machine control device based on the combination of fuzzy control and MPC in an embodiment of the present invention;
[0043] Figure 4 is a schematic diagram of the structure of an electronic device in an embodiment of the present invention;
[0044] Figure 5 It is an operation logic diagram of the foaming machine in the embodiment of the present invention. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] For example, see Figure 1 , Figure 1 It is a flow chart of a foaming machine control method based on the combination of fuzzy control and MPC in an embodiment of the present invention.
[0047] like Figure 1 As shown, a foaming machine control method based on the combination of fuzzy control and MPC, the method comprising:
[0048] S101: Obtaining definition parameters of a foaming machine defined during foaming, and calculating a first target weight of a first material and a second target weight of a second material based on the definition parameters;
[0049] In the specific implementation process of the present invention, the first target weight of the first material and the second target weight of the second material are calculated based on the defined parameters, including: obtaining the target total mass output by the foaming machine, the first material ratio and the second material ratio in the defined parameters; based on the target total mass, the first material ratio and the second material ratio, the first target weight of the first material and the second target weight of the second material are calculated.
[0050] Specifically, the operating logic of the foaming machine refers to Figure 5 As shown, after the raw materials reach the machine head, they will flow back into the material cylinder from the return pipe when not in production, forming a cycle; during production injection, the electromagnetic valve is controlled to be on and off according to the injection time, thereby controlling the action of the A and B needle valves at the same time, the needle valve is opened, the return port is closed, and the raw materials flow out of the machine head; during the injection action, the three-phase asynchronous water-cooled motor in the machine head starts stirring in advance according to the set time through the control of the frequency converter, in order to make it transition to the acceleration time, and after entering the set speed, according to the set advance carbon dioxide output time, carbon dioxide is output in the stirring, and then the needle valve is opened, and the A and B materials are output at the same time. During this period, carbon dioxide, stirring, and A and B raw materials are output together at the same time, and the A and B raw materials are fully stirred in the carbon dioxide, and then output from the stirring gun cup to the outside; at the end of the stirring gun cup, a rotating blade is installed, which is connected to the end of the load stirring head of the three-phase asynchronous water-cooled motor, and rotates simultaneously with the motor, which can further achieve the effect of breaking up and atomizing the output raw materials. After the raw material output is completed, the needle valve will be closed on time according to the injection time, the discharge will be stopped, the return pipe will be opened again, and the circulation will be resumed. However, the stirring and carbon dioxide will continue to work for 0.5-1 second to ensure that the raw materials in the gun cup are completely output to the outside and to ensure the weight accuracy of the raw material output; after the raw materials return to the material cylinder through the return pipe, the water circulation insulation layer will be used to keep the raw materials warm.
[0051] After obtaining the definition parameters of the foaming machine defined during foaming, it is necessary to obtain relevant data in the definition parameters so as to calculate the first target weight of the first material and the second target weight of the second material.
[0052] When defining parameters, you can do as follows: 1. Ratio of the first material: ratio1, the value range is 0≤ratio1≤1, which indicates the mass proportion of the first material; the ratio of the second material is 1-ratio1; total target output: W (unit: gram), which is the total weight to be output after mixing; servo motor parameters: number of pulses / turn: P (unit: piece), which indicates the number of pulses required for each rotation of the servo motor; the discharge amount of the circulating pump per turn: the discharge amount of the first material: Q1 (unit: gram / turn); the discharge amount of the second material: Q2 (unit: gram / turn); injection time: T (unit: second), which indicates the time to complete the injection action.
[0053] The calculation steps are as follows:
[0054] W1=W*ratio1;
[0055] W2=W*(1-ratio1);
[0056] Calculate the required discharge volume per second:
[0057]
[0058] Calculate the speed of the circulation pump (cycles / second):
[0059]
[0060] Calculate the servo motor frequency (pulses / second):
[0061] f1=R1*P;f2=R2*P;
[0062] Output: f1 is the frequency (pulses / second) of the servo motor controlling the first material; f2 is the frequency (pulses / second) of the servo motor controlling the second material.
[0063] Examples:
[0064] The first material ratio ratio1 = 0.6; the target output volume: W = 100g
[0065] Injection time: T = 2s; Servo motor pulse number / turn: P = 2000; First material discharge per turn: QA = 5g / turn; Second material discharge per turn: QB = 6g / turn; Calculation: Target weight: W1 = 100*0.6 = 60g; W1 = 100*(1-0.6) = 40g;
[0066] Output per second:
[0067]
[0068] Rotational speed:
[0069]
[0070] Servo motor frequency: f1=6*2000=12000Hz; f2=3.33*2000=6667Hz.
[0071] S102: Calculating and obtaining a feedback adjustment signal corresponding to each moment using a fuzzy control algorithm based on the first target weight and the second target weight;
[0072] In the specific implementation process of the present invention, the feedback adjustment signal corresponding to each moment is calculated based on the first target weight and the second target weight using a fuzzy control algorithm, including: calculating the corresponding error and error change rate of the material when it is output based on the first target weight and the second target weight; inputting the error and the error change rate into the fuzzy control algorithm for calculation and processing to obtain the feedback adjustment signal corresponding to each moment.
[0073] The error and the error change rate are input into the fuzzy control algorithm for calculation and processing to obtain the feedback adjustment signal corresponding to each moment, including: performing fuzzy reasoning processing on the error and the error change rate based on fuzzy rules to obtain fuzzy reasoning results; and converting the fuzzy reasoning results based on the centroid method to obtain the feedback adjustment signal corresponding to each moment.
[0074] Specifically, fuzzy control is used to deal with the nonlinear behavior and uncertainty of the system (such as changes in environmental factors); the error and the error change rate are calculated; the calculation is as follows:
[0075] e(t)=W actual (t)-W target ;
[0076] Fuzzy input: convert the error e and error change rate de into fuzzy values. The fuzzification process involves converting e and de into fuzzy language (such as: positive, small, large, medium, etc.); suppose a fuzzy partitioning rule is set:
[0077] e: {negative large, negative middle, negative small, zero, positive small, positive middle, positive large};
[0078] de: {negative large, negative middle, negative small, zero, positive small, positive middle, positive large};
[0079] Then we have:
[0080] e / de Negative Negative Negative small zero Just small middle Zhengda Negative Rapid reduction reduce reduce Slightly reduced Slightly increased Increase Rapid increase Negative reduce Slightly reduced Slightly reduced Slightly reduced Increase Increase Increase Negative small reduce Slightly reduced Slightly reduced Slightly increased Increase Increase Increase zero Slightly reduced Slightly reduced Slightly increased Slightly increased Increase Increase Increase Just small Slightly reduced Slightly increased Increase Increase Increase Increase Increase middle Slightly reduced Slightly increased Increase Increase Increase Increase Increase Zhengda reduce Slightly reduced Slightly increased Increase Increase Increase Increase
[0081] Fuzzy reasoning: According to the values of e and de, the adjustment amount ΔV (for example: speeding up or slowing down the discharge rate) is inferred through fuzzy rules.
[0082] ΔV=f(e,de);
[0083] Defuzzification: Use the Center of Gravity method to convert the fuzzy results into specific control outputs; as follows:
[0084]
[0085] Among them, w i is the weight of the ith rule; x i is the output of the i-th rule inference.
[0086] S103: performing control input optimization processing on the feedback adjustment signal based on model predictive control to form an optimized control input signal;
[0087] In the specific implementation process of the present invention, the model-based predictive control performs optimization processing on the control input of the feedback adjustment signal to form an optimized control input signal, including: constructing a linear model of the discharge volume and servo motor frequency of the foaming machine; constructing an objective function corresponding to the predictive control optimization problem based on the linear model; solving the objective function based on preset conditions to obtain an optimized control input signal, wherein the optimized control input signal is the optimal control of the foaming machine to be at the optimal servo motor frequency and the discharge volume at the corresponding moment.
[0088] Furthermore, the construction of a linear model of the discharge amount and the servo motor frequency of the foaming machine includes:
[0089] The state of the foaming machine at time t is set to x(t) = [Q1(t), Q2(t), f1(t), f2(t)]; Q1(t), Q2(t) respectively represent the discharge amount of the first material and the second material; f1(t), f2(t) respectively represent the servo motor frequency corresponding to the first material and the second material; the linear model is constructed based on the state of the foaming machine as follows:
[0090] x(t+1)=A*x(t)+B*u(t);
[0091] Among them, A is the state transfer matrix of the foaming machine; B is the control input matrix; u(t) is the control input at time t, that is, the frequency of the servo motor at time t.
[0092] Furthermore, the objective function is as follows:
[0093]
[0094] Among them, W predicted (t+i) represents the future output predicted based on the control input at time t; λ is the regularization coefficient, which is used to control the smoothness of the input; W target Indicates the target output amount.
[0095] Specifically, assuming that the dynamic relationship between the discharge amount and the servo motor frequency can be represented by a linear model, the state of the foaming machine at time t is set to x(t) = [Q1(t), Q2(t), f1(t), f2(t)]; Q1(t), Q2(t) represent the discharge amounts of the first material and the second material respectively; f1(t), f2(t) represent the servo motor frequencies corresponding to the first material and the second material respectively; then the linear model is constructed according to the state of the foaming machine as follows:
[0096] x(t+1)=A*x(t)+B*u(t);
[0097] Among them, A is the state transfer matrix of the foaming machine; B is the control input matrix; u(t) is the control input at time t, that is, the frequency of the servo motor at time t.
[0098] Predictive control optimization problem:
[0099] In order to minimize the discharge error and ensure the target weight W, the following objective function needs to be minimized:
[0100]
[0101] Among them, W predicted (t+i) represents the future output predicted based on the control input at time t; λ is the regularization coefficient, which is used to control the smoothness of the input; W target Indicates the target output amount.
[0102] Constraints:
[0103] Control problems usually have some constraints, such as:
[0104] The discharge volume cannot exceed the maximum value: Q1(t)≤Q1(t) max ; Q2(t)≤Q2(t) max ;
[0105] Servo motor frequency range: f1(t)∈(f1(t) min ,f1(t) max ); f2(t)∈(f2(t) min ,f2(t) max );
[0106] By solving this optimization problem, we can obtain the optimal servo motor frequencies f1(t) and f2(t), as well as the discharge volumes Q1(t) and Q2(t) at each moment.
[0107] By performing optimization in the above manner, it is possible to achieve precise frequency control of the servo motor of the foaming machine, and adaptively adjust the required discharge volume between the maximum and minimum values according to demand, and adjust the servo motor frequency accordingly, thereby achieving precise control of the discharge volume of each discharge port of the foaming machine.
[0108] S104: Adaptively control the foaming machine during foaming based on the optimized control input signal.
[0109] In a specific implementation process of the present invention, after obtaining the optimized control input signal, the optimized control input signal is input into the foaming machine to perform an adaptive control operation on the foaming machine.
[0110] In an embodiment of the present invention, by obtaining definition parameters of the foaming machine defined during foaming, a first target weight of the first material and a second target weight of the second material are calculated based on the definition parameters; a feedback adjustment signal corresponding to each moment is calculated using a fuzzy control algorithm based on the first target weight and the second target weight; the feedback adjustment signal is optimized for control input based on model predictive control to form an optimized control input signal; adaptive control processing of the foaming machine during foaming is performed based on the optimized control input signal; precise control of the output material weight of the foaming machine is achieved, and excessive raw material output waste is reduced, operator human errors are reduced, quality control is enhanced, and production efficiency is improved; and adaptive control is achieved, which is conducive to improving production capacity and application in automation scenarios.
[0111] For example 2, please refer to Figure 2 , Figure 2 It is a flow chart of a foaming machine control method based on the combination of fuzzy control and MPC in another embodiment of the present invention.
[0112] like Figure 2 As shown, a foaming machine control method based on the combination of fuzzy control and MPC, the method comprising:
[0113] S201: Obtaining definition parameters of the foaming machine defined during foaming, and calculating a first target weight of the first material and a second target weight of the second material based on the definition parameters;
[0114] S202: Calculating and obtaining a corresponding error and error change rate of the material when it is output based on the first target weight and the second target weight;
[0115] S203: inputting the error and the error change rate into the fuzzy control algorithm for calculation and processing to obtain a feedback adjustment signal corresponding to each moment;
[0116] S204: constructing a linear model of the material output and the servo motor frequency of the foaming machine;
[0117] S205: constructing an objective function corresponding to the predictive control optimization problem based on the linear model;
[0118] S206: Solving the objective function based on preset conditions to obtain an optimized control input signal, wherein the optimized control input signal is an optimal control signal for controlling the foaming machine to be at an optimal private service motor frequency and a discharge amount at a corresponding time;
[0119] S207: Adaptively control the foaming machine during foaming based on the optimized control input signal.
[0120] The specific implementation of the second embodiment can be found in the above embodiments, which will not be described in detail here.
[0121] For example 3, please refer to Figure 3 , Figure 3 It is a schematic diagram of the structural composition of a foaming machine control device based on the combination of fuzzy control and MPC in an embodiment of the present invention.
[0122] A foaming machine control device based on the combination of fuzzy control and MPC, the device comprising:
[0123] Calculation module 301: used to obtain definition parameters of the foaming machine defined during foaming, and calculate a first target weight of the first material and a second target weight of the second material based on the definition parameters;
[0124] In the specific implementation process of the present invention, the first target weight of the first material and the second target weight of the second material are calculated based on the defined parameters, including: obtaining the target total mass output by the foaming machine, the first material ratio and the second material ratio in the defined parameters; based on the target total mass, the first material ratio and the second material ratio, the first target weight of the first material and the second target weight of the second material are calculated.
[0125] Specifically, the operating logic of the foaming machine refers to Figure 5As shown, after the raw materials reach the machine head, they will flow back into the material cylinder from the return pipe when not in production, forming a cycle; during production injection, the electromagnetic valve is controlled to be on and off according to the injection time, thereby controlling the action of the A and B needle valves at the same time, the needle valve is opened, the return port is closed, and the raw materials flow out of the machine head; during the injection action, the three-phase asynchronous water-cooled motor in the machine head starts stirring in advance according to the set time through the control of the frequency converter, in order to make it transition to the acceleration time, and after entering the set speed, according to the set advance carbon dioxide output time, carbon dioxide is output in the stirring, and then the needle valve is opened, and the A and B materials are output at the same time. During this period, carbon dioxide, stirring, and A and B raw materials are output together at the same time, and the A and B raw materials are fully stirred in the carbon dioxide, and then output from the stirring gun cup to the outside; at the end of the stirring gun cup, a rotating blade is installed, which is connected to the end of the load stirring head of the three-phase asynchronous water-cooled motor, and rotates simultaneously with the motor, which can further achieve the effect of breaking up and atomizing the output raw materials. After the raw material output is completed, the needle valve will be closed on time according to the injection time, the discharge will be stopped, the return pipe will be opened again, and the circulation will be resumed. However, the stirring and carbon dioxide will continue to work for 0.5-1 second to ensure that the raw materials in the gun cup are completely output to the outside and to ensure the weight accuracy of the raw material output; after the raw materials return to the material cylinder through the return pipe, the water circulation insulation layer will be used to keep the raw materials warm.
[0126] After obtaining the definition parameters of the foaming machine defined during foaming, it is necessary to obtain relevant data in the definition parameters so as to calculate the first target weight of the first material and the second target weight of the second material.
[0127] When defining parameters, you can do as follows: 1. Ratio of the first material: ratio1, the value range is 0≤ratio1≤1, which indicates the mass proportion of the first material; the ratio of the second material is 1-ratio1; total target output: W (unit: gram), which is the total weight to be output after mixing; servo motor parameters: number of pulses / turn: P (unit: piece), which indicates the number of pulses required for each rotation of the servo motor; the discharge amount of the circulating pump per turn: the discharge amount of the first material: Q1 (unit: gram / turn); the discharge amount of the second material: Q2 (unit: gram / turn); injection time: T (unit: second), which indicates the time to complete the injection action.
[0128] The calculation steps are as follows:
[0129] W1=W*ratio1;
[0130] W2=W*(1-ratio1);
[0131] Calculate the required discharge volume per second:
[0132]
[0133] Calculate the speed of the circulation pump (cycles / second):
[0134]
[0135] Calculate the servo motor frequency (pulses / second):
[0136] f1=R1*P;f2=R2*P;
[0137] Output: f1 is the frequency (pulses / second) of the servo motor controlling the first material; f2 is the frequency (pulses / second) of the servo motor controlling the second material.
[0138] Examples:
[0139] The first material ratio ratio1 = 0.6; the target output volume: W = 100g
[0140] Injection time: T = 2s; Servo motor pulse number / turn: P = 2000; First material discharge per turn: QA = 5g / turn; Second material discharge per turn: QB = 6g / turn; Calculation: Target weight: W1 = 100*0.6 = 60g; W1 = 100*(1-0.6) = 40g;
[0141] Output per second:
[0142]
[0143] Rotational speed:
[0144]
[0145] Servo motor frequency: f1=6*2000=12000Hz; f2=3.33*2000=6667Hz.
[0146] Fuzzy control module 302: used for calculating and obtaining a feedback adjustment signal corresponding to each moment based on the first target weight and the second target weight by using a fuzzy control algorithm;
[0147] In the specific implementation process of the present invention, the feedback adjustment signal corresponding to each moment is calculated based on the first target weight and the second target weight using a fuzzy control algorithm, including: calculating the corresponding error and error change rate of the material when it is output based on the first target weight and the second target weight; inputting the error and the error change rate into the fuzzy control algorithm for calculation and processing to obtain the feedback adjustment signal corresponding to each moment.
[0148] The error and the error change rate are input into the fuzzy control algorithm for calculation and processing to obtain the feedback adjustment signal corresponding to each moment, including: performing fuzzy reasoning processing on the error and the error change rate based on fuzzy rules to obtain fuzzy reasoning results; and converting the fuzzy reasoning results based on the centroid method to obtain the feedback adjustment signal corresponding to each moment.
[0149] Specifically, fuzzy control is used to deal with the nonlinear behavior and uncertainty of the system (such as changes in environmental factors); the error and the error change rate are calculated; the calculation is as follows:
[0150] e(t)=W actual (t)-W target ;
[0151] Fuzzy input: convert the error e and error change rate de into fuzzy values. The fuzzification process involves converting e and de into fuzzy language (such as: positive, small, large, medium, etc.); suppose a fuzzy partitioning rule is set:
[0152] e: {negative large, negative middle, negative small, zero, positive small, positive middle, positive large};
[0153] de: {negative large, negative middle, negative small, zero, positive small, positive middle, positive large};
[0154] Then we have:
[0155] e / de Negative Negative Negative small zero Just small middle Zhengda Negative Rapid reduction reduce reduce Slightly reduced Slightly increased Increase Rapid increase Negative reduce Slightly reduced Slightly reduced Slightly reduced Increase Increase Increase Negative small reduce Slightly reduced Slightly reduced Slightly increased Increase Increase Increase zero Slightly reduced Slightly reduced Slightly increased Slightly increased Increase Increase Increase Just small Slightly reduced Slightly increased Increase Increase Increase Increase Increase middle Slightly reduced Slightly increased Increase Increase Increase Increase Increase Zhengda reduce Slightly reduced Slightly increased Increase Increase Increase Increase
[0156] Fuzzy reasoning: According to the values of e and de, the adjustment amount ΔV (for example: speeding up or slowing down the discharge rate) is inferred through fuzzy rules.
[0157] ΔV=f(e,de);
[0158] Defuzzification: Use the Center of Gravity method to convert the fuzzy results into specific control outputs; as follows:
[0159]
[0160] Among them, w i is the weight of the ith rule; x i is the output of the i-th rule inference.
[0161] Control optimization module 303: used for optimizing the control input of the feedback adjustment signal based on model predictive control to form an optimized control input signal;
[0162] In the specific implementation process of the present invention, the model-based predictive control performs optimization processing on the control input of the feedback adjustment signal to form an optimized control input signal, including: constructing a linear model of the discharge volume and servo motor frequency of the foaming machine; constructing an objective function corresponding to the predictive control optimization problem based on the linear model; solving the objective function based on preset conditions to obtain an optimized control input signal, wherein the optimized control input signal is the optimal control of the foaming machine to be at the optimal servo motor frequency and the discharge volume at the corresponding moment.
[0163] Furthermore, the construction of a linear model of the discharge amount and the servo motor frequency of the foaming machine includes:
[0164] The state of the foaming machine at time t is set to x(t)=[Q1(t), Q2(t), f1(t), f2(t)]; Q1(t), Q2(t) respectively represent the discharge amount of the first material and the second material; f1(t), f2(t) respectively represent the servo motor frequency corresponding to the first material and the second material; the linear model is constructed based on the state of the foaming machine as follows:
[0165] x(t+1)=A*x(t)+B*u(t);
[0166] Among them, A is the state transfer matrix of the foaming machine; B is the control input matrix; u(t) is the control input at time t, that is, the frequency of the servo motor at time t.
[0167] Furthermore, the objective function is as follows:
[0168]
[0169] Among them, W predicted (t+i) represents the future output predicted based on the control input at time t; λ is the regularization coefficient, which is used to control the smoothness of the input; W target Indicates the target output amount.
[0170] Specifically, assuming that the dynamic relationship between the discharge amount and the servo motor frequency can be represented by a linear model, the state of the foaming machine at time t is set to x(t) = [Q1(t), Q2(t), f1(t), f2(t)]; Q1(t), Q2(t) represent the discharge amounts of the first material and the second material respectively; f1(t), f2(t) represent the servo motor frequencies corresponding to the first material and the second material respectively; then the linear model is constructed according to the state of the foaming machine as follows:
[0171] x(t+1)=A*x(t)+B*u(t);
[0172] Among them, A is the state transfer matrix of the foaming machine; B is the control input matrix; u(t) is the control input at time t, that is, the frequency of the servo motor at time t.
[0173] Predictive control optimization problem:
[0174] In order to minimize the discharge error and ensure the target weight W, the following objective function needs to be minimized:
[0175]
[0176] Among them, W predicted (t+i) represents the future output predicted based on the control input at time t; λ is the regularization coefficient, which is used to control the smoothness of the input; W target Indicates the target output amount.
[0177] Constraints:
[0178] Control problems usually have some constraints, such as:
[0179] The discharge volume cannot exceed the maximum value: Q1(T)≤Q1(t) max ; Q2(t)≤Q2(T) max ;
[0180] Servo motor frequency range: f1(t)∈(f1(t) min ,f1(t) max ); f2(t)∈(f2(t) min ,f2(t) max );
[0181] By solving this optimization problem, we can obtain the optimal servo motor frequencies f1(t) and f2(t), as well as the discharge volumes Q1(t) and Q2(t) at each moment.
[0182] By performing optimization in the above manner, it is possible to achieve precise frequency control of the servo motor of the foaming machine, and adaptively adjust the required discharge volume between the maximum and minimum values according to demand, and adjust the servo motor frequency accordingly, thereby achieving precise control of the discharge volume of each discharge port of the foaming machine.
[0183] The foaming machine control module 304 is used for adaptively controlling the foaming machine during foaming based on the optimized control input signal.
[0184] In a specific implementation of the present invention, after obtaining the optimized control input signal, the optimized control input signal is input into the foaming machine to perform a control operation on the foaming machine.
[0185] In an embodiment of the present invention, by obtaining definition parameters of the foaming machine defined during foaming, a first target weight of the first material and a second target weight of the second material are calculated based on the definition parameters; a feedback adjustment signal corresponding to each moment is calculated using a fuzzy control algorithm based on the first target weight and the second target weight; the feedback adjustment signal is optimized for control input based on model predictive control to form an optimized control input signal; adaptive control processing of the foaming machine during foaming is performed based on the optimized control input signal; precise control of the output material weight of the foaming machine is achieved, and excessive raw material output waste is reduced, operator human errors are reduced, quality control is enhanced, and production efficiency is improved; and adaptive control is achieved, which is conducive to improving production capacity and application in automation scenarios.
[0186] A computer-readable storage medium is provided in an embodiment of the present invention, wherein a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, a foaming machine control method of any one of the above embodiments is implemented. The computer-readable storage medium includes, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic card or optical card. That is, the storage device includes any medium that can store or transmit information in a readable form by a device (for example, a computer, a mobile phone), which can be a read-only memory, a disk or an optical disk, etc.
[0187] An embodiment of the present invention further provides a computer application program, which runs on a computer and is used to execute the foaming machine control method of any one of the above embodiments.
[0188] also, Figure 4 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention.
[0189] The embodiment of the present invention further provides an electronic device, such as Figure 4 The electronic device includes a processor 402, a memory 403, an input unit 404, a display unit 405 and other devices. Those skilled in the art will understand that Figure 4The structural components of the electronic device shown do not constitute a limitation on all devices, and may include more or fewer components than shown, or combine certain components. The memory 403 can be used to store the application 401 and various functional modules, and the processor 402 runs the application 401 stored in the memory 403, thereby executing various functional applications and data processing of the device. The memory can be an internal memory or an external memory, or include both internal and external memories. The internal memory may include a read-only memory (ROM), a programmable ROM (PROM), an electrically programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), a flash memory, or a random access memory. The external memory may include a hard disk, a floppy disk, a ZIP disk, a U disk, a magnetic tape, etc. The memory disclosed in the present invention includes but is not limited to these types of memories. The memory disclosed in the present invention is only used as an example and not as a limitation.
[0190] The input unit 404 is used to receive the input of the signal and the keyword input by the user. The input unit 404 may include a touch panel and other input devices. The touch panel can collect the user's touch operation on or near it (such as the user's operation on or near the touch panel using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program; other input devices may include but are not limited to one or more of a physical keyboard, a function key (such as a playback control key, a switch key, etc.), a trackball, a mouse, a joystick, etc. The display unit 405 can be used to display the information input by the user or the information provided to the user and various menus of the terminal device. The display unit 405 can be in the form of a liquid crystal display, an organic light emitting diode, etc. The processor 402 is the control center of the terminal device, which uses various interfaces and lines to connect the various parts of the entire device, and executes various functions and processes data by running or executing software programs and / or modules stored in the memory 403, and calling the data stored in the memory.
[0191] As an embodiment, the electronic device includes: one or more processors 402, a memory 403, and one or more applications 401, wherein the one or more applications 401 are stored in the memory 403 and are configured to be executed by the one or more processors 402, and the one or more applications 401 are configured to execute the corresponding foaming machine control method in any one of the above-mentioned embodiments.
[0192] In an embodiment of the present invention, by obtaining definition parameters of the foaming machine defined during foaming, a first target weight of the first material and a second target weight of the second material are calculated based on the definition parameters; a feedback adjustment signal corresponding to each moment is calculated using a fuzzy control algorithm based on the first target weight and the second target weight; the feedback adjustment signal is optimized for control input based on model predictive control to form an optimized control input signal; adaptive control processing of the foaming machine during foaming is performed based on the optimized control input signal; precise control of the output material weight of the foaming machine is achieved, and excessive raw material output waste is reduced, operator human errors are reduced, quality control is enhanced, and production efficiency is improved; and adaptive control is achieved, which is conducive to improving production capacity and application in automation scenarios.
[0193] In addition, the above is a detailed introduction to a foaming machine control method based on the combination of fuzzy control and MPC and related devices provided in an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A foaming machine control method based on the combination of fuzzy control and MPC, characterized in that: The method comprises: Obtaining definition parameters of the foaming machine defined during foaming, and calculating a first target weight of the first material and a second target weight of the second material based on the definition parameters; Based on the first target weight and the second target weight, a fuzzy control algorithm is used to calculate and obtain a feedback adjustment signal corresponding to each moment; Based on model predictive control, the feedback adjustment signal is optimized for control input to form an optimized control input signal; Adaptive control processing of the foaming machine during foaming is performed based on the optimized control input signal.
2. The foaming machine control method according to claim 1, characterized in that: The calculating the first target weight of the first material and the second target weight of the second material based on the defined parameters includes: Obtaining the target total mass output by the foaming machine, the first material ratio and the second material ratio in the defined parameters; A first target weight of the first material and a second target weight of the second material are calculated based on the target total mass, the first material ratio and the second material ratio.
3. The foaming machine control method according to claim 1, characterized in that: The method of calculating and obtaining the feedback adjustment signal corresponding to each moment based on the first target weight and the second target weight by using a fuzzy control algorithm includes: Calculating and obtaining a corresponding error and error change rate of the material when it is output based on the first target weight and the second target weight; The error and the error change rate are input into the fuzzy control algorithm for calculation and processing to obtain the feedback adjustment signal corresponding to each moment.
4. The foaming machine control method according to claim 3, characterized in that: The step of inputting the error and the error change rate into the fuzzy control algorithm for calculation and processing to obtain the feedback adjustment signal corresponding to each moment includes: Performing fuzzy reasoning on the error and the error change rate based on fuzzy rules to obtain a fuzzy reasoning result; The fuzzy inference result is transformed based on the centroid method to obtain the feedback adjustment signal corresponding to each moment.
5. The foaming machine control method according to claim 1, characterized in that: The optimizing process of the control input of the feedback adjustment signal based on the model predictive control to form an optimized control input signal includes: Constructing a linear model of the material output and the servo motor frequency of the foaming machine; Constructing an objective function corresponding to the predictive control optimization problem based on the linear model; The objective function is solved based on preset conditions to obtain an optimized control input signal, wherein the optimized control input signal is used to optimally control the foaming machine to be at an optimal private service motor frequency and a discharge amount at a corresponding moment.
6. The foaming machine control method according to claim 5, characterized in that: The linear model of the discharge amount and the servo motor frequency of the foaming machine is constructed, including: The state of the foaming machine at time t is set to x(t) = [q1(t), Q2(t), f1(t), f2(t)]; Q1(t), Q2(t) respectively represent the discharge amounts of the first material and the second material; f1(t), f2(t) respectively represent the servo motor frequencies corresponding to the first material and the second material; The linear model is constructed based on the state of the foaming machine as follows: x(t+1)=A*x(t)+B*u(t); Among them, A is the state transfer matrix of the foaming machine; B is the control input matrix; u(t) is the control input at time t, that is, the frequency of the servo motor at time t.
7. The foaming machine control method according to claim 5, characterized in that: The objective function is as follows: Among them, W predicted (t+i) represents the future output predicted based on the control input at time t; λ is the regularization coefficient, which is used to control the smoothness of the input; W target Indicates the target output.
8. A foaming machine control device based on the combination of fuzzy control and MPC, characterized in that: The device comprises: Calculation module: used for obtaining definition parameters of the foaming machine defined during foaming, and calculating a first target weight of the first material and a second target weight of the second material based on the definition parameters; Fuzzy control module: used for calculating and obtaining the corresponding feedback adjustment signal at each moment based on the first target weight and the second target weight by using a fuzzy control algorithm; Control optimization module: used for optimizing the control input of the feedback adjustment signal based on model predictive control to form an optimized control input signal; Foaming machine control module: used for adaptive control processing of the foaming machine during foaming based on the optimized control input signal.
9. An electronic device comprising a processor and a memory, characterized in that: The processor runs a computer program or code stored in the memory to implement the foaming machine control method according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program or code, characterized in that: When the computer program or code is executed by a processor, the foaming machine control method according to any one of claims 1 to 7 is implemented.