Methods and devices for tuning control parameters of magnetic levitation bearings, storage media and electronic equipment
By combining Bayesian optimization and dung beetle optimization algorithms, the problem of low PID parameter tuning efficiency in magnetic levitation bearings is solved, achieving efficient and accurate parameter tuning, which is suitable for automatic control of magnetic levitation bearing systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG ZHANGQIU HUADONG BLOWER
- Filing Date
- 2025-07-30
- Publication Date
- 2026-05-26
AI Technical Summary
The PID parameter tuning methods for magnetic levitation bearing systems are inefficient, making it difficult to achieve multi-objective optimization in a short time. Furthermore, existing methods rely on experience or involve complex calculations, resulting in weak local development capabilities.
By combining Bayesian optimization and dung beetle optimization algorithms, a mathematical model is constructed to generate a PID parameter subspace. A Gaussian process surrogate model is used for global exploration, and the dung beetle optimization algorithm is executed within the subspace to quickly find the optimal solution.
It achieves efficient automatic tuning of PID parameters for magnetic levitation bearings, balancing efficiency and accuracy, reducing dependence on initial sample size, and improving the robustness and accuracy of the tuning process.
Smart Images

Figure CN120926188B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and apparatus for tuning control parameters of magnetic levitation bearings, a storage medium and an electronic device, and belongs to the technical field of magnetic levitation control parameters. Background Technology
[0002] As a core supporting component of rotating machinery, the stability of a magnetic bearing system largely depends on the performance of the controller, which in turn is closely related to the control parameters. Therefore, finding suitable control parameters is often the key to debugging a magnetic bearing system.
[0003] PID (Proportional Integral Derivative) control has become the mainstream control scheme for magnetic levitation bearings due to its simple structure and strong robustness. However, PID parameter tuning faces some challenges: the strong nonlinearity of the magnetic levitation bearing system causes traditional linear tuning methods to fail, and it is difficult to simultaneously consider multiple objectives such as overshoot, settling time, and current ripple. Online tuning needs to be completed in a short time.
[0004] Current PID tuning methods also have certain shortcomings: trial and error mainly rely on engineers' experience, which takes several hours and cannot guarantee optimal parameters; Bayesian optimization (BO) reduces the number of simulations to the hundreds, but it is computationally complex in high-dimensional parameter spaces and has weak local development capabilities in the later stages; Dung beetle optimization (DBO) improves the convergence speed through population division of labor, but is still limited by simulation costs.
[0005] Therefore, there is an urgent need to propose a method for tuning the control parameters of magnetic levitation bearings, aiming to efficiently achieve online automatic tuning of the control parameters. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides a method for tuning the control parameters of magnetic levitation bearings, and offers a hybrid optimization strategy that combines Bayesian optimization with the dung beetle optimization algorithm. This fusion aims to combine the global exploration capability of Bayesian optimization with the local development capability of the dung beetle algorithm. Bayesian optimization reduces the dependence on the initial sample size, while the dung beetle algorithm accelerates convergence within the subspace, balancing efficiency and accuracy.
[0007] The technical solution of this invention is as follows:
[0008] On one hand, the present invention provides a method for tuning the control parameters of a magnetic levitation bearing, comprising:
[0009] S1, Construct a mathematical model for the PID parameter optimization problem in magnetic levitation bearings;
[0010] S2 generates a Bayesian optimized sample set, fits a Gaussian process surrogate model, and globally explores and generates a PID parameter subspace;
[0011] S3, execute the dung beetle optimization algorithm within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db );
[0012] S4, the optimal point (x) db y db Add it to the sample set for Bayesian optimization and update the Gaussian process surrogate model;
[0013] S5. Repeat steps S2 to S4 until the stopping condition is met, and output the final global optimal solution x. db * That is, to obtain the PID parameter K P * K I * K D * .
[0014] According to a preferred embodiment of the present invention, in step S1, constructing a mathematical model for the PID parameter optimization problem in a magnetic levitation bearing includes: transforming the PID parameter optimization problem into a fitness function minimization problem, with the optimization variable being the PID parameter K. P K I K D K P K represents the proportionality coefficient. I K represents the integral coefficient. D Denotes the differential coefficients, and selects the integral time squared error ITSE. Let t represent the integration time, T represent the maximum integration time, and e(t) represent the error between the rotor target setpoint and the actual rotor output value; and introduce a penalty function as a performance index, then the fitness function is:
[0015]
[0016] In the formula, t s Indicates the adjustment time, t s,max This represents the maximum allowable adjustment time, and t s ≤t s,max σ represents overshoot. max This represents the maximum allowable overshoot, and σ ≤ σ max λ1 represents the weight of overshoot in the penalty function, λ2 represents the weight of settling time in the penalty function, and the PID parameter range satisfies: K p ∈[K P,min ,K P,max ], K i ∈[K I,min ,K I,max ], K d∈[K D,min ,K D,max ].
[0017] According to a preferred embodiment of the present invention, in step S2, a Bayesian optimized sample set is generated, a Gaussian process surrogate model is fitted, and a global exploration is performed to generate the PID parameter subspace; including:
[0018] S2-1, Generate initial sample points x i = ( K P i K I i K D i ) A closed-loop test of the magnetic levitation system was conducted, and the fitness value y was calculated. i The initial sample set D = {(x i y i )} N i = 1;
[0019] S2-2, based on the sample set D, fits a Gaussian process surrogate model to obtain the posterior mean μ(x) and posterior variance σ of the fitness function at any point. 2 (x);
[0020] S2-3, optimize the acquisition function EI, select the next sample point, and generate the PID parameter subspace.
[0021] According to a preferred embodiment of the present invention, in S2-1, initial sample points x are generated. i =(K P i K I i K D i The system underwent a closed-loop test of the magnetic levitation system, and the fitness value y was then calculated. i The initial sample set D = {(x i y i )} N i=1 ;include:
[0022] a) Using Latin hypercube sampling in the global parameter space χ=[K P,min ,K P,max ]×[K I,min ,K I,max ]×[K D,min ,K D,max Generate N sets of PID parameter vectors x within the [internal range]. i ;
[0023] b) For each x iPerform closed-loop simulation of the magnetic levitation system: Input amplitude is A step The step position signal; the output error response e(t);
[0024] c) Calculate the performance index based on e(t): overshoot σ i Adjustment time t s,i ITSE;
[0025] d) Calculate fitness value: The initial sample set D = {(x i y i )} N i=1 .
[0026] According to a preferred embodiment of the present invention, in step S2-2, the surrogate model of fitting a Gaussian process based on the sample set D is used to obtain the posterior mean μ(x) and posterior variance σ of the fitness function at any point. 2 (x); includes:
[0027] A Gaussian process surrogate model is fitted based on the sample set D: f(x) ~ GP(μ(x), k(x) i ,x j f(x) is the fitness function, used to measure the performance index of the magnetic bearing system when the input PID parameter combination x is given. The mean function μ(x) is used to calculate the expected value of the predicted fitness value at the input point x. The covariance function... x i and x j For any two input vectors in the sample set, ||x i -x j || represents the distance between two parameter vectors; l represents the length scale; Indicates the signal variance;
[0028] The posterior mean μ(x) = k T (K+σ 2 n I) -1 In y, k represents the covariance vector of x with all training samples, K represents the covariance matrix of the training samples, and σ 2 n Let I represent the noise variance, and let (K+σ) represent the identity matrix. 2 n I) -1 Let represent the inverse of the noise-corrected covariance matrix, and y represent the fitness value vector of the training samples.
[0029] The posterior variance σ 2 (x)=k(x,x)-k T (K+σ 2n I) -1 In k, k(x,x) represents the covariance of the sample point x to be evaluated.
[0030] According to a preferred embodiment of the present invention, in steps S2-3, the optimized acquisition function EI selects the next sample point and generates a PID parameter subspace; including:
[0031] a) Calculate the value of the acquisition function EI(x) over the entire global parameter space χ;
[0032] b) Find the point that maximizes the acquisition function EI, where EI(x) satisfies: EI(x) = E[max(0,f](x, ...) = min -f(x))]
[0033] f min Let f(x) represent the minimum fitness value in the current sample, and let f(x) represent the fitness function, with the point x corresponding to the maximum EI. c Centered on x c As the center of the PID parameter subspace;
[0034] c) Calculate x c The predicted standard deviation σ(x) at the location c );
[0035] d) Define the PID parameter subspace: with x c Centered on m*σ(x) c A hypercube or hypersphere with radius ) is used as the subspace of PID parameters.
[0036] According to a preferred embodiment of the present invention, in step S3, the dung beetle optimization algorithm is executed within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db );include:
[0037] S3-1, Initialize the parameters for the dung beetle swarm and the DBO algorithm; including:
[0038] Set the parameters for the DBO algorithm, including population size M and maximum number of iterations T. max Natural coefficient α, deflection coefficient k, light intensity variation coefficient b, deflection angle θ;
[0039] Initialize the dung beetle population within the PID parameter subspace obtained through Bayesian optimization: the position vector x of each dung beetle. i =(K P i K I i K D i), representing a set of PID parameters, i = 1, 2, ..., M; initial positions are generated in the subspace using Latin hypercube sampling, dividing the population into four subgroups: dung beetle, reproductive dung beetle, small dung beetle, and thieving dung beetle;
[0040] S3-2, Calculate the initial fitness value;
[0041] S3-3, Update the location of all dung beetles:
[0042] (1) The regeneration of the dung beetle can be divided into two cases: with obstacles and without obstacles.
[0043] Accessibility update formula: x i (t+1)=x i (t)+α×k×x i (t-1)+b×Δx(I),
[0044] Δx=|x i (t)-X W |(II),
[0045] In equation (I), t represents the current iteration number, and x i (t) represents the position of the i-th dung beetle during the t-th iteration; x i (t+1) represents the position of the i-th dung beetle during the (t+1)-th iteration; x i (t-1) represents the position of the i-th dung beetle during the (t-1)-th iteration; in equation (II), X W The worst-case position globally; Δx simulates changes in light intensity;
[0046] With obstacles, update formula: x i (t+1)=x i (t)+tan(θ)×|x i (t)-x i (t-1)|(III);
[0047] (2) The renewal formula for breeding dung beetles is:
[0048] x i (t+1)=X B +b1×(x i (t)-Lb*)+b2×(x i (t)-Ub*)(IV),
[0049] Lb * =max(X B ×(1-R1),Lb)(V),
[0050] Ub * =min(X) B×(1+R1),Ub)(VI),
[0051] In equation (IV), X B The current optimal position of the individual is represented by Lb*, the lower bound of the spawning zone is represented by Ub*, the upper bound of the spawning zone is represented by b1 and b2, which are two independent vectors of size 1×D, where D represents the dimension of the optimization problem, R1 represents the proportional coefficient of the spawning zone radius, R1=1-t / Tmax, Lb represents the lower bound of the PID parameter subspace, and Ub represents the upper bound of the PID parameter subspace.
[0052] (3) The renewal formula of the dung beetle:
[0053] x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b (VII),
[0054] Lb b =max(X b ×(1-R2),Lb)(VIII),
[0055] Ub b =min(X) b ×(1+R2),Ub)(IX),
[0056] In equation (VII), C1 represents a random number that follows a normal distribution; C2 represents a random number belonging to (0,1); X b R2 represents the global optimal position, and R2 represents the foraging radius proportionality coefficient, R2 = 1 - t / Tmax; Lb b Ub represents the upper bound of the optimal feeding region. b This represents the lower bound of the optimal feeding region.
[0057] (4) The update formula for dung beetle thieves:
[0058] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |)(X),
[0059] In equation (X), g is a 1×D dimensional random vector following a normal distribution; S represents the theft step size coefficient, and X... * This represents the position of a randomly selected individual in the current population, and S represents the theft step size coefficient.
[0060] S3-4, check whether the updated position of each dung beetle exceeds the boundary of the PID parameter subspace recommended by Bayesian optimization;
[0061] S3-5, calculate the new fitness value, and update the individual optimal position and the global optimal position;
[0062] S3-6, Repeat steps S3-3 to S3-5 until convergence or the termination condition is met, and output the global optimal solution x. db =(K P * ,K I * ,K D * ) and its fitness value y db .
[0063] Secondly, the present invention provides a device for setting control parameters of a magnetic levitation bearing, comprising:
[0064] The mathematical modeling module is used to construct mathematical models for the PID parameter optimization problem in magnetic levitation bearings.
[0065] The Bayesian optimization module is used to generate a sample set for Bayesian optimization, fit a Gaussian process surrogate model, and globally explore and generate a subspace of PID parameters.
[0066] The dung beetle optimization module is used to execute the dung beetle optimization algorithm within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db );
[0067] The loop update module is used to update the Gaussian process model and obtain the optimal PID parameters x. db * =(K P * ,K I * ,K D * ).
[0068] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the tuning method described above.
[0069] Fourthly, the present invention provides an electronic device, comprising:
[0070] Memory, used to store programs;
[0071] A processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the tuning method.
[0072] The beneficial effects of this invention are as follows:
[0073] This application provides an innovative architecture combining Bayesian optimization for locating the potential PID parameter subspace and dung beetle optimization for fine-grained search, achieving efficient collaboration between global and local optimization. Bayesian optimization is used for global exploration, modeling the probability distribution of the fitness function through a Gaussian process to predict the performance trend of the global parameter space with a small number of samples. An EI acquisition function is used to accurately locate the potential region, i.e., the PID parameter subspace, avoiding blind search and significantly reducing the number of simulations. The dung beetle optimization algorithm is used for local development: within the PID parameter subspace determined by Bayesian optimization, a population division of labor involving rolling ball exploration, breeding development, and stealing perturbations is used to finely search for the optimal solution. This not only reduces the dependence on the initial sample size but also accelerates convergence within the PID parameter subspace, balancing efficiency and accuracy. The tuning method provided in this application solves three major pain points in PID parameter tuning for magnetic bearings: low efficiency, susceptibility to local optima, and difficulty in meeting engineering constraints. It achieves high-precision, low-time-consumption, and robust automatic tuning, providing core technical support for the engineering application of magnetic bearings. Attached Figure Description
[0074] Figure 1 This is a schematic diagram of a method for tuning the control parameters of a magnetic levitation bearing according to an embodiment of the present invention.
[0075] Figure 2 This is a schematic diagram illustrating the specific steps of step S2 in the tuning method provided in this embodiment of the invention.
[0076] Figure 3 This is a schematic diagram illustrating the specific steps of step S3 in the tuning method provided in this embodiment of the invention.
[0077] Figure 4 This is a schematic diagram of a device for setting control parameters of a magnetic levitation bearing, provided in an embodiment of the present invention.
[0078] Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present invention.
[0079] Figure 6 This is a schematic diagram showing the connection relationship between the electronic device using the tuning method provided in an embodiment of the present invention and the magnetic bearing control system.
[0080] Figure 7 This diagram illustrates the connection relationship between the electronic device using the tuning method provided in this embodiment of the invention and other modules. Detailed Implementation
[0081] The following illustrations will disclose several embodiments of this application, providing a clear and complete description of the technical solution of the present invention, which constitutes a part of this application. The accompanying drawings are used to provide a further understanding of the present invention. The illustrative embodiments and descriptions of the present invention are used to explain the present invention and do not constitute an improper limitation of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0082] In this invention, unless otherwise explicitly specified and limited, the terms "connection," "fixed," etc., should be interpreted broadly. For example, "connection" can refer to a fixed connection, a detachable connection, or an integral part, unless otherwise explicitly limited. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0083] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0084] To overcome the shortcomings of existing technologies, this embodiment provides a method for tuning the control parameters of a magnetic levitation bearing, such as... Figure 1 As shown, it includes:
[0085] S1, Construct a mathematical model for the PID parameter optimization problem in magnetic levitation bearings;
[0086] S2 generates a Bayesian optimized sample set, fits a Gaussian process surrogate model, and globally explores and generates a PID parameter subspace;
[0087] S3, execute the dung beetle optimization algorithm within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db );
[0088] S4, the optimal point (x) db y db Add it to the sample set for Bayesian optimization and update the Gaussian process surrogate model;
[0089] S5. Repeat steps S2 to S4 until the stopping condition is met, and output the final global optimal solution x. db * That is, to obtain the PID parameter K P * K I * K D *The stopping conditions include the number of iterations or convergence.
[0090] In an exemplary embodiment, step S1, constructing a mathematical model for the PID parameter optimization problem in a magnetic levitation bearing, includes: transforming the PID parameter optimization problem into a fitness function minimization problem, with the optimization variable being the PID parameter K. P K I K D K P K represents the proportionality coefficient. I K represents the integral coefficient. D Denotes the differential coefficients, and selects the integral time squared error ITSE. Let t represent the integration time, T represent the maximum integration time, and e(t) represent the error between the rotor target setpoint and the actual rotor output value; and introduce a penalty function as a performance index, then the fitness function is:
[0091]
[0092] In the formula, t s Indicates the adjustment time, t s,max This represents the maximum allowable adjustment time, and t s ≤t s,max σ represents overshoot. max This represents the maximum allowable overshoot, and σ ≤ σ max λ1 represents the weight of overshoot in the penalty function, λ2 represents the weight of settling time in the penalty function, and the PID parameter range satisfies: K p ∈[K P,min ,K P,max ], K i ∈[K I,min ,K I,max ], K d ∈[K D,min ,K D,max ].
[0093] For example, K P ∈[100,500], K I ∈[0.5,2], K D ∈[2000,8000]; the range constraints of the PID parameters are determined based on prior knowledge. λ2 and λ1 are determined experimentally.
[0094] Bayesian optimization is an efficient global optimization strategy, especially suitable for black-box problems where the objective function evaluation is costly. Its core elements include the Bayesian framework, surrogate model, and acquisition function.
[0095] In one exemplary embodiment, such as Figure 2As shown, in step S2, a Bayesian optimization sample set is generated, a Gaussian process surrogate model is fitted, and the PID parameter subspace is globally explored, including:
[0096] S2-1, Generate initial sample points x i =(K P i K I i K D i The system underwent a closed-loop test of the magnetic levitation system, and the fitness value y was then calculated. i The initial sample set D = {(x i y i )} N i=1 ;
[0097] S2-2, based on the sample set D, fits a Gaussian process surrogate model to obtain the posterior mean μ(x) and posterior variance σ of the fitness function at any point. 2 (x); The core of the Gaussian process is to use sample data to build a probabilistic model (posterior distribution) of the objective function (fitness function), so that the mean and variance of any point can be predicted.
[0098] S2-3, optimize the sampling function EI, select the next sample point, and generate the PID parameter subspace. ExpectedImprovement (EI) is a sampling function for Bayesian optimization that selects the next sampling point by evaluating the expected improvement between each candidate point and the current optimal solution, aiming to quickly find the global optimum.
[0099] In an exemplary embodiment, S2-1, initial sample point x is generated. i =(K P i K I i K D i The system underwent a closed-loop test of the magnetic levitation system, and the fitness value y was then calculated. i The initial sample set D = {(x i y i )} N i=1 ;include:
[0100] a) Using Latin hypercube sampling in the global parameter space χ=[K P,min ,K P,max ]×[K I,min ,K I,max ]×[K D,min ,K D,max Generate N sets of PID parameter vectors x within the [internal range].i ;
[0101] b) For each x i Conduct a closed-loop test of the magnetic levitation system: Input amplitude is A step The step position signal; the output error response e(t);
[0102] c) Calculate the performance index based on e(t): overshoot σ i Adjustment time t s,i ITSE;
[0103] d) Calculate fitness value: The initial sample set D = {(x i y i )} N i=1 .
[0104] In this embodiment, λ1 = 2000, λ2 = 500;
[0105] In an exemplary embodiment, step S2-2 involves fitting a Gaussian process surrogate model based on the sample set D to obtain the posterior mean μ(x) and posterior variance σ of the fitness function at any point. 2 (x); includes:
[0106] A Gaussian process surrogate model is fitted based on the sample set D: f(x) ~ GP(μ(x), k(x) i ,x j f(x) is the fitness function, used to measure the performance index of the magnetic bearing system when the input PID parameter combination x is given. The mean function μ(x) is used to calculate the expected value of the predicted fitness value at the input point x. The covariance function... Used to measure the two input endpoints x i and x j Correlation between them, x i and x j For any two input vectors in the sample set, ||x i -x j || represents the distance between two parameter vectors; l represents the length scale; The value represents the signal variance and controls the fluctuation range of the function value. The larger the value, the greater the change in the prediction fitness value; the smaller the value, the more stable the prediction. exp(·) realizes the negative exponential weighting of the distance and forms the radial basis function (RBF) kernel.
[0107] The posterior mean μ(x) = k T (K+σ 2 n I) -1In y, k represents the covariance vector of x with all training samples, K represents the covariance matrix of the training samples, and σ 2 n Let I represent the noise variance, and let (K+σ) represent the identity matrix. 2 n I) -1 represents the inverse of the noise-corrected covariance matrix, used to eliminate the influence of simulation noise on the model; y represents the fitness value vector of the training samples.
[0108] The posterior variance σ 2 (x)=k(x,x)-k T (K+σ 2 n I) -1 In k, k(x,x) represents the covariance of the sample point x to be evaluated.
[0109] The sample point x to be evaluated represents the combination of PID parameters to be evaluated. It is a new point, that is, any set of parameters (K) that has not yet been simulated and tested. P K I K D ); The new point x is not in the current sample set D = {(x i y i In the sequence |i=1,2,…,N}, the fitness value f(x) has not been calculated in actual simulation; in step S2-3, candidate points x are generated by optimizing the EI function. c In step S3, any new location explored by the dung beetle population within the subspace, or any point in the parameter space, can be considered a new point. This new point serves as a candidate parameter combination in the PID parameter space of the magnetic levitation bearing; its fitness value needs to be predicted using a surrogate model, not through actual simulation.
[0110] The core idea of Bayesian optimization is to train a Gaussian process model using existing samples; predict the posterior distribution of the unevaluated point x; and guide the next sampling step based on the prediction results (mean and variance).
[0111] In an exemplary embodiment, steps S2-3, where the optimized acquisition function EI selects the next sample point and generates a PID parameter subspace, include:
[0112] a) Calculate the value of the acquisition function EI(x) over the entire global parameter space χ;
[0113] b) Find the point that maximizes the acquisition function EI, where EI(x) satisfies: EI(x) = E[max(0,f](x, ...) = min -f(x))]
[0114] f minLet f(x) represent the minimum fitness value in the current sample, and let f(x) represent the fitness function, with the point x corresponding to the maximum EI. c Centered on x c As the center of the PID parameter subspace;
[0115] c) Calculate x c The predicted standard deviation σ(x) at the location c );
[0116] d) Define the PID parameter subspace: with x c Centered on m*σ(x) c A hypercube or hypersphere with radius (m) is used as the PID parameter subspace. m is a scaling factor, for example, m = 1.5. Since the parameter space is three-dimensional (K... P ,K I ,K D Therefore, the subspace is a cubic region.
[0117] In one exemplary embodiment, such as Figure 3 As shown, in step S3, the dung beetle optimization algorithm is executed within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db );include:
[0118] S3-1, Initialize the parameters for the dung beetle swarm and the DBO algorithm; including:
[0119] Set the parameters for the DBO algorithm, including the population size M, for example, 50 dung beetles, M=50; and the maximum number of iterations T. max For example, 20 times; other algorithm-specific parameters: such as natural coefficient α, deflection coefficient k, light intensity variation coefficient b, deflection angle θ, etc.
[0120] Initialize the dung beetle population within the PID parameter subspace obtained through Bayesian optimization: the position vector x of each dung beetle. i =(K P i K I i K D i A point (i = 1, 2, ..., M) within the PID parameter subspace represents a set of PID parameters. Latin hypercube sampling is used to generate initial positions within the subspace to ensure uniform coverage. The population is divided into four subgroups: rolling dung beetles, reproductive dung beetles, small dung beetles, and thieving dung beetles. Rolling dung beetles are responsible for global exploration; reproductive dung beetles are responsible for local development; small dung beetles balance exploration and development; and thieving dung beetles increase randomness. The subgroups can be divided according to a fixed ratio, for example: 40% rolling dung beetles, 20% reproductive dung beetles, 30% small dung beetles, and 10% thieving dung beetles, or dynamically adjusted. This step is performed only once.
[0121] S3-2, Calculate the initial fitness value;
[0122] For each individual in the population: run a closed-loop test of the magnetic levitation system to obtain the dynamic response of the magnetic levitation system;
[0123] The fitness value (Fitness) is calculated based on the dynamic response.
[0124] Record the fitness value for each individual; this step is performed only once.
[0125] S3-3, Update the location of all dung beetles:
[0126] (1) The rolling dung beetle was used to simulate the behavior of pushing dung balls. This population simulates the process of dung beetles pushing dung balls, focusing on a large-scale global search in the early stages of iteration. The rolling dung beetle's updates are divided into two cases: with obstacles and without obstacles.
[0127] Accessibility update formula: x i (t+1)=x i (t)+α×k×x i (t-1)+b×Δx(I),
[0128] Δx=|x i (t)-X W |(II),
[0129] In equation (I), t represents the current iteration number, and x i (t) represents the position of the i-th dung beetle during the t-th iteration; x i (t+1) represents the position of the i-th dung beetle during the (t+1)-th iteration; x i (t-1) represents the position of the i-th dung beetle during the (t-1)-th iteration; k∈(0,0.2] is a constant; b∈(0,1) is a fixed value; α is a natural coefficient that takes the value 1 or -1; -1 indicates deviation from the original direction, and 1 indicates no deviation; in equation (II), X W The individual with the worst global position and the highest fitness; Δx simulates changes in light intensity;
[0130] With obstacles, update formula: x i (t+1)=x i (t)+tan(θ)×|x i (t)-x i (t-1)|(III),
[0131] In equation (III), θ represents the deflection angle, and θ∈[0,π].
[0132] After the update, if the new position exceeds the subspace boundary, proceed to step S3-4 for boundary processing.
[0133] When t = 1: the barrier-free formula (I): xi(1) = xi(0) + b × Δx;
[0134] Obstacle formula (III): If θ = 0, then do not update; when θ ≠ 0, replace xi(t-1) with xi(0).
[0135] (2) The renewal formula for breeding dung beetles is:
[0136] x i (t+1)=X B +b1×(x i (t)-Lb*)+b2×(x i (t)-Ub*)(IV),
[0137] Lb * =max(X B ×(1-R1),Lb)(V),
[0138] Ub * =min(X) B ×(1+R1),Ub)(VI),
[0139] In equation (IV), X B This represents the current optimal position of the individual, which is also the optimal spawning position of the individual; Lb* represents the lower bound of the spawning zone, and Ub* represents the upper bound of the spawning zone; b1 and b2 represent two independent vectors of size 1×D, where D represents the dimension of the optimization problem, and R1 represents the proportional coefficient of the spawning zone radius, R1=1-t / Tmax. R1 makes the range of the spawning zone decrease linearly. As the number of iterations approaches its maximum, R approaches 0. Lb represents the lower bound of the PID parameter subspace; Ub represents the upper bound of the PID parameter subspace.
[0140] (3) Dung beetles are used to simulate the exploration behavior of dung beetle larvae after hatching, and to conduct a medium-range search near the breeding area, balancing exploration and development.
[0141] Its update formula:
[0142] x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b (VII),
[0143] Lb b =max(X b ×(1-R2),Lb) (VIII),
[0144] Ub b =min(X) b ×(1+R2),Ub) (IX),
[0145] In equation (VII), C1 represents a random number that follows a normal distribution; C2 represents a random number belonging to (0,1); X b R2 represents the globally optimal location, which is also the globally optimal feeding location; R2 represents the foraging radius proportionality coefficient, R2 = 1 - t / Tmax; Lb b Ub represents the upper bound of the optimal feeding region. b This represents the lower bound of the optimal feeding region.
[0146] (4) The dung beetle stealing behavior is used to simulate the behavior of dung beetles snatching dung balls from other individuals, increasing randomness and enhancing population diversity through sudden random jumps; its update formula is:
[0147] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |) (X),
[0148] In equation (X), g is a 1×D dimensional random vector following a normal distribution; S represents the theft step size coefficient, and X... * This represents the position of a randomly selected individual in the current population, simulating a thief tracking a target ball; S represents the theft step size coefficient.
[0149] S3-4, check whether the updated position of each dung beetle exceeds the boundary of the PID parameter subspace recommended by Bayesian optimization;
[0150] If it exceeds the limit, boundary processing is performed: the position can be projected onto the boundary and set as the boundary value. The specific method depends on the problem, but the projection method is usually used.
[0151] x i new =min(max(x) i new ,LB sub ),UB sub ) (XI),
[0152] In equation (XI), LB sub UB represents the lower bound of the PID parameter subspace in each dimension. sub This represents the upper bound of the PID parameter subspace in each dimension.
[0153] S3-5, calculate the new fitness value, and update the individual optimal position and the global optimal position;
[0154] Update individual optimality: Compare the fitness values of all individuals in the current population; if the fitness value of the new location is better than the individual's historical best, then update the individual optimality; this allows reproductive behavior to lay eggs in better safe zones, foraging behavior to be based on better food locations, and stealing behavior to target higher-quality targets. The purpose of this step is to preserve the best solution found by the individual during the search process and avoid losing high-quality solutions due to subsequent moves.
[0155] Update the global optimum: If the fitness value of an individual is better than the global optimum, then update the global optimum and its fitness value.
[0156] S3-6, Repeat steps S3-3 to S3-5 until convergence or the termination condition is met, and output the global optimal solution x. db =(K P * ,K I * ,K D * ) and its fitness value y db The global optimal solution is the optimal PID parameter found within the PID parameter subspace recommended by BO; the termination condition includes reaching the maximum number of iterations.
[0157] In one exemplary embodiment, a device for setting control parameters of a magnetic levitation bearing is provided, such as... Figure 4 As shown, it includes:
[0158] The mathematical modeling module is used to construct mathematical models for the PID parameter optimization problem in magnetic levitation bearings.
[0159] The Bayesian optimization module is used to generate a sample set for Bayesian optimization, fit a Gaussian process surrogate model, and globally explore and generate a subspace of PID parameters.
[0160] The dung beetle optimization module is used to execute the dung beetle optimization algorithm within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db );
[0161] The iterative update module is used to update the Gaussian process model and obtain the final global optimum x. db * =(K P * ,K I * ,K D * ).
[0162] In one exemplary embodiment, a computer-readable storage medium is provided, the storage medium storing a computer program that, when executed by a processor, implements the tuning method described above.
[0163] In one exemplary embodiment, an electronic device is provided, such as Figure 5 As shown, it includes:
[0164] Memory, used to store programs;
[0165] A processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the tuning method.
[0166] In one exemplary embodiment, such as Figure 6 As shown, the method for tuning the control parameters of the magnetic levitation bearing is stored in a PC and integrated with the magnetic bearing control system.
[0167] Based on the original magnetic bearing control system, the magnetic bearing coil current signal and rotor displacement signal under working conditions are input to the PC through the data acquisition card. The PC runs the above-mentioned tuning method, sends excitation signals such as step signals or sine wave signals to the digital controller, and analyzes the current and displacement signals generated by the system after excitation to obtain the tuned control parameters. These parameters are then transmitted to the magnetic bearing digital controller through serial communication to complete the online parameter tuning.
[0168] By using online tuning, the parameter deviation caused by the error between the actual system and the mathematical model can be resolved, and the optimal control parameters can be quickly tuned. Static and dynamic tuning can be performed when the rotor is statically suspended or rotating. Based on the tuning results of the control parameters under different operating conditions, a magnetic bearing controller with better dynamic performance can be designed.
[0169] Figure 6 The digital controller and the PC exchange data via a serial communication module. The specific relationship between the digital controller, the serial communication module, and the PC is as follows: Figure 7 As shown.
[0170] The model of a magnetic levitation bearing rotor system exhibits speed dependence, with its dynamic characteristics significantly evolving with changes in rotational speed. Accordingly, the control method must achieve adaptive parameter adjustment to ensure the system remains within its optimal operating range. In practice, a staged tuning method for the magnetic levitation bearing control parameters can be implemented across the entire speed range to identify and solidify the optimal control parameters for each speed segment, thereby constructing a speed-PID parameter mapping table. This parameter tuning method based on operating condition partitioning significantly enhances the adaptability and robustness of the magnetic levitation bearing under variable speed conditions, ultimately improving the reliability of the entire system.
[0171] The foregoing description illustrates and describes preferred embodiments of this application. However, as previously understood, this application is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the conception herein through the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of this application should be within the protection scope of the appended claims.
Claims
1. A method for tuning control parameters of a magnetic levitation bearing, characterized in that, include: S1. Construct a mathematical model for the PID parameter optimization problem in magnetic levitation bearings, including: transforming the PID parameter optimization problem into a fitness function minimization problem, with the optimization variable being the PID parameter K. P K I K D K P K represents the proportionality coefficient. I K represents the integral coefficient. D Denotes the differential coefficients, and selects the integral time squared error ITSE. Let t represent the integration time, T represent the maximum integration time, and e(t) represent the error between the rotor target setpoint and the actual rotor output value; and introduce a penalty function as a performance index, then the fitness function is: ; In the formula, t s Indicates the adjustment time, t s,max This represents the maximum allowable adjustment time, and t s ≤t s,max σ represents overshoot. max This represents the maximum allowable overshoot, and σ ≤ σ max λ1 represents the weight of overshoot in the penalty function, λ2 represents the weight of settling time in the penalty function, and the PID parameter range satisfies: K p ∈[K P,min ,K P,max ], K i ∈[K I,min ,K I,max ], K d ∈[K D,min ,K D,max ]; S2 generates a Bayesian optimized sample set, fits a Gaussian process surrogate model, and globally explores and generates a PID parameter subspace; S3, execute the dung beetle optimization algorithm within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db ); S4, the optimal point (x) db y db Add it to the sample set for Bayesian optimization and update the Gaussian process surrogate model; S5. Repeat steps S2 to S4 until the stopping condition is met, and output the final global optimal solution x. db * That is, to obtain the PID parameter K P * K I * K D * .
2. The method for tuning the control parameters of a magnetic levitation bearing according to claim 1, characterized in that, In step S2, a Bayesian optimized sample set is generated, a Gaussian process surrogate model is fitted, and the PID parameter subspace is globally explored; including: S2-1, Generate initial sample points x i =(K P i K I i K D i The system underwent a closed-loop test of the magnetic levitation system, and the fitness value y was then calculated. i The initial sample set D={(x i y i )} N i=1 ; S2-2, based on the sample set D, fits a Gaussian process surrogate model to obtain the posterior mean μ(x) and posterior variance σ of the fitness function at any point. 2 (x); S2-3, optimize the acquisition function EI, select the next sample point, and generate the PID parameter subspace.
3. The method for tuning the control parameters of a magnetic levitation bearing according to claim 2, characterized in that, S2-1, Generate initial sample points x i =(K P i K I i K D i The system underwent a closed-loop test of the magnetic levitation system, and the fitness value y was then calculated. i The initial sample set D={(x i y i )} N i=1 ; include: a) Using Latin hypercube sampling in the global parameter space χ=[K P,min ,K P,max ]×[K I,min ,K I,max ]×[K D,min ,K D,max Generate N sets of PID parameter vectors x within the [internal] scope. i ; b) For each x i Perform closed-loop simulation of the magnetic levitation system: Input amplitude is A step The step position signal; the output error response e(t); c) Calculate the performance index based on e(t): overshoot σ i Adjustment time t s,i ITSE; d) Calculate fitness value: The initial sample set D={(x i y i )} N i=1 .
4. The method for tuning the control parameters of a magnetic levitation bearing according to claim 3, characterized in that, Step S2-2, the Gaussian process surrogate model is fitted based on the sample set D to obtain the posterior mean μ(x) and posterior variance σ of the fitness function at any point. 2 (x); includes: A Gaussian process surrogate model fitted based on sample set D: f (x)~GP(μ(x),k(x i ,x j )), f (x) is the fitness function, used to measure the performance index of the magnetic bearing system when the input PID parameter combination x is given. The mean function μ(x) is used to calculate the expected value of the predicted fitness value at the input point x. The covariance function... x i and x j For any two input vectors in the sample set, ||x i -x j || represents the distance between two parameter vectors; l Indicates length measurement; σ 2 f Indicates the signal variance; The posterior mean μ(x) = k T (K+σ 2 n I) -1 In y, k represents the covariance vector of x with all training samples, K represents the covariance matrix of the training samples, and σ 2 n Let I represent the noise variance, and let (K+σ) represent the identity matrix. 2 n I) -1 Let represent the inverse of the noise-corrected covariance matrix, and y represent the fitness value vector of the training samples. The posterior variance σ 2 (x)=k(x,x)-k T (K+σ 2 n I) -1 In k, k(x,x) represents the covariance of the sample point x to be evaluated.
5. The method for tuning the control parameters of a magnetic levitation bearing according to claim 2, characterized in that, In steps S2-3, the optimized acquisition function EI selects the next sample point and generates a PID parameter subspace; including: a) Calculate the value of the acquisition function EI(x) over the entire global parameter space χ; b) Find the point that maximizes the acquisition function EI, where EI(x) satisfies: EI(x) = E[max(0, f min - f (x))], f min This represents the minimum fitness value in the current sample. f (x) represents the fitness function, with x being the point corresponding to the maximum EI. c Centered on x c As the center of the PID parameter subspace; c) Calculate x c The predicted standard deviation σ(x) at the location c ); d) Define the PID parameter subspace: using x c Centered on m*σ(x) c A hypercube or hypersphere with radius ) is used as the subspace of PID parameters.
6. The method for tuning the control parameters of a magnetic levitation bearing according to claim 2, characterized in that, In step S3, the dung beetle optimization algorithm is executed within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db );include: S3-1, Initialize the parameters for the dung beetle swarm and the DBO algorithm; including: Set the parameters for the DBO algorithm, including population size M and maximum number of iterations T. max Natural coefficient α, deflection coefficient k, light intensity variation coefficient b, deflection angle θ; Initialize the dung beetle population within the PID parameter subspace obtained through Bayesian optimization: the position vector x of each dung beetle. i =(K P i K I i K D i ), representing a set of PID parameters, i=1,2,..,M; initial positions are generated in the subspace using Latin hypercube sampling, dividing the population into four subgroups: dung beetle, reproductive dung beetle, small dung beetle, and thieving dung beetle; S3-2, Calculate the initial fitness value; S3-3, Update the location of all dung beetles: (1) The regeneration of the dung beetle is divided into two cases: with obstacles and without obstacles. Accessibility update formula: x i (t+1)=x i (t)+α×k×x i (t-1)+b×Δx (I), Δx=|x i (t)-X W | (II) , In equation (I), t represents the current iteration number, and x i (t) represents the position of the i-th dung beetle during the t-th iteration; x i (t+1) represents the position of the i-th dung beetle during the (t+1)-th iteration; x i (t-1) represents the position of the i-th dung beetle during the (t-1)-th iteration; in equation (II), X W The worst-case position globally; Δx simulates changes in light intensity; With obstacles, update formula: x i (t+1)=x i (t)+tan(θ)×|x i (t)-x i (t-1)| (III); (2) The renewal formula for breeding dung beetles is: x i (t+1)=X B +b1×(x i (t)-Lb*)+b2×(x i (t)-Ub*) (IV), Lb * =max(X B ×(1-R1),Lb) (V), Ub * =min(X B ×(1+R1),Ub) (VI), In equation (IV), X B The current optimal position of the individual is represented by Lb*, the lower bound of the spawning zone is represented by Ub*, the upper bound of the spawning zone is represented by b1 and b2, which are two independent vectors of size 1×D, where D represents the dimension of the optimization problem, R1 represents the proportional coefficient of the spawning zone radius, R1=1-t / Tmax, Lb represents the lower bound of the PID parameter subspace, and Ub represents the upper bound of the PID parameter subspace. (3) The renewal formula of the dung beetle: x i (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b ) (VII), Lb b =max(X b ×(1-R2),Lb) (VIII), Ub b =min(X b ×(1+R2),Ub) (IX), In equation (VII), C1 represents a random number that follows a normal distribution; C2 represents a random number belonging to (0,1); X b R2 represents the global optimal position; R2 represents the foraging radius proportionality coefficient, R2=1-t / Tmax; Lb b Ub represents the upper bound of the optimal feeding region. b This represents the lower bound of the optimal feeding region; (4) The update formula for the dung beetle: x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |) (X), In equation (X), g is a 1×D dimensional random vector following a normal distribution; S represents the theft step size coefficient, and X * This represents the position of a randomly selected individual in the current population, and S represents the theft step size coefficient. S3-4, check whether the updated position of each dung beetle exceeds the boundary of the PID parameter subspace recommended by Bayesian optimization; S3-5, calculate the new fitness value, and update the individual optimal position and the global optimal position; S3-6, Repeat steps S3-3 to S3-5 until convergence or the termination condition is met, and output the global optimal solution x. db =(K P * ,K I * ,K D * ) and its fitness value y db .
7. A device for setting control parameters of a magnetic levitation bearing, characterized in that, To implement the method according to any one of claims 1-6, comprising: The mathematical modeling module is used to construct mathematical models for the PID parameter optimization problem in magnetic levitation bearings. The Bayesian optimization module is used to generate a sample set for Bayesian optimization, fit a Gaussian process surrogate model, and globally explore and generate a subspace of PID parameters. The dung beetle optimization module is used to execute the dung beetle optimization algorithm within the PID parameter subspace to obtain the optimal point (x) within the PID parameter subspace. db y db ); The loop update module is used to update the Gaussian process model and obtain the optimal PID parameters x. db * =(K P * ,K I * ,K D * ).
8. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the tuning method according to any one of claims 1-6.
9. An electronic device, characterized in that, include: Memory, used to store programs; A processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps of the tuning method according to any one of claims 1-6.