Servo motor control system based on fuzzy logic and genetic algorithm

By combining fuzzy logic and genetic algorithms in the servo motor control system, dynamically optimize control parameters, the existing system has solved the problems of high cost, high complexity and poor adaptability, and achieved efficient and low-cost adaptive control effect.

CN120143713APending Publication Date: 2025-06-13江苏华郢智能技术有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510326022.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

The existing servo motor control system has high cost, complex control logic and poor adaptability, making it difficult to meet the needs of modern industry for efficient and low-cost control.

Method used

The control system based on fuzzy logic and genetic algorithm is adopted, combined with the main control processor, fuzzy controller, genetic algorithm optimization module, data acquisition module and external processing module, dynamically optimize the membership function parameters to realize adaptive control.

Benefits of technology

It reduces the overall cost of the system, improves the adaptability and robustness of the control system, and realizes efficient and low-cost servo motor control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120143713A_ABST
    Figure CN120143713A_ABST
Patent Text Reader

Abstract

The invention discloses a servo motor control system and method based on fuzzy logic and a genetic algorithm and a computer storage medium, and relates to the technical field of motor control. A main control processor in the servo motor control system is used for receiving an instruction and fault information and state information of a servo motor and processing the instruction; the fuzzy controller is used for generating a fuzzy control signal according to an error between a current position and an expected position of the servo motor and a change rate of the error, and the genetic algorithm optimization module is used for dynamically optimizing parameters of a membership function in the fuzzy controller; the external processing module is used for achieving three-loop control over the position, speed and current of the servo motor, and the servo motor control system can adapt to changes of external conditions and can quickly respond to external instructions and interference, has high robustness, adaptability and high real-time performance and is convenient to integrate and expand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of motor control, and particularly to a servo motor control system, a control method, and a computer storage medium based on fuzzy logic and genetic algorithms. Background Art

[0002] With the rapid development of industrial automation and robotics, higher requirements are put forward for the accuracy, response speed, and adaptability of servo motor control systems. As the core component of a motion control system, the control performance of a servo motor directly affects the operating efficiency and accuracy of the equipment. Traditional servo motor control systems usually adopt PID control or a coordinated control architecture based on FPGA and MCU. Although these methods can meet the control requirements to a certain extent, their performance is often limited when facing non-linearity, parameter changes, or external disturbances. In addition, the design of traditional control systems is complex and costly, making it difficult to meet the requirements of modern industry for high-efficiency and low-cost control.

[0003] In the prior art, fuzzy logic controllers have been widely used in the field of servo motor control because they can handle uncertainty and non-linearity problems. However, the performance of a fuzzy controller highly depends on the design of membership functions and rule bases. Traditional methods usually rely on manual experience and are difficult to achieve dynamic optimization. As a global optimization technology, genetic algorithms can automatically optimize control parameters by simulating natural selection and genetic mechanisms. However, it is difficult to meet the requirements of real-time control when applied alone. Therefore, how to organically combine fuzzy logic and genetic algorithms to design an efficient, adaptive, and low-cost servo motor control system has become an urgent technical problem to be solved. Summary of the Invention

[0004] The present invention provides a servo motor control system, a control method, and a computer storage medium based on fuzzy logic and genetic algorithms to solve the problems of high cost, complex control logic, and poor adaptability in the prior art servo motor control systems.

[0005] To solve the above problems, the present invention provides a servo motor control system applied to a servo motor, including a main control processor, a fuzzy controller, a genetic algorithm optimization module, a data acquisition module, and an external processing module, wherein: The main control processor is connected to the external processing module and is used for receiving instructions, as well as the fault information and status information of the servo motor, and processing the instructions based on the fault information and the status information to generate three-phase pulse width modulation signals; The fuzzy controller is connected to the main control processor and is used for generating a fuzzy control signal according to the error between the current position and the desired position of the servo motor and its rate of change; The genetic algorithm optimization module is connected to the fuzzy controller and is used to dynamically optimize the parameters of the membership function in the fuzzy controller to adapt to the changes in the initial conditions of the system; The data acquisition module is connected to the servo motor and is used to collect the position, speed, and current information of the servo motor in real time and transmit the feedback signal to the fuzzy controller; The external processing module is connected to the servo motor and is used to receive the three-phase pulse width modulation signal to achieve the three-loop control of the position, speed, and current of the servo motor; Among them, the main control processor is connected to the external processing module through the fuzzy controller and the genetic algorithm optimization module. The fuzzy controller is used to convert the fuzzy control signal into the three-phase pulse width modulation signal, so that the external processing module controls the servo motor according to the adjusted pulse width modulation signal.

[0006] Further, the fuzzy controller includes: 1. A fuzzification module, which is used to convert the error and its change rate of the servo motor into fuzzy language variables; 2. An inference module, which is used to generate a fuzzy output according to the preset fuzzy rules; 3. A defuzzification module, which is used to convert the fuzzy output into a specific control signal.

[0007] The following is a detailed explanation of the optimization of the fuzzy part and the genetic algorithm: The numerical values of the variables are converted into language expressions by using triangular, trapezoidal, l-type, and r-type membership functions. The following formula corresponds to the trigonometric function.

[0008] The following formula defines the trapezoidal function:

[0009] The r function is described in the following formula: The following formula corresponds to the l function : And the error is obtained by using the difference between the expected value r and the real value y : Three trigonometric functions are used for the error variable (e), one r-type function and one l-type function. The range of the domain is -15 to 15 cm. The distribution of this variable is as Figure 3 shown in a. It should be emphasized that the values of the trigonometric functions are not fixed, but are connected to the genetic algorithm and are updated according to the factors explained later in this article.

[0010] The second input variable is the derivative of the error (e). ˙For its fuzzification process, five membership functions are used: one L-shaped function, one R-shaped function, and three triangular functions. The range of the linguistic universe is -50 to 50 cm / second.

[0011] Furthermore, the genetic algorithm optimization module includes: 1. A population initialization unit for randomly generating an initial population, where each individual is composed of the parameters of the membership functions in the fuzzy controller; 2. A fitness evaluation unit for evaluating the fitness of each individual according to the objective function; 3. A selection unit for selecting the individual with the optimal fitness for reproduction; 4. A crossover unit for generating a new generation of population through crossover operations; 5. A mutation unit for randomly mutating the individuals in the population; 6. A stop condition judgment unit for judging whether the optimization stop condition is satisfied.

[0012] The following provides a detailed explanation of the fuzzy part and the optimization of the genetic algorithm: As mentioned before, the connection between the fuzzy controller and the genetic algorithm optimization is the input variable of the error. Specifically, the aim is to optimize the values of the triangular functions of the linguistic expressions ne, ezero, and pe.

[0013] Equation (3) describes the three values necessary to represent the triangular function: the left base of the triangle represented by the letter a, the highest point m of the triangle, and finally the base b of the triangle. Figure 5 It shows that each individual in the population in the genetic algorithm is composed of a combination of these three points, which are respectively used for the three triangular functions to be optimized.

[0014]

[0015] For the initialization of the population, 40 individuals are randomly generated. In order to achieve a uniform distribution and maintain the triangular shape of the function, the individuals must satisfy the conditions shown in the following formula, and the formula is as follows:

[0016] After generating the initial population, its qualification is evaluated according to the following formula, where r(k) and y(k) are the expected value and the measured value at the k-th iteration respectively, and m is the number of iterations, and the formula is as follows: The next step is the selection process. This step uses the tournament method, which randomly compares two individuals from the initial population. The individual with the optimal qualification is selected for reproduction. Once an individual is selected, PMX crossover is used. In this type of hybridization, two individuals called parents share genes based on the H-index. The first new individual obtains all the genes of the first parent before index H and the genes of parent 2 from this index. The second new individual obtains all the genes of the second parent before index H and the genes of the first parent after the index. Repeat the above process until a new population of the same size as the initial population is generated.

[0017] Once a new generation is created, its suitability must be re-evaluated. The process continues until the stopping criterion is met, which includes 2s iterations for experiments with a single expected value and 12s iterations for experiments with multiple expected values.

[0018] Furthermore, the external processing module includes: 1. A bus communication unit, which is respectively connected to the host computer and the main control processor, and is used to receive the instruction and realize the information interaction between the host computer and the main control processor; 2. An analog quantity processing unit, which is respectively connected to the host computer, the main control processor and the data acquisition module, and is used to receive the analog quantity information output by the host computer; 3. An input / output processing unit, which is connected to the host computer and is connected to the main control processor through input / output peripherals, and is used to realize the logical interaction between the host computer and the main control processor; 4. A current acquisition unit, which is respectively connected to the servo motor and the data acquisition module, and is used to collect the three-phase current of the servo motor and generate a current digital signal; 5. An encoder signal processing unit, which is connected to the servo motor and is used to read the position information and speed information of the servo motor; 6. A wave generation control unit, which is connected to the main control processor through a timer peripheral, and is used to receive the pulse width modulation signals of the three phases and output the pulse width modulation signals of the three phases.

[0019] Furthermore, the external processing module also includes: 1. A debugging circuit unit, which is respectively connected to the host computer and the main control processor, and is used to transmit the information of the servo motor control system to the host computer; 2. A drive control unit, which is respectively connected to the wave generation control unit and the servo motor, and is used to convert the pulse width modulation signals of the three phases into voltage signals and control the servo motor based on the voltage signals. 3. A servo encoder, connected to the servo motor, is used to detect the position and speed of the servo motor and generate the position information and speed information of the servo motor.

[0020] Further, the external processing module further includes: 1. A power processing unit, connected to an external power supply, is used to receive an input voltage, process the input voltage, and supply power to the servo motor control system; 2. A hardware protection unit, respectively connected to the main control processor and the drive control unit, is used to receive a fault control instruction and control the drive control unit based on the fault control instruction to control the servo motor to stop running. Description of the Drawings

[0021] Figure 1 It is the overall flowchart of the servo motor control system of the fuzzy logic and genetic algorithm of the present invention.

[0022] Four different scenarios were designed in the experiment.

[0023] • Scenario 1: There is no weight on the basis, and a trajectory is defined for a single expected value. • Scenario 2: There is no weight on the basis, and trajectories are defined for multiple expected values. • Scenario 3: Add a weight of 5 pounds and define a trajectory for a single expected value. • Scenario 4: Add a weight of 5 pounds and define a trajectory for multiple expected values.

[0024] The results of Scenario 1 and 3 are as Figure 2 shown, and the results of Scenario 2 and 4 are as Figure 3 shown.

[0025] Figure 4 The servo motor used in the experiment is a servo motor manufactured by Jiangsu Huaying Intelligent Technology Co., Ltd.

[0026] Figure 5 It is a schematic diagram of PMX crossover. Detailed Embodiment

[0027] By providing a servo motor control system based on fuzzy logic and genetic algorithm in the embodiments of the present application, the technical problems of high cost, complex control logic, and poor adaptability in the existing technical solutions of the servo motor control system are solved. The overall idea of the technical solutions in the embodiments of the present application to solve the above problems is as follows: To better understand the above technical solutions, the above technical solutions will be described in detail below in conjunction with the accompanying drawings of the specification and specific embodiments.

[0028] A servo motor control system based on fuzzy logic and genetic algorithm, as Figure 1As shown in the figure, it includes a power supply part, an MCU part, an FPGA part, a data acquisition module, an external processing module, a fuzzy controller, a genetic algorithm optimization module, and a high-speed DDR3. The power supply part powers the MCU part, the FPGA part, the data acquisition module, the external processing module, and related peripherals through a DC-DC buck circuit to ensure the normal operation of the system.

[0029] The MCU part uses STM32F427 and is programmed in C language to mainly implement the motion control algorithm of the servo motor and the core logic of the fuzzy logic controller. The FPGA part uses Spartan6 (with more than 6000 logic cells) to implement the logical operations of the genetic algorithm optimization module and is responsible for external input / output and high-speed data processing to reduce the burden on the MCU. Data interaction between the FPGA and the MCU is carried out through parallel communication.

[0030] The data acquisition module is connected to the servo motor to collect the position, speed, and current information of the servo motor in real time and transmit the feedback signal to the fuzzy controller to provide accurate input data for the control algorithm. The external processing module includes a bus communication unit, an analog processing unit, an input / output processing unit, a current acquisition unit, an encoder signal processing unit, a wave generation control unit, a debugging circuit unit, a drive control unit, a servo encoder, a power supply processing unit, and a hardware protection unit, which are used to implement the three-loop control of the servo motor and system protection.

[0031] The fuzzy controller includes a fuzzification module, an inference module, and a defuzzification module. The fuzzification module converts the error and its change rate of the servo motor into fuzzy linguistic variables; the inference module generates a fuzzy output according to the preset fuzzy rules; the defuzzification module converts the fuzzy output into a specific control signal. The genetic algorithm optimization module includes a population initialization unit, a fitness evaluation unit, a selection unit, a crossover unit, a mutation unit, and a stop condition judgment unit, which are used to dynamically optimize the parameters of the membership function in the fuzzy controller to adapt to the changes in the initial conditions of the system.

[0032] High-speed DDR3 is used to provide data caching for the FPGA part to cooperate in completing high-speed data processing. Through the above design, the embodiments of the present application achieve the following technical effects: adopting fuzzy logic and genetic algorithm to optimize the control strategy, without relying on complex hardware devices or high-cost dedicated controllers, reducing the overall cost of the system; adopting the collaborative architecture of STM32F427 and Spartan-6 FPGA, STM32F427 focuses on motion control algorithms, and the FPGA is responsible for the processing of external input / output and genetic algorithm optimization modules, significantly reducing the burden on the CPU and making the system more efficient and reliable; the genetic algorithm dynamically optimizes the parameters of the fuzzy controller, enabling the system to adapt to changes in external conditions, improving the robustness and adaptability of the system; through the collaborative work of the MCU and the FPGA, the system can quickly respond to external instructions and interferences, ensuring high real-time performance of the control process; the system adopts a modular design, and each module can be independently developed and tested, facilitating the integration and expansion of the system.

[0033] Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concept. The appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications falling within the scope of the present invention. Obviously, those skilled in the art can make various changes and variations to the present invention without departing from the spirit and scope of the present invention. If these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these modifications and variations.

Claims

1. A servo motor control system based on fuzzy logic and genetic algorithm, characterized in that: Applied to servo motor, including main control processor, fuzzy controller, genetic algorithm optimization module, data acquisition module and external processing module, among which: The main control processor is connected to the external processing module, and is used to receive instructions and fault information and status information of the servo motor, and process the instructions based on the fault information and the status information to generate a three-phase pulse width modulation signal; The fuzzy controller is connected to the main control processor and is used to generate a fuzzy control signal according to the error and the change rate of the current position and the desired position of the servo motor; The genetic algorithm optimization module is connected to the fuzzy controller and is used to dynamically optimize the parameters of the membership function in the fuzzy controller to adapt to changes in the initial conditions of the system; The data acquisition module is connected to the servo motor and is used to collect the position, speed and current information of the servo motor in real time, and transmit the feedback signal to the fuzzy controller; The external processing module is connected to the servo motor and is used to receive the three-phase pulse width modulation signal to achieve three-loop control of the position, speed and current of the servo motor; Among them, the main control processor is connected to the external processing module through the fuzzy controller and the genetic algorithm optimization module, and the fuzzy controller is used to convert the fuzzy control signal into the three-phase pulse width modulation signal so that the external processing module controls the servo motor according to the adjusted pulse width modulation signal.

2. The servo motor control system according to claim 1, characterized in that: The fuzzy controller comprises: A fuzzification module, used for converting the error of the servo motor and its change rate into fuzzy linguistic variables; The reasoning module is used to generate fuzzy output according to preset fuzzy rules; The defuzzification module is used to convert the fuzzy output into a specific control signal.

3. The servo motor control system according to claim 1, characterized in that: The genetic algorithm optimization module includes: A population initialization unit, used for randomly generating an initial population, wherein each individual is composed of parameters of a membership function in the fuzzy controller; A fitness evaluation unit, used to evaluate the fitness of each individual according to the objective function; Selection unit, used to select individuals with the best fitness for reproduction; A crossover unit, used to generate a new generation of population through a crossover operation; Mutation unit, used to randomly mutate individuals in the population; The stop condition judgment unit is used to judge whether the optimization stop condition is met.

4. The servo motor control system according to claim 1, characterized in that: The external processing module comprises: A bus communication unit, connected to the host computer and the main control processor respectively, for receiving the instructions and realizing information exchange between the host computer and the main control processor; An analog quantity processing unit, connected to the host computer, the main control processor and the data acquisition module respectively, and used for receiving the analog quantity information output by the host computer; An input / output processing unit, connected to the host computer and connected to the main control processor via input / output peripherals, for realizing logical interaction between the host computer and the main control processor; A current acquisition unit, connected to the servo motor and the data acquisition module respectively, for acquiring the three-phase current of the servo motor and generating a current digital signal; An encoder signal processing unit, connected to the servo motor, for reading position information and speed information of the servo motor; The pulsation control unit is connected to the main control processor via a timer peripheral, and is used to receive the three-phase pulse width modulation signal and output the three-phase pulse width modulation signal.

5. The servo motor control system according to claim 4, characterized in that: The external processing module also includes: A debugging circuit unit, connected to the host computer and the main control processor respectively, for transmitting information of the servo motor control system to the host computer; A driving control unit, connected to the wave generation control unit and the servo motor, respectively, for converting the three-phase pulse width modulation signal into a voltage signal, and controlling the servo motor based on the voltage signal; A servo encoder is connected to the servo motor and is used to detect the position and speed of the servo motor and generate the position information and speed information of the servo motor.

6. The servo motor control system according to claim 5, characterized in that: The external processing module also includes: A power processing unit, connected to an external power source, for receiving an input voltage and processing the input voltage to supply power to the servo motor control system; The hardware protection unit is connected to the main control processor and the drive control unit respectively, and is used to receive a fault control instruction and control the drive control unit based on the fault control instruction to control the servo motor to stop running.

7. A servo motor control method based on fuzzy logic and genetic algorithm, characterized in that: The control method is applied to the servo motor control system according to any one of claims 1 to 6, and the control method comprises: The main control processor receives the instruction and the fault information and status information of the servo motor, and processes the instruction based on the fault information and the status information to generate a three-phase pulse width modulation signal; The fuzzy controller generates a fuzzy control signal according to the error between the current position and the desired position of the servo motor and the rate of change thereof; The genetic algorithm optimization module dynamically optimizes the parameters of the membership function in the fuzzy controller to adapt to the changes in the initial conditions of the system; The data acquisition module collects the position, speed and current information of the servo motor in real time, and transmits the feedback signal to the fuzzy controller; The external processing module receives the three-phase pulse width modulation signal to realize three-loop control of the position, speed and current of the servo motor; Among them, the main control processor is connected to the external processing module through the fuzzy controller and the genetic algorithm optimization module, and the fuzzy controller is used to convert the fuzzy control signal into the three-phase pulse width modulation signal so that the external processing module controls the servo motor according to the adjusted pulse width modulation signal.

8. A computer storage medium, characterized in that The computer storage medium is used to store program data, and when the program data is executed by a computer, it is used to implement the servo motor control method according to claim 7.