Underwater brushless direct current motor control method based on fuzzy PID
By employing fuzzy PID control in an underwater brushless DC motor and utilizing genetic algorithms to optimize the membership function and fuzzy rules, the problems of insufficient accuracy and poor self-adjustment capability of traditional PID control are solved, achieving high-precision closed-loop speed control.
Patent Information
- Application Number
- CN202510988016.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-10-24
AI Technical Summary
Traditional PID control algorithms are difficult to meet the high-precision control requirements of underwater brushless DC motors, while fuzzy PID control suffers from imperfect control rules and insufficient parameter self-adjustment capabilities.
A fuzzy PID-based control method is adopted. By setting input and output parameters, the membership function and fuzzy rules of the fuzzy PID are optimized using a genetic algorithm. Combined with the fitness ratio method and elite strategy, genetic operations are performed to optimize the PID parameters and achieve real-time speed regulation.
This improves the speed control accuracy and disturbance rejection capability of underwater brushless DC motors, and achieves efficient closed-loop speed control.
Smart Images

Figure CN120834740A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of underwater brushless DC motor control, and particularly relates to a control method of an underwater brushless DC motor based on fuzzy PID. BACKGROUND
[0002] In recent years, with the continuous exploration of marine resources by human beings, underwater robots play a vital role in the fields of marine exploration and underwater operation. Due to the characteristics of high reliability, high efficiency, noiseless operation, long service life and low maintenance cost of brushless DC motors, brushless DC motors are selected as core power components.
[0003] When facing the complex and changeable underwater environment and the nonlinear and multivariable coupling characteristics of the brushless DC motor itself, the traditional PID control algorithm is difficult to meet the high-precision control requirements and cannot realize the precise operation of the motor. In order to optimize the control effect, at present, most of the fuzzy PID control methods combining fuzzy control and PID control are used. When applied to the nonlinear system of the underwater robot brushless DC motor with time-varying parameters, there are still problems such as imperfect control rules, lack of self-adjusting ability of control system parameters, and insufficient optimization of fuzzy PID control rules and online adjustment of parameters. Therefore, a more effective control method is needed to solve these problems. SUMMARY
[0004] The problem to be solved by the present application is the insufficient control precision of the brushless DC motor, the difficulty of the control rules to adapt to changes, and the poor parameter self-adjusting ability in the existing fuzzy PID technology. A control method of an underwater brushless DC motor based on fuzzy PID is proposed.
[0005] To achieve the above purpose, the technical scheme is as follows:
[0006] A control method of an underwater brushless DC motor based on fuzzy PID, comprising the following steps:
[0007] S1. Set the input parameters and output parameters of the fuzzy PID, the input parameters are the speed error e and the speed error change rate ec, and the output parameters are the correction coefficient of the proportional coefficient, the correction coefficient of the integral coefficient and the correction coefficient of the differential coefficient;
[0008] S2. Genetic gene coding is performed on the membership function and fuzzy rules of the fuzzy PID, and then the genetic gene coding is initialized;
[0009] S3. Select the fitness function;
[0010] S4. Formulate the genetic algorithm rules, and perform genetic operation by combining the fitness proportion method and the elite strategy rules, and then generate new individuals based on the adaptive crossover and mutation rules.
[0011] S5. Calculate the individual fitness based on the generated new individual, and then repeat step S4-step S5 until the end of iteration, and the output parameters are obtained after decoding.
[0012] Further, the correction coefficient of the proportional coefficient, the correction coefficient of the integral coefficient, and the correction coefficient of the differential coefficient in step S1 are The output parameters optimized by the genetic algorithm are input into the PID controller, and the corresponding control variables are output, and the speed of the underwater brushless DC motor is adjusted in real time according to the control variables, forming a speed closed loop control of the underwater brushless DC motor.
[0013] Further, the specific implementation method of step S2 includes the following steps:
[0014] S2.1. Membership function coding: triangular membership function is adopted, and each variable has 7 fuzzy subsets. Before optimization, the 7 subsets are uniformly distributed, and the horizontal coordinates of the vertices are set as , which determines the subset area of the membership function; based on the input of 2 parameters and the output of 3 parameters, a set of horizontal coordinates of the vertices corresponding to each parameter is set, and the membership function base to be optimized is obtained as 25;
[0015] S2.2. Fuzzy rule coding: the fuzzy language is converted into a digital instead, and negative big NB, negative middle NM, negative small NS, zero ZO, positive small PS, positive middle PM, and positive big PB are respectively corresponding to numbers 1, 2, 3, 4, 5, 6, and 7, so that correspond to 49 kinds of rules, and the total number of rules is 147;
[0016] The membership function coding and fuzzy rule coding are combined to form a genetic code string of 172 bits;
[0017] S2.3. Genetic code initialization: the first 147 bits of genetic code are randomly selected from [1, 7] as integers, and the last 25 bits of genetic code are randomly selected from [-6, 6] as integers, and the genetic code initialization is completed.
[0018] Further, the specific implementation method of step S3 is to select the fitness function, and the expression is:
[0019]
[0020] Wherein, J is the target function selection standard ITAE performance index, t is a time variable, which is used to weight the error; e(t) is the error signal of the system, which is defined as the difference between the expected output and the actual output.
[0021] Further, the specific implementation method of step S4 includes the following steps:
[0022] S4.1. Set the fitness proportion method as the proportion of individual fitness and population cumulative fitness as the screening rule, and set the top 50% of fitness as the genes inherited to the next generation;The elite strategy is to select the top 5% of the highest fitness as the next generation directly;
[0023] S4.2. Set the self-adaptive crossover method as the allelic crossover operation of the two chromosome individuals before and after setting;For the gene variables of the first 147 fuzzy rules, if the absolute value of the difference of the gene variables to be crossed is less than or equal to 3, the exchange is allowed, otherwise the exchange is not allowed;For the gene variables of the membership function of the last 148-172, the allelic crossover is performed between groups with 5 bits as a group;
[0024] S4.3. Set the mutation rule method as judging whether to perform a mutation according to the mutation probability, if the mutation is performed, a gene of the chromosome is randomly selected as the mutation point;If the mutation point position is at the first 147, the random +1 or-1 operation of the mutation position is performed, and the gene variable after mutation must be within the digitization range [1,7] of the fuzzy rule, if less than 1, take 1, and if greater than 7, take 7;If the mutation point position is at the last 148-172, the random +1.5 or-1.5 operation of the mutation position is performed, the gene variable after mutation cannot be less than the previous one and cannot be greater than the next one, and the gene variable after mutation must be within the fuzzy domain [-6,6].
[0025] Further, step S5 is performed in the MATLAB / Simulink module, and PID, fuzzy PID and genetic algorithm optimized fuzzy PID control system simulation are performed.
[0026] The beneficial effects of the present application are as follows:
[0027] The control method of the underwater brushless DC motor based on the fuzzy PID disclosed by the present application is obtained by setting the speed and the actual speed of the motor, the speed error e and the speed error change rate ec, and the membership function and the fuzzy control rule in the fuzzy PID controller are optimized by the genetic algorithm, so that the optimized PID parameter adjustment amount is input into the PID controller, and the corresponding control variable is output, and the motor speed is adjusted in real time according to the control variable, so that the actual speed is equal to the set speed, forming a speed closed-loop control.
[0028] The control method of the underwater brushless DC motor based on the fuzzy PID selects the coding assignment range, selects a suitable fitness function, and makes the genetic coding iteration speed fast. The high-speed closed-loop control performance is high. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The flow chart of the control method of the underwater brushless DC motor based on the fuzzy PID is shown in the figure.
[0030] Figure 2 The input and output membership function chart of the application is shown in the figure.
[0031] Figure 3 The system block diagram of the genetic algorithm optimized fuzzy PID control method of the application is shown in the figure.
[0032] Figure 4 The fuzzy domain division chart of the application is shown in the figure.
[0033] Figure 5 The brushless DC motor control system under the control of the PID, the fuzzy PID and the genetic algorithm optimized fuzzy PID control method respectively is shown in the figure. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical scheme and advantages of the application clearer and more understandable, the application is further described in detail below in combination with the drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the application and are not used to limit the application, that is, the described specific embodiments are only a part of the embodiments of the application, but not all the specific embodiments. The components of the specific embodiments of the application described and shown in the drawings can be arranged and designed in various different configurations, and the application can also have other embodiments.
[0035] Therefore, the detailed description of the specific embodiments of the application provided in the drawings below is not intended to limit the scope of the claimed application, but only represents selected specific embodiments of the application. Based on the specific embodiments of the application, all other specific embodiments obtained by those skilled in the art without creative labor are within the scope of the protection of the application.
[0036] In order to further understand the inventive content, characteristics and effects of the application, the following specific embodiments are exemplified, and the drawings are combined Figure 1- attached Figure 5 The detailed description is as follows:
[0037] Embodiment 1:
[0038] A control method of an underwater brushless DC motor based on fuzzy PID, comprising the following steps:
[0039] S1. Set the input parameters and output parameters of the fuzzy PID, the input parameters being the speed error e and the speed error change rate ec, and the output parameters being the correction coefficient of the proportional coefficient, the correction coefficient of the integral coefficient and the correction coefficient of the differential coefficient;
[0040] Further, the correction coefficient of the proportional coefficient, the correction coefficient of the integral coefficient and the correction coefficient of the differential coefficient in step S1 are The output parameters optimized by the genetic algorithm are input into the PID controller, and the corresponding control variables are output, and the speed of the underwater brushless DC motor is adjusted in real time according to the control variables to form a speed closed-loop control of the underwater brushless DC motor;
[0041] Further, the physical domains of e and ec are [0, 500] and [-3.65e+5, 0] respectively, and the corresponding fuzzy domains are [-6, 6]. Among them, the subsets of the fuzzy domain are NB, NM, NS, ZO, PS, PM and PB, which represent "negative large", "negative medium", "negative small", "zero", "positive small", "positive medium" and "positive large" respectively. The membership function has little effect on the overall algorithm, so the triangular membership function is adopted in the present application.
[0042] Further, the input quantity domain conversion is performed, and the physical domain is one-to-one mapped to the fuzzy domain according to the size order. During the conversion, the calculation factor required for the conversion is called the quantization factor. After the input variable is fuzzed, the membership degree of the real value in different fuzzy subsets can be obtained.
[0043] S2. Genetic gene coding is performed on the membership function and fuzzy rules of the fuzzy PID, and then the genetic gene coding is initialized;
[0044] Further, the specific implementation method of step S2 comprises the following steps:
[0045] S2.1. Membership function coding: a triangular membership function is adopted, each variable has 7 fuzzy subsets, and before optimization, the 7 subsets are uniformly distributed, the top horizontal coordinates are set as , which determine the subset area of the membership function; based on 2 input parameters and 3 output parameters, a set of top horizontal coordinates corresponding to each parameter is set, and 25 membership function bases to be optimized are obtained;
[0046] S2.2. Fuzzy rule coding: the fuzzy language is converted into digital instead, negative big NB, negative middle NM, negative small NS, zero ZO, positive small PS, positive middle PM, positive big PB corresponding to the number 1, 2, 3, 4, 5, 6, 7, respectively, then Corresponding to 49 rules, a total of 147 rules;
[0047] Fuzzy rule making, its rules are mainly based on the experience of experts or engineering practice, e big→ Big, Small; e and ec median→ Small, Big; e small→ Big, Big. The commonly used area barycentric method is used to solve the fuzzy. Output quantity domain conversion, through the scale factor, the fuzzy quantity is converted into the physical domain of the real quantity.
[0048] The membership function coding and fuzzy rule coding are combined, and a total of 172-bit coding string forms genetic coding; Table 1 is an empirical fuzzy PID rule table, and the three columns in the table are respectively The output rule of;
[0049] Table 1
[0050]
[0051] S2.3. Genetic code initialization: the first 147-bit genetic code is randomly selected from [1, 7] integer, and the last 25-bit genetic code is randomly selected from [-6, 6] integer, and the genetic code initialization is completed. The digital rule graph is rewritten according to table 1 as shown in table 2;
[0052] Table 2
[0053]
[0054] S3. Select fitness function;
[0055] Further, the specific implementation method of step S3 is to select the fitness function, and its expression is:
[0056]
[0057] Wherein, wherein, J is the target function selection standard ITAE performance index, t is a time variable, used to weight the error; e(t) is the error signal of the system, defined as the difference between the expected output and the actual output; the target function selection standard ITAE performance index, the minimum value of J is taken as the best fitness value, which is a comprehensive evaluation standard commonly used in engineering control system, which can comprehensively reflect the accuracy, rapidity and other dynamic and static performance of system response.
[0058] S4. Formulate genetic algorithm rules, adopt fitness proportionate method and elite strategy combined rules for genetic operation, and then generate new individuals based on adaptive crossover and mutation rules;
[0059] Further, the specific implementation method of step S4 includes the following steps:
[0060] S4.1. Set the fitness proportionate method as the ratio of individual fitness and population cumulative fitness as the screening rule, and stipulate that the top 50% of fitness is the gene inherited to the next generation; the elite strategy is to select the top 5% with the highest fitness proportion as the next generation;
[0061] S4.2. Set the method of adaptive crossover as setting the alleles of the two chromosome individuals before and after the operation to exchange; for the gene variables of the first 147 fuzzy rules, if the absolute value of the difference of the gene variables to be exchanged is less than or equal to 3, exchange is allowed, otherwise exchange is not allowed; for the gene variables of the membership function from the 148th to the 172nd, exchange the alleles in groups of 5;
[0062] S4.3. Set the method of mutation rule as judging whether to perform a mutation according to the mutation probability, if a mutation is performed, randomly select a gene of the chromosome as the mutation point; if the mutation point position is at the first to the 147th position, perform a random +1 or -1 operation on the mutation position, and the mutated gene variable must be within the digitization range [1,7] of the fuzzy rule, if less than 1, take 1, and if greater than 7, take 7; if the mutation point position is at the 148th to the 172nd position, perform a random +1.5 or -1.5 operation on the mutation position, the mutated gene variable cannot be less than the previous position nor greater than the next position, and the mutated gene variable must be within the fuzzy domain [-6,6].
[0063] S5. Calculate the individual fitness based on the generated new individuals, and then repeat steps S4-S5 until the iteration is ended, and the output parameters are obtained after decoding.
[0064] Further, step S5 is in the MATLAB / Simulink module, and PID, fuzzy PID and genetic algorithm optimized fuzzy PID control system simulation is performed. The obtained is added to the initial to obtain the final The PID regulated output is sent to a direct current power module, and the direct current voltage is directly connected to the brushless direct current motor for power supply.
[0065] Further, the fuzzy PID controller based on genetic algorithm optimization has the following specific steps:
[0066] The fuzzy PID control method: input domain conversion, the physical domain is converted to the fuzzy domain, and the input quantity e and ec are not symmetrical in the physical domain. The calculation formula is as follows:
[0067]
[0068] Wherein, a, b are the upper and lower limits of the physical domain; j is e or ec; x is the physical domain input quantity, and n is the fuzzy domain value.
[0069] ;
[0070] The membership function is selected, and the triangular membership function is selected because the center point can be changed by changing the base and vertex position of the triangle, which is suitable for online adjustment of the intelligent control algorithm, and the expression is as follows, wherein a, b, c are the triangle vertices. Figure 2 As shown in the following formula:
[0071] ;
[0072] The fuzzy rule is determined, and the rule is determined by reasoning according to engineering experience, and the rule is mainly formulated according to the experience of experts or engineering practice. Large, Small; e and ec medium value Small, Large; e small Large, Large. The fuzzy rule is shown in Table 1.
[0073] After the area barycenter method is used to solve the fuzziness, the value of the fuzzy domain is obtained, and the following formula is used to convert to the physical domain, and the proportional factors of the three output quantities are .
[0074] ;
[0075] The brushless direct current motor control system is a strong coupling, multivariable nonlinear complex system, so the control method needs to have self-adaptability and self-adjustment control method, on the basis of fuzzy PID control method, the invention optimizes the membership function and fuzzy rule by genetic algorithm, after the iteration calculation of genetic algorithm, a set of membership function and fuzzy control rule with maximum fitness are obtained, so as to enhance the control performance,
[0076] As shown in Figure 5 Fig. 3 is the speed waveform of the brushless direct current motor under the control of the genetic algorithm optimized fuzzy PID control method, Fig. 4 is the speed waveform of the brushless direct current motor under the control of the fuzzy PID control method, and Fig. 5 is the speed waveform of the brushless direct current motor under the control of the genetic algorithm optimized fuzzy control method.
[0077] It should be noted that the relational terms herein such as first and second and the like are used solely to distinguish one from another entity or action without necessarily requiring or implying any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0078] Although the present application has been described with reference to specific implementations, it will be apparent to those skilled in the art that various modifications in form and details can be made therein without departing from the scope of the application. In particular, elements of one implementation can be combined with elements of another implementation to create further implementations. Such modifications and combinations are intended to fall within the scope of the present application. The disclosure is not limited to the specific implementations described herein, but only to the scope of the appended claims, albeit with the proviso that modifications relating to structure and equivalents of what is shown herein are to be considered within the scope of the disclosure.
Claims
1. A control method of an underwater brushless DC motor based on fuzzy PID, characterized by, Comprising the following steps: S1. Set the input parameters and output parameters of the fuzzy PID, the input parameters are the speed error e and the speed error change rate ec, and the output parameters are the correction coefficient of the proportional coefficient, the correction coefficient of the integral coefficient and the correction coefficient of the differential coefficient; S2. Genetic gene coding is performed on the membership function and fuzzy rule of the fuzzy PID, and then the genetic gene coding is initialized; S3. Select the fitness function; S4. Formulate the genetic algorithm rules, and perform genetic operation by combining the fitness proportion method and the elite strategy rules, and then generate new individuals based on the adaptive crossover and mutation rules; S5. Calculate the individual fitness based on the generated new individuals, and then repeat step S4-step S5 until the iteration is ended, and the output parameters are obtained after decoding.
2. The control method of an underwater brushless DC motor based on fuzzy PID according to claim 1, characterized in that, The correction factor of the proportional coefficient, the correction factor of the integral coefficient, and the correction factor of the differential coefficient in step S1 are The output parameter optimized by the genetic algorithm is input into the PID controller, and the corresponding control variable is output. The underwater brushless DC motor speed is adjusted in real time according to the control variable, and the underwater brushless DC motor speed closed-loop control is formed.
3. The control method of an underwater brushless DC motor based on fuzzy PID according to claim 2, characterized in that, The specific implementation method of step S2 comprises the following steps: S2.
1. Membership function coding: A triangular membership function is adopted, and each variable has 7 fuzzy subsets. Before optimization, the 7 subsets are uniformly distributed, and the horizontal coordinates of the vertices are set as , which determine the subset area of the membership function; based on the input of 2 parameters and the output of 3 parameters, a set of horizontal coordinates of the vertices corresponding to each parameter is set, and 25 membership function bases to be optimized are obtained; S2.
2. Fuzzy rule coding: Convert the fuzzy language into digital substitutes, and let negative big NB, negative medium NM, negative small NS, zero ZO, positive small PS, positive medium PM, and positive big PB correspond to 1, 2, 3, 4, 5, 6, and 7 respectively, then correspond to 49 rules respectively, and the total number of rules is 147. The membership function coding and the fuzzy rule coding are combined, and a total of 172-bit coding strings form the genetic coding; S2.
3. Genetic code initialization: the first 147-bit genetic code is randomly selected from [1,7], and the last 25-bit genetic code is randomly selected from [-6,6], and the genetic code initialization is completed.
4. The control method of an underwater brushless DC motor based on fuzzy PID according to claim 3, characterized in that, The specific implementation method of step S3 is to select the fitness function, and the expression is: Wherein, J is the target function selection standard ITAE performance index, t is the time variable, which is used to weight the error; e(t) is the error signal of the system, which is defined as the difference between the expected output and the actual output.
5. The control method of an underwater brushless DC motor based on fuzzy PID according to claim 4, characterized in that, The specific implementation method of step S4 comprises the following steps: S4.
1. Set the fitness proportion method as the proportion of individual fitness and population cumulative fitness as the screening rule, and set the top 50% of the fitness as the genes that are inherited to the next generation; the elite strategy is to select the top 5% of the highest fitness proportion as the next generation; S4.
2. Set the method of adaptive crossover as setting the two chromosome individuals before and after to perform allele crossover operation; for the gene variables of the first 147-bit fuzzy rule, if the absolute value of the difference of the gene variables to be crossed is less than or equal to 3, the exchange is allowed, otherwise the exchange is not allowed; for the gene variables of the last 148-172-bit membership function, perform allele crossover between groups with 5 bits as a group; S4.
3. Set the method of mutation rule as judging whether to perform a mutation according to the mutation probability, if a mutation is performed, a gene of the chromosome is randomly selected as the mutation point; if the mutation point position is in the first 147-bit, the random+1 or-1 operation is performed on the mutation bit, and the gene variable after mutation must be within the numerical range [1,7] of the fuzzy rule, if it is less than 1, it is taken as 1, and if it is greater than 7, it is taken as 7; if the mutation point position is in the 148-172-bit, the random+1.5 or-1.5 operation is performed on the mutation bit, and the gene variable after mutation cannot be less than the previous bit nor greater than the next bit, and the gene variable after mutation must be within the fuzzy domain [-6,6].
6. The control method of an underwater brushless DC motor based on fuzzy PID according to claim 5, characterized in that, Step S5 is performed in the MATLAB / Simulink module to simulate the PID, fuzzy PID and genetic algorithm optimized fuzzy PID control system.
Citation Information
Cited By
SoC chip temperature control method
CN122063847A