CN110705030A - Genetic algorithm-based PID controller parameter optimization method and motor - Google Patents

Genetic algorithm-based PID controller parameter optimization method and motor Download PDF

Info

Publication number
CN110705030A
CN110705030A CN201910840873.6A CN201910840873A CN110705030A CN 110705030 A CN110705030 A CN 110705030A CN 201910840873 A CN201910840873 A CN 201910840873A CN 110705030 A CN110705030 A CN 110705030A
Authority
CN
China
Prior art keywords
individuals
individual
fitness
pid controller
population
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910840873.6A
Other languages
Chinese (zh)
Other versions
CN110705030B (en
Inventor
夏亮
李晋宏
周彬
齐云霞
杨宝军
魏章保
陈吉奎
郑登华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CHONGQING HUASHU ROBOTICS Co Ltd
Chongqing Robotics Institute
Original Assignee
CHONGQING HUASHU ROBOTICS Co Ltd
Chongqing Robotics Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CHONGQING HUASHU ROBOTICS Co Ltd, Chongqing Robotics Institute filed Critical CHONGQING HUASHU ROBOTICS Co Ltd
Priority to CN201910840873.6A priority Critical patent/CN110705030B/en
Publication of CN110705030A publication Critical patent/CN110705030A/en
Application granted granted Critical
Publication of CN110705030B publication Critical patent/CN110705030B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biophysics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Genetics & Genomics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Physiology (AREA)
  • Feedback Control In General (AREA)

Abstract

The invention relates to a PID controller parameter optimization method and a motor based on a genetic algorithm, wherein two PID controllers are controlled in a cascade mode, through setting different control parameters, Kp1, Ki1, Kd1, Kp2, Ki2 and Kd2 are combined into a plurality of different individuals after binary coding, an initial population is formed, the fitness of each individual in the initial population is confirmed, corresponding individuals are selected according to the fitness to be sequentially subjected to copying, crossing and mutation operations to form a next generation population, S2 and S3 are iteratively executed on the next generation population, when the iteration process is finished, the individual with the maximum fitness in the generated population is finally used as an optimal solution individual, and the K of the optimal solution individual is used as a K of the optimal solution individualp1、Ki1、Kd1、Kp2、Ki2、Kd2The optimal control parameter is used for controlling the controlled object, the optimization efficiency is high, the calculation precision is high, and after the method is applied to the motor, the controlled object can be controlledThe torque and the speed of the motor are quickly adjusted to the optimal state.

Description

Genetic algorithm-based PID controller parameter optimization method and motor
Technical Field
The invention relates to the field of PID controllers, in particular to a PID controller parameter optimization method based on a genetic algorithm and a motor.
Background
A PID controller is a feedback loop component commonly used in industrial control and is controlled in a linear combination of Proportional (Proportional), Integral (Integral) and Derivative (Derivative) of deviation. The PID controller has been used as the earliest practical controller for nearly one hundred years, and is still the most widely used controller at present due to the characteristics of simple structure, good stability, no need of accurate system model in use and other prerequisites.
At present, the main method for optimizing the parameters of the PID controller is a manual setting method, a user needs to have skilled skills, time is consumed, the parameter precision is not high, particularly when the characteristics of a controlled object change, the PID regulator cannot optimize the change in real time, the parameters need to be optimized again, and therefore, the efficiency and the precision of the existing parameter optimization process of the PID controller are low.
Disclosure of Invention
The invention aims to solve the technical problem of the prior art and provides a parameter optimization method of a PID controller based on a genetic algorithm and a motor.
The technical scheme of the PID controller parameter optimization method based on the genetic algorithm is as follows:
s1, cascade control of two PID controllers, setting different control parameters, and converting K into Kp1、Ki1、Kd1、Kp2、Ki2、Kd2Binary coding is carried out, and then the binary coding is combined into a plurality of different individuals to form an initial population;
s2, confirming the fitness of each individual in the initial population;
s3, selecting corresponding individuals according to the fitness to perform copying, crossing and mutation operations in sequence to form a next generation population;
s4, iteratively executing S2 and S3 on the next generation population, and when the iterative process is finished, taking the individual with the maximum fitness in the generated population as the optimal solution individual, wherein K of the optimal solution individualp1、Ki1、Kd1、Kp2、Ki2、Kd2As an optimal control parameter;
wherein, Kp1、Ki1、Kd1Respectively representing a proportional control parameter, an integral control parameter, a differential control parameter, K, of the first PID controllerp2、Ki2、Kd2Respectively representing a proportional control parameter, an integral control parameter and a differential control parameter of the second PID controller.
The invention has the beneficial effects that: two PID controllers are adopted for cascade control, and K is controlled by setting different control parametersp1、Ki1、Kd1、Kp2、Ki2、Kd2Binary coding is carried out and then combined into a plurality of different individuals to form an initial population, the fitness of each individual in the initial population is calculated, then corresponding individuals are selected according to the fitness to carry out copying, crossing and mutation operations in sequence, the process is executed in an iteration mode, each control parameter of two PID controllers is continuously optimized, after the iteration process is finished, the control parameter of the individual with the optimal solution is selected as the optimal control parameter, the controlled object is controlled by the optimal control parameter, the optimization efficiency and the accuracy are high, and when the characteristic of the controlled object changes, the calculation can be carried out according to the process to obtain a new set of optimal control parameter, so that the method realizes the purpose thatThe PID controller parameter optimization method based on the genetic algorithm has high optimization efficiency and high precision.
On the basis of the technical scheme, the invention can be further improved as follows.
Further, the expression for calculating the fitness F is:
Figure BDA0002193671220000021
wherein the content of the first and second substances,
Figure BDA0002193671220000022
wherein, PovDenotes a penalty factor, enRepresents tracking error, T represents error observation time, n belongs to [0, T ∈]。
The beneficial effect of adopting the further scheme is that: when tracking error enWhen the fitness F is calculated when the fitness F is larger than 0, a penalty factor P is introducedovAnd the method is used for properly reducing the adaptability to prevent the controlled object from generating abnormal phenomena.
Further, comparing the fitness of the individual with a given step response target value, and if the fitness of the individual is smaller than the step response target value, deleting the individual, namely the individual does not participate in the iterative process any more; if not, the individual continues to participate in the iterative process.
The beneficial effect of adopting the further scheme is that: by comparing the given step response target value with the individual fitness, the individual with the fitness lower than the step response target value is directly deleted, so that the individual does not participate in the iterative process any more, on one hand, the calculation precision of the optimal control parameter is ensured, on the other hand, the operation speed is improved, and the efficiency is high.
Further, the copy operation in S3 specifically includes: sequencing the individuals according to the fitness of the individuals from big to small; selecting the previous Ne individuals, and directly copying the individuals to the next generation population; where Ne represents the number of a given elite individual.
The beneficial effect of adopting the further scheme is that: according to the fitness of each individual, the individuals are sequenced from large to small, the first Ne individuals are selected, namely the elite individuals are selected and directly copied to the next generation population, on one hand, the calculation precision of the optimal control parameters is further ensured, on the other hand, the calculation speed is further improved, and the efficiency is high.
Further, the interleaving operation in S3 specifically includes:
randomly selecting two groups of individuals from the initial population, wherein the number of the individuals in each group is two;
confirming the fitness of all individuals in each group, and selecting the individual with high fitness in each group to perform the cross operation;
randomly generating a cross weight Kc,Kc∈(0,1);
The following calculations were performed:
K′1=K1*KC+K2*(1-KC)
K′2=K1*(1-KC)+K2*KC
to K'1And K'2Carrying out amplitude limiting processing;
wherein, K1Denotes the individuals of the first group with high fitness, K2Denotes the individual of the second group with high fitness, K'1,K′2Representing the next generation of individuals resulting from the crossover operation.
The beneficial effect of adopting the further scheme is that: by randomly selecting two groups of individuals, then respectively competing the two groups of individuals in the groups, and selecting the individuals with high fitness in each group to carry out the cross operation, on one hand, the calculation precision of the optimal control parameters is further ensured, on the other hand, the calculation speed is further improved, and the efficiency is high.
Further, before the crossover operation, randomly generating a first random number by a genetic algorithm, if the first random number is greater than a given crossover rate, not performing the crossover operation, and if not, performing the crossover operation.
The beneficial effect of adopting the further scheme is that: the randomness of the crossover operation is enhanced by comparing the first random number randomly generated by the genetic algorithm with a given crossover rate to improve the accuracy of the genetic algorithm.
Further, to K'1And K'2Performing the mutation operation specifically as follows:
will Kp1、Ki1、Kd1、Kp2、Ki2、Kd2Forming an individual parameter matrix KnThe expression is as follows:
Kn=(Kp1Ki1Kd1Kp2Ki2Kd2)
randomly generating six variant weights K'mForming a variance weight matrix Km,KmIs a matrix with one row and six columns, wherein K'm∈(-1,1);
The following calculation is then performed:
K"1=K′1+Km⊙(Kmax-Kmin)
K"2=K′2+Km⊙(Kmax-Kmin)
wherein, Kmax、KminRepresents Kn⊙ denotes the Hadamard product operator, K ″1Is represented by K'1Individuals formed after the mutation operation is performed; k ″)2Is represented by K'2Individuals formed after the mutation operation is performed;
for K ″)1And K ″)2And merging the obtained product into the next generation population after the amplitude limiting treatment is carried out.
The beneficial effect of adopting the further scheme is that: k 'of progeny individuals resulting from crossover operations'1And K'2Performing mutation operations, i.e. using the individual parameter matrix KnAnd a variance weight matrix KmTo K thereinp1、Kil、Kd1、Kp2、Ki2、Kd2The parameters are subjected to variation operation respectively to ensure the calculation accuracy of the optimal control parameters.
Further, P 'of individuals in each generation of population in the populations generated by three consecutive iterations is detected'1、P′2、P3、P4、P5、P6Whether the corresponding difference values are smaller than a set threshold value or not, if so, increasing the variation rate; if not, the variation rate is reduced.
Further, P 'of individuals in each generation of population in the populations generated by three consecutive iterations is detected'1、P′2、P′3、P′4、P′5、P′6Whether the corresponding difference values are smaller than a set threshold value or not, if so, increasing the variation rate; if not, the variation rate is reduced.
The beneficial effect of adopting the further scheme is that: if P 'of individuals in each generation of population'1、P′2、P′3、P′4、P′5、P′6The difference value corresponding to each is smaller than the set threshold value, which indicates that each individual is too similar at the moment, and the variation rate needs to be increased at the moment, so as to prevent the genetic algorithm from premature convergence, and ensure the calculation accuracy of the optimal control parameter.
Further, before the mutation operation, a second random number is randomly generated by a genetic algorithm, if the second random number is larger than a given mutation rate, the mutation operation is not performed on the individuals after the crossover operation, and if not, the mutation operation is performed on the individuals after the crossover operation.
The beneficial effect of adopting the further scheme is that: the second random number randomly generated by the genetic algorithm is compared with a given variation rate, so that the randomness of variation operation is enhanced, and the accuracy of the genetic algorithm is improved.
Further, the ending of the iteration process in S4 specifically includes: and setting the iteration number W, and finishing the iteration process after the iterations are executed for S2 and S3W times.
The beneficial effect of adopting the further scheme is that: the number of iterations W is set to control the number of iterations S2 and S3.
An electric machine utilizing any of the above methods of PID controller parameter optimization based on genetic algorithm, wherein a first PID controller is used to control the torque loop of the electric machine and a second PID controller is used to control the speed loop of the electric machine.
The motor has the advantages that: the optimal control parameters of the first PID controller and the second PID controller are calculated by the method, so that the torque and the speed of the motor can be quickly adjusted to the optimal state.
Drawings
FIG. 1 is a block diagram of the PID controller parameter optimization method based on genetic algorithm of the present invention;
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the scope of the invention.
As shown in fig. 1, the method for optimizing PID controller parameters based on genetic algorithm provided in this embodiment includes the following steps:
s1, cascade control of two PID controllers, setting different control parameters, and converting K into Kp1、Ki1、Kd1、Kp2、Ki2、Kd2Binary coding is carried out, and then the binary coding is combined into a plurality of different individuals to form an initial population;
s2, confirming the fitness of each individual in the initial population;
s3, selecting corresponding individuals according to the fitness to perform copying, crossing and mutation operations in sequence to form a next generation population;
s4, iteratively executing S2 and S3 on the next generation population, and when the iterative process is finished, taking the individual with the maximum fitness in the generated population as the optimal solution individual, wherein K of the optimal solution individualp1、Kil、Kd1、Kp2、Ki2、Kd2As an optimal control parameter;
wherein, Kp1、Ki1、Kd1Respectively representing a proportional control parameter, an integral control parameter, a differential control parameter, K, of the first PID controllerp2、Ki2、Kd2Respectively representing proportional control parameter and integral control of the second PID controllerSystem parameters and differential control parameters.
Two PID controllers are adopted for cascade control, and K is controlled by setting different control parametersp1、Ki1、Kd1、Kp2、Ki2、Kd2Binary coding is carried out and then combined into a plurality of different individuals, an initial population is formed, the fitness of each individual in the initial population is calculated, corresponding individuals are selected according to the fitness to carry out copying, crossing and mutation operations in sequence, the process is executed in an iteration mode, each control parameter of two PID controllers is continuously optimized, after the iteration process is finished, the control parameter of the individual with the optimal solution is selected as the optimal control parameter, the controlled object is controlled by the optimal control parameter, the optimization efficiency and the precision are high, when the characteristic of the controlled object changes, the calculation can be carried out according to the process again, and a new set of optimal control parameters are obtained.
Preferably, in the above technical solution, the expression for calculating the fitness F is:
Figure BDA0002193671220000071
wherein the content of the first and second substances,
Figure BDA0002193671220000072
wherein, PovDenotes a penalty factor, enRepresents tracking error, T represents error observation time, n belongs to [0, T ∈]。
When tracking error enWhen the fitness F is calculated when the fitness F is larger than 0, a penalty factor P is introducedovAnd the method is used for properly reducing the adaptability to prevent the controlled object from generating abnormal phenomena.
Wherein the tracking error enAnd a penalty factor PovThe following explanation can be made: for example, when the controlled object is a motor, a tracking error e may be definednTracking error of motor speed and monitoring any error in error observation time in real timeTracking error of time; when the tracking error of the motor speed is more than 0, a penalty factor P is introducedovIs used for properly reducing the fitness to prevent the motor from generating abnormal phenomena, such as overheating and shaking phenomena generated when the motor overshoots, and a penalty factor PovThe value of (A) can be improved according to the actual situation, if the overheating of the motor is too large, the penalty factor P is increased appropriatelyovThe value of (c).
When the controlled object is different or the controlled part of the controlled object is changed, such as from controlling the motor speed and motor torque, to controlling the motor, the transformer transforms the voltage and the motor torque or the motor speed, in the above expression, the error e is trackednAnd a penalty factor PovThe two parameters have different values, that is, the tracking error e is reserved in the above expressionnAnd a penalty factor PovThe positions of the two parameters can be brought into different values according to different actual conditions.
Moreover, the above-mentioned "tracking error enA.. times ", where 0 may be set as another threshold.
Preferably, in the above technical solution, the fitness of the individual is compared with a given target value of step response, and if the fitness of the individual is smaller than the target value of step response, the individual is deleted, that is, the individual does not participate in the iterative process any more; if not, the individual continues to participate in the iterative process. By comparing the given step response target value with the individual fitness, the individual with the fitness lower than the step response target value is directly deleted, so that the individual does not participate in the iterative process any more, on one hand, the calculation precision of the optimal control parameter is ensured, on the other hand, the operation speed is improved, and the efficiency is high.
Wherein, the target value of the step response may be given by the user, for example, the target value of the step response is set to 0.6, when the calculated fitness of a certain individual is 0.5, because the fitness of the individual is smaller than the target value of the step response given by the user, the individual is deleted, that is, the individual does not participate in the iterative process any more; when the calculated fitness of a certain individual is 0.7, the individual continues to participate in the iterative process because the fitness of the individual is greater than the step response target value given by the user.
Preferably, in the above technical solution, the copy operation in S3 specifically includes: sequencing the individuals according to the fitness of the individuals from big to small; selecting the first Ne individuals and directly copying the individuals to the next generation population; where Ne represents the number of a given elite individual. And sequencing the individuals according to the fitness of the individuals from large to small, selecting the first Ne individuals, namely selecting the elite individuals, and directly copying the elite individuals to the next generation population.
The number Ne of elite individuals can be given by the user, for example, the value Ne is 3, after the individuals are sorted according to the fitness of the individuals from large to small, the first 3 individuals are taken and directly copied to the next generation population.
Preferably, in the above technical solution, the crossing operation in S3 specifically includes:
randomly selecting two groups of individuals from the initial population, wherein the number of the individuals in each group is two;
confirming the fitness of all individuals in each group, and selecting the individual with high fitness in each group to perform the cross operation;
randomly generating a cross weight Kc,Kc∈(0,1);
The following calculations were performed:
K′1=K1*KC+K2*(1-KC)
K′2=K1*(1-KC)+K2*KC
to K'1And K'2Carrying out amplitude limiting processing;
wherein, K1Denotes the individuals of the first group with high fitness, K2Denotes the individual of the second group with high fitness, K'1,K′2Representing the next generation of individuals resulting from the crossover operation.
By random selectionTwo groups of individuals are selected, then the two groups of individuals compete in the groups respectively, and the individuals with high fitness in each group are selected to perform the cross operation, so that on one hand, the calculation precision of the optimal control parameters is further ensured, on the other hand, the calculation speed is further improved, and the efficiency is high. And randomly generating a cross weight KcAccording to the cross-over weight KcAnd calculating to enhance the randomness of the cross operation so as to improve the accuracy of the genetic algorithm.
Preferably, in the above technical solution, before the crossover operation, a first random number is randomly generated by a genetic algorithm, and if the first random number is greater than a given crossover rate, the crossover operation is not performed, and if not, the crossover operation is performed. The randomness of the crossover operation is enhanced by comparing the first random number randomly generated by the genetic algorithm with a given crossover rate to improve the accuracy of the genetic algorithm.
Preferably, in the above technical solution, K is1And K2Performing the mutation operation specifically as follows:
will Kp1、Ki1、Kd1、Kp2、Ki2、Kd2Forming an individual parameter matrix KnThe expression is as follows:
Kn=(Kp1Ki1Kd1Kp2Ki2Kd2)
randomly generating six variant weights K'mForming a variance weight matrix Km,KmIs a matrix with one row and six columns, wherein K'm∈(-1,1);
The following calculation is then performed:
K"1=K′1+Km⊙(Kmax-Kmin)
K"2=K′2+Km⊙(Kmax-Kmin)
wherein, Kmax、KminRepresents Kn⊙ denotes the Hadamard product operator, K ″1Is represented by K'1Formed after performing the mutation operation(ii) an individual of (a); k ″)2Is represented by K'2Individuals formed after the mutation operation is performed;
to K "1And K'2And merging the obtained product into the next generation population after the amplitude limiting treatment is carried out.
K 'of progeny individuals resulting from crossover operations'1And K'2Performing mutation operations, i.e. using the individual parameter matrix KnAnd a variance weight matrix KmTo K thereinp1、Ki1、Kd1、Kp2、Ki2、Kd2The parameters are subjected to variation operation respectively, so that the calculation accuracy of the optimal control parameters is further ensured.
From the above, the next generation population is formed by the following steps: firstly, selecting the previous Ne individuals, directly copying the previous Ne individuals to the next generation population, and secondly, sequentially carrying out cross operation and mutation operation to form the individuals, and merging the individuals into the next generation population.
Preferably, in the above technical solution, P 'of individuals in each generation of population in the population generated by three successive iterations is detected'1、P′2、P′3、P′4、P′5、P′6Whether the corresponding difference values are smaller than a set threshold value or not, if so, increasing the variation rate; if not, the variation rate is reduced. If P 'of individuals in each generation of population'1、P′2、P′3、P′4、P′5、P′6The difference value corresponding to each is smaller than the set threshold value, which indicates that each individual is too similar at the moment, and the variation rate needs to be increased at the moment, so as to prevent the genetic algorithm from premature convergence, and ensure the calculation accuracy of the optimal control parameter.
For example, the threshold value is set to 0.001, the mutation rate is set to 0.1, and the individual P 'in each generation of population'1、P′2、P′3、P′4、P′5、P′6If the difference between the two is 0.0005, the variation rate can be increased, for example, the variation rate is multiplied by 3, or fine tuning can be performed according to actual conditions, which is not described herein.
Preferably, in the above technical solution, before the mutation operation, a second random number is randomly generated by a genetic algorithm, and if the second random number is greater than a given mutation rate, the mutation operation is not performed on the individuals after the crossover operation, and if not, the mutation operation is performed on the individuals after the crossover operation. The second random number randomly generated by the genetic algorithm is compared with a given variation rate, so that the randomness of variation operation is enhanced, and the accuracy of the genetic algorithm is improved.
Preferably, in the above technical solution, the ending of the iteration process in S4 specifically includes: and setting the iteration number W, and finishing the iteration process after the iterations are executed for S2 and S3W times. The number of iterations W is set to control the number of iterations S2 and S3.
For example, when the customer has low demand on the calculation accuracy of the optimal control parameter, the number of iterations W may be set to a small value, such as W being 5, 6, 7, etc., and when the customer has high demand on the calculation accuracy of the optimal control parameter, the number of iterations W may be set to 100, 1000, 10000, etc.
A motor utilizes any one of the above PID controller parameter optimization methods based on genetic algorithm, wherein a first PID controller is used for controlling a torque loop of the motor, and a second PID controller is used for controlling a speed loop of the motor. The optimal control parameters of the first PID controller and the second PID controller are calculated by the method, so that the torque and the speed of the motor can be quickly adjusted to the optimal state. In which the tracking error enAnd a penalty factor PovFor reference, the details are not described herein, and the motor may be a permanent magnet synchronous brushless dc motor, a permanent magnet synchronous brushed dc motor, etc., and other devices such as a refrigerator, a washing machine, etc. may also utilize any of the above PID controller parameter optimization methods based on the genetic algorithm, which is also within the protection scope of the present invention.
Taking the case that the motor is a permanent magnet synchronous brush direct current motor as an example, the detailed explanation is carried out:
the following settings were made for each parameter:
the iteration number W is 30;
the initial population size is 30, wherein the initial population size is generated for each generationThe significance of the number of individuals, here set to an initial population size of 30, is: setting different control parameters to Kp1、Ki1、Kd1、Kp2、Ki2、Kd2After binary coding, combining the binary coded data into a plurality of different individuals to form an initial population, namely the number of individuals in a preset first generation population;
the number Ne of elite individuals is 2;
error observation time T is 0.3 second;
the crossing rate is 0.8;
the variation rate is 0.20;
penalty factor Pov=0.10;
Kmax=(2.5 0.008 0.0 10.0 0.016 20.0)
Kmin=(0.0 0.0 0.0 0.0 0.0 0.0)
The input and output of the PID controller are standardized to (-1.0), the torque loop control frequency is 10kHZ, and the speed loop control frequency is 5 kHZ;
calculating according to the steps in the PID controller parameter optimization method based on the genetic algorithm, and after iteration is completed, storing the optimized result to an individual parameter matrix KnAccording to the actual control system of the permanent magnet synchronous brush direct current motor, the optimization result is as follows:
Kn=(1.85 0.00117 0.0 9.37 0.00898 14.8)
that is, when Kp1=1.85,Ki1=0.00117,Kd1=0.0,Kp2=9.37,Ki2=0.00898,Kd2When the torque and the speed of the permanent magnet synchronous brush direct current motor are 14.8, the torque and the speed of the permanent magnet synchronous brush direct current motor can be adjusted to be in an optimal state.
It should also be understood that, in the embodiments of the present invention, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
While the invention has been described with reference to specific embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A PID controller parameter optimization method based on genetic algorithm is characterized by comprising the following steps:
s1, cascade control of two PID controllers, setting different control parameters, and converting K into Kp1、Ki1、Kd1、Kp2、Ki2、Kd2Binary coding is carried out, and then the binary coding is combined into a plurality of different individuals to form an initial population;
s2, confirming the fitness of each individual in the initial population;
s3, selecting corresponding individuals according to the fitness to perform copying, crossing and mutation operations in sequence to form a next generation population;
s4, iteratively executing S2 and S3 on the next generation population, and when the iterative process is finished, taking the individual with the maximum fitness in the generated population as the optimal solution individual, wherein K of the optimal solution individualp1、Ki1、Kd1、Kp2、Ki2、Kd2As an optimal control parameter;
wherein, Kp1、Ki1、Kd1Respectively representing a proportional control parameter, an integral control parameter, a differential control parameter, K, of the first PID controllerp2、Ki2、Kd2Respectively representing a proportional control parameter, an integral control parameter and a differential control parameter of the second PID controller.
2. The method for optimizing the parameters of the PID controller based on the genetic algorithm according to claim 1, wherein the fitness F is calculated by the following expression:
Figure FDA0002193671210000011
wherein the content of the first and second substances,
Figure FDA0002193671210000012
wherein, PovDenotes a penalty factor, enRepresents tracking error, T represents error observation time, n belongs to [0, T ∈]。
3. The method of claim 2, wherein the fitness of the individual is compared with a given target value of the step response, and if the fitness of the individual is smaller than the target value of the step response, the individual is deleted, i.e. the individual is not involved in the iterative process any more; if not, the individual continues to participate in the iterative process.
4. The method for optimizing parameters of a PID controller based on genetic algorithm as claimed in claim 1, wherein the copying operation in S3 is specifically:
sequencing the individuals according to the fitness of the individuals from big to small;
selecting the first Ne individuals and directly copying the individuals to the next generation population;
where Ne represents the number of a given elite individual.
5. The method for optimizing parameters of a PID controller based on genetic algorithm as claimed in claim 1, wherein the crossover operation in S3 is specifically:
randomly selecting two groups of individuals from the initial population, wherein the number of the individuals in each group is two;
confirming the fitness of all individuals in each group, and selecting the individual with high fitness in each group to perform the cross operation;
randomly generating a cross weight Kc,Kc∈(0,1);
The following calculations were performed:
K′1=K1*KC+K2*(1-KC)
K′2=K1*(1-KC)+K2*KC
to K'1And K'2Carrying out amplitude limiting processing;
wherein, K1Denotes the individuals of the first group with high fitness, K2Denotes the individual of the second group with high fitness, K'1,K′2Representing the next generation of individuals resulting from the crossover operation.
6. The method of claim 5, wherein prior to the crossover operation, a first random number is randomly generated by the genetic algorithm, and if the first random number is greater than a given crossover rate, the crossover operation is not performed, and if not, the crossover operation is performed.
7. The method for optimizing parameters of PID controller based on genetic algorithm as claimed in claim 5, wherein K'1And K'2Performing the mutation operation specifically as follows:
will Kp1、Ki1、Kd1、Kp2、Ki2、Kd2Forming an individual parameter matrix KnThe expression is as follows:
Kn=(Kp1Ki1Kd1Kp2Ki2Kd2)
randomly generating six variant weights K'mForming a variance weight matrix Km,KmIs a matrix with one row and six columns, wherein K'm∈(-1,1);
The following calculation is then performed:
K″1=K′1+Km⊙(Kmax-Kmin)
K″2=K′2+Km⊙(Kmax-Kmin)
wherein, Kmax、KminRepresents Kn⊙ denotes the Hadamard product operator, K ″1Is represented by K'1Individuals formed after the mutation operation is performed; k ″)2Is represented by K'2Individuals formed after the mutation operation is performed;
for K ″)1And K ″)2And merging the obtained product into the next generation population after the amplitude limiting treatment is carried out.
8. The method of claim 6, wherein P 'of individuals in each generation of population in the population generated by three successive iterations is detected'1、P′2、P′3、P′4、P′5、P′6Whether the corresponding difference values are smaller than a set threshold value or not, if so, increasing the variation rate; if not, the variation rate is reduced.
9. The method as claimed in claim 6, wherein a second random number is randomly generated by the genetic algorithm before the mutation operation, and if the second random number is greater than a given mutation rate, the mutation operation is not performed on the individuals after the crossover operation, and if not, the mutation operation is performed on the individuals after the crossover operation.
10. An electrical machine, characterized in that it utilizes a method for the optimization of the parameters of a PID controller based on a genetic algorithm according to any of claims 1 to 9, wherein a first PID controller is used to control the torque loop of the electrical machine and a second PID controller is used to control the speed loop of the electrical machine.
CN201910840873.6A 2019-09-06 2019-09-06 Genetic algorithm-based PID controller parameter optimization method and motor Active CN110705030B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910840873.6A CN110705030B (en) 2019-09-06 2019-09-06 Genetic algorithm-based PID controller parameter optimization method and motor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910840873.6A CN110705030B (en) 2019-09-06 2019-09-06 Genetic algorithm-based PID controller parameter optimization method and motor

Publications (2)

Publication Number Publication Date
CN110705030A true CN110705030A (en) 2020-01-17
CN110705030B CN110705030B (en) 2023-03-24

Family

ID=69194362

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910840873.6A Active CN110705030B (en) 2019-09-06 2019-09-06 Genetic algorithm-based PID controller parameter optimization method and motor

Country Status (1)

Country Link
CN (1) CN110705030B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230545A (en) * 2020-10-13 2021-01-15 西北工业大学 AUV course angle control method based on PPGA adaptive optimization PID parameter
CN113914055A (en) * 2021-11-18 2022-01-11 珠海格力电器股份有限公司 Washing parameter optimization method and device and clothes treatment device
CN114002946A (en) * 2021-12-31 2022-02-01 浙江中控技术股份有限公司 Self-adaptive PID parameter setting method, system, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298328A (en) * 2011-07-13 2011-12-28 上海电力建设启动调整试验所 Binary ant colony algorithm-based optimization design and setting method for adaptive PID controller
CN104808494A (en) * 2015-04-23 2015-07-29 西安外事学院 PID parameter setting method based on self-adaptation ant colony genetic hybrid algorithm
CN105487496A (en) * 2015-08-10 2016-04-13 河北省电力建设调整试验所 Optimization method for heat-engine plant thermal on-line process identification and control algorithm based on dual-objective parallel ISLAND-HFC mixed model genetic programming algorithm
CN105807607A (en) * 2016-05-11 2016-07-27 杭州电子科技大学 Method for optimizing predictive fuzzy-PID coking furnace temperature control through genetic algorithm
CN107272403A (en) * 2017-06-14 2017-10-20 浙江师范大学 A kind of PID controller parameter setting algorithm based on improvement particle cluster algorithm
CN107703749A (en) * 2017-10-10 2018-02-16 常州大学 A kind of pid parameter optimization method based on self-adapted genetic algorithm
CN108490965A (en) * 2018-04-19 2018-09-04 东华大学 Rotor craft attitude control method based on Genetic Algorithm Optimized Neural Network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102298328A (en) * 2011-07-13 2011-12-28 上海电力建设启动调整试验所 Binary ant colony algorithm-based optimization design and setting method for adaptive PID controller
CN104808494A (en) * 2015-04-23 2015-07-29 西安外事学院 PID parameter setting method based on self-adaptation ant colony genetic hybrid algorithm
CN105487496A (en) * 2015-08-10 2016-04-13 河北省电力建设调整试验所 Optimization method for heat-engine plant thermal on-line process identification and control algorithm based on dual-objective parallel ISLAND-HFC mixed model genetic programming algorithm
CN105807607A (en) * 2016-05-11 2016-07-27 杭州电子科技大学 Method for optimizing predictive fuzzy-PID coking furnace temperature control through genetic algorithm
CN107272403A (en) * 2017-06-14 2017-10-20 浙江师范大学 A kind of PID controller parameter setting algorithm based on improvement particle cluster algorithm
CN107703749A (en) * 2017-10-10 2018-02-16 常州大学 A kind of pid parameter optimization method based on self-adapted genetic algorithm
CN108490965A (en) * 2018-04-19 2018-09-04 东华大学 Rotor craft attitude control method based on Genetic Algorithm Optimized Neural Network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘明等: "基于自适应遗传算法的改进PID参数优化", 《计算机测量与控制》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112230545A (en) * 2020-10-13 2021-01-15 西北工业大学 AUV course angle control method based on PPGA adaptive optimization PID parameter
CN113914055A (en) * 2021-11-18 2022-01-11 珠海格力电器股份有限公司 Washing parameter optimization method and device and clothes treatment device
CN114002946A (en) * 2021-12-31 2022-02-01 浙江中控技术股份有限公司 Self-adaptive PID parameter setting method, system, electronic equipment and storage medium
CN114002946B (en) * 2021-12-31 2022-05-03 浙江中控技术股份有限公司 Self-adaptive PID parameter setting method, system, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110705030B (en) 2023-03-24

Similar Documents

Publication Publication Date Title
CN110705030B (en) Genetic algorithm-based PID controller parameter optimization method and motor
CN111628687B (en) Entropy weight method based permanent magnet synchronous motor multi-target parameter optimization method
Öztürk et al. Speed control of permanent magnet synchronous motors using fuzzy controller based on genetic algorithms
Gong et al. Adaptive strategy selection in differential evolution
Du et al. Identification of fractional-order systems with unknown initial values and structure
Wang et al. Fixed-Structure $ H_ {\infty} $ Controller Synthesis Based on Differential Evolution With Level Comparison
Panda et al. Comparative evaluation of optimization algorithms at training of genetic programming for tensile strength prediction of FDM processed part
CN110910277A (en) XGboost-based cement mill system power consumption index prediction method
CN111555682A (en) PID permanent magnet synchronous motor control method based on optimization algorithm
Yu et al. Improved meta-heuristics with Q-learning for solving distributed assembly permutation flowshop scheduling problems
Wang et al. Adaptive backtracking search optimization algorithm with pattern search for numerical optimization
Fang et al. Interval multi-objective evolutionary optimization for disassembly line balancing with uncertain task time
Wang et al. A cooperative algorithm for energy-efficient scheduling of distributed no-wait flowshop
Cao et al. Multi-objective flexible job shop scheduling problem using differential evolution algorithm
Prabu et al. Genetic algorithm tuned PID controller for rotor position control of BLDC motor
CN115249112A (en) Distributed mixed flow shop scheduling optimization method taking glass manufacturing as background
Zheng et al. Evaluating a hybrid DE and BBO with self adaptation on ICSI 2014 benchmark problems
Sajedi et al. Application of particle swarm optimization and genetic algorithm methods for vector control of induction motor
Yeh et al. An improved multiobjective evolutionary algorithm for solving the no-wait flow shop scheduling problem
Maqbool et al. Analysis of adaptability of Reinforcement Learning approach
CN112183843A (en) Thermal power plant load optimal distribution method based on hybrid intelligent algorithm
Antić et al. Optimal fuzzy sliding mode control with a time-varying sliding surface
Wang et al. An adaptive immune algorithm based on the endocrine regulation mechanism for scheduling problems of flow shop with zero wait
CN116681269B (en) Intelligent collaborative operation optimization method for power grid interactive type efficient residential building
Xu et al. An adaptive strategy to adjust the components of memetic algorithms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant