Brushless direct current motor rotating speed control method based on genetic ant colony optimization

文档序号:1920853 发布日期:2021-12-03 浏览:22次 中文

阅读说明:本技术 一种基于遗传蚁群优化的无刷直流电机转速控制方法 (Brushless direct current motor rotating speed control method based on genetic ant colony optimization ) 是由 马梦琳 李梦达 李永祥 张东昱 张承宇 赵愈熙 邓琳 于 2021-08-31 设计创作,主要内容包括:本发明涉及一种基于遗传蚁群优化的无刷直流电机转速控制方法,其特征在于,包括以下步骤:获取电机的转速误差e和误差率ec,将转速误差e和误差率ec输入模糊控制器,以得到PID控制参数调整量ΔK-(p)、ΔK-(i)和ΔK-(d),其中,模糊控制器的模糊规则、量化因子K-(e)、K-(ec)和比例因子K-(u)均基于遗传蚁群混合算法进行优化;将PID控制参数调整量ΔK-(p)、ΔK-(i)和ΔK-(d)输出给PID调节器,由PID调节器输出得到对应的控制变量;根据控制变量对应控制电机转速。与现有技术相比,本发明采用遗传蚁群混合算法对模糊控制器的模糊规则进行离线优化,并在线优化量化因子和比例因子,能够有效减小转速控制的超调量、提高转速控制的响应速度、抗干扰能力及稳定性。(The invention relates to a brushless direct current motor rotating speed control method based on genetic ant colony optimization, which is characterized by comprising the following steps of: acquiring a rotating speed error e and an error rate ec of the motor, and inputting the rotating speed error e and the error rate ec into a fuzzy controller to obtain a PID control parameter adjustment quantity delta K p 、ΔK i And Δ K d Wherein, the fuzzy rule and the quantization factor K of the fuzzy controller e 、K ec And a scale factor K u Optimizing based on a genetic ant colony mixing algorithm; adjusting the PID control parameter by delta K p 、ΔK i And Δ K d Outputting the control variable to a PID regulator, and outputting the control variable to obtain a corresponding control variable by the PID regulator; and correspondingly controlling the rotating speed of the motor according to the control variable. Compared with the prior art, the method adopts the genetic ant colony hybrid algorithm to perform off-line optimization on the fuzzy rule of the fuzzy controller, optimizes the quantization factor and the scale factor on line, and can effectively reduce the overshoot of the rotating speed control and improve the response speed, the anti-interference capability and the stability of the rotating speed control.)

1. A brushless direct current motor rotating speed control method based on genetic ant colony optimization is characterized by comprising the following steps:

s1, obtaining the rotation speed error e and the error rate ec of the motor, inputting the rotation speed error e and the error rate ec into a fuzzy controller to obtain the PID control parameter adjustment quantity delta Kp、ΔKiAnd Δ KdWherein, the fuzzy rule and the quantization factor K of the fuzzy controllere、KecAnd a scale factor KuOptimizing based on a genetic ant colony mixing algorithm;

s2, adjusting quantity delta K of PID control parameterp、ΔKiAnd Δ KdOutputting the control variable to a PID regulator, and outputting the control variable to obtain a corresponding control variable by the PID regulator;

and S3, correspondingly controlling the motor speed according to the control variable.

2. The method for controlling the rotation speed of the brushless direct current motor based on genetic ant colony optimization according to claim 1, wherein the step S1 specifically comprises the following steps:

s11, the error rate e and the error rate ec pass through a quantization factor KeAnd KecConversion from the fundamental discourse domain to the fuzzy domain;

s12, combining the fuzzy rule, carrying out fuzzy reasoning and deblurring processing on the rotating speed error e and the error rate ec after the fuzzy conversion to obtain a fuzzy output variable delta Kpˊ、ΔKiˊ、ΔKdˊ;

S13 fuzzy output variable delta Kpˊ、ΔKiˊ、ΔKdThe process scale factor KuCarrying out clarification to obtain PID control parameter adjustment quantity delta Kp、ΔKiAnd Δ Kd

3. The method for controlling the rotation speed of the brushless dc motor according to claim 2, wherein the fuzzy rule of the fuzzy controller in step S1 is specifically:

the input variables are rotating speed error e and error rate ec, the fuzzy decision output variable is U, and the input and output are divided into 7 stages: { NB, NM, NS, ZE, PS, PM, PB }, i.e. the correspondence indicates { negative large, negative medium, negative small, zero, positive small, positive medium, positive large }, whereby 49 fuzzy rules can be obtained.

4. The method according to claim 3, wherein the step S1 of optimizing based on the genetic ant colony optimization is to operate the genetic algorithm to obtain a solution generated when the genetic algorithm is terminated and to use the solution as an initial pheromone distribution of the ant colony algorithm, and then operate the ant colony algorithm to solve the solution to obtain the optimized fuzzy rule and the optimized quantization factor Ke、KecAnd a scale factor Ku

5. The brushless direct current motor rotation speed control method based on genetic ant colony optimization according to claim 4, wherein the solving process of the genetic algorithm specifically comprises the following steps:

a1, adopting a 10-bit binary code to set the encoding form of the fuzzy rule;

a2, constructing a first fitness function;

a3, selecting according to a first population quantity by adopting a roulette method, calculating the fitness value of each first individual to determine a first selection probability, and setting a first cross probability and a first variation probability, wherein the first population quantity is the same as the quantity of fuzzy rules, and each first individual corresponds to one fuzzy rule;

a4, constructing a control function to control the iteration times of the genetic algorithm, setting the maximum value and the minimum value of the iteration times, and finishing the optimization solution of the fuzzy rule by combining the first selection probability, the first cross probability and the first variation probability;

b1, setting a second population quantity corresponding to the control parameter, and carrying out initial assignment on the control parameter, wherein the control parameter comprises a quantization factor Ke、KecAnd a scale factor Ku

B2, constructing a second fitness function;

b3, selecting according to the second population quantity by adopting a roulette method, calculating the fitness value of each second individual to determine a second selection probability, and setting a second cross probability and a second variation probability, wherein each second individual corresponds to a control parameter;

and B4, combining the maximum value of the iteration times, the second selection probability, the second cross probability and the second variation probability to complete the optimization solution of each control parameter.

6. The method for controlling the rotating speed of the brushless direct current motor based on genetic ant colony optimization according to claim 5, wherein the encoding form of the fuzzy rule is specifically as follows: the first bit indicates whether the rule is available, 1 indicates available, 0 indicates abort;

the second to fourth bits represent an error e;

the fifth to seventh bits represent the error change rate ec;

the eighth to tenth digits represent the decision variable U.

7. The method for controlling the rotating speed of the brushless direct current motor based on genetic ant colony optimization according to claim 5, wherein the first fitness function is specifically as follows:

wherein f isGA1As a function of the first fitness, JGA1Is a first objective function;

the first population quantity is:

MGA1=49

the first selection probability is:

wherein f isGA1iThe fitness value of the ith first individual;

the first cross probability is set as:

PGA1c=0.8

the first mutation probability is set as:

PGA1m=0.2

the control function is specifically:

ΔfGA=fGAmax-fGAΣ

wherein f isGAmaxObtaining the maximum fitness value, f, for a single individualGAΣAs the average value of individual fitnessWhen Δ f isGAIf the value of (2) exceeds 5 generations and is lower than the set threshold value, ending the genetic algorithm and starting to run the ant colony algorithm.

If the control function fails to end the genetic algorithm, the maximum value N is determined according to the number of iterationsGAmaxAnd minimum value NGAminAt the current iteration number, N is reachedGAmaxAnd ending the genetic algorithm and starting to operate the ant colony algorithm.

8. The method for controlling the rotating speed of the brushless direct current motor based on genetic ant colony optimization according to claim 7, wherein the second fitness function is specifically as follows:

wherein f isGA2As a function of the second fitness, JGA2Is a second objective function, k1To optimize the coefficients.

9. The brushless direct current motor rotation speed control method based on genetic ant colony optimization according to claim 8, wherein the solving process of the ant colony algorithm specifically comprises the following steps:

c1, screening out high-quality solutions with the fitness value within the first 30% from the solutions generated when the genetic algorithm is terminated, and using the high-quality solutions as the initial pheromone distribution of the ant colony algorithm;

c2, setting a fuzzy rule table, an ant colony iteration threshold value and the total number of ants, and searching by taking the current positions of 49 fuzzy rules as initial positions;

c3, setting ant colony selection probability and ant colony objective function to update solving pheromones and complete the optimization solution of fuzzy rules;

d1, quantizing factor Ke、KecAnd a scale factor KuCorresponding to a set of 15-bit numerical sequences to represent on a plane coordinate axis, wherein the abscissa x1~x5、x6~x10、x11~x15Respectively represents Ke、Kec、KuThe walking path of ant is P (q) ═ y1,β,y2,β,…yj,β…,y15,β},q=1,2,……,N,j=1,2,……,15,yj,βIs the ordinate on which the beta-th ant crawls, and N is the total number of ants;

thereby determining the quantization factor Ke、KecAnd a scale factor KuThe computational expression of (1);

d2, setting transition probability and combining with a quantization factor Ke、KecAnd a scale factor KuTo the quantization factor Ke、KecAnd a scale factor KuAnd (4) optimizing and solving.

10. The method for controlling the rotating speed of the brushless direct current motor based on genetic ant colony optimization according to claim 9, wherein the ant colony selection probability specifically comprises:

wherein, cACO1Is the selection probability of ants from h point to s point at time t, awAlpha is the pheromone concentration weight, p is the set of points that the ant is allowed to walkACOhs βThe probability of the beta-th ant transferring from h point to s point, tauhsQ is a random number between 0 and 1 in order to transfer pheromone concentration on the path from the point h to the point s0Is a random number uniformly distributed between 0 and 1, when q is0When the size of the ant is large, the ant can easily select a path with more pheromones to cause local convergence, and if the size of the ant is small, the convergence speed is too low, so that q is selected0Is the ratio of the number of iterations to the total number of iterations;

the ant colony objective function is specifically:

filling the fuzzy rule corresponding to the minimum value of the objective function into a fuzzy rule table so as to optimize the fuzzy rule table;

the pheromone for updating and solving is specifically as follows:

τhs(t+1)=ρτhs(t)+Δτhs b

wherein ρ is the pheromone volatilization coefficient concentration from t to t +1, and 0<ρ<1,The beta th ant is at d from t to t +1hsThe pheromone amount of unit length on the branch, Q is the total pheromone amount released by ants in the process of reciprocating, is a constant,for iterating the amount of pheromones on the optimal path, JACOβThe objective function value of the beta-th ant;

the quantization factor Ke、KecAnd a scale factor KuThe calculation expression of (a) is specifically:

the transition probability is specifically:

wherein, the lambda is the heuristic information weight,heuristic factor, y, for transition from h to s at time thsIs the ordinate of the point s and,is the ordinate value of the current best path point.

Technical Field

The invention relates to the technical field of brushless direct current motor control, in particular to a brushless direct current motor rotating speed control method based on genetic ant colony optimization.

Background

A brushless dc motor is composed of a motor main body and a driver, and is a typical mechatronic device, the rotation speed of which is controlled by changing the alternating frequency of a current input to a stator coil.

The control of brushless DC motor rotational speed can adopt open-loop control, also can adopt closed-loop control, compare in open-loop control, adopt PID closed-loop control can improve the speed governing scope greatly, consequently, adopt the PID regulator to carry out brushless DC motor's rotational speed control at present mostly, but the PID regulator is easily disturbed, the influence of sampling precision, to such a typical nonlinearity of brushless DC motor, multivariable coupled system, conventional PID regulator is difficult to realize the high accuracy control to the motor, this just leads to motor torque to fluctuate great.

The prior art improves the control precision of PID by a fuzzy self-adaptive control mode, namely, a fuzzy controller is utilized to output three parameters K of PIDp、Ki、KdIs adjusted by delta Kp、ΔKiAnd Δ KdHowever, in the existing fuzzy controller, the fuzzy rules are mostly obtained according to expert experience, and the online adjustment capability of the control parameters is poor, the response speed is slow, and the control is not beneficial to stable and reliable control.

Disclosure of Invention

The invention aims to overcome the defects in the prior art and provide a brushless direct current motor rotating speed control method based on genetic ant colony optimization.

The purpose of the invention can be realized by the following technical scheme: a brushless direct current motor rotating speed control method based on genetic ant colony optimization comprises the following steps:

s1, obtaining the rotation speed error e and the error rate ec of the motor, inputting the rotation speed error e and the error rate ec into a fuzzy controller to obtain the PID control parameter adjustment quantity delta Kp、ΔKiAnd Δ KdWherein, the fuzzy rule and the quantization factor K of the fuzzy controllere、KecAnd a scale factor KuOptimizing based on a genetic ant colony mixing algorithm;

s2, adjusting quantity delta K of PID control parameterp、ΔKiAnd Δ KdOutputting the control variable to a PID regulator, and outputting the control variable to obtain a corresponding control variable by the PID regulator;

and S3, correspondingly controlling the motor speed according to the control variable.

Further, the step S1 specifically includes the following steps:

s11, the error rate e and the error rate ec pass through a quantization factor KeAnd KecConversion from the fundamental discourse domain to the fuzzy domain;

s12, combining the fuzzy rule, carrying out fuzzy reasoning and deblurring processing on the rotating speed error e and the error rate ec after the fuzzy conversion to obtain a fuzzy output variable delta Kpˊ、ΔKiˊ、ΔKdˊ;

S13 fuzzy output variable delta Kpˊ、ΔKiˊ、ΔKdThe process scale factor KuCarrying out clarification to obtain PID control parameter adjustment quantity delta Kp、ΔKiAnd Δ Kd

Further, the fuzzy rule of the fuzzy controller in the step S1 is specifically:

the input variables are rotating speed error e and error rate ec, the fuzzy decision output variable is U, and the input and output are divided into 7 stages: { NB, NM, NS, ZE, PS, PM, PB }, i.e. the correspondence indicates { negative large, negative medium, negative small, zero, positive small, positive medium, positive large }, whereby 49 fuzzy rules can be obtained.

Further, the optimization in step S1 is specifically performed based on a genetic ant colony mixture algorithmFirstly, running the genetic algorithm to obtain a solution generated when the genetic algorithm is terminated and serving as initial pheromone distribution of the ant colony algorithm, then running the ant colony algorithm to solve to obtain an optimized fuzzy rule and a quantization factor Ke、KecAnd a scale factor Ku

Further, the solving process of the genetic algorithm specifically comprises the following steps:

a1, adopting a 10-bit binary code to set the encoding form of the fuzzy rule;

a2, constructing a first fitness function;

a3, selecting according to a first population quantity by adopting a roulette method, calculating the fitness value of each first individual to determine a first selection probability, and setting a first cross probability and a first variation probability, wherein the first population quantity is the same as the quantity of fuzzy rules, and each first individual corresponds to one fuzzy rule;

a4, constructing a control function to control the iteration times of the genetic algorithm, setting the maximum value and the minimum value of the iteration times, and finishing the optimization solution of the fuzzy rule by combining the first selection probability, the first cross probability and the first variation probability;

b1, setting a second population quantity corresponding to the control parameter, and carrying out initial assignment on the control parameter, wherein the control parameter comprises a quantization factor Ke、KecAnd a scale factor Ku

B2, constructing a second fitness function;

b3, selecting according to the second population quantity by adopting a roulette method, calculating the fitness value of each second individual to determine a second selection probability, and setting a second cross probability and a second variation probability, wherein each second individual corresponds to a control parameter;

and B4, combining the maximum value of the iteration times, the second selection probability, the second cross probability and the second variation probability to complete the optimization solution of each control parameter.

Further, the encoding form of the fuzzy rule is specifically as follows: the first bit indicates whether the rule is available, 1 indicates available, 0 indicates abort;

the second to fourth bits represent an error e;

the fifth to seventh bits represent the error change rate ec;

the eighth to tenth digits represent the decision variable U.

Further, the first fitness function is specifically:

wherein f isGA1As a function of the first fitness, JGA1Is a first objective function;

the first population quantity is:

MGA1=49

the first selection probability is:

wherein f isGA1iThe fitness value of the ith first individual;

the first cross probability is set as:

PGA1c=0.8

the first mutation probability is set as:

PGA1m=0.2

the control function is specifically:

ΔfGA=fGAmax-fGAΣ

wherein f isGAmaxObtaining the maximum fitness value, f, for a single individualGAΣIs the average value of individual fitness when delta fGAIf the value of (2) exceeds 5 generations and is lower than the set threshold value, ending the genetic algorithm and starting to run the ant colony algorithm.

If the control function fails to endGenetic algorithm, then according to the maximum value N of the number of iterationsGAmaxAnd minimum value NGAminAt the current iteration number, N is reachedGAmaxAnd ending the genetic algorithm and starting to operate the ant colony algorithm.

Further, the second fitness function is specifically:

wherein f isGA2As a function of the second fitness, JGA2Is a second objective function, k1To optimize the coefficients.

Further, the solving process of the ant colony algorithm specifically includes:

c1, screening out high-quality solutions with the fitness value within the first 30% from the solutions generated when the genetic algorithm is terminated, and using the high-quality solutions as the initial pheromone distribution of the ant colony algorithm;

c2, setting a fuzzy rule table, an ant colony iteration threshold value and the total number of ants, and searching by taking the current positions of 49 fuzzy rules as initial positions;

c3, setting ant colony selection probability and ant colony objective function to update solving pheromones and complete the optimization solution of fuzzy rules;

d1, quantizing factor Ke、KecAnd a scale factor KuCorresponding to a set of 15-bit numerical sequences to represent on a plane coordinate axis, wherein the abscissa x1~x5、x6~x10、x11~x15Respectively represents Ke、Kec、KuThe walking path of ant is P (q) ═ y1,β,y2,β,…yj,β…,y15,β},q=1,2,……,N,j=1,2,……,15,yj,βIs the ordinate on which the beta-th ant crawls, and N is the total number of ants;

thereby determining the quantization factor Ke、KecAnd a scale factor KuThe computational expression of (1);

d2, setting transition probability and combining with a quantization factor Ke、KecAnd a scale factor KuTo the quantization factor Ke、KecAnd a scale factor KuAnd (4) optimizing and solving.

Further, the ant colony selection probability specifically includes:

wherein, cACO1Is the selection probability of ants from h point to s point at time t, awAlpha is the pheromone concentration weight, p is the set of points that the ant is allowed to walkACOhs βThe probability of the beta-th ant transferring from h point to s point, tauhsQ is a random number between 0 and 1 in order to transfer pheromone concentration on the path from the point h to the point s0Is a random number uniformly distributed between 0 and 1, when q is0When the size of the ant is large, the ant can easily select a path with more pheromones to cause local convergence, and if the size of the ant is small, the convergence speed is too low, so that q is selected0Is the ratio of the number of iterations to the total number of iterations;

the ant colony objective function is specifically:

filling the fuzzy rule corresponding to the minimum value of the objective function into a fuzzy rule table so as to optimize the fuzzy rule table;

the pheromone for updating and solving is specifically as follows:

τhs(t+1)=ρτhs(t)+Δτhs b

wherein ρ is the pheromone volatilization coefficient concentration from t to t +1, and 0<ρ<1,The beta th ant is at d from t to t +1hsThe pheromone amount of unit length on the branch, Q is the total pheromone amount released by ants in the process of reciprocating, is a constant,for iterating the amount of pheromones on the optimal path, JACOβThe objective function value of the beta-th ant;

the quantization factor Ke、KecAnd a scale factor KuThe calculation expression of (a) is specifically:

the transition probability is specifically:

wherein, the lambda is the heuristic information weight,heuristic factor, y, for transition from h to s at time thsIs the ordinate of the point s and,is the ordinate value of the current best path point.

Compared with the prior art, the method aims at the brushless direct current motor, combines the genetic algorithm with the ant colony algorithm to perform off-line optimization on the fuzzy rule of the fuzzy controller, and optimizes the quantization factor and the scale factor on line, so that the method has the advantages of higher response capability, smaller overshoot and stronger anti-interference capability, and further ensures the response speed and stability of subsequent rotating speed control;

the method firstly operates the genetic algorithm, then takes the solution generated when the genetic algorithm is terminated as the initial pheromone distribution of the ant colony algorithm, and operates the ant colony algorithm on the basis of the genetic algorithm, thereby further improving the global search capability and the convergence speed of the optimization solving process.

Drawings

FIG. 1 is a schematic flow diagram of the process of the present invention;

FIG. 2 is a block diagram of a control architecture of the present invention;

FIG. 3 is a schematic diagram illustrating membership of a fuzzy PID controller in an embodiment;

FIG. 4 is a schematic diagram of fuzzy rule coding of the genetic algorithm in the example;

FIG. 5 is a diagram illustrating the corresponding encoding of fuzzy linguistic variables in the embodiment;

fig. 6 is a schematic diagram of ant walking paths of the ant colony algorithm in the embodiment;

FIG. 7 is a graph comparing unit step response curves of three control modes in the embodiment;

FIG. 8a is a graph illustrating the iteration number of an objective function when the ant colony algorithm is adopted alone in the embodiment;

FIG. 8b is a graph of the iteration number of the objective function when the hybrid algorithm of the present invention is used in the embodiment;

FIG. 9 is a comparison graph of the control effect of the rotational speed in the three control modes in the embodiment;

FIG. 10 is a schematic diagram showing the comparison of the torque control effects in the three control modes in the embodiment;

FIG. 11a is a motor current curve diagram when the fuzzy controller is optimized by the ant colony algorithm alone in the embodiment;

FIG. 11b is a graph of motor current curves for an embodiment using the hybrid algorithm of the present invention to optimize a fuzzy controller;

FIG. 11c is a schematic diagram of the motor current curve when only the fuzzy control is performed in the embodiment.

Detailed Description

The invention is described in detail below with reference to the figures and specific embodiments.

Examples

As shown in fig. 1, a method for controlling the rotation speed of a brushless dc motor based on genetic ant colony optimization includes the following steps:

s1, obtaining the rotation speed error e and the error rate ec of the motor, inputting the rotation speed error e and the error rate ec into a fuzzy controller to obtain the PID control parameter adjustment quantity delta Kp、ΔKiAnd Δ KdWherein, the fuzzy rule and the quantization factor K of the fuzzy controllere、KecAnd a scale factor KuOptimizing based on a genetic ant colony mixing algorithm;

s2, adjusting quantity delta K of PID control parameterp、ΔKiAnd Δ KdOutputting the control variable to a PID regulator, and outputting the control variable to obtain a corresponding control variable by the PID regulator;

and S3, correspondingly controlling the motor speed according to the control variable.

The technical scheme is applied in the embodiment, and the method mainly comprises the following processes:

design of fuzzy PID controller

1. Controller overall design

As shown in fig. 2, the speed loop of the BLDCM control system employs a fuzzy PID controller, which has a two-input three-output structure. The motor speed error e and error rate ec are used as two inputs to the controller, and are converted from the basic discourse domain to the fuzzy domain by the quantization factors Ke and Kec. The transformed input variables are then subjected to fuzzy inference, followed by a fuzzy output variable Δ Kpˊ、ΔKiˊ、ΔKdBy clarification with the scaling factor Ku, K is obtained therefrompˊ、KiAnd KdVariation Δ K of `p、ΔKiAnd Δ KdAnd is used for online regulation of PID parameters.

2. Fuzzy rule and membership function determination

The value ranges of the input variables e and ec, and the output variable Kp、KiAnd KdAre predetermined, and in the actual motor control process, the input amount and the output amount are set as follows: the discourse domain of the input quantity e, ec is [ -3,3],ΔKpThe discourse domain of [ -0.3,0.3 [)],ΔKiThe argument of [ -0.06,0.06 [ ]],ΔKdThe universe of discourse is taken to [ -0.3,0,3 [)]. The invention divides the input quantity and the output quantity into 7 levels, which are respectively { NB, NM, NS, ZE, PS, PM, PB }, and correspondingly represent { big negative, middle negative, small negative, zero positive, small positive, middle positive, big positive }. In the invention, the input variable and the output variable both adopt symmetrically distributed triangular membership functions, as shown in figure 3. This results in 49 fuzzy rules, shown in table 1, where U represents the fuzzy decision output.

TABLE 1

Second, genetic algorithm optimization fuzzy PID

1. Optimizing fuzzy rules

1) Encoding

A fuzzy rule is represented by a 10-bit binary code, encoded in the manner shown in fig. 4, where the first bit indicates whether the rule is available: 1 indicates available, 0 indicates disclaimer; 2-4 bits represent error e; 5-7 bits represent the error change rate ec; 8-10 bits represent the decision variable U. The encoding method of 3 variables is the same, and the encoding method corresponding to 7 fuzzy linguistic variables is shown in FIG. 5.

2) Fitness function

Designing a first objective function of the system, properly converting the first objective function, and constructing a first fitness function as follows:

wherein f isGA1As a function of the first fitness, JGA1Is a first objective function;

3) selection, mutation, crossover

Setting the first population quantity as:

MGA1=49

selecting by roulette method, and calculating fitness value f of each individualGA1iObtaining a first selection probability as follows:

and setting the first cross probability as:

PGA1c=0.8

the first mutation probability is:

PGA1m=0.2

4) genetic algorithm termination

Designing a control function to control the iteration times of the genetic algorithm, wherein the control function is as follows:

ΔfGA=fGAmax-fGAΣ

wherein f isGAmaxObtaining the maximum fitness value, f, for a single individualGAΣIs the average value of individual fitness, when deltafGAIf the value of (2) exceeds 5 generations and is lower than the set threshold value, ending the genetic algorithm and starting to run the ant colony algorithm.

If the control function fails to end the genetic algorithm, the maximum value N is determined according to the number of iterationsGAmaxAnd minimum value NGAminAt the current iteration number, N is reachedGAmaxAnd ending the genetic algorithm and starting to operate the ant colony algorithm.

2. Optimizing control parameters

The genetic algorithm optimizes the parameters of the fuzzy controller, can be converted into combined optimization, and has the same mode as the optimized fuzzy rule. Setting population size MGA2When the sum is 50, K ise、Kec、KuInitialized to [0, 4 ]]Random value within the range, maximum number of iterations NGAmaxConstructing a second fitness function as 59:

wherein f isGA2As a function of the second fitness, JGA2Is a second objective function, k1To optimize the coefficients;

the selection, crossover, and mutation are the same as the optimized fuzzy rule described above.

Third, ant colony algorithm optimization fuzzy PID

The ant colony algorithm is operated on the basis of the genetic algorithm, the first 30% of the fitness value of the solution generated when the genetic algorithm is terminated is used as a high-quality solution, the optimal path is generated, and the high-quality solutions are used as initial pheromone distribution of the ant colony algorithm.

1. Optimizing fuzzy rules

For fuzzy decisions in the form of "IF... THEN" of the fuzzy controller, which are converted into the problem form of the ant colony algorithm, D represents the front piece, L represents the selection set of the front piece to the back piece, and seven fuzzy linguistic variables { NB, NM, NS, ZE, PS, PM, PB } are represented in decimal notation as {0,1,2,3,4,5,6} respectively, and fuzzy rules can be shown in Table 3.

TABLE 3

The invention sets the maximum ant colony iteration number NACOmax60, the number of ants MACONo longer, 80 ants are randomly assigned, and the position of the rule of 49 is used as the initial position for searching. Let R < 49 >]For the 49 fuzzy rule tables to be optimized, all their values are initialized to the same value, τhsFor the concentration of the pheromone in the path from h (front piece) to s (back piece), a pheromone matrix can be constructed, the value of the back piece, namely U, is selected according to the pheromone matrix, so as to construct a new rule table, and the basic steps for operating the ant colony algorithm are as follows:

1) selection strategy improvement and objective function determination

And optimizing the fuzzy rule to select the back piece only according to the pheromone, wherein the selection probability of ants from h to s at the time t is as follows:

wherein, cACO1Is the selection probability of ants from h point to s point at time t, awAlpha is the pheromone concentration weight, p is the set of points that the ant is allowed to walkACOhs βThe probability of the beta-th ant transferring from h point to s point, tauhsQ is a random number between 0 and 1 in order to transfer pheromone concentration on the path from the point h to the point s0Is a random number uniformly distributed between 0 and 1, when q is0When the size of the ant is large, the ant can easily select a path with more pheromones to cause local convergence, and if the size of the ant is small, the convergence speed is too low, so that q is selected0Is the ratio of the number of iterations to the total number of iterations;

selecting a time-multiplied-absolute-integral error criterion for the objective function:

filling the fuzzy rule corresponding to the minimum value of the objective function into a fuzzy rule table so as to optimize the fuzzy rule table;

2) pheromone improvements

As ants pass, the pheromones on each path also decrease to disappear over time, and thus, each iteration updates the pheromones. Because a hybrid algorithm is used, the optimal solution generated by the genetic algorithm is considered to be the initial pheromone distribution of the ant colony algorithm. Setting the total initial pheromone concentration as tau, the path initialization pheromone concentration is as follows:

wherein L isn={L1,L2,......LnJ is the optimal path generated by the selected genetic algorithm, JhsR is a constant which is an objective function of the path from h to s, so as to ensure that a small amount of pheromone is distributed on the path which is not selected;

after the ants swim around, the pheromone is set to be updated as follows:

τhs(t+1)=ρτhs(t)+Δτhs b

wherein ρ is the pheromone volatilization coefficient concentration from t to t +1, and 0<ρ<1,The beta th ant is at d from t to t +1hsThe pheromone amount of unit length on the branch, Q is the total pheromone amount released by ants in the process of reciprocating, is a constant,for iterating the amount of pheromones on the optimal path, JACOβThe objective function value of the beta-th ant;

2. optimizing control parameters

To Ke、Kec、KuOptimization is carried out by firstly empirically keeping four decimal places for all three parameters, each parameter being represented by 5 digits, and three parameters corresponding to a group of fifteen digit sequences, as shown in fig. 6, and three parameters are represented on a plane coordinate axis: abscissa x1~x5、x6~x10、x11~x15Respectively represents Ke、Kec、KuThe walking path of ant is P (q) ═ y1,β,y2,β,…yj,β…,y15,β},q=1,2,……,80,j=1,2,……,15,yj,βThe ordinate of the crawling of the beta-th ant is the parameter Ke、Kec、KuCan be expressed as:

1) path selection and objective function

The transition probability is different from the optimized fuzzy rule, and is set as follows:

wherein, the lambda is the heuristic information weight,heuristic factor, y, for transition from h to s at time thsIs the ordinate of the point s and,is the ordinate value of the current best path point.

The setting of the objective function and pheromone is the same as the optimized fuzzy rule described above.

In order to verify the effectiveness of the method of the present invention, in this embodiment, a speed loop is built in Matlab/Simulink, and a model of a brushless dc motor control system of a fuzzy PID controller based on fuzzy PID, a fuzzy PID based on ACO, and a fuzzy PID based on GA-ACO (i.e., the method of the present invention) is respectively adopted, and the settings of each parameter are shown in table 4.

TABLE 4

The unit step curves of the three optimization control methods are shown in fig. 7, and the optimization index pairs are shown in table 5.

TABLE 5

Control strategy Adjusting time/s Steady state error/%) Overshoot/% of
Fuzzy PID 0.125 0.1 20
ACO-fuzzy PID 0.15 0.05 4.4
GA-ACO fuzzy PID 0.1 0.01 0.1

The variation curves of the objective function with the iteration times under the same search precision of the ant colony algorithm and the genetic ant colony hybrid algorithm are shown in fig. 8a and 8 b. As can be seen from fig. 7, 8a, 8b and table 5, the hybrid algorithm provided by the present invention has the advantages of faster response speed, almost no overshoot, smaller steady-state error, and significantly faster convergence speed, and the hybrid algorithm is verified to have more superiority.

In addition, in the embodiment, the motor is set to start in an idle state, the given rotating speed is 700r/min at 0.02s, the motor load is 3N · m initially, and the motor load is changed to 1N · m at 0.04s, so that comparison graphs of the rotating speed, the torque and the current of the brushless direct current under three controllers are obtained, as shown in fig. 9, 10, 11a, 11b and 11c, experimental results show that the BLDCM system based on the improved fuzzy PID controller has strong anti-interference capability, fast response speed, better improvement in performance in each aspect, and verification of superiority of the improved control strategy.

In summary, the fuzzy PID controller of the brushless direct current motor has the advantages that the fuzzy rules of the fuzzy PID controller are mostly obtained according to expert experience, the online adjusting capacity of control parameters is poor, if the fuzzy controller is optimized by using a genetic algorithm, the process is complex, a large number of encoding and decoding processes exist, and the control structure is also complex; the ant colony algorithm is singly used for optimizing the fuzzy controller, so that local optimization is easily caused, and the convergence speed is too low; in addition, the adoption of the sliding mode control is easy to generate buffeting, and the complexity and the physical realization difficulty of the system are increased.

Therefore, the invention combines the genetic algorithm and the ant colony algorithm, runs the ant colony algorithm on the basis of the genetic algorithm, can effectively improve the system performance, enhance the anti-interference and robustness and ensure the precision, the response speed and the stability of the rotating speed control by improving the global search capability and the convergence speed of the algorithm and applying the fuzzy PID controller based on the genetic ant colony hybrid algorithm optimization to the brushless direct current motor control system.

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:矢量加速器及其控制方法、装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类