Motor controller research and development method and research and development system based on intelligent algorithm
The PID controller parameters are optimized through an adaptive differential evolution algorithm, combined with an extended Kalman filter and a sliding mode observer to design a virtual sensor, to achieve the improvement of adaptability and robustness of the motor control system, and solve the problem of experience and sensor failure in the traditional motor control technology, and improve the system's fault tolerance and reliability.
Patent Information
- Application Number
- CN202510500414.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-04-21
AI Technical Summary
The existing motor control technology has experience in parameter setting, which is difficult to adapt to motor parameter changes and load disturbances. The optimization of intelligent algorithms lacks comprehensive considerations. The system is difficult to maintain stable operation under sensor failures, the fault tolerance is insufficient, and the hardware implementation is high, so real-time is difficult to ensure.
Through the adaptive differential evolution algorithm, optimize the PID controller parameters, build a motor dual-loop control structure, design an extended Kalman filter and sliding mode observer as virtual sensors, combine it with neural network for signal fusion, realize the reverse-step sliding mode controller, and build a motor control system with high fault tolerance.
It improves the adaptability and robustness of the motor control system, can maintain basic operating performance in the case of abnormal sensors or failures, reduces the controller design complexity and time cost, and enhances the reliability and safety of the system.
Smart Images

Figure CN120428592A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a motor controller development method and development system based on intelligent algorithms. Background Art
[0002] Motor control systems are widely used in industrial automation, electric vehicles, robotics, and other fields. Traditional motor control methods primarily employ proportional-integral-derivative (PID) controllers, which are widely used due to their simple structure and ease of implementation. With technological advancements, advanced control technologies such as vector control and direct torque control have emerged, improving the dynamic performance of motor control. In recent years, with the development of digital signal processors and power electronics, intelligent control algorithms such as fuzzy control, neural network control, and genetic algorithm optimization control have been introduced into the motor control field, further enhancing the system's adaptability and robustness. Furthermore, observer technologies such as Kalman filters and sliding mode observers have also been widely used, laying the foundation for sensorless control technology.
[0003] However, existing motor control technologies still have many shortcomings. First, traditional PID controller parameter tuning relies primarily on experience, making it difficult to adapt to changes in motor parameters and load disturbances. Second, while intelligent algorithms can improve control performance, most methods optimize for a single objective and lack comprehensive consideration. Furthermore, in the event of sensor failure, existing control systems struggle to maintain stable operation and lack fault tolerance. Furthermore, while most control algorithms perform well in theoretical verification, actual hardware implementation often faces challenges such as high computational complexity and difficulty ensuring real-time performance. Especially for applications requiring high dynamic performance, implementing complex control algorithms with limited hardware resources while maintaining robustness remains an urgent issue. Summary of the Invention
[0004] This application provides a motor controller R&D method and R&D system based on intelligent algorithms, which is used to build a motor control system with high fault tolerance by integrating multiple intelligent algorithms and virtual sensor technologies. Even in the case of sensor abnormality or failure, the basic operating performance of the motor can be maintained, thereby improving the reliability and safety of the system.
[0005] In the first aspect, the present application provides a motor controller development method based on an intelligent algorithm, and the motor controller development method based on the intelligent algorithm includes: performing parameter identification on the motor system to obtain motor parameters, and inputting the motor parameters into an adaptive differential evolution algorithm, performing parameter optimization on the PID controller, and obtaining optimal PID control parameters; constructing a motor dual-loop control structure according to the optimal PID control parameters, and adjusting the parameters to obtain an optimized dual-loop control structure; based on the optimized dual-loop control structure, designing an extended Kalman filter and a sliding mode observer as virtual sensors, and constructing a fault feature vector to obtain a sensor health index; inputting the sensor health index and the actual sensor and virtual sensor signals into a neural network to calculate the weight coefficient and perform signal fusion to obtain a fused speed signal; based on the fused speed signal, implementing a backstepping sliding mode controller with a dual integral sliding surface to complete the hardware design and performance verification of the motor control system.
[0006] In a second aspect, the present application provides a motor controller development system based on an intelligent algorithm, the motor controller development system based on an intelligent algorithm comprising:
[0007] An identification module is used to perform parameter identification on the motor system to obtain motor parameters, and input the motor parameters into an adaptive differential evolution algorithm to perform parameter optimization on the PID controller to obtain optimal PID control parameters;
[0008] An adjustment module is used to construct a motor dual-loop control structure according to the optimal PID control parameters and adjust the parameters to obtain an optimized dual-loop control structure;
[0009] A construction module is used to design an extended Kalman filter and a sliding mode observer as a virtual sensor based on the optimized dual-loop control structure, and to construct a fault feature vector to obtain a sensor health index;
[0010] An input module is used to input the sensor health index and the actual sensor and virtual sensor signals into a neural network to calculate weight coefficients and perform signal fusion to obtain a fused speed signal;
[0011] The verification module is used to implement a backstepping sliding mode controller with a double integral sliding surface according to the fused speed signal, thereby completing the hardware design and performance verification of the motor control system.
[0012] In a third aspect, a computer device is provided, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor calls the instructions in the memory so that the computer device executes the above-mentioned motor controller development method based on intelligent algorithm.
[0013] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, which, when executed on a computer, enables the computer to execute the above-mentioned method for developing a motor controller based on an intelligent algorithm.
[0014] In the technical solution provided by the present application, by performing parameter identification on the motor system and optimizing the PID controller parameters in combination with the adaptive differential evolution algorithm, the shortcomings of the traditional PID controller parameter tuning that relies on experience are effectively overcome, so that the control parameters can be automatically optimized and adjusted according to the motor characteristics, the accuracy and adaptability of the parameter tuning are improved, and the complexity and time cost of the controller design are reduced. The motor dual-loop control structure constructed based on the optimal PID control parameters is combined with the artificial immune system algorithm for parameter adjustment, so that the speed outer loop and the current inner loop are coordinated, which not only ensures the dynamic response speed but also maintains the stability of the control system, significantly improving the control performance of the motor under different working conditions. The extended Kalman filter and sliding mode observer designed by the present invention serve as virtual sensors, which can estimate the key state quantities of the motor in real time without increasing the hardware cost, and realize real-time monitoring of the sensor state and early warning of faults by constructing fault feature vectors and calculating the sensor health index, providing a reliable basis for system fault-tolerant control. The core innovation of this invention is the integration of sensor health indexes, along with actual sensor and virtual sensor signals, into a neural network for weight calculation and signal fusion. Leveraging the neural network's self-learning capabilities, this approach enables intelligent fusion of multi-source information, enabling the system to automatically adjust the weights of each signal source based on sensor health, ensuring the continuity and reliability of the velocity signal. A backstepping sliding mode controller with a dual-integrating sliding surface, combined with the fused velocity signal, creates a highly precise and robust control strategy that maintains excellent control performance even in the presence of parameter variations and external disturbances. This invention leverages the strengths of multiple intelligent algorithms in the field of motor control: adaptive differential evolution solves parameter optimization, an artificial immune system addresses multi-objective control structure optimization, a neural network implements information fusion, and sliding mode control provides a robust control approach. This multi-algorithm collaborative approach not only improves the overall performance of the control system but also provides the system with excellent adaptability and fault tolerance. In particular, in the event of sensor failure, traditional methods often lead to system loss of control. However, this invention maintains basic system functionality through intelligent switching of operating modes, relying on virtual sensors and fusion algorithms, even when sensor performance degrades or fails completely, significantly improving the reliability and safety of the motor control system. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 A schematic diagram of an embodiment of a motor controller development method based on an intelligent algorithm in an embodiment of the present application;
[0017] Figure 2 A schematic diagram of an embodiment of a motor controller development system based on an intelligent algorithm in an embodiment of the present application;
[0018] Figure 3 It is a schematic block diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The embodiments of the present application provide a motor controller R&D method and R&D system based on an intelligent algorithm. The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or that are inherent to these processes, methods, products or devices.
[0020] For ease of understanding, the specific process of the embodiment of the present application is described below. Figure 1 In the embodiment of the present application, an embodiment of a motor controller development method based on an intelligent algorithm includes:
[0021] Step S101: Perform parameter identification on the motor system to obtain motor parameters, and input the motor parameters into the adaptive differential evolution algorithm to optimize the parameters of the PID controller to obtain the optimal PID control parameters;
[0022] Step S102: constructing a motor dual-loop control structure according to the optimal PID control parameters, and adjusting the parameters to obtain an optimized dual-loop control structure;
[0023] Step S103: Based on the optimized dual-loop control structure, an extended Kalman filter and a sliding mode observer are designed as virtual sensors, and a fault feature vector is constructed to obtain a sensor health index;
[0024] Step S104: Input the sensor health index, the actual sensor signal, and the virtual sensor signal into a neural network to calculate the weight coefficient and perform signal fusion to obtain a fused speed signal;
[0025] Step S105 : Implement a backstepping sliding mode controller with a double integral sliding surface based on the fused speed signal, completing the hardware design and performance verification of the motor control system.
[0026] It is understandable that the execution subject of this application can be a motor controller development system based on intelligent algorithms, or a terminal or a server, which is not limited here. The embodiment of this application is described by taking the server as the execution subject as an example.
[0027] Specifically, motor system parameter identification is performed by applying a test signal to the motor and collecting voltage, current, speed, and torque data as parameter identification input signals. In actual operation, motor system parameter identification uses recursive least squares combined with differential evolution algorithm to iteratively calculate the motor parameter values, including stator resistance, stator inductance, rotor resistance, rotor inductance, and mutual inductance parameters. For example, when performing parameter identification on an induction motor with a rated power of 5 kW, test signals are applied and data is collected at different speed points. After constructing the optimization objective function and performing 300 iterative calculations, the motor parameter values of 0.6 ohms for stator resistance, 0.4 ohms for rotor resistance, 80 millihenries for stator inductance, 85 millihenries for rotor inductance, and 78 millihenries for mutual inductance are finally obtained. The identified motor parameter values are input into the adaptive differential evolution algorithm to optimize the parameters of the PID controller. The adaptive differential evolution algorithm first constructs the objective function of the PID controller, which includes error integral, time-weighted error integral, and control signal integral terms, and assigns different weight coefficients. The adaptive differential evolution algorithm population was initialized to 30, with each individual containing proportional, integral, and differential parameters. An adaptive mutation factor was used during the mutation operation, whose value was dynamically adjusted based on the number of iterations. A crossover operation was performed on the mutated individuals, using an adaptive crossover probability, and a selection operation was performed to retain the best individuals. Finally, the individual with the minimum objective function value was selected from the optimization results to obtain the optimal PID control parameters.
[0028] A dual-loop motor control structure was constructed based on the optimal PID control parameters. The optimal PID control parameters were applied to the inner current loop controller, with the current response frequency set to 1 kHz. This inner-loop unit was then constructed. An integral-proportional-derivative controller was constructed based on the inner loop unit as the outer speed loop control structure, with the differential filter time constant set to 0.01 seconds, forming a dual-loop control system. The control indicators of the dual-loop control system were defined as antigens, and the controller parameter combinations were defined as antibodies, forming an artificial immune system algorithm framework. An initial population of antibodies was generated, containing fifty parameter combinations. Each antibody contained the proportional, integral, differential, and filter parameters of the integral-proportional-derivative controller for the speed loop. A motor system simulation was run on this initial population of antibodies, and the integrated squared error was calculated as an affinity evaluation metric. The ten controller parameter combinations with the highest affinity were selected for cloning and amplification, with the number of amplifications proportional to the motor control performance. Mutation was performed on the amplified controller parameters, with the mutation amplitude dynamically adjusted based on the parameter's impact on motor performance. The parameter combination with the best motor speed response was selected from the mutated controller parameters to obtain the optimized dual-loop control structure. Based on this optimized dual-loop control structure, an extended Kalman filter and a sliding mode observer were designed as virtual sensors. The extended Kalman filter (EKF) establishes nonlinear state and observation equations, defining the motor state vector, control input, and observed output as basic parameters. The EKF sets the covariance matrix for system noise and measurement noise. The EKF process is performed in two phases: time update and measurement update, yielding the first virtual sensor output. A sliding mode observer is designed using the super-twist algorithm. By constructing a sliding surface and setting the observer gain, the second virtual sensor output is generated. The actual motor sensor measurements are compared with the first and second virtual sensor outputs to calculate a difference index. This difference index is then used for quality assessment, and the sensor health index (SHI) is calculated based on the deviation between the actual motor sensor measurements and the virtual sensor output. For example, in an industrial servo motor, the SHI remains above 0.95 during normal operation. When a sensor drift fault occurs, the SHI drops to around 0.7. When a sensor disconnection fault occurs, the SHI rapidly drops below 0.3, effectively identifying the sensor's health status.
[0029] The sensor health index, along with the actual sensor and virtual sensor signals, is input into a neural network to calculate weight coefficients and perform signal fusion. A three-layer feedforward neural network structure, consisting of four neurons in the input layer, eight neurons in the hidden layer, and one neuron in the output layer, forms the basic framework of the voting algorithm. The actual sensor signal, the virtual sensor signal from the extended Kalman filter, the virtual sensor signal from the sliding mode observer, and the sensor health index are combined into an input vector. The input vector is normalized, adjusting the value range to between zero and one, to obtain standardized neural network input data. Five thousand data samples, including those from normal and fault conditions, are collected to train the neural network and determine network weights and thresholds. The trained neural network performs online calculations and outputs weight coefficients for the three signal sources, ensuring that the sum of the weight coefficients is unity. Based on the weight coefficients, the actual sensor signal, the extended Kalman filter signal, and the sliding mode observer signal are weighted and summed to obtain a fused velocity signal.
[0030] A backstepping sliding mode controller with a dual-integral sliding surface is implemented based on the fused velocity signal. A dual-integral sliding surface is constructed based on the deviation between the fused velocity signal and the set velocity value. The sliding surface expression is obtained by weighted summation of the velocity error, the integral error term, and the double integral error term. The sliding surface expression is parameterized with positive constants, and weight coefficients are set to adjust the dynamic response and steady-state performance of the control system. Control terms are derived based on the inverse dynamics of the system, and switching control terms are added to form the control law, resulting in the backstepping sliding mode controller structure. The sign function is replaced with a continuous function, and chattering is suppressed by setting a smoothing factor, resulting in an improved control law. Based on the improved control law, the hardware platform for the motor controller is designed, with the processor selected and the peripheral circuits configured to form the hardware architecture. The current loop control, velocity loop control, virtual sensor calculation, fault diagnosis, and voting algorithms are assigned to interrupts of different priorities to construct a software framework. The controller is tested for startup performance, speed step response, load disturbance, and fault conditions in normal, degraded, and emergency modes. The test results are analyzed and the control performance indicators under different operating modes are compared to verify the functionality of the backstepping sliding mode controller with a dual-integral sliding surface.
[0031] In an embodiment of the present application, by performing parameter identification on the motor system and optimizing the PID controller parameters in combination with an adaptive differential evolution algorithm, the disadvantage of the traditional PID controller parameter tuning relying on experience is effectively overcome, so that the control parameters can be automatically optimized and adjusted according to the motor characteristics, thereby improving the accuracy and adaptability of the parameter tuning and reducing the complexity and time cost of the controller design. The motor dual-loop control structure constructed based on the optimal PID control parameters is combined with the artificial immune system algorithm for parameter adjustment, so that the speed outer loop and the current inner loop are coordinated and cooperated, which not only ensures the dynamic response speed but also maintains the stability of the control system, significantly improving the control performance of the motor under different working conditions. The extended Kalman filter and sliding mode observer designed by the present invention serve as virtual sensors, which can estimate the key state quantities of the motor in real time without increasing the hardware cost, and realize real-time monitoring of the sensor state and early warning of faults by constructing fault feature vectors and calculating the sensor health index, providing a reliable basis for system fault-tolerant control. The core innovation of this invention is the integration of sensor health indexes, along with actual sensor and virtual sensor signals, into a neural network for weight calculation and signal fusion. Leveraging the neural network's self-learning capabilities, this approach enables intelligent fusion of multi-source information, enabling the system to automatically adjust the weights of each signal source based on sensor health, ensuring the continuity and reliability of the velocity signal. A backstepping sliding mode controller with a dual-integrating sliding surface, combined with the fused velocity signal, creates a highly precise and robust control strategy that maintains excellent control performance even in the presence of parameter variations and external disturbances. This invention leverages the strengths of multiple intelligent algorithms in the field of motor control: adaptive differential evolution solves parameter optimization, an artificial immune system addresses multi-objective control structure optimization, a neural network implements information fusion, and sliding mode control provides a robust control approach. This multi-algorithm collaborative approach not only improves the overall performance of the control system but also provides the system with excellent adaptability and fault tolerance. In particular, in the event of sensor failure, traditional methods often lead to system loss of control. However, this invention maintains basic system functionality through intelligent switching of operating modes, relying on virtual sensors and fusion algorithms, even when sensor performance degrades or fails completely, significantly improving the reliability and safety of the motor control system.
[0032] In a specific embodiment, the process of executing step S101 may specifically include the following steps:
[0033] Apply test signals to the motor and collect voltage, current, speed, and torque data as input signals for parameter identification. An optimization objective function is constructed based on the input signals. The motor parameter values are obtained through iterative calculation using a recursive least squares method combined with a differential evolution algorithm.
[0034] The motor parameter values are model-verified to ensure that the consistency error between the output and the actual motor response does not exceed the preset threshold. The objective function of the PID controller is constructed, including the error integral, time-weighted error integral, and control signal integral terms, and different weight coefficients are assigned.
[0035] Initialize the population of the adaptive differential evolution algorithm, set the population size to 30, and the individuals contain three PID parameters;
[0036] Perform mutation operation on the population, use adaptive mutation factor, dynamically adjust the size of mutation factor according to the number of iterations, perform crossover operation on the mutated individuals, use adaptive crossover probability, and perform selection operation to retain the better individuals;
[0037] The individual with the smallest objective function value is selected from the optimization results to obtain the optimal PID control parameters.
[0038] Specifically, a test signal is applied to the motor and relevant data is collected. Specifically, a frequency-adjustable voltage source applies voltage signals of varying frequencies to the motor while the motor is operating at rest and at different speeds. Voltage, current, speed, and torque signals are collected as input data for parameter identification. This data is collected using high-precision data acquisition equipment, with a sampling frequency typically set at 10kHz to ensure data validity and accuracy. Constructing an optimization objective function based on the collected input signals is a key step in parameter identification. The optimization objective function is expressed as the sum of the squares of the difference between the actual measured output values and the model-calculated output values. The goal is to minimize this difference by adjusting the motor parameters. Recursive least squares is used to estimate the motor parameters in real time, continuously updating the parameter estimates based on newly acquired data. Furthermore, to avoid local optimal solutions, a differential evolution algorithm is introduced for global search. The differential evolution algorithm is an evolutionary computing technique that simulates biological evolution to find the optimal solution to a problem. During the execution of the algorithm, multiple iterative calculations are performed, and the motor parameter estimates are updated in each iteration until the objective function value converges or the maximum number of iterations is reached. Finally, the motor parameter values are obtained, including stator resistance, stator inductance, rotor resistance, rotor inductance, and mutual inductance.
[0039] After obtaining the motor parameters, model validation is necessary to ensure parameter accuracy. The measured parameters are substituted into the motor model, and the model is run under the same conditions to compare the consistency between the model output and the actual motor response. If the error exceeds a preset threshold (typically set at 3%), parameter identification must be repeated. After validation, the objective function of the PID controller is constructed. This function consists of three main components: an error integral term (representing the accumulation of error during the control process), a time-weighted error integral term (which imposes a greater penalty on long-standing errors), and a control signal integral term (which limits excessive changes in the control signal). These three terms are assigned different weights: the error integral term typically has a weight of 0.6, the time-weighted error integral term has a weight of 0.3, and the control signal integral term has a weight of 0.1. This configuration achieves a balance between control accuracy and system stability. Next, the population of the adaptive differential evolution algorithm is initialized. The population size is set to 30 individuals, each representing a set of PID controller parameters (proportional gain Kp, integral gain Ki, and differential gain Kd). During initialization, each parameter is randomly generated within a preset range: the proportional gain Kp is between 0 and 100, the integral gain Ki is between 0 and 50, and the differential gain Kd is between 0 and 10. This initialization range is based on the empirical parameter range of the motor controller to ensure that the initial population covers a reasonable search space.
[0040] Subsequently, a mutation operation is performed on the population. The key lies in the use of an adaptive mutation factor. The mutation factor F determines the degree to which the new individual deviates from the original individual, and its size is dynamically adjusted according to the number of iterations. In the early iterations, the F value is large (approximately 0.8-0.9), which promotes global search. As the number of iterations increases, the F value gradually decreases (to approximately 0.4-0.5), enhancing local fine-grained search capabilities. After the mutation operation, a crossover operation is performed on the mutated individuals, using an adaptive crossover probability CR. The crossover probability determines the probability that the offspring individual inherits characteristics from the mutated vector or the original vector. Its value also adjusts with the number of iterations, starting small (approximately 0.1-0.2) and increasing later (to approximately 0.8-0.9), promoting algorithm convergence. After the crossover operation is completed, a selection operation is performed to compare the fitness values (objective function values) of the original individual and the individuals after the crossover, retaining the individuals with better fitness for the next generation.
[0041] The optimal PID control parameters are obtained by selecting the individual with the smallest objective function value from the final population of the optimization process. This set of parameters achieves the optimization of the control system while meeting the control performance requirements.
[0042] Taking an industrial induction motor as an example, the above method was used to perform parameter identification and controller parameter optimization. First, a test signal was applied to the motor within the frequency range of 0 Hz to 50 Hz. 200 sets of voltage, current, speed, and torque data were collected at rest and at 25%, 50%, 75%, and 100% of the rated speed. Using a recursive least squares method combined with a differential evolution algorithm, after 250 iterations, the motor parameters were calculated: stator resistance 0.5 ohm, rotor resistance 0.45 ohm, stator inductance 78 millihenry, rotor inductance 82 millihenry, and mutual inductance 76 millihenry. Model validation showed a 2.3% consistency error between the output and actual response, which is below the preset threshold of 3%. After constructing the PID objective function, an adaptive differential evolution algorithm was used with a population size of 30, an initial mutation factor of 0.8, and an initial crossover probability of 0.2. After 400 generations of evolutionary calculations, the optimal PID parameters were obtained: Kp = 45.6, Ki = 22.8, and Kd = 5.2. After this set of control parameters is applied to the motor control system, it shows good dynamic response and steady-state accuracy under various working conditions, meeting the design requirements of the motor controller.
[0043] In a specific embodiment, the process of executing step S102 may specifically include the following steps:
[0044] Apply the optimal PID control parameters to the current inner loop controller, set the current response frequency to one kilohertz, build the inner loop unit for induction motor control, build an integral-proportional-differential controller based on the inner loop unit as the speed outer loop control structure, set the differential term filter time constant, and form a dual-loop control system;
[0045] The control index of the dual-loop control system is defined as antigen, and the controller parameter combination is defined as antibody. An artificial immune system algorithm framework is constructed, and an initial antibody population containing fifty parameter combinations is generated. Each antibody contains the proportional, integral, differential and filter parameters of the speed loop integral-proportional differential controller.
[0046] The motor system simulation is run on the initial population of antibodies, and the integrated square error is calculated as the affinity evaluation indicator;
[0047] The ten controller parameter combinations with the highest affinity are selected for cloning and amplification, and the number of amplifications is proportional to the motor control performance;
[0048] Perform mutation operations on the amplified controller parameters, and the mutation amplitude is dynamically adjusted according to the degree of influence of the parameters on the motor performance;
[0049] The parameter combination with the best motor speed response is selected from the controller parameters after mutation, and the parameter diversity is maintained to obtain the optimized dual-loop control structure.
[0050] Specifically, a frequency-adjustable voltage source applies voltage signals of varying frequencies to the motor while the motor is running at rest and at different speeds. Voltage, current, speed, and torque signals are collected as input data for parameter identification. This data is collected using high-precision data acquisition equipment, typically at a sampling frequency of 10kHz to ensure data validity and accuracy.
[0051] Constructing an optimization objective function based on the collected input signals is a key step in parameter identification. The optimization objective function is expressed as the sum of the squares of the difference between the actual measured output value and the model-calculated output value. The goal is to minimize this difference by adjusting the motor parameters. The recursive least squares method is used to estimate the motor parameters in real time, and it continuously updates the parameter estimates based on newly acquired data. At the same time, to avoid local optimal solutions, the differential evolution algorithm is introduced for global search. The differential evolution algorithm is an evolutionary computing technique that simulates the biological evolution process to find the optimal solution to the problem. During the execution of the algorithm, through multiple iterative calculations, the motor parameter estimates are updated with each iteration until the objective function value converges or the maximum number of iterations is reached. The motor parameter values are finally obtained, including stator resistance, stator inductance, rotor resistance, rotor inductance, and mutual inductance.
[0052] After obtaining the motor parameters, model verification must be performed to ensure parameter accuracy. Substitute the measured parameters into the motor model, run the model under the same conditions, and compare the consistency between the model output and the actual motor response. If the error exceeds the preset threshold (usually set to 3%), the parameter identification needs to be repeated. After verification, the objective function of the PID controller is constructed, which contains three main parts: the error integral term (representing the accumulation of errors in the control process), the time-weighted error integral term (giving greater penalties to errors that exist for a long time), and the control signal integral term (limiting excessive changes in the control signal). These three terms are assigned different weight coefficients. The error integral term weight is usually 0.6, the time-weighted error integral term weight is 0.3, and the control signal integral term weight is 0.1. Such a configuration can achieve a balance between control accuracy and system stability.
[0053] Next, the population of the adaptive differential evolution algorithm is initialized. The population size is set to 30 individuals, each representing a set of PID controller parameters (proportional gain Kp, integral gain Ki, and differential gain Kd). During initialization, each parameter is randomly generated within a preset range: proportional gain Kp between 0 and 100, integral gain Ki between 0 and 50, and differential gain Kd between 0 and 10. This initialization range is based on the empirical parameter range of the motor controller, ensuring that the initial population covers a reasonable range of the search space.
[0054] Subsequently, a mutation operation is performed on the population. The key lies in the use of an adaptive mutation factor. The mutation factor F determines the degree to which the new individual deviates from the original individual, and its size is dynamically adjusted according to the number of iterations. In the early iterations, the F value is large (approximately 0.8-0.9), which promotes global search. As the number of iterations increases, the F value gradually decreases (to approximately 0.4-0.5), enhancing local fine-grained search capabilities. After the mutation operation, a crossover operation is performed on the mutated individuals, using an adaptive crossover probability CR. The crossover probability determines the probability that the offspring individual inherits characteristics from the mutated vector or the original vector. Its value also adjusts with the number of iterations, starting small (approximately 0.1-0.2) and increasing later (to approximately 0.8-0.9), promoting algorithm convergence. After the crossover operation is completed, a selection operation is performed to compare the fitness values (objective function values) of the original individual and the individuals after the crossover, retaining the individuals with better fitness for the next generation.
[0055] Finally, the individual with the smallest objective function value is selected from the final population of the optimization process to obtain the optimal PID control parameters. This set of parameters achieves the optimization of the control system while meeting the control performance requirements.
[0056] Taking an industrial induction motor as an example, the above method was used to perform parameter identification and controller parameter optimization. First, a test signal was applied to the motor within the frequency range of 0 Hz to 50 Hz. 200 sets of voltage, current, speed, and torque data were collected at rest and at 25%, 50%, 75%, and 100% of the rated speed. Using a recursive least squares method combined with a differential evolution algorithm, after 250 iterations, the motor parameters were calculated: stator resistance 0.5 ohm, rotor resistance 0.45 ohm, stator inductance 78 millihenry, rotor inductance 82 millihenry, and mutual inductance 76 millihenry. Model validation showed a 2.3% consistency error between the output and actual response, which is below the preset threshold of 3%. After constructing the PID objective function, an adaptive differential evolution algorithm was used with a population size of 30, an initial mutation factor of 0.8, and an initial crossover probability of 0.2. After 400 generations of evolutionary calculations, the optimal PID parameters were obtained: Kp = 45.6, Ki = 22.8, and Kd = 5.2. After this set of control parameters is applied to the motor control system, it shows good dynamic response and steady-state accuracy under various working conditions, meeting the design requirements of the motor controller.
[0057] In a specific embodiment, the process of executing step S103 may specifically include the following steps:
[0058] Based on the optimized dual-loop control structure, nonlinear state equations and observation equations are established, and the motor state vector, control input, and observation output are defined as the basic parameters of the extended Kalman filter.
[0059] The covariance matrix of the system noise and measurement noise of the extended Kalman filter is set, and the extended Kalman filter process is performed through two stages: time update and measurement update to obtain the first virtual sensor output value;
[0060] The super-twist algorithm is used to design a sliding mode observer, and the second virtual sensor output value is formed by constructing the sliding surface and setting the observer gain.
[0061] Compare the actual sensor measurement value of the motor with the output value of the first virtual sensor and the output value of the second virtual sensor to calculate a difference index;
[0062] Perform quality assessment on the difference indicators and calculate the initial sensor health index based on the deviation between the actual sensor measurement value and the virtual sensor output value of the motor;
[0063] Based on the initial sensor health index, a fault feature vector is constructed, which includes signal mean deviation, signal variance, signal maximum change rate and signal spectrum characteristics;
[0064] The fault feature vector is subjected to feature extraction and dimensionality reduction processing to obtain optimized feature parameters, and the sensor health index is corrected according to the optimized feature parameters to obtain the sensor health index.
[0065] Specifically, for induction motors, the state equation describes the time-dependent evolution of the system state, while the observation equation describes the relationship between the system output and the state. The motor state vector consists of the stator current d-axis component, the stator current q-axis component, the rotor flux d-axis component, the rotor flux q-axis component, and the rotor angular velocity. These state variables comprehensively reflect the dynamic characteristics of the motor. The control inputs are the motor's stator voltage d-axis and q-axis components, while the observed outputs are typically the stator current d-axis and q-axis components, as these quantities can be directly obtained from phase current measurements. These vectors and parameters are defined as the basic parameters of the extended Kalman filter, paving the way for subsequent state estimation. The extended Kalman filter is a state estimation algorithm for nonlinear systems, suitable for nonlinear systems such as motors. Setting the covariance matrix for the extended Kalman filter's system noise and measurement noise is a key step. The system noise covariance matrix represents the uncertainty of the state equation and is typically a diagonal matrix, with the diagonal elements sized according to the uncertainty of the corresponding state variables. The measurement noise covariance matrix represents the uncertainty of the measurement process and is also a diagonal matrix, with the diagonal elements reflecting sensor accuracy. The extended Kalman filter process consists of two phases: time update and measurement update. The time update phase predicts the current state estimate and its error covariance matrix based on the previous state estimate and control inputs. The measurement update phase, combined with actual measurements, modifies the predicted state estimate to achieve a more accurate state estimate. This process enables the extended Kalman filter to estimate directly measurable state variables such as motor speed and flux in real time, generating a first-of-its-kind virtual sensor output.
[0066] A sliding mode observer, designed using the super-twisting algorithm, serves as a second virtual sensor. The sliding mode observer is a highly robust nonlinear observer, particularly well-suited to accommodating system parameter changes and external disturbances. The super-twisting algorithm, an improvement on sliding mode control theory, achieves state estimation by constructing a sliding surface and setting observer gains. The sliding surface is the manifold along which the system state trajectory should slide. For motor speed estimation, the sliding surface is typically defined as the error between the actual current and the estimated current. The observer gain determines the speed and stability of the system's convergence to the sliding surface. Setting the gain too low results in slow convergence, while setting it too high can cause chattering. Using the super-twisting algorithm, the sliding mode observer overcomes the chattering problem of conventional sliding mode control, providing a smooth estimation result, which forms the second virtual sensor output. The actual motor sensor measurement is compared with the two virtual sensor outputs to calculate a difference index. This difference index typically measures the relative deviation between the actual and estimated values. For speed signals, this is the absolute value of the difference between the actual speed and the speed estimates of the two virtual sensors, divided by the rated speed. The smaller the difference index, the more accurate the virtual sensor estimation is and the more normal the actual sensor working status is; a sudden increase in the difference index may mean that there is an abnormality in the actual sensor or the virtual sensor.
[0067] The difference indicators are evaluated for quality and the initial sensor health index is calculated. The sensor health index is a value between 0 and 1 that represents the sensor's operating status, with 1 indicating complete health and 0 indicating complete failure. The initial sensor health index is calculated by applying an exponential transformation to the difference indicator, so that the smaller the difference, the closer the health index is to 1. This transformation reflects the nonlinear relationship between sensor status and measurement accuracy and is more realistic. Constructing a fault feature vector based on the initial sensor health index is a key step in further refining fault diagnosis. The fault feature vector contains four main features: signal mean deviation, signal variance, maximum signal rate of change, and signal spectrum characteristics. The signal mean deviation reflects the sensor's zero drift; the signal variance reflects the sensor's noise level; the maximum signal rate of change reflects the sensor's dynamic characteristics; and the signal spectrum characteristics, obtained through a fast Fourier transform, reflect the sensor's frequency domain characteristics. These features are combined into a fault feature vector, which comprehensively characterizes the sensor's operating status.
[0068] The fault feature vector is subjected to feature extraction and dimensionality reduction to obtain optimized feature parameters. Principal component analysis (PCA) is used to calculate the covariance matrix of the feature vector, determine its eigenvalues and eigenvectors, and select the principal components with the highest contribution as the optimized feature parameters. This process helps remove redundant information between features and extract the most discriminative feature combinations. The initial sensor health index is then corrected based on the optimized feature parameters to obtain the final sensor health index. This correction process takes into account the weight of the impact of different features on the sensor health status, ensuring that the health index more accurately reflects the actual operating status of the sensor.
[0069] Taking a certain type of permanent magnet synchronous motor as an example, when applying this method for sensor health monitoring, a nonlinear state equation containing five state variables is first established, and the system noise covariance matrix and the measurement noise covariance matrix are set. An extended Kalman filter algorithm is run with a sampling period of 1 millisecond. After two phases, time update and measurement update, the speed estimate for the first virtual sensor is obtained. Simultaneously, a sliding mode observer is designed using the super-torsion algorithm, with the sliding surface set to the current error and observer gain parameters set to 1.5 and 2.0, respectively, to obtain the speed estimate for the second virtual sensor. During normal operation, the speed estimates of the two virtual sensors are very close to the actual sensor measurements, with the difference index remaining below 0.01. When the sensor begins to experience drift faults, the difference index gradually increases to around 0.05, and the initial sensor health index drops to 0.8. At this point, a fault feature vector containing four features is constructed. Feature extraction and dimensionality reduction are performed to obtain two key characteristic parameters. These parameters are used to correct the initial health index, further reducing it to 0.7, accurately reflecting the actual sensor health status.
[0070] In a specific embodiment, the process of executing step S104 may specifically include the following steps:
[0071] Design a three-layer feedforward neural network structure with four neurons in the input layer, eight neurons in the hidden layer, and one neuron in the output layer to form the basic framework of the voting algorithm;
[0072] The actual sensor signal, the extended Kalman filter virtual sensor signal, the sliding mode observer virtual sensor signal and the sensor health index are combined into an input vector;
[0073] Normalize the input vector and adjust the value range to between zero and one to obtain standardized neural network input data;
[0074] Collect 5,000 sets of data samples containing normal operating conditions and fault conditions, train the neural network, and obtain network weights and thresholds;
[0075] Perform online calculations on the trained neural network, output the weight coefficients of the three signal sources, and ensure that the sum of the weight coefficients is one;
[0076] The actual sensor signal, extended Kalman filter signal and sliding mode observer signal are weighted and summed according to the weight coefficient to obtain the fused speed signal. The control system is divided into normal mode, degraded mode and emergency mode based on the sensor health index. Corresponding to different weight coefficient allocation schemes, the effectiveness of the fused speed signal is verified in different modes.
[0077] Specifically, the three-layer feedforward neural network consists of four neurons in the input layer, eight neurons in the hidden layer, and one neuron in the output layer. A feedforward neural network is an artificial neural network in which information flows in one direction: signals flow from the input layer through the hidden layer to the output layer, with no feedback connection. The four neurons in the input layer receive the actual sensor signal, the extended Kalman filter virtual sensor signal, the sliding mode observer virtual sensor signal, and the sensor health index, respectively. The eight neurons in the hidden layer receive input signals through weighted connections and use the hyperbolic tangent function as the activation function to process the data. The single neuron in the output layer generates the final output result. This network structure design fully considers the needs of multi-source information fusion in motor control systems while maintaining a relatively simple structure.
[0078] The first step in data preprocessing is to combine the actual sensor signal, the virtual sensor signal from the extended Kalman filter, the virtual sensor signal from the sliding mode observer, and the sensor health index into an input vector. Each of these four signals represents a different source of information: the actual sensor signal directly measures motor speed but may be affected by faults; the virtual sensor signal from the extended Kalman filter derives speed values based on state estimation and is sensitive to parameter changes; the virtual sensor signal from the sliding mode observer is highly robust and insensitive to disturbances; and the sensor health index reflects the reliability of the actual sensor. These four signals are combined to form a four-dimensional input vector, providing comprehensive information to the neural network.
[0079] Normalizing the input vector is a key step in ensuring effective neural network training. Normalization maps data of varying dimensions and ranges to a uniform value between zero and one, preventing training instability caused by excessively large values. For speed signals, normalization is performed by dividing the current speed by the rated speed. The sensor health index, already between zero and one, requires no additional processing. The normalized four-dimensional vector constitutes the standardized neural network input data, and the consistency of the numerical range helps improve network training efficiency and generalization capabilities.
[0080] The neural network training data base is based on five thousand data samples collected under both normal and faulty conditions. These samples cover motor operating conditions at various speeds and loads, as well as various sensor fault conditions, including open circuit, short circuit, drift, and increased noise. Each sample set includes actual sensor signals, two virtual sensor signals, a sensor health index, and manually labeled ideal weight coefficients as training targets. The neural network is trained using the Levenberg-Marquardt algorithm, an optimization algorithm that combines the advantages of gradient descent and Newton's method. It continuously adjusts network weights and thresholds to minimize the mean squared error (MSE) between the network output and the target output. Training is terminated when the MSE falls below 0.0001 or when the maximum number of iterations, 1000, is reached. After training is complete, the network's weight matrix and threshold vector are obtained; these parameters define the neural network's computational process.
[0081] Performing online calculations on the trained neural network and outputting the weight coefficients for the three signal sources is a key step in achieving signal fusion. During real-time operation of the motor controller, the current actual sensor signal, two virtual sensor signals, and the sensor health index are input into the neural network during each control cycle. Three weight coefficients are then generated through forward calculation. The forward calculation process involves the following steps: the input layer receives a normalized four-dimensional input vector; each neuron in the hidden layer performs a weighted sum of the input signals and applies a nonlinear transformation using an activation function; and the neurons in the output layer perform a weighted sum of the hidden layer outputs to produce the raw output value. To ensure that the weight coefficients sum to unity, the raw output values are normalized to obtain the final three weight coefficients, corresponding to the signal weights for the actual sensor, the extended Kalman filter, and the sliding mode observer.
[0082] The fused velocity signal is obtained by weighting the actual sensor signals, the extended Kalman filter signals, and the sliding mode observer signals according to the weight coefficients. The weighted summation process is a simple mathematical operation: the three signals are multiplied by their corresponding weight coefficients and then added together to produce a fused velocity signal that integrates the advantages of multi-source information. This signal fusion method adaptively adjusts the contribution ratio of each signal based on the current operating conditions and sensor status, effectively suppressing the errors and fluctuations of individual signals. Furthermore, the control system is divided into three operating modes based on the sensor health index (SHI). When the SHI is greater than 0.9, the system operates in normal mode, relying primarily on actual sensor signals. When the SHI is between 0.5 and 0.9, the system enters degraded mode, increasing the weight of virtual sensor signals. When the SHI is below 0.5, the system switches to emergency mode, relying almost entirely on virtual sensor signals. Each mode corresponds to a different weight coefficient allocation scheme: in normal mode, the actual sensor signals are given a higher weight; in degraded mode, the weights of the three signals are relatively balanced; and in emergency mode, the virtual sensor signals dominate. The validity of the fused velocity signal is verified in each mode to ensure reliable velocity information under various operating conditions.
[0083] Taking an industrial permanent magnet synchronous motor as an example, when applying this method to speed signal fusion, a three-layer neural network structure was first designed to meet the requirements. Five thousand sets of sample data covering different operating conditions were collected on a test bench. These data included the actual sensor speed signal read from a photoelectric encoder, the speed estimates for the extended Kalman filter and sliding mode observer derived from the corresponding algorithm outputs, and the sensor health index calculated using the aforementioned method. These four signals were normalized and then fed into the neural network for training. After approximately 800 iterations, the mean squared error (MSE) dropped to 0.00095, meeting the termination criteria. After the trained neural network is put into use, when the motor operates normally, the weight coefficients output by the neural network are 0.7 for the actual sensor, 0.2 for the extended Kalman filter, and 0.1 for the sliding mode observer, and the system operates in normal mode; when a sensor drift fault is artificially introduced and the health index drops to 0.7, the weight coefficients are automatically adjusted to 0.3 for the actual sensor, 0.4 for the extended Kalman filter, and 0.3 for the sliding mode observer, and the system enters a degraded mode; when the sensor is completely disconnected and the health index drops to 0.2, the weight coefficients are quickly adjusted to 0.0 for the actual sensor, 0.6 for the extended Kalman filter, and 0.4 for the sliding mode observer, and the system switches to an emergency mode.
[0084] In a specific embodiment, the process of executing step S105 may specifically include the following steps:
[0085] Based on the deviation between the fused velocity signal and the velocity given value, a double integral sliding surface is constructed, and the velocity error, the error integral term and the error double integral term are weighted summed to obtain the sliding surface expression.
[0086] Configure the normal parameters of the sliding surface expression and set the weight coefficient to adjust the dynamic response and steady-state performance of the control system;
[0087] The control term is derived according to the inverse dynamics principle of the system, and the switching control term is added to form the control law, thus obtaining the backstepping sliding mode controller structure.
[0088] The sign function is replaced by a continuous function, and the chattering suppression is performed by setting a smoothing factor to obtain an improved control law.
[0089] Design the hardware platform of the motor controller based on the improved control law, select the processor and configure the peripheral circuits to form the hardware structure;
[0090] Assign current loop control, speed loop control, virtual sensor calculation, fault diagnosis, and voting algorithms to interrupts of different priorities to build a software framework.
[0091] Test the controller for startup performance, speed step response, load disturbance, and fault conditions in normal, degraded, and emergency modes;
[0092] Analyze the test results, compare the control performance indicators under different working modes, and verify the functionality of the backstepping sliding mode controller with double integral sliding surface.
[0093] Specifically, the double-integral sliding surface is an extension of the traditional sliding surface. It incorporates not only the velocity error term but also an error integral term and an error double integral term. The velocity error is calculated by fusing the difference between the velocity signal and the given velocity value. The error integral term and the error double integral term are then numerically integrated. Finally, a weighted sum of these three terms is taken to produce the sliding surface expression. This structure exhibits improved steady-state accuracy and robustness compared to traditional sliding surfaces.
[0094] Configuring the normal parameters of the sliding surface expression is a key step in controller design. These normal parameters weight the various terms in the sliding surface, and these must be positive to ensure system stability. The weighting coefficients directly impact the system's dynamic response and steady-state performance: increasing the velocity error term accelerates response but may increase overshoot; increasing the error integral term helps eliminate steady-state error but may reduce response; and increasing the error double integral term further improves system performance and enhances interference rejection. Parameter configuration requires comprehensive consideration of these factors to find the right balance.
[0095] The basis for constructing control laws is to derive control terms based on the inverse dynamics of the system. Inverse dynamics refers to the reverse calculation of the required control input based on the desired motion trajectory. For a motor control system, the motor dynamics model is first established, expressed as:
[0096]
[0097] Where, ω r represents the rotor angular velocity, J m represents the moment of inertia, T e Represents electromagnetic torque, T L Indicates load torque, B m represents the damping coefficient.
[0098] According to the dynamic equation of sliding surface:
[0099]
[0100] Where s represents the sliding surface, e represents the velocity error, and α, β, and γ represent the weight coefficients of the velocity error, error integral, and error double integral, respectively.
[0101] In sliding mode, Combine the above equations and solve the equivalent control term T of electromagnetic torque. eq :
[0102]
[0103] Where, Indicates the derivative of the reference speed, also known as the speed reference, J m is the motor moment of inertia
[0104] In order to overcome the influence of model error and external disturbance, a switching control term T is added. s :
[0105] T s =-K s sgn(s)-β s ·s
[0106] Where K s and β s represents the switching control gain, and sgn(s) represents the sign function.
[0107] The final control law T c Consists of equivalent controls and toggle controls:
[0108] T c =T eq +T s
[0109] This is the basic structure of a backstepping sliding mode controller. Backstepping refers to the process of control design starting from the system's high-order state variables and gradually moving towards lower-order state variables, ensuring the system's asymptotic stability.
[0110] However, switching the sign function in the control term can lead to discontinuity in the control output, causing system chattering, reducing control accuracy, and potentially stimulating unmodeled high-frequency dynamic characteristics. To address this problem, the sign function is replaced with a continuous function, such as the hyperbolic tangent function sgn(s):
[0111] sgn(s)≈tanh(s / ε)
[0112] Where ε represents the smoothing factor, which controls the steepness of the function. Smaller ε values result in a closer function to the sign function; larger ε values result in a smoother function, but this also reduces control accuracy. By setting an appropriate smoothing factor, a balance between chatter suppression and control accuracy can be achieved, resulting in an improved control law.
[0113] Designing a motor controller hardware platform based on the improved control law is a crucial step in implementing the control algorithm into a real system. The core of the hardware platform is a 32-bit floating-point digital signal processor operating at 200 MHz, with 128KB of RAM and 512KB of Flash memory, providing ample computing power and storage space. Peripheral circuits include current sampling, velocity sampling, and PWM drive circuits. The current sampling circuit uses a Hall effect current sensor with 12-bit resolution and a sampling frequency of 20 kHz. The velocity sampling circuit employs a 2000-line incremental encoder, using quadrature decoding technology to increase the resolution to 8000 pulses per revolution. The PWM drive circuit employs an isolated gate drive scheme with a frequency of 10 kHz and a dead time of 1 microsecond to effectively prevent short circuits between the upper and lower bridge arms. Assigning current loop control, velocity loop control, virtual sensor calculations, fault diagnosis, and voting algorithms to interrupts of different priorities is central to building the software framework. This interrupt mechanism allows the processor to suspend its current task and execute higher-priority tasks, ensuring the real-time performance of critical algorithms. The current loop control algorithm has the highest priority and is implemented in a 10kHz PWM interrupt with a control cycle of 100 microseconds, ensuring fast current response. The speed loop control algorithm, implemented in a 1kHz timer interrupt, has the next highest priority and a control cycle of 1 millisecond, meeting speed control requirements. Virtual sensor calculations, including the extended Kalman filter and sliding mode observer algorithms, are implemented in a 2kHz timer interrupt with an execution cycle of 500 microseconds. The fault diagnosis and neural network voting algorithms are implemented in a lower-priority 5kHz timer interrupt with an execution cycle of 5 milliseconds. Through appropriate task allocation and priority setting, real-time execution of each algorithm and efficient utilization of system resources are ensured. Comprehensive testing of the controller in normal, degraded, and emergency modes is essential for verifying system performance. The start-up performance test verifies the motor's acceleration from standstill to rated speed, recording the start-up time and peak current. The speed step response test is conducted across a range of speeds, recording the rise time, overshoot, and steady-state error. The load disturbance test involves a sudden increase or decrease in the rated load at rated speed, recording the speed fluctuation and recovery time. Fault condition testing simulates speed sensor open circuit, short circuit, and drift faults to verify the system's fault tolerance. These tests are performed in three operating modes to comprehensively evaluate system performance.
[0114] Analyzing test results and comparing control performance indicators under different operating modes is the final step in validating the functionality of the backstepping sliding mode controller with a dual-integrating sliding surface. Control performance indicators include speed control accuracy, dynamic response time, and steady-state error. Data recording and analysis confirmed that in normal mode, speed control accuracy reached ±0.1%, dynamic response time did not exceed 150 milliseconds, and overshoot was less than 5%. In degraded mode, control accuracy was ±0.3%, response time did not exceed 200 milliseconds, and in emergency mode, control accuracy was ±0.5%, and response time did not exceed 250 milliseconds. These results demonstrate that the system maintains excellent control performance even in the presence of sensor failures.
[0115] In a specific embodiment, the process of executing the steps of allocating current loop control, speed loop control, virtual sensor calculation, fault diagnosis, and voting algorithm to interrupts of different priorities may specifically include the following steps:
[0116] Design an interrupt nesting structure based on a floating-point digital signal processor, initialize the interrupt vector table, set the priority of each interrupt, and obtain the basic framework of the interrupt system;
[0117] Set the pulse width modulation interrupt to the highest priority, place the current sampling and current loop control algorithms in the interrupt service routine, and set the control period to 100 microseconds;
[0118] Set timer interrupt 1 to the second highest priority, and place the speed sampling and speed loop control algorithms in the interrupt service routine, and set the control period to one millisecond. Set timer interrupt 2 to the medium priority, and place the extended Kalman filter and sliding mode observer calculation program in the interrupt, and set the calculation period to five hundred microseconds. Set timer interrupt 3 to the lower priority, and place the fault diagnosis algorithm and neural network voting algorithm in the interrupt, and set the processing period to five milliseconds.
[0119] Evaluate the memory usage of interrupt programs, measure the execution time of each program, and resolve task conflicts through the task queuing mechanism;
[0120] Define data structures based on global variables, establish data exchange mechanisms between modules, design caching strategies for key parameters, and form a software framework.
[0121] Specifically, designing a nested interrupt structure based on a floating-point digital signal processor (DSP) is fundamental to building the motor controller software framework. A floating-point DSP, such as the TMS320F28335, features a dedicated processor with a floating-point unit (FPU), running at up to 150MHz. This built-in FPU makes it suitable for executing complex control algorithms. This nested interrupt structure allows high-priority interrupts to interrupt lower-priority interrupts, ensuring timely response to critical tasks. First, the interrupt vector table is initialized. This data structure stores the entry addresses of each interrupt service routine. Instructions are used to write the address of each interrupt service routine into the corresponding vector location. The priority of each interrupt is then set by writing to the control register. Priority levels range from 0 to 16, with lower values indicating higher priorities. This establishes the basic framework for the interrupt system, facilitating real-time operation of each module. The pulse-width modulation interrupt is set to the highest priority because current loop control requires the highest timing accuracy. The pulse-width modulation interrupt is an interrupt signal generated at the end of each PWM cycle. Its priority is set to 1 by writing to the PWM module's control register. This interrupt service routine incorporates current sampling and the current loop control algorithm. Current sampling uses the ADC module to read phase current values, then performs a Park transform to obtain the d / q axis current components. The current loop control algorithm uses a PI controller to calculate voltage command values. Finally, an inverse Park transform is performed to generate three-phase voltage commands and update the PWM comparator registers. The entire process control cycle is set to 100 microseconds, resulting in an interrupt frequency of 10 kHz, determined based on the motor's electrical time constant and switching frequency.
[0122] Timer interrupt 1 is set to the second-highest priority level and is used for speed loop control. This timer interrupt is generated by configuring the timer module. The countdown initial value is set so that the timer overflows once every millisecond, generating an interrupt. The priority is set to 2. This interrupt service routine executes the speed sampling and speed loop control algorithms. Speed sampling obtains the speed value by reading the encoder count and calculating the number of pulses per unit time. The speed loop control algorithm calculates the torque command based on the speed reference and actual speed, which serves as the reference for current loop control. Timer interrupt 2 is set to a medium priority level of 3 with a calculation cycle of 500 microseconds. It is responsible for executing the extended Kalman filter and sliding mode observer calculation routines. The extended Kalman filter routine first performs a time update step, predicting the current state based on the previous state estimate and control inputs. It then performs a measurement update step, revising the state estimate based on actual measurements. The sliding mode observer routine estimates the motor state by constructing a sliding surface and calculating switching control terms. Timer interrupt 3 is set to a lower priority level of 4 with a processing cycle of 5 milliseconds. It executes the fault diagnosis algorithm and the neural network voting algorithm. The fault diagnosis algorithm identifies the fault type by analyzing sensor signal characteristics. The neural network voting algorithm uses forward calculations to determine the weight coefficients of the three signal sources. Evaluating the memory usage of interrupt routines is essential for ensuring proper allocation of system resources. First, calculate the code size of each interrupt service routine, including program instructions and local variables. For example, the current loop control routine occupies 2KB of code space, while the velocity loop control routine occupies 1.5KB. Next, measure the execution time of each routine. This can be done by monitoring the voltage level changes on the GPIO pins with an oscilloscope or using the timer capture function to record the start and end times of the routines. For example, the execution time of the current loop control routine is 20 microseconds, the velocity loop control routine 30 microseconds, the extended Kalman filter routine 120 microseconds, the sliding mode observer routine 80 microseconds, and the fault diagnosis and neural network routines 200 microseconds. Based on this data, analyze the worst-case execution time for nested interrupts to ensure that interrupt accumulation is avoided. When potential task conflicts are detected, they are resolved through task queuing, either deferring the execution of lower-priority tasks until higher-priority tasks complete, or breaking down time-consuming tasks into multiple shorter tasks for phased execution.
[0123] Defining data structures based on global variables is fundamental to establishing a data exchange mechanism between modules. Global variables are variables that are accessible to all functions in a program and are defined outside of all functions. Several key global variables are defined in the motor controller software: a current setpoint structure containing the d-axis and q-axis current setpoints; a current feedback structure containing the d-axis and q-axis current measurements; a speed setpoint variable storing the target speed; a speed feedback variable storing the measured speed; a DC bus voltage variable storing the supply voltage; a motor temperature variable storing the measured temperature; and a fault status flag containing various fault status bits. These global variables serve as interfaces between modules, enabling data transfer. To avoid data access conflicts, a caching strategy for key parameters was designed, employing a double buffering technique: while one buffer is being written, the other is being read. Buffer pointers are exchanged atomically to ensure data consistency. Furthermore, for critical data that needs to be shared across interrupts, an interrupt disable protection mechanism is implemented. Interrupts are disabled before data access and restored after the access is complete to prevent data corruption.
[0124] Take, for example, a digital controller for permanent magnet synchronous motor control, designed based on the TMS320F28335 processor. During system startup, the program first configures the interrupt vector table, writing the PWM1_INT_ISR function address to the PWM1 interrupt vector, the TIMER0_INT_ISR function address to the Timer0 interrupt vector, and so on. The PWM module is then configured to generate a 10kHz PWM waveform and interrupt signal, with priority set to 1. Timer 0 is configured to generate an interrupt every 1 millisecond, with priority set to 2; Timer 1 is configured to generate an interrupt every 0.5 milliseconds, with priority set to 3; and Timer 2 is configured to generate an interrupt every 5 milliseconds, with priority set to 4. Testing found that the current sampling and current loop control algorithms executed in the PWM interrupt take 18 microseconds, the speed sampling and control algorithms executed in the Timer0 interrupt take 25 microseconds, the state observation algorithm executed in the Timer1 interrupt takes 90 microseconds, and the fault diagnosis and voting algorithms executed in the Timer2 interrupt take 180 microseconds. When the worst-case scenario occurs, where all interrupts arrive simultaneously, the system is able to process each interrupt sequentially according to priority, with a total execution time of 313 microseconds, less than the minimum interrupt period of 500 microseconds, proving the interrupt design is sound. Regarding data exchange, the global structure MotorData is used to store all motor-related parameters, including current, speed, and torque. SpeedBuffer is used for speed data storage, and the active and standby buffers are swapped atomically via the Exchange_Buffer() function to ensure conflict-free read and write operations. For critical parameters such as the current setpoint, the DISABLE_INTERRUPTS() and ENABLE_INTERRUPTS() macros are used to temporarily disable interrupts during updates to prevent interruptions in the update process and data inconsistencies. These designs ensure the orderly execution of each algorithm module and the secure transmission of data, laying the foundation for the stable operation of the motor controller.
[0125] The motor controller development method based on intelligent algorithm in the embodiment of the present application is described above. The motor controller development system based on intelligent algorithm in the embodiment of the present application is described below. Figure 2 In the embodiment of the present application, an embodiment of a motor controller development system based on an intelligent algorithm includes:
[0126] The identification module is used to identify the parameters of the motor system, obtain the motor parameters, and input the motor parameters into the adaptive differential evolution algorithm to optimize the parameters of the PID controller to obtain the optimal PID control parameters;
[0127] An adjustment module is used to construct a motor dual-loop control structure according to the optimal PID control parameters and adjust the parameters to obtain an optimized dual-loop control structure;
[0128] A building block is used to design an extended Kalman filter and a sliding mode observer as virtual sensors based on the optimized dual-loop control structure, construct fault feature vectors, and obtain the sensor health index;
[0129] An input module is used to input the sensor health index and the actual sensor and virtual sensor signals into a neural network to calculate weight coefficients and perform signal fusion to obtain a fused speed signal;
[0130] The verification module is used to implement a backstepping sliding mode controller with a double integral sliding surface according to the fused speed signal, thereby completing the hardware design and performance verification of the motor control system.
[0131] Through the synergy of the above-mentioned components, by performing parameter identification on the motor system and optimizing the PID controller parameters in combination with the adaptive differential evolution algorithm, the shortcomings of the traditional PID controller parameter tuning that relies on experience are effectively overcome, so that the control parameters can be automatically optimized and adjusted according to the motor characteristics, improving the accuracy and adaptability of the parameter tuning, while reducing the complexity and time cost of the controller design. The motor dual-loop control structure constructed based on the optimal PID control parameters is combined with the artificial immune system algorithm for parameter adjustment, so that the speed outer loop and the current inner loop are coordinated, which not only ensures the dynamic response speed, but also maintains the stability of the control system, and significantly improves the control performance of the motor under different working conditions. The extended Kalman filter and sliding mode observer designed in the present invention serve as virtual sensors, which can estimate the key state quantities of the motor in real time without increasing the hardware cost, and realize real-time monitoring of the sensor state and early warning of faults by constructing fault feature vectors and calculating the sensor health index, providing a reliable basis for system fault-tolerant control. The core innovation of this invention is the integration of sensor health indexes, along with actual sensor and virtual sensor signals, into a neural network for weight calculation and signal fusion. Leveraging the neural network's self-learning capabilities, this approach enables intelligent fusion of multi-source information, enabling the system to automatically adjust the weights of each signal source based on sensor health, ensuring the continuity and reliability of the velocity signal. A backstepping sliding mode controller with a dual-integrating sliding surface, combined with the fused velocity signal, creates a highly precise and robust control strategy that maintains excellent control performance even in the presence of parameter variations and external disturbances. This invention leverages the strengths of multiple intelligent algorithms in the field of motor control: adaptive differential evolution solves parameter optimization, an artificial immune system addresses multi-objective control structure optimization, a neural network implements information fusion, and sliding mode control provides a robust control approach. This multi-algorithm collaborative approach not only improves the overall performance of the control system but also provides the system with excellent adaptability and fault tolerance. In particular, in the event of sensor failure, traditional methods often lead to system loss of control. However, this invention maintains basic system functionality through intelligent switching of operating modes, relying on virtual sensors and fusion algorithms, even when sensor performance degrades or fails completely, significantly improving the reliability and safety of the motor control system.
[0132] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3As shown. The computer device includes a processor, memory, display screen, input device, network interface and database connected via a system bus. The processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the above method is implemented.
[0133] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention and does not constitute a limitation on the computer device to which the solution of the present invention is applied.
[0134] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the above-described method when executed by a processor. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0135] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A motor controller development method based on intelligent algorithm, characterized in that: The motor controller development method based on intelligent algorithm includes: Perform parameter identification on the motor system to obtain motor parameters, and input the motor parameters into an adaptive differential evolution algorithm to perform parameter optimization on the PID controller to obtain optimal PID control parameters; Constructing a motor dual-loop control structure according to the optimal PID control parameters, and adjusting the parameters to obtain an optimized dual-loop control structure; Based on the optimized dual-loop control structure, an extended Kalman filter and a sliding mode observer are designed as virtual sensors, and a fault feature vector is constructed to obtain a sensor health index. The sensor health index, the actual sensor signal, and the virtual sensor signal are input into a neural network to calculate a weight coefficient and perform signal fusion to obtain a fused speed signal; According to the fused speed signal, a backstepping sliding mode controller with a double integral sliding surface is implemented, completing the hardware design and performance verification of the motor control system.
2. The motor controller development method based on intelligent algorithm according to claim 1 is characterized in that: The method of performing parameter identification on the motor system to obtain motor parameters, and inputting the motor parameters into an adaptive differential evolution algorithm to perform parameter optimization on the PID controller to obtain optimal PID control parameters includes: Applying a test signal to the motor, collecting voltage, current, speed, and torque data as input signals for parameter identification, constructing an optimization objective function based on the input signals, and performing iterative calculations using a recursive least squares method combined with a differential evolution algorithm to obtain motor parameter values; The motor parameter values are model-verified to ensure that the consistency error between the output and the actual motor response does not exceed a preset threshold, and the objective function of the PID controller is constructed, including error integral, time-weighted error integral and control signal integral terms, and assigned different weight coefficients; Initialize the population of the adaptive differential evolution algorithm, set the population size to 30, and the individuals contain three PID parameters; Performing a mutation operation on the population, using an adaptive mutation factor, dynamically adjusting the size of the mutation factor according to the number of iterations, performing a crossover operation on the mutated individuals, using an adaptive crossover probability, and performing a selection operation to retain better individuals; The individual with the smallest objective function value is selected from the optimization results to obtain the optimal PID control parameters.
3. The motor controller development method based on intelligent algorithm according to claim 1 is characterized in that: The motor dual-loop control structure is constructed according to the optimal PID control parameters, and the parameters are adjusted to obtain an optimized dual-loop control structure, including: Applying the optimal PID control parameters to the current inner loop controller, setting the current response frequency to one kilohertz, constructing an inner loop unit for induction motor control, constructing an integral-proportional-differential controller based on the inner loop unit as a speed outer loop control structure, and setting a differential term filter time constant to form a dual-loop control system; The control index of the dual-loop control system is defined as an antigen, and the controller parameter combination is defined as an antibody. An artificial immune system algorithm framework is constructed, and an initial antibody population containing fifty parameter combinations is generated. Each antibody contains the proportional, integral, differential and filter parameters of the speed loop integral-proportional differential controller. Performing motor system simulation on the initial population of antibodies and calculating the integrated square error as an affinity evaluation index; The ten controller parameter combinations with the highest affinity are selected for cloning and amplification, and the number of amplifications is proportional to the motor control performance; Perform mutation operations on the amplified controller parameters, and the mutation amplitude is dynamically adjusted according to the degree of influence of the parameters on the motor performance; The parameter combination with the best motor speed response is selected from the controller parameters after mutation, and the parameter diversity is maintained to obtain the optimized dual-loop control structure.
4. The motor controller development method based on intelligent algorithm according to claim 1 is characterized in that: Based on the optimized dual-loop control structure, an extended Kalman filter and a sliding mode observer are designed as virtual sensors, and a fault feature vector is constructed to obtain a sensor health index, including: Based on the optimized dual-loop control structure, a nonlinear state equation and an observation equation are established, and the motor state vector, the control input, and the observation output are defined as basic parameters of the extended Kalman filter; Setting a covariance matrix for the system noise and measurement noise of the extended Kalman filter, performing an extended Kalman filter process through two stages of time update and measurement update to obtain a first virtual sensor output value; The super-twist algorithm is used to design a sliding mode observer, and the second virtual sensor output value is formed by constructing the sliding surface and setting the observer gain. Comparing the actual sensor measurement value of the motor with the first virtual sensor output value and the second virtual sensor output value to calculate a difference index; Performing a quality assessment on the difference indicator and calculating an initial sensor health index based on a deviation between an actual sensor measurement value of the motor and an output value of the virtual sensor; Constructing a fault feature vector including signal mean deviation, signal variance, signal maximum rate of change, and signal spectrum characteristics based on the initial sensor health index; The fault feature vector is subjected to feature extraction and dimensionality reduction processing to obtain optimized feature parameters, and the sensor health index is corrected according to the optimized feature parameters to obtain the sensor health index.
5. The motor controller development method based on intelligent algorithm according to claim 1 is characterized in that: The sensor health index, the actual sensor signal, and the virtual sensor signal are input into a neural network to calculate a weight coefficient and perform signal fusion to obtain a fused speed signal, including: Design a three-layer feedforward neural network structure with four neurons in the input layer, eight neurons in the hidden layer, and one neuron in the output layer to form the basic framework of the voting algorithm; The actual sensor signal, the extended Kalman filter virtual sensor signal, the sliding mode observer virtual sensor signal and the sensor health index are combined into an input vector; Normalizing the input vector to adjust its value range to between zero and one to obtain standardized neural network input data; Collecting 5,000 sets of data samples including normal operating conditions and fault operating conditions, training the neural network, and obtaining network weights and thresholds; Perform online calculations on the trained neural network, output the weight coefficients of the three signal sources, and ensure that the sum of the weight coefficients is one; According to the weight coefficient, the actual sensor signal, the extended Kalman filter signal and the sliding mode observer signal are weighted and summed to obtain the fused speed signal. The control system is divided into normal mode, degraded mode and emergency mode based on the sensor health index. Corresponding to different weight coefficient allocation schemes, the effectiveness of the fused speed signal is verified in different modes.
6. The motor controller development method based on intelligent algorithm according to claim 1 is characterized in that: The backstepping sliding mode controller with a double integral sliding surface is implemented based on the fused speed signal to complete the hardware design and performance verification of the motor control system, including: Based on the deviation between the fused velocity signal and the velocity given value, a double integral sliding surface is constructed, and a sliding surface expression is obtained by weighted summing the velocity error, the error integral term and the error double integral term; Performing positive parameter configuration on the sliding surface expression and setting weight coefficients to adjust the dynamic response and steady-state performance of the control system; The control term is derived according to the inverse dynamics principle of the system, and the switching control term is added to form the control law, thus obtaining the backstepping sliding mode controller structure. The sign function is replaced by a continuous function, and the chattering suppression is performed by setting a smoothing factor to obtain an improved control law. Designing a hardware platform for a motor controller based on the improved control law, selecting a processor and configuring peripheral circuits to form a hardware structure; Assign current loop control, speed loop control, virtual sensor calculation, fault diagnosis, and voting algorithms to interrupts of different priorities to build a software framework. Testing the controller for startup performance, speed step response, load disturbance, and fault conditions in normal mode, degraded mode, and emergency mode; The test results were analyzed and the control performance indicators under different working modes were compared to verify the function of the backstepping sliding mode controller with double integral sliding surface.
7. The motor controller development method based on intelligent algorithm according to claim 6 is characterized in that: The current loop control, speed loop control, virtual sensor calculation, fault diagnosis, and voting algorithm are assigned to interrupts of different priorities to build a software framework, including: Design an interrupt nesting structure based on a floating-point digital signal processor, initialize the interrupt vector table, set the priority of each interrupt, and obtain the basic framework of the interrupt system; Set the pulse width modulation interrupt to the highest priority, place the current sampling and current loop control algorithms in the interrupt service routine, and set the control period to 100 microseconds; Set timer interrupt 1 to the second highest priority, and place the speed sampling and speed loop control algorithms in the interrupt service routine, and set the control period to one millisecond. Set timer interrupt 2 to the medium priority, and place the extended Kalman filter and sliding mode observer calculation program in the interrupt, and set the calculation period to five hundred microseconds. Set timer interrupt 3 to the lower priority, and place the fault diagnosis algorithm and neural network voting algorithm in the interrupt, and set the processing period to five milliseconds. Evaluate the memory usage of interrupt programs, measure the execution time of each program, and resolve task conflicts through the task queuing mechanism; The software framework is formed by defining data structures based on global variables, establishing a data exchange mechanism between modules, and designing a cache strategy for key parameters.
8. A motor controller development system based on an intelligent algorithm, used to implement the motor controller development method based on an intelligent algorithm as described in any one of claims 1 to 7, characterized in that: The motor controller R&D system based on intelligent algorithm includes: An identification module is used to perform parameter identification on the motor system to obtain motor parameters, and input the motor parameters into an adaptive differential evolution algorithm to perform parameter optimization on the PID controller to obtain optimal PID control parameters; An adjustment module is used to construct a motor dual-loop control structure according to the optimal PID control parameters and adjust the parameters to obtain an optimized dual-loop control structure; A construction module is used to design an extended Kalman filter and a sliding mode observer as a virtual sensor based on the optimized dual-loop control structure, and to construct a fault feature vector to obtain a sensor health index; An input module is used to input the sensor health index and the actual sensor and virtual sensor signals into a neural network to calculate weight coefficients and perform signal fusion to obtain a fused speed signal; The verification module is used to implement a backstepping sliding mode controller with a double integral sliding surface according to the fused speed signal, thereby completing the hardware design and performance verification of the motor control system.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the motor controller development method based on the intelligent algorithm described in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the processor is enabled to execute the motor controller development method based on an intelligent algorithm according to any one of claims 1 to 7.
Citation Information
Patent Citations
Doubly-fed wind turbine generator wind energy integrated control scheme based on wireless sensor network
CN111030180A
Unmanned aerial vehicle digital twin control method and platform for intelligent algorithm agile deployment
CN115098941A
Industrial robot servo motor vibration fault detection method and device
CN115683235A
High-precision motor driving method
CN117792190A
Motor driving intelligent regulation and control method and system
CN117792219A
Cited By
Motor parameter self-adaptive adjusting method and system based on intelligent mechanical arm
CN121061889A
Motor parameter self-adaptive adjusting method and system based on intelligent mechanical arm
CN121061889B