Motor controller research and development method and research and development system based on intelligent algorithm
By integrating adaptive differential evolution algorithm to optimize PID controller parameters, constructing a dual-loop control structure for the motor and designing a virtual sensor, and combining neural network signal fusion, the robustness and stability issues of the motor control system under sensor failure were solved, achieving high-precision motor control performance.
Patent Information
- Application Number
- CN202510500414.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-04-21
AI Technical Summary
Existing motor control technologies rely on experience for parameter tuning, making it difficult to adapt to changes in motor parameters and load disturbances. Intelligent algorithm optimization lacks comprehensiveness, the system struggles to maintain stability under sensor failures, hardware implementation is highly complex, and real-time performance is difficult to guarantee. In particular, it is difficult to maintain good robustness with limited hardware resources under high dynamic performance requirements.
By optimizing the PID controller parameters through the integration of adaptive differential evolution algorithm, a dual-loop control structure for the motor is constructed. An extended Kalman filter and a sliding mode observer are designed as virtual sensors. The signal is fused using a neural network to realize a backstepping sliding mode controller with a double integral sliding surface, ensuring that the system can maintain basic operating performance even when the sensor is abnormal.
It improves the adaptability and robustness of the motor control system, reduces the design complexity of the controller, ensures the reliability and safety of the system in the event of sensor failure, and achieves high-precision control performance.
Smart Images

Figure CN120428592B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a motor controller research and development method and system based on intelligent algorithms. BACKGROUND
[0002] Motor control systems are widely used in industrial automation, electric vehicles, robots, and other fields. Traditional motor control methods mainly use proportional-integral-derivative (PID) controllers, which are widely used due to their simple structure and easy implementation. With the development of technology, advanced control techniques 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 electronic devices, intelligent control algorithms such as fuzzy control, neural network control, and genetic algorithm optimization control have been introduced into the field of motor control, further enhancing the adaptive ability and robustness of the system. At the same time, observer technologies such as Kalman filter and sliding mode observer have also been widely used, laying the foundation for sensorless control technology.
[0003] However, existing motor control technology still has many shortcomings. First, the parameter tuning of traditional PID controllers mainly relies on experience and is difficult to adapt to changes in motor parameters and load disturbances. Second, although intelligent algorithms can improve control performance, most methods optimize for a single target and lack comprehensive consideration. Third, in the case of sensor failure, existing control systems are difficult to maintain stable operation and lack fault tolerance. In addition, most control algorithms perform well in theoretical verification, but when implemented in actual hardware, they often face problems such as high computational complexity and difficulty in ensuring real-time performance. Especially for high dynamic performance requirements, how to implement complex control algorithms in limited hardware resources while maintaining good robustness is still a problem that needs to be solved. SUMMARY
[0004] The present application provides a motor controller research and development method and system based on intelligent algorithms, which is used to fuse multiple intelligent algorithms and virtual sensor technology to build a motor control system with high fault tolerance. Even in the case of sensor abnormalities or failures, the basic operating performance of the motor can be maintained, and the reliability and safety of the system can be improved.
[0005] In a first aspect, the application provides a motor controller development method based on an intelligent algorithm, which comprises: parameter identification of a motor system to obtain motor parameters, and inputting the motor parameters into an adaptive differential evolution algorithm to optimize parameters of a PID controller and obtain optimal PID control parameters; constructing a motor double-loop control structure according to the optimal PID control parameters and adjusting parameters to obtain an optimized double-loop control structure; based on the optimized double-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 actual sensor and virtual sensor signals into a neural network to calculate a weight coefficient and perform signal fusion to obtain a fused speed signal; and realizing a backstepping sliding mode controller with a double-integral sliding surface according to the fused speed signal to complete hardware design and performance verification of the motor control system.
[0006] In a second aspect, the application provides a motor controller development system based on an intelligent algorithm, which comprises:
[0007] An identification module for parameter identification of a motor system to obtain motor parameters, and inputting the motor parameters into an adaptive differential evolution algorithm to optimize parameters of a PID controller and obtain optimal PID control parameters;
[0008] An adjustment module for constructing a motor double-loop control structure according to the optimal PID control parameters and adjusting parameters to obtain an optimized double-loop control structure;
[0009] A construction module for designing an extended Kalman filter and a sliding mode observer as virtual sensors based on the optimized double-loop control structure, and constructing a fault feature vector to obtain a sensor health index;
[0010] An input module for inputting the sensor health index and actual sensor and virtual sensor signals into a neural network to calculate a weight coefficient and perform signal fusion to obtain a fused speed signal;
[0011] A verification module for realizing a backstepping sliding mode controller with a double-integral sliding surface according to the fused speed signal to complete hardware design and performance verification of the motor control system.
[0012] In a third aspect, a computer device is provided, which comprises a memory and at least one processor, the memory storing instructions; the at least one processor invokes the instructions in the memory to enable the computer device to perform the motor controller development method based on an intelligent algorithm described above.
[0013] In a fourth aspect, a computer readable storage medium is provided, which stores instructions that, when executed on a computer, cause the computer to perform the above-mentioned intelligent algorithm-based motor controller development method.
[0014] In the technical scheme provided in the present application, the motor system is parameter-identified and the PID controller parameters are optimized in combination with the adaptive differential evolution algorithm, thereby effectively overcoming the shortcoming that the parameter setting of the traditional PID controller relies on experience, enabling the control parameters to be automatically optimized and adjusted according to the motor characteristics, improving the accuracy and adaptability of parameter setting, and reducing the complexity and time cost of controller design. The motor double-loop control structure constructed based on the optimal PID control parameters, in combination with the parameter adjustment of the artificial immune system algorithm, enables the speed outer loop and the current inner loop to coordinate with each other, ensuring the dynamic response speed and maintaining the stability of the control system, and significantly improving the control performance of the motor under different working conditions. The extended Kalman filter and the sliding mode observer designed in the present application can be used as virtual sensors to realize real-time estimation of the key state quantities of the motor without increasing the hardware cost, and through the construction of a fault feature vector and the calculation of a sensor health index, real-time monitoring and early warning of sensor faults are realized, thereby providing a reliable basis for system fault-tolerant control. The input of the sensor health index, the actual sensor and the virtual sensor signal into the neural network for weight calculation and signal fusion is the core innovation point of the present application, and through the self-learning ability of the neural network, intelligent fusion of multi-source information is realized, enabling the system to automatically adjust the weight of each signal source according to the health state of the sensor, thereby ensuring the continuity and reliability of the speed signal. The backstepping sliding mode controller with a double-integral sliding surface is designed in combination with the fused speed signal, thereby constructing a high-precision and strong-robustness control strategy, which can maintain good control performance even in the presence of parameter changes and external disturbances. The present application fully utilizes the advantages of various intelligent algorithms in the field of motor control: the adaptive differential evolution algorithm solves the parameter optimization problem, the artificial immune system handles the optimization of the multi-objective control structure, the neural network realizes information fusion, and the sliding mode control provides a robust control method. This multi-algorithm collaborative method not only improves the overall performance of the control system, but also enables the system to have excellent adaptive and fault-tolerant capabilities. Especially in the case of sensor failure, the traditional method often leads to system loss of control, while the present application can maintain the basic functions of the system through intelligent switching of the working mode, virtual sensors and fusion algorithms in the case of sensor performance degradation or complete failure, thereby greatly improving the reliability and safety of the motor control system. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0016] Figure 1 An embodiment of the method for developing a motor controller based on an intelligent algorithm in the present application;
[0017] Figure 2 An embodiment of the system for developing a motor controller based on an intelligent algorithm in the present application;
[0018] Figure 3 An embodiment of the structure of a computer device in the present application. DETAILED DESCRIPTION
[0019] The embodiments of the present application provide a method and a system for developing a motor controller based on an intelligent algorithm. In the specification, claims and above drawings of the present application, the terms "first", "second", "third", "fourth" and the like (if any) are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" or "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0020] For the convenience of understanding, the specific process of the embodiments of the present application will be described below. Please refer to Figure 1 An embodiment of the method for developing a motor controller based on an intelligent algorithm in the present application includes:
[0021] Step S101, parameter identification is performed on the motor system to obtain motor parameters, and the motor parameters are input into a self-adaptive differential evolution algorithm to optimize parameters of a PID controller, so as to obtain optimal PID control parameters;
[0022] Step S102, a motor double-loop control structure is constructed according to the optimal PID control parameters, and parameter adjustment is performed to obtain an optimized double-loop control structure;
[0023] Step S103, based on the optimized double-loop control structure, design an extended Kalman filter and a sliding mode observer as a virtual sensor, and construct a fault feature vector to obtain a sensor health index;
[0024] Step S104, input the sensor health index and the actual sensor and virtual sensor signals into a neural network to calculate a weight coefficient and perform signal fusion to obtain a fused speed signal;
[0025] Step S105, according to the fused speed signal, implement a backstepping sliding mode controller with a double-integral sliding surface, and complete hardware design and performance verification of the motor control system.
[0026] It can be understood that the execution subject of the present application can be a motor controller research and development system based on intelligent algorithm, and can also be a terminal or a server, which is not limited here. The server is taken as an example for description in the embodiments of the present application.
[0027] Specifically, motor system parameter identification is performed, and voltage, current, speed and torque data are collected as parameter identification input signals by applying test signals to the motor. In actual operation, motor system parameter identification is obtained by recursive least squares method combined with differential evolution algorithm iterative calculation, including stator resistance, stator inductance, rotor resistance, rotor inductance and mutual inductance parameters. For example, when a 5-kilowatt induction motor is parameter identified, test signals are applied at different speed points and data are collected, and after constructing an optimization objective function, 300 iterations are calculated to obtain motor parameter values of stator resistance of 0.6 ohm, rotor resistance of 0.4 ohm, stator inductance of 80 millihenry, rotor inductance of 85 millihenry, and mutual inductance of 78 millihenry. 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 items, and assigns different weight coefficients. The population of the adaptive differential evolution algorithm is initialized, and the population size is set to 30. Each individual contains three parameters: proportion, integral and differential. When performing mutation operation, adaptive mutation factor is used, which is dynamically adjusted according to the number of iterations. After the mutation of the individual, the crossover operation is performed, and the adaptive crossover probability is used, and the selection operation is performed to retain the better individual. Finally, the individual with the minimum objective function value is selected from the optimization results to obtain the optimal PID control parameters.
[0028] The optimal PID control parameters are used to construct the motor double-loop control structure, and the optimal PID control parameters are applied to the current inner loop controller. The current response frequency is set to 1000 Hz, and the induction motor control inner loop unit is constructed. Based on the inner loop unit, an integral-proportional-derivative controller is constructed as the speed outer loop control structure, and the differential term filter time constant is set to 0.01 s, forming a double-loop control system. The control index of the double-loop control system is defined as the antigen, and the controller parameter combination is defined as the antibody, and the artificial immune system algorithm framework is constructed. An initial antibody population containing fifty parameter combinations is generated, and each antibody contains the proportional, integral, derivative, and filter parameters of the speed loop integral-proportional-derivative controller. The antibody initial population is simulated and run on the motor system, and the integral squared error is calculated as the affinity evaluation index. The ten controller parameter combinations with the highest affinity are selected for cloning and amplification, and the number of amplification is proportional to the motor control performance. Mutation operation is performed on the amplified controller parameters, and the mutation amplitude is dynamically adjusted according to the parameter influence on the motor performance. The parameter combination with the best motor speed response is selected from the mutated controller parameters, and the optimized double-loop control structure is obtained. Based on the optimized double-loop control structure, an extended Kalman filter and a sliding mode observer are designed as virtual sensors. The extended Kalman filter defines the motor state vector, control input, and observation output as the basic parameters by establishing a nonlinear state equation and an observation equation. The system noise and measurement noise of the extended Kalman filter are set by covariance matrix, and the extended Kalman filtering process is performed through time update and measurement update to obtain the first virtual sensor output value. The sliding mode observer is designed using the super-twisting algorithm, and the second virtual sensor output value is formed by constructing the sliding surface and setting the observer gain. The actual sensor measurement value of the motor is compared with the first virtual sensor output value and the second virtual sensor output value, and the difference index is calculated. The difference index is quality evaluated, and the sensor health index is calculated according to the deviation between the actual sensor measurement value and the virtual sensor output value. Taking an industrial servo motor as an example, the sensor health index remains above 0.95 during normal operation, when the sensor drifts, the health index drops to about 0.7, and when the sensor line breaks, the health index quickly drops to below 0.3, effectively identifying the sensor health status in this way.
[0029] The sensor health index is input into a neural network with actual sensor and virtual sensor signals to calculate weight coefficients and perform signal fusion. A three-layer feedforward neural network structure is designed, including four neurons in the input layer, eight neurons in the hidden layer, and one neuron in the output layer, forming the basic framework of the voting algorithm. The actual sensor signal, extended Kalman filter virtual sensor signal, sliding mode observer virtual sensor signal, and sensor health index are combined into an input vector. The input vector is normalized to adjust the numerical range to between zero and one, obtaining standardized neural network input data. Five thousand data samples containing normal and fault conditions are collected to train the neural network, obtaining network weights and thresholds. The trained neural network is calculated online to output weight coefficients of the three signal sources, ensuring that the sum of the weight coefficients is one. The actual sensor signal, extended Kalman filter signal, and sliding mode observer signal are weighted and summed according to the weight coefficients to obtain the fusion speed signal.
[0030] According to the fusion speed signal, a backstepping sliding mode controller with a double-integral sliding surface is realized. Based on the deviation of the fusion speed signal and the speed given value, a double-integral sliding surface is constructed, and the speed error, error integral term, and error double-integral term are weighted and summed to obtain the sliding surface expression. The sliding surface expression is configured with normal parameters to set weight coefficients to adjust the dynamic response and steady-state performance of the control system. According to the inverse dynamics principle of the system, the control term is derived, and the switching control term is added to form the control law, obtaining the structure of the backstepping sliding mode controller. The sign function is replaced by a continuous function, and the chattering suppression process is performed by setting a smoothing factor, obtaining the improved control law. Based on the improved control law, the hardware platform of the motor controller is designed, the processor is selected, and the peripheral circuit is configured to form the hardware structure. The current loop control, speed loop control, virtual sensor calculation, fault diagnosis, and voting algorithm are distributed to different priority interrupts to construct the software framework. The controller is tested in normal mode, degraded mode, and emergency mode for startup performance, speed step response, load disturbance, and fault conditions. The test results are analyzed, and the control performance indicators in different working modes are compared to verify the function of the backstepping sliding mode controller with a double-integral sliding surface.
[0031] In the embodiment of the application, the motor system is parameter identified, and the PID controller parameters are optimized by combining the adaptive differential evolution algorithm, thereby effectively overcoming the disadvantage that the parameter setting of the traditional PID controller depends on experience, enabling the control parameters to be automatically optimized and adjusted according to the motor characteristics, improving the accuracy and adaptability of parameter setting, and reducing the complexity and time cost of controller design. The motor double-loop control structure based on the optimal PID control parameters is combined with the parameter adjustment of the artificial immune system algorithm, enabling the speed outer loop and the current inner loop to coordinate, ensuring the dynamic response speed and maintaining the stability of the control system, and significantly improving the control performance of the motor under different working conditions. The extended Kalman filter and the sliding mode observer designed in the application can be used as virtual sensors to realize real-time estimation of the key state quantities of the motor without increasing the hardware cost, and through the construction of a fault feature vector and the calculation of a sensor health index, real-time monitoring and early warning of sensor faults are realized, thereby providing a reliable basis for system fault-tolerant control. The core innovation of the application is that the sensor health index is input into the neural network together with the actual sensor and virtual sensor signals for weight calculation and signal fusion, and through the self-learning ability of the neural network, intelligent fusion of multi-source information is realized, enabling the system to automatically adjust the weight of each signal source according to the health status of the sensor, thereby ensuring the continuity and reliability of the speed signal. The backstepping sliding mode controller with a double-integral sliding surface is designed, and a high-precision and strong-robustness control strategy is constructed by combining the fused speed signal, which can maintain good control performance even in the presence of parameter changes and external disturbances. The application fully utilizes the advantages of various intelligent algorithms in the field of motor control: the adaptive differential evolution algorithm solves the parameter optimization problem, the artificial immune system handles the optimization of the multi-objective control structure, the neural network realizes information fusion, and the sliding mode control provides a robust control method. This multi-algorithm collaborative method not only improves the overall performance of the control system, but also enables the system to have excellent adaptive and fault-tolerant capabilities. Especially in the case of sensor failure, the traditional method often leads to system failure, while the application can maintain the basic functions of the system by switching the working mode intelligently, relying on virtual sensors and fusion algorithms, thereby greatly improving the reliability and safety of the motor control system.
[0032] In a specific embodiment, the process of step S101 can specifically include the following steps:
[0033] A test signal is applied to the motor, voltage, current, speed and torque data are collected as input signals for parameter identification, an optimization objective function is constructed based on the input signals, and the motor parameter values are obtained by iterative calculation through the recursive least squares method combined with the differential evolution algorithm;
[0034] The motor parameter values are verified by a model to ensure that the output is consistent with the actual motor response, with an error not exceeding a preset threshold, and a target function of the PID controller is constructed, including error integration, time-weighted error integration, and control signal integration items, with different weight coefficients;
[0035] The population of the adaptive differential evolution algorithm is initialized, with a population size of 30, and each individual contains three PID parameters;
[0036] The mutation operation is performed on the population, with an adaptive mutation factor, the mutation factor size is dynamically adjusted according to the number of iterations, and the crossover operation is performed on the mutated individuals, with an adaptive crossover probability, and the selection operation is performed to retain better individuals;
[0037] The individual with the minimum target function value is selected from the optimization results to obtain the optimal PID control parameters.
[0038] Specifically, test signals are applied to the motor and relevant data are collected. Specifically, different frequency voltage signals are applied to the motor through a frequency-adjustable voltage source, and voltage, current, speed and torque signals are collected as input data for parameter identification in the motor static state and different speed states. These data are collected through high-precision data acquisition equipment, and the sampling frequency is generally set to 10 kHz to ensure the effectiveness and accuracy of the data. Based on the collected input signals, constructing the optimization target function is a key step in parameter identification. The optimization target function represents the sum of the squares of the differences between the actual measured output values and the model calculated output values, and the goal is to minimize this difference by adjusting the motor parameters. Recursive least squares method is used to estimate the motor parameters in real time, which constantly updates the parameter estimates based on newly acquired data. At the same time, in order to avoid local optimal solution, the differential evolution algorithm is introduced for global search, which is an evolutionary computation technique that simulates the biological evolution process to find the optimal solution of the problem. During the execution of the algorithm, the motor parameter estimates are updated through multiple iterations, and the target function value converges or reaches the maximum number of iterations, and finally the motor parameter values are obtained, including the stator resistance, stator inductance, rotor resistance, rotor inductance and mutual inductance.
[0039] After obtaining the motor parameters, model validation must be performed to ensure the accuracy of the parameters. The measured parameters are substituted into the motor model, and the model is run under the same conditions. The consistency between the model output and the actual motor response is compared. If the error exceeds the preset threshold (usually set to 3%), parameter identification needs to be performed again. After validation, the objective function of the PID controller is constructed, which includes three main parts: the error integral term (representing the accumulation of errors in the control process), the time-weighted error integral term (giving greater punishment to errors that exist for a long time), and the control signal integral term (limiting the excessive change of the control signal). These three terms are assigned different weight coefficients, with the error integral term usually having a weight of 0.6, the time-weighted error integral term having a weight of 0.3, and the control signal integral term having a weight of 0.1. This configuration can balance the 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 derivative gain Kd). During initialization, each parameter is randomly generated within a preset range, with the proportional gain Kp ranging from 0 to 100, the integral gain Ki ranging from 0 to 50, and the derivative gain Kd ranging from 0 to 10. Such initialization range is based on the experience parameter range of the motor controller, ensuring that the initial population covers a reasonable search space.
[0040] Subsequently, mutation operation is performed on the population, with the key being the use of an adaptive mutation factor. The mutation factor F determines the degree of deviation of the new individual from the original individual, and its size is dynamically adjusted according to the number of iterations. In the early iteration stage, F has a larger value (about 0.8-0.9), promoting global search; as the number of iterations increases, F gradually decreases (to about 0.4-0.5), enhancing the ability of local fine search. After mutation operation, crossover operation is performed on the mutated individuals, using an adaptive crossover probability CR. The crossover probability determines the probability of the offspring individual inheriting characteristics from the mutated vector or the original vector, and its value is also adjusted with the number of iterations, initially smaller (about 0.1-0.2), and then increased (to about 0.8-0.9) in the later stage, promoting algorithm convergence. After crossover operation, selection operation is performed, comparing the fitness values (objective function values) of the original individuals and the individuals after crossover, and retaining the individuals with better fitness to enter the next generation.
[0041] From the final population of the optimization process, the individual with the smallest objective function value is selected to obtain the optimal PID control parameters. This set of parameters meets the control performance requirements while achieving the optimization of the control system.
[0042] Take an industrial induction motor as an example, the parameter identification and controller parameter optimization are carried out by the above method. First, the motor is applied with test signal in the frequency range of 0 Hz to 50 Hz, and 200 groups of voltage, current, speed and torque data are collected respectively at static state and 25%, 50%, 75%, 100% rated speed. Through recursive least squares method combined with differential evolution algorithm, after 250 iteration calculations, the motor parameter values are obtained: stator resistance 0.5 ohm, rotor resistance 0.45 ohm, stator inductance 78 millihenry, rotor inductance 82 millihenry, mutual inductance 76 millihenry. Model verification shows that the consistency error of output and actual response is 2.3%, which is lower than the preset threshold of 3%. After constructing the PID objective function, the adaptive differential evolution algorithm is used, the population size is set to 30, the initial value of mutation factor is 0.8, and the initial value of crossover probability is 0.2, and after 400 generations of evolution calculation, the optimal PID parameters are obtained: Kp=45.6, Ki=22.8, Kd=5.2. This set of control parameters applied to the motor control system shows good dynamic response and steady-state accuracy under various operating conditions, meeting the design requirements of motor controller.
[0043] In a specific embodiment, the process of step S102 can specifically include the following steps:
[0044] The optimal PID control parameters are applied to the current inner loop controller, the current response frequency is set to one kilohertz, the inner loop unit of induction motor control is constructed, the integral-proportional-differential controller is constructed as the speed outer loop control structure based on the inner loop unit, the differential term filter time constant is set, and the double-loop control system is formed;
[0045] The control index of the double-loop control system is defined as an antigen, and the controller parameter combination is defined as an antibody. The 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 initial antibody population is subjected to motor system simulation operation, and the integral square error is calculated as the affinity evaluation index;
[0047] The ten controller parameter combinations with the highest affinity are selected for cloning and amplification, and the number of amplification is proportional to the motor control performance;
[0048] Mutation operation is performed on the amplified controller parameters, and the mutation amplitude is dynamically adjusted according to the influence degree of the parameters on the motor performance;
[0049] The parameter combination with the best motor speed response is selected from the mutated controller parameters, and the parameter diversity is maintained to obtain the optimized double-loop control structure.
[0050] Specifically, the motor is subjected to voltage signals of different frequencies by a frequency-adjustable voltage source while operating at both static and different rotational speed states. Voltage, current, speed, and torque signals are collected as input data for parameter identification. These data are collected by high-precision data acquisition equipment, with a sampling frequency of 10 kHz to ensure data validity and accuracy.
[0051] Based on the collected input signals, constructing an optimization objective function is a key step in parameter identification. The optimization objective function represents the sum of the squares of the differences 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 method is used to estimate the motor parameters in real time, which constantly updates the parameter estimates based on newly acquired data. At the same time, to avoid local optimal solution, differential evolution algorithm is introduced for global search, which is an evolutionary computation technique that simulates the biological evolution process to find the optimal solution of the problem. During the algorithm execution process, through multiple iteration calculations, the motor parameter estimation value is updated each time, until the objective function value converges or reaches the maximum iteration number, and finally the motor parameter value is obtained, including stator resistance, stator inductance, rotor resistance, rotor inductance and mutual inductance.
[0052] After obtaining the motor parameters, model validation must be performed to ensure parameter accuracy. The measured parameters are substituted into the motor model, and the model is run under the same conditions. The consistency between the model output and the actual motor response is compared. If the error exceeds the preset threshold (usually set to 3%), parameter identification needs to be performed again. After verification, the objective function of the PID controller is constructed, which includes three main parts: error integral term (representing the accumulation of errors in the control process), time-weighted error integral term (giving greater punishment to long-existing errors) and control signal integral term (limiting the excessive change of control signal). These three terms are assigned different weight coefficients, with the error integral term weight usually being 0.6, the time-weighted error integral term weight being 0.3, and the control signal integral term weight being 0.1. Such configuration can 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 derivative gain Kd). During initialization, each parameter is randomly generated within a preset range, with the proportional gain Kp ranging from 0 to 100, the integral gain Ki ranging from 0 to 50, and the derivative gain Kd ranging from 0 to 10. Such initialization range is based on the experience parameter range of the motor controller, ensuring that the initial population covers a reasonable search space.
[0054] Subsequently, a mutation operation is performed on the population, and the key is to adopt an adaptive mutation factor. The mutation factor F determines the degree to which a new individual deviates from an original individual, and the size thereof is dynamically adjusted according to the iteration number. In the early iteration stage, the F value is relatively large (about 0.8-0.9), promoting global search; as the iteration number increases, the F value gradually decreases (to about 0.4-0.5), enhancing the local fine search capability. After the mutation operation, a crossover operation is performed on the mutated individual, and an adaptive crossover probability CR is adopted. The crossover probability determines the probability of a child individual inheriting characteristics from a mutated vector or an original vector, and the value thereof is also adjusted according to the iteration number, being initially small (about 0.1-0.2) and increasing (to about 0.8-0.9) in the later stage, promoting algorithm convergence. After the crossover operation is completed, a selection operation is performed, the fitness values (objective function values) of the original individual and the individual after the crossover are compared, and the individual with better fitness is retained to enter the next generation.
[0055] Finally, the individual with the minimum objective function value is selected from the final population of the optimization process, and the optimal PID control parameter is obtained. This set of parameters meets the control performance requirements while realizing the optimization of the control system.
[0056] Taking an industrial induction motor as an example, parameter identification and controller parameter optimization are performed through the above method. First, a test signal is applied to the motor in a frequency range of 0 Hz to 50 Hz, and 200 groups of voltage, current, speed and torque data are collected at a stationary state and at 25%, 50%, 75% and 100% rated speed, respectively. Through recursive least squares combined with a differential evolution algorithm, after 250 iteration calculations, the motor parameter values are obtained: stator resistance 0.5 ohm, rotor resistance 0.45 ohm, stator inductance 78 millihenry, rotor inductance 82 millihenry, mutual inductance 76 millihenry. Model verification shows that the consistency error of the output and the actual response is 2.3%, which is lower than the preset threshold of 3%. After the PID objective function is constructed, an adaptive differential evolution algorithm is adopted, the population size is set to 30, the initial value of the mutation factor is 0.8, and the initial value of the crossover probability is 0.2, and after 400 generation evolution calculations, the optimal PID parameters Kp=45.6, Ki=22.8 and Kd=5.2 are finally obtained. After these control parameters are applied to the motor control system, good dynamic response and steady-state accuracy are exhibited under various operating conditions, meeting the motor controller design requirements.
[0057] In a specific embodiment, the process of performing step S103 can specifically include the following steps:
[0058] Based on the optimized double-loop control structure, a nonlinear state equation and an observation equation are established, and the motor state vector, control input and observation output are defined as basic parameters of an extended Kalman filter;
[0059] The covariance matrix setting of system noise and measurement noise of the extended Kalman filter is performed, the extended Kalman filter process is executed through two stages of time update and measurement update, and a first virtual sensor output value is obtained;
[0060] The super-twisting algorithm is adopted to design a sliding mode observer, a sliding surface is constructed, and an observer gain is set, so as to form a second virtual sensor output value;
[0061] The actual sensor measurement value of the motor is compared with the first virtual sensor output value and the second virtual sensor output value, and a difference index is calculated;
[0062] The quality of the difference index is evaluated, the initial sensor health index is calculated according to the deviation between the actual sensor measurement value of the motor and the virtual sensor output value;
[0063] Based on the initial sensor health index, a fault feature vector containing signal mean deviation, signal variance, signal maximum change rate and signal spectrum characteristics is constructed;
[0064] The fault feature vector is subjected to feature extraction and dimension reduction processing, and the optimized feature parameters are obtained, and the sensor health index is corrected according to the optimized feature parameters, so as to obtain the sensor health index.
[0065] Specifically, for induction motor, the state equation describes the evolution of system states over time, while the observation equation describes the relationship between system outputs and states. The motor state vector contains the d-axis component of stator current, the q-axis component of stator current, the d-axis component of rotor flux, the q-axis component of rotor flux and the rotor angular velocity, which fully reflect the dynamic characteristics of the motor. The control input is the d-axis and q-axis components of the motor stator voltage, and the observation output is usually the d-axis and q-axis components of the stator current, because these two quantities can be directly obtained by measuring the phase current. These vectors and parameters are defined as the basic parameters of the extended Kalman filter, which are ready for subsequent state estimation. The extended Kalman filter is a state estimation algorithm for nonlinear systems, which is suitable for objects such as motors with nonlinear characteristics. The covariance matrix setting of the system noise and measurement noise of the extended Kalman filter is a key step. The system noise covariance matrix represents the uncertainty of the state equation, which is usually in the form of a diagonal matrix, and the size of the diagonal element is set according to the uncertainty of the corresponding state variable; the measurement noise covariance matrix represents the uncertainty of the measurement process, which is also in the form of a diagonal matrix, and the diagonal element reflects the sensor accuracy. The extended Kalman filter process is divided into two stages: time update and measurement update. In the time update stage, the state estimation value and the control input at the last time are used to predict the state estimation value and the error covariance matrix at the current time. In the measurement update stage, the actual measurement value is combined to correct the predicted state estimation value, and a more accurate state estimation is obtained. Through this process, the extended Kalman filter can estimate the motor speed, flux and other non-directly measurable state variables in real time, forming the first virtual sensor output value.
[0066] Meanwhile, a sliding mode observer is designed as the second virtual sensor using the super-twisting algorithm. The sliding mode observer is a robust nonlinear observer, which is especially suitable for dealing with parameter variations and external disturbances. The super-twisting algorithm is an improved algorithm of the sliding mode control theory, which realizes state estimation by constructing a sliding surface and setting an observer gain. The sliding surface is a manifold that the system state trajectory should slide on. For motor speed estimation, the sliding surface is usually defined as the error between the actual current and the estimated current. The observer gain determines the speed and stability of the system converging to the sliding surface. If the gain is too small, the convergence will be slow, and if the gain is too large, the chattering phenomenon will occur. Through the super-twisting algorithm, the sliding mode observer can overcome the chattering problem of the conventional sliding mode control and provide smooth estimation results, forming the output value of the second virtual sensor. The actual sensor measurement value and the output values of the two virtual sensors are compared to calculate the difference index. The difference index usually uses the relative deviation between the actual value and the estimated value. For the speed signal, the absolute value of the difference between the actual speed and the estimated speed of the two virtual sensors is divided by the rated speed. The smaller the difference index, the more accurate the virtual sensor estimation, and the more normal the actual sensor working state; a sudden increase in the difference index may mean that the actual sensor or the virtual sensor is abnormal.
[0067] The difference index is evaluated for quality, and the initial sensor health index is calculated. The sensor health index is a value between 0 and 1, representing the working state of the sensor, 1 indicating complete health, and 0 indicating complete failure. The initial sensor health index calculation method is to take an exponential function transformation of the difference index, so that the smaller the difference, the closer the health index to 1. This transformation relationship reflects the nonlinear relationship between the sensor state and the measurement accuracy, which is more consistent with the actual situation. Based on the initial sensor health index, constructing a fault feature vector is a key step for further refining fault diagnosis. The fault feature vector contains four main features: signal mean deviation, signal variance, signal maximum change rate, and signal spectral feature. The signal mean deviation reflects the zero drift of the sensor; the signal variance reflects the noise level of the sensor; the signal maximum change rate reflects the dynamic characteristics of the sensor; and the signal spectral feature is obtained by fast Fourier transform, reflecting the frequency domain characteristics of the sensor. These features are combined into a fault feature vector, which fully describes the working state of the sensor.
[0068] The fault feature vector is extracted and dimensionally reduced to obtain the optimized feature parameters. The principal component analysis method is used in the feature extraction and dimension reduction process. The covariance matrix of the feature vector is calculated, the eigenvalues and eigenvectors are solved, and the several principal components with the largest contribution rate are selected as the optimized feature parameters. This process helps to remove the redundant information between features and extract the most discriminative feature combination. The initial sensor health index is corrected according to the optimized feature parameters to obtain the final sensor health index. The correction process considers the influence weight of different features on the sensor health state, so that the health index can more accurately reflect the actual working state of the sensor.
[0069] Taking a certain type of permanent magnet synchronous motor as an example, when the method is applied to sensor health monitoring, first, a nonlinear state equation containing five state variables is established, and the system noise covariance matrix and the measurement noise covariance matrix are set. Run the extended Kalman filter algorithm, the sampling period is 1 millisecond, after the time update and measurement update stages, the speed estimation value of the first virtual sensor is obtained. At the same time, the super-twisting algorithm is used to design the sliding mode observer, the sliding surface is set to the current error, the observer gain parameter is 1.5 and 2.0, and the speed estimation value of the second virtual sensor is obtained. Under normal working conditions, the speed estimation values of the two virtual sensors are very close to the actual sensor measurement value, and the difference index is maintained below 0.01. When the sensor starts to drift, the difference index gradually increases to about 0.05, and the initial sensor health index decreases to 0.8. At this time, by constructing a fault feature vector containing four features and performing feature extraction and dimension reduction, two main feature parameters are obtained, and the initial health index is corrected according to these parameters, and the sensor health index is further reduced to 0.7, which accurately reflects the actual health status of the sensor.
[0070] In a specific embodiment, the process of performing step S104 can specifically include the following steps:
[0071] A three-layer feedforward neural network structure is designed, which includes four neurons in the input layer, eight neurons in the hidden layer, and one neuron in the output layer, forming 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] The input vector is normalized to adjust the numerical range to between zero and one to obtain standardized neural network input data;
[0074] Five thousand groups of data samples containing normal working conditions and fault working conditions are collected to train the neural network to obtain network weights and threshold values;
[0075] The trained neural network is used for online calculation to output weight coefficients of the three signal sources, and to ensure that the sum of the weight coefficients is one;
[0076] The actual sensor signal, the extended Kalman filter signal and the sliding mode observer signal are weighted and summed according to the weight coefficients to obtain a fusion speed signal, and the control system is divided into a normal mode, a degraded mode and an emergency mode based on the sensor health index, corresponding to different weight coefficient distribution schemes, and the fusion speed signal is verified for effectiveness in different modes.
[0077] Specifically, the three-layer feedforward neural network specifically includes four neurons in the input layer, eight neurons in the hidden layer and one neuron in the output layer. The feedforward neural network is a kind of artificial neural network with unidirectional information flow, and the signal passes through the hidden layer from the input layer to the output layer without feedback connection. The four neurons in the input layer respectively receive the actual sensor signal, the extended Kalman filter virtual sensor signal, the sliding mode observer virtual sensor signal and the sensor health index; the eight neurons in the hidden layer receive the input signals through weight connection and process the data using the hyperbolic tangent function as the activation function; and the single neuron in the output layer generates the final output result. This network structure design fully considers the demand of multi-source information fusion in the motor control system and maintains the relative simplicity of the structure.
[0078] Combining the actual sensor signal, the extended Kalman filter virtual sensor signal, the sliding mode observer virtual sensor signal and the sensor health index into an input vector is the first step of data preprocessing. The four signals each represent different information sources: the actual sensor signal directly measures the motor speed but may be affected by faults; the extended Kalman filter virtual sensor signal obtains the speed value based on state estimation and is sensitive to parameter changes; the sliding mode observer virtual sensor signal has strong robustness and is not sensitive to disturbances; and the sensor health index reflects the reliability degree of the actual sensor. Combining the four signals together forms a four-dimensional input vector to provide comprehensive information for the neural network.
[0079] Normalization processing of the input vector is a key step to ensure the training effect of the neural network. Normalization processing uniformly maps data of different dimensions and ranges to between zero and one, avoiding training instability caused by some excessively large values. For the speed signal, the normalization processing uses the method of dividing the current speed value by the rated speed; for the sensor health index, since it is originally between zero and one, no additional processing is required. The four-dimensional vector after normalization constitutes the standardized neural network input data, and the consistency of the numerical range helps to improve the network training efficiency and generalization ability.
[0080] Five thousand data samples of normal and fault conditions were collected to train the neural network. These samples cover different operating conditions of the motor at different speeds and loads, as well as various types of sensor faults, including open circuit, short circuit, drift, and noise increase. Each sample contains actual sensor signals, two virtual sensor signals, sensor health index, and manually labeled ideal weight coefficients as training targets. The neural network is trained using the Levenberg-Marquardt algorithm, which combines the advantages of gradient descent and Newton's method. By continuously adjusting the network weights and thresholds, the mean square error between the network output and the target output is minimized. The learning rate is set to 0.01, and the training termination condition is that the mean square error is less than 0.0001 or the maximum iteration number is 1000. After training, the network's weight matrix and threshold vector are obtained, which define the specific calculation process of the neural network.
[0081] The online calculation of the trained neural network outputs the weight coefficients of the three signal sources, which is the core step of signal fusion. In real-time operation of the motor controller, the current actual sensor signal, two virtual sensor signals, and sensor health index are input into the neural network every control cycle to obtain the three weight coefficients through forward calculation. The forward calculation process includes: the input layer receives the normalized four-dimensional input vector; each neuron in the hidden layer performs weighted summation on the input signal and nonlinear transformation through the activation function; the neurons in the output layer perform weighted summation on the hidden layer output to produce the original output value. To ensure that the sum of the weight coefficients is one, the original output value is normalized to obtain the final three weight coefficients, corresponding to the signal weights of the actual sensor, extended Kalman filter, and sliding mode observer.
[0082] The actual sensor signal, the extended Kalman filter signal and the sliding mode observer signal are weighted and summed according to the weight coefficients to obtain a fused speed signal. The weighted sum process is a simple mathematical operation, and the three signals are multiplied by the corresponding weight coefficients and then added to obtain a fused speed signal that integrates the advantages of multi-source information. This signal fusion method can adaptively adjust the contribution proportion of each signal according to the current working condition and sensor state, and effectively suppress the error and fluctuation of a single signal. At the same time, the control system is divided into three working modes based on the sensor health index: when the sensor health index is greater than 0.9, the system works in normal mode and mainly relies on the actual sensor signal; when the sensor health index is between 0.5 and 0.9, the system enters the degraded mode and increases the weight of the virtual sensor signal; when the sensor health index is less than 0.5, the system switches to the emergency mode and almost completely relies on the virtual sensor signal. Each mode corresponds to a different weight coefficient distribution scheme, the actual sensor weight is higher in the normal mode, the weights of the three signals are relatively balanced in the degraded mode, and the virtual sensor weight dominates in the emergency mode. The effectiveness of the fused speed signal is verified in different modes to ensure that reliable speed information can be obtained under various working conditions.
[0083] Taking an industrial permanent magnet synchronous motor as an example, when the method is applied to speed signal fusion, a three-layer neural network structure meeting the requirements is first designed, and five thousand sets of sample data covering different working conditions are collected on the experimental platform. In these data, the actual sensor speed signal is read from the optical encoder, the speed estimation values of the extended Kalman filter and the sliding mode observer are obtained from the corresponding algorithm outputs, and the sensor health index is calculated by the aforementioned method. After normalization, the four signals are input into the neural network for training. After about 800 iterations, the mean square error is reduced to 0.00095, meeting the termination condition. After the trained neural network is put into use, when the motor is running normally, the weight coefficients output by the neural network are actual sensor 0.7, extended Kalman filter 0.2, and sliding mode observer 0.1, and the system works in normal mode; when the sensor drift fault is artificially introduced to reduce the health index to 0.7, the weight coefficients are automatically adjusted to actual sensor 0.3, extended Kalman filter 0.4, and sliding mode observer 0.3, and the system enters the degraded mode; when the sensor is completely disconnected to reduce the health index to 0.2, the weight coefficients are quickly adjusted to actual sensor 0.0, extended Kalman filter 0.6, and sliding mode observer 0.4, and the system switches to the emergency mode.
[0084] In a specific embodiment, the process of performing step S105 can specifically include the following steps:
[0085] Based on the deviation of the fused speed signal from the speed given value, a double-integral sliding surface is constructed, and the speed error, error integral term and error double integral term are weighted and summed to obtain a sliding surface expression;
[0086] Normal number parameter configuration is performed on the sliding surface expression, and weight coefficients are set to adjust the dynamic response and steady-state performance of the control system;
[0087] According to the principle of system inverse dynamics, the control term is derived, and the switching control term is added to form the control law, and the backstepping sliding mode controller structure is obtained;
[0088] The sign function is replaced by a continuous function, and the chattering suppression process is performed by setting a smoothing factor, and the improved control law is obtained;
[0089] Based on the improved control law, the hardware platform of the motor controller is designed, the processor is selected and the peripheral circuit is configured, and the hardware structure is formed;
[0090] The current loop control, speed loop control, virtual sensor calculation, fault diagnosis and voting algorithm are distributed to different priority interrupts to build the software framework;
[0091] The controller is tested in normal mode, degraded mode and emergency mode for start-up performance, speed step response, load disturbance and fault conditions;
[0092] The test results are analyzed, and the control performance indicators in different working modes are compared to verify the function 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, which not only contains the speed error term, but also introduces the error integral term and the error double integral term. The speed error is calculated, that is, the difference between the fusion speed signal and the given speed value, and then the error integral term and the error double integral term are calculated by numerical integration, and finally the three terms are weighted and summed to obtain the sliding surface expression. This structure has better steady-state accuracy and robustness than the traditional sliding surface.
[0094] Normal number parameter configuration of the sliding surface expression is a key link in controller design. Normal number refers to the weight coefficients of each term in the sliding surface, and these coefficients must be positive to ensure system stability. The setting of weight coefficients directly affects the dynamic response and steady-state performance of the system: increasing the speed error term coefficient can speed up the response but may increase the overshoot; increasing the error integral term coefficient helps to eliminate steady-state error but may reduce the response speed; increasing the error double integral term coefficient can further improve the system type and enhance the anti-interference ability. Parameter configuration needs to consider these factors and find the right balance.
[0095] Deriving the control term according to the principle of system inverse dynamics is the basis for building the control law. Inverse dynamics refers to the reverse calculation of the required control input according to the desired motion trajectory. For a motor control system, first establish the dynamics model of the motor, expressed as:
[0096]
[0097] where ω r represents the rotor angular velocity, J m represents the moment of inertia, T e represents the electromagnetic torque, T L represents the load torque, B m represents the damping coefficient.
[0098] According to the dynamic equation of the sliding surface:
[0099]
[0100] where s represents the sliding surface, e represents the speed error, and α, β, and γ represent the weight coefficients of the speed error, error integral, and error double integral, respectively.
[0101] In the sliding mode, Solving the above equations simultaneously, the equivalent control term T eq of the electromagnetic torque is obtained:
[0102]
[0103] where represents the derivative of the reference speed, also known as the speed given value, J m is the motor moment of inertia
[0104] To overcome the effects of model errors and external disturbances, a switching control term T s is added:
[0105] T s = -K s · sgn(s) - β s · s
[0106] where K s and β s represent the switching control gains, and sgn(s) represents the sign function.
[0107] The final control law T c is composed of the equivalent control term and the switching control term:
[0108] T c = T eq + T s
[0109] This is the basic structure of the backstepping sliding mode controller. Backstepping refers to the process of control design starting from high-order state variables of the system and gradually advancing to low-order state variables, ensuring the asymptotic stability of the system.
[0110] However, the sign function in the switching control term will cause discontinuity of the control output, resulting in system chattering, reducing control accuracy and possibly exciting unmodeled high-frequency dynamic characteristics. To solve this problem, the sign function is replaced by a continuous function, such as the hyperbolic tangent function sgn(s):
[0111] sgn(s)≈tanh(s / ε)
[0112] In the formula, ε represents the smoothing factor, which determines the steepness of the control function. The smaller the value of ε, the closer the function is to the sign function; the larger the value of ε, the smoother the function, but it will reduce the control accuracy. By setting an appropriate smoothing factor, a balance between chattering suppression and control accuracy is achieved, resulting in an improved control law.
[0113] The hardware platform of the motor controller based on the improved control law is an important step to implement the control algorithm into the actual system. The core of the hardware platform is a 32-bit floating-point digital signal processor with a main frequency of 200 MHz, built-in 128 KB RAM and 512 KB Flash memory, providing sufficient computing performance and storage space. The peripheral circuits include current sampling circuit, speed sampling circuit and PWM drive circuit. The current sampling circuit uses a Hall current sensor with a resolution of 12 bits and a sampling frequency of 20 kHz. The speed sampling circuit uses a 2000-line incremental encoder, which improves the resolution to 8000 pulses per revolution through quadrature decoding technology. The PWM drive circuit uses an isolated gate drive scheme with a frequency of 10 kHz and a dead time of 1 μs, effectively preventing short circuit caused by the conduction of upper and lower bridge arms. Assigning current loop control, speed loop control, virtual sensor calculation, fault diagnosis and voting algorithm to different priority interrupts is the core of building the software framework. The interrupt mechanism allows the processor to pause the current task and execute high-priority tasks to ensure the real-time performance of critical algorithms. The current loop control algorithm has the highest priority and is placed in the 10 kHz PWM interrupt with a control period of 100 μs to ensure fast response to current. The speed loop control algorithm is placed in the 1 kHz timer interrupt with the second highest priority, with a control period of 1 ms to meet the speed control requirements. The virtual sensor calculation includes extended Kalman filter and sliding mode observer algorithms, which are placed in the 2 kHz timer interrupt with an execution period of 500 μs. The fault diagnosis and neural network voting algorithm is placed in the 5 kHz timer interrupt with lower priority, with an execution period of 5 ms. Through reasonable task allocation and priority setting, the real-time execution of each algorithm and the effective use of system resources are ensured. Comprehensive testing of the controller in normal mode, degraded mode and emergency mode is a necessary step to verify the system performance. The startup performance test verifies the acceleration process of the motor from static to rated speed, records the startup time and current peak. The speed step response test is conducted in different speed ranges, recording the rise time, overshoot and steady-state error. The load disturbance test adds / removes the rated load at the rated speed, recording the speed fluctuation and recovery time. The fault condition test simulates the open circuit, short circuit and drift of the speed sensor to verify the fault tolerance of the system. These tests are conducted in three working modes to evaluate the system performance comprehensively.
[0114] Analyzing the test results and comparing the control performance indicators under different operating modes is the final step in verifying the function of the backstepping sliding mode controller with a double integral sliding surface. Control performance indicators include speed control accuracy, dynamic response time, and steady-state error. Through data recording and analysis, it was determined that in normal mode, the speed control accuracy reaches ±0.1%, the dynamic response time does not exceed 150 milliseconds, and the overshoot is less than 5%; in degraded mode, the control accuracy is ±0.3%, and the response time does not exceed 200 milliseconds; in emergency mode, the control accuracy is ±0.5%, and the response time does not exceed 250 milliseconds. These results indicate that even under sensor failure conditions, the system can maintain good control performance.
[0115] In one specific embodiment, the process of assigning 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] Based on the design of the floating-point digital signal processor, an interrupt nesting structure is designed, the interrupt vector table is initialized, the priority of each interrupt is set, and the basic framework of the interrupt system is obtained.
[0117] Set the pulse width modulation interrupt to the highest priority, and place the current sampling and current loop control algorithm in the interrupt service routine, setting the control cycle to one hundred microseconds;
[0118] Set Timer Interrupt 1 to the second highest priority and place the speed sampling and speed loop control algorithm in this interrupt service routine, setting 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 this interrupt, setting 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 this interrupt, setting the processing period to five milliseconds.
[0119] The memory usage of interrupt routines is evaluated, the execution time of each program is measured, and task conflicts are resolved through a task queuing mechanism.
[0120] A software framework is formed by defining data structures based on global variables, establishing data exchange mechanisms between modules, designing caching strategies for key parameters, and developing a caching strategy for key parameters.
[0121] Specifically, designing an interrupt nesting structure based on a floating-point digital signal processor is the basis for building the software framework of the motor controller. The floating-point digital signal processor refers to a special processor with a floating-point operation unit, such as TMS320F28335, which has a main frequency of up to 150 MHz and a built-in floating-point operation unit, suitable for executing complex control algorithms. The interrupt nesting structure allows high-priority interrupts to interrupt the execution of low-priority interrupts, ensuring timely response of critical tasks. First, the interrupt vector table is initialized, which is a data structure that stores the entry addresses of each interrupt service program. The addresses of each interrupt service program are written to the corresponding vector position through instructions. Then, the priority of each interrupt is set by writing to the control register. The priority ranges from 0 to 16, with the smaller the value, the higher the priority. In this way, the basic framework of the interrupt system is built, creating conditions for the real-time operation of each module. Setting the pulse width modulation interrupt to the highest priority is because the current loop control requires the highest time accuracy. The pulse width modulation interrupt refers to the interrupt signal generated at the end of each PWM period. Its priority is set to 1 by writing to the control register of the PWM module. The current sampling and current loop control algorithm are placed in the interrupt service program. The current sampling reads the phase current value through the ADC module, then performs Park transformation to obtain the d-q axis current components. The current loop control algorithm uses a PI controller to calculate the voltage command value, and finally generates a three-phase voltage command through inverse Park transformation and updates the PWM comparison register. The control cycle of the entire process is set to one hundred microseconds, i.e., the interrupt frequency is 10 kHz. This frequency is determined based on the motor electrical time constant and the switching frequency.
[0122] Timer interrupt 1 is set as the second highest priority for speed loop control. Timer interrupt is generated by configuring timer module, setting the initial value of the counter to make the timer overflow every millisecond to generate an interrupt, and setting the priority to 2. In the interrupt service program, speed sampling and speed loop control algorithm are executed. Speed sampling is obtained by reading the encoder count value and calculating the number of pulses per unit time to get the speed value; the speed loop control algorithm calculates the torque command according to the given speed value and the actual speed, which is used as the given value of the current loop control. Timer interrupt 2 is set as medium priority, with a priority value of 3 and a calculation period of 500 microseconds, responsible for executing the extended Kalman filter and sliding mode observer calculation programs. The extended Kalman filter program first performs the time update step to predict the current state according to the previous state estimation value and control input; then performs the measurement update step to correct the state estimation value combined with the actual measurement value. The sliding mode observer program estimates the motor state by constructing a sliding surface and calculating a switching control term. Timer interrupt 3 is set as a lower priority, with a priority value of 4 and a processing period of 5 milliseconds, to execute the fault diagnosis algorithm and neural network voting algorithm. The fault diagnosis algorithm identifies the fault type by analyzing the characteristics of the sensor signals; the neural network voting algorithm obtains the weight coefficients of the three signal sources through forward calculation. Evaluating the memory usage of the interrupt program is a necessary step to ensure reasonable allocation of system resources. First, the code size of each interrupt service program is counted, including program instructions and local variables, for example, the current loop control program occupies 2KB of code space, and the speed loop control program occupies 1.5KB. Then measure the execution time of each program, which can be monitored by observing the level change of the GPIO pin or using the timer capture function to record the start and end time of the program. For example, the execution time of the current loop control program is 20 microseconds, the speed loop control program is 30 microseconds, the extended Kalman filter program is 120 microseconds, the sliding mode observer program is 80 microseconds, and the fault diagnosis and neural network program is 200 microseconds. According to these data, the worst-case execution time under interrupt nesting is analyzed to ensure that there is no interrupt stacking problem. When potential task conflicts are detected, the task queuing mechanism is used to solve the problem, that is, the low-priority task is delayed until the high-priority task is completed, or the time-consuming task is divided into multiple short tasks for step-by-step execution.
[0123] The data structure based on global variables is the foundation of the data exchange mechanism among modules. Global variables are variables that can be accessed by all functions in the program and are defined outside all functions. In the motor controller software, several key global variables are defined: the current given value structure contains the d-axis and q-axis current given values; the current feedback value structure contains the d-axis and q-axis current measurement values; the speed given value variable stores the target rotational speed; the speed feedback value variable stores the measured rotational speed; the DC bus voltage variable stores the power supply voltage value; the motor temperature variable stores the measured temperature value; and the fault status flag word contains various fault status bits. These global variables serve as interfaces among modules to achieve data transmission. To avoid data access conflicts, a cache strategy for key parameters is designed, i.e., a double buffer technology is used: when one buffer is written, the other buffer is used for reading, and the buffer pointers are exchanged through atomic operations to ensure data consistency. In addition, for critical data that needs to be shared among interrupts, an interrupt disable protection mechanism is used: interrupts are disabled before data access and restored after access is completed to avoid data corruption.
[0124] Taking a digital controller for permanent magnet synchronous motor control as an example, the controller is designed based on a TMS320F28335 processor. In the system startup phase, the program first configures the interrupt vector table, writes the PWM1_INT_ISR function address into the PWM1 interrupt vector position, writes the TIMER0_INT_ISR function address into the timer 0 interrupt vector position, and so on. Then, the PWM module is configured to generate a 10 kHz PWM waveform and an interrupt signal with a priority of 1; the timer 0 is configured to generate an interrupt every 1 millisecond with a priority of 2; the timer 1 is configured to generate an interrupt every 0.5 milliseconds with a priority of 3; and the timer 2 is configured to generate an interrupt every 5 milliseconds with a priority of 4. Tests show that the current sampling and current loop control algorithm executed in the PWM interrupt occupies 18 microseconds, the speed sampling and control algorithm executed in the Timer0 interrupt occupies 25 microseconds, the state observation algorithm executed in the Timer1 interrupt occupies 90 microseconds, and the fault diagnosis and voting algorithm executed in the Timer2 interrupt occupies 180 microseconds. When the worst case occurs, that is, all interrupts come at the same time, the system can process each interrupt in order according to the priority, and the total execution time is 313 microseconds, which is less than the minimum interrupt period of 500 microseconds, proving that the interrupt design is reasonable. In terms of data exchange, a global structure MotorData is used to store all motor-related parameters, including current, speed, torque and other data; a double-buffer technology SpeedBuffer is used to store speed data, and an atomic operation Exchange_Buffer() function is used to exchange the active buffer and the standby buffer to ensure that the read and write operations do not conflict; for key parameters such as current given value, the DISABLE_INTERRUPTS() and ENABLE_INTERRUPTS() macros are used to temporarily disable interrupts when updating to prevent the update process from being interrupted and causing data inconsistency. Through these designs, the orderly execution of each algorithm module and the safe transmission of data are realized, laying a foundation for the stable operation of the motor controller.
[0125] The above describes the motor controller development method based on intelligent algorithm in the embodiments of the application, and the motor controller development system based on intelligent algorithm in the embodiments of the application is described below. Please refer to Figure 2 The motor controller development system based on intelligent algorithm in the embodiments of the application includes one embodiment:
[0126] The identification module is configured to 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 and obtain optimal PID control parameters.
[0127] An adjusting module is configured to construct a motor double-loop control structure according to the optimal PID control parameters, and to perform parameter adjustment to obtain an optimized double-loop control structure.
[0128] A constructing module is configured to design an extended Kalman filter and a sliding mode observer as virtual sensors based on the optimized double-loop control structure, and to construct a fault feature vector to obtain a sensor health index.
[0129] An inputting module is configured to input the sensor health index and actual sensor and virtual sensor signals into a neural network to calculate a weight coefficient and perform signal fusion to obtain a fused speed signal.
[0130] A verifying module is configured to realize a backstepping sliding mode controller with a double-integral sliding surface according to the fused speed signal, and to complete hardware design and performance verification of a motor control system.
[0131] Through the cooperation of the above-mentioned components, through parameter identification of the motor system and combination of the adaptive differential evolution algorithm to optimize the PID controller parameters, the disadvantages of the traditional PID controller parameter setting depending on experience are effectively overcome, the control parameters can be automatically optimized and adjusted according to the motor characteristics, the accuracy and adaptability of parameter setting are improved, and the complexity and time cost of controller design are reduced. The motor double-loop control structure based on the optimal PID control parameters, combined with the artificial immune system algorithm for parameter adjustment, makes the speed outer loop and the current inner loop coordinate, 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 the sliding mode observer designed in the application as virtual sensors can estimate the key state quantities of the motor in real time without increasing the hardware cost, and through the construction of the fault feature vector and the calculation of the sensor health index, the real-time monitoring and early warning of the sensor state are realized, which provides a reliable basis for system fault-tolerant control. The core innovation of the application is that the sensor health index and the actual sensor and virtual sensor signal are input into the neural network for weight calculation and signal fusion. Through the self-learning ability of the neural network, intelligent fusion of multi-source information is realized, so that the system can automatically adjust the weight of each signal source according to the health state of the sensor, ensuring the continuity and reliability of the speed signal. The backstepping sliding mode controller with double integral sliding surface is designed, combined with the fused speed signal, a high-precision and strong-robustness control strategy is constructed, which can maintain good control performance even in the case of parameter variation and external disturbance. The application fully utilizes the advantages of various intelligent algorithms in the field of motor control: the adaptive differential evolution algorithm solves the parameter optimization problem, the artificial immune system handles the multi-objective control structure optimization, the neural network realizes information fusion, and the sliding mode control provides a robust control method. This multi-algorithm cooperative method not only improves the overall performance of the control system, but also makes the system have excellent adaptive ability and fault-tolerant ability. Especially in the case of sensor failure, the traditional method often leads to system out of control, while the application can maintain the basic functions of the system through intelligent switching of working modes, virtual sensors and fusion algorithms in the case of sensor performance degradation or complete failure, greatly improving the reliability and safety of the motor control system.
[0132] Reference Figure 3 In the embodiment of the application, a computer device, which can be a server, is also provided. The internal structure of the computer device can be as follows: Figure 3The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. The processor of the computer device is configured 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 running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store corresponding data in the embodiment. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the above method.
[0133] Those skilled in the art can understand that, Figure 3 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied.
[0134] The computer program is executed by the processor to implement the above method. It can be understood that the computer readable storage medium in the 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, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for developing an intelligent algorithm-based motor controller, characterized in that, The intelligent algorithm-based motor controller development method comprises the following steps: Parameter identification is performed on the motor system to obtain motor parameters, and the motor parameters are input into an adaptive differential evolution algorithm to optimize parameters of a PID controller, so as to obtain optimal PID control parameters; A motor double-loop control structure is constructed according to the optimal PID control parameters, and parameter adjustment is performed to obtain an optimized double-loop control structure; Based on the optimized double-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, actual sensor signals and virtual sensor signals are input into a neural network to calculate weight coefficients and perform signal fusion to obtain a fused speed signal, including the following steps: a three-layer feedforward neural network structure is designed, including four neurons in an input layer, eight neurons in a hidden layer and one neuron in an output layer, to form a basic framework of a voting algorithm; actual sensor signals, extended Kalman filter virtual sensor signals, sliding mode observer virtual sensor signals and sensor health indexes are combined into an input vector; the input vector is normalized to adjust the numerical range to between zero and one, to obtain standardized neural network input data; data samples containing five thousand normal working conditions and fault working conditions are collected, and the neural network is trained to obtain network weights and thresholds; the trained neural network is calculated online, weight coefficients of three signal sources are output, and the sum of the weight coefficients is ensured to be one; the actual sensor signals, extended Kalman filter signals and sliding mode observer signals are weighted and summed according to the weight coefficients, to obtain a fused speed signal, and the control system is divided into a normal mode, a degraded mode and an emergency mode based on the sensor health index, corresponding to different weight coefficient distribution schemes, and the fused speed signal is verified for effectiveness in different modes; According to the fused speed signal, a backstepping sliding mode controller with a double-integral sliding surface is realized, and hardware design and performance verification of the motor control system are completed.
2. The intelligent algorithm based motor controller development method of claim 1, wherein, The parameter identification of the motor system to obtain motor parameters, and inputting the motor parameters into an adaptive differential evolution algorithm to optimize parameters of a PID controller to obtain optimal PID control parameters comprises the following steps: A test signal is applied to the motor, voltage, current, speed and torque data are collected as input signals for parameter identification, an optimization objective function is constructed based on the input signals, and iterative calculation is performed by combining a recursive least squares method with a differential evolution algorithm to obtain motor parameter values; The motor parameter values are verified by a model to ensure that the consistency error of the output and the actual motor response is not more than a preset threshold, an objective function of the PID controller is constructed, including error integral, time-weighted error integral and control signal integral items, and different weight coefficients are assigned; The population of the adaptive differential evolution algorithm is initialized, and the population size is set to 30, and the individual includes three parameters of the PID. The mutation operation is performed on the population, an adaptive mutation factor is used, the mutation factor size is dynamically adjusted according to the iteration number, the crossover operation is performed on the mutated individuals, an adaptive crossover probability is used, and the selection operation is performed to retain better individuals; An individual with the minimum target function value is selected from the optimization result to obtain optimal PID control parameters.
3. The intelligent algorithm based motor controller development method of claim 1, wherein, The optimal PID control parameters are used to construct a motor double-loop control structure, and parameter adjustment is performed to obtain an optimized double-loop control structure, including: The optimal PID control parameters are applied to a current inner loop controller, the current response frequency is set to 1 kHz, an induction motor control inner loop unit is constructed, an integral-proportional-derivative controller is constructed as a speed outer loop control structure based on the inner loop unit, a differential term filter time constant is set, and a double-loop control system is formed; The control indicators of the double-loop control system are defined as antigens, and the controller parameter combinations are defined as antibodies, an artificial immune system algorithm framework is constructed, and an antibody initial population containing 50 parameter combinations is generated, each antibody containing proportional, integral, differential and filter parameters of the speed loop integral-proportional-derivative controller; The motor system simulation is performed on the antibody initial population, and the integral square error is calculated as the affinity evaluation index; The ten controller parameter combinations with the highest affinity are selected for clonal amplification, and the amplification number is proportional to the motor control performance; Mutation operation is performed on the amplified controller parameters, and the mutation amplitude is dynamically adjusted according to the influence of the parameters on the motor performance; The parameter combination with the best motor speed response is selected from the mutated controller parameters, and parameter diversity maintenance is performed to obtain the optimized double-loop control structure.
4. The intelligent algorithm based motor controller development method of claim 1, wherein, Based on the optimized double-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: The nonlinear state equation and the observation equation are established based on the optimized double-loop control structure, the motor state vector, the control input and the observation output are defined as the basic parameters of the extended Kalman filter; The covariance matrix of the system noise and the measurement noise of the extended Kalman filter is set, the extended Kalman filtering process is performed through two stages of time update and measurement update to obtain the first virtual sensor output value; The sliding mode observer is designed by using the super-twisting algorithm, the sliding surface is constructed and the observer gain is set to form the second virtual sensor output value; The actual sensor measurement value of the motor is compared with the first virtual sensor output value and the second virtual sensor output value, and the difference index is calculated; The difference index is quality evaluated, and the initial sensor health index is calculated according to the deviation between the actual sensor measurement value of the motor and the virtual sensor output value; Based on the initial sensor health index, a fault feature vector containing signal mean deviation, signal variance, signal maximum change rate and signal spectrum characteristics is constructed. The fault feature vector is subjected to feature extraction and dimension reduction processing to obtain an optimized feature parameter, and the sensor health index is corrected according to the optimized feature parameter to obtain a sensor health index.
5. The intelligent algorithm based motor controller development method of claim 1, wherein, The double-integral sliding surface is constructed based on the fusion speed signal and the speed given value, the weighted sum of the speed error, the error integral term and the error double integral term is obtained, and the sliding surface expression is obtained. The normal parameter configuration is performed on the sliding surface expression, and the weight coefficient is set to adjust the dynamic response and steady-state performance of the control system. The control term is derived according to the system inverse dynamics principle, and the switching control term is added to form the control law, and the backstepping sliding mode controller structure is obtained. The sign function is replaced by a continuous function, and the chattering suppression processing is performed by setting a smoothing factor, and the improved control law is obtained. The hardware platform of the motor controller is designed based on the improved control law, the processor is selected, and the peripheral circuit is configured to form the hardware structure. The current loop control, speed loop control, virtual sensor calculation, fault diagnosis and voting algorithm are distributed to different priority interrupts to construct the software framework. The controller is tested in normal mode, degraded mode and emergency mode in terms of starting performance, speed step response, load disturbance and fault conditions. The test results are analyzed, and the control performance indexes in different working modes are compared to verify the function of the double-integral sliding surface backstepping sliding mode controller. The current loop control, speed loop control, virtual sensor calculation, fault diagnosis and voting algorithm are distributed to different priority interrupts to construct the software framework, including:
6. The intelligent algorithm based motor controller development method of claim 5, wherein, The interrupt nesting structure is designed based on the floating-point digital signal processor, the interrupt vector table is initialized, the priority of each interrupt is set, and the interrupt system basic framework is obtained. The pulse width modulation interrupt is set to the highest priority, the current sampling and current loop control algorithm are placed in the interrupt service program, and the control period is set to one hundred microseconds. Timer interrupt one is set to the second highest priority, speed sampling and speed loop control algorithm are placed in the interrupt service program, control period is set to one millisecond, timer interrupt two is set to medium priority, extended Kalman filter and sliding mode observer calculation program are placed in the interrupt, calculation period is set to five hundred microseconds, timer interrupt three is set to low priority, fault diagnosis algorithm and neural network voting algorithm are placed in the interrupt, processing period is set to five milliseconds. The interrupt program memory occupation is evaluated, the execution time of each program is measured, and the task conflict problem is solved through the task queuing mechanism. The data structure is defined based on the global variable, the data exchange mechanism between modules is established, the cache strategy of key parameters is designed, and the software framework is formed. The motor controller research and development system based on intelligent algorithm includes:
7. A smart algorithm based motor controller development system for implementing the smart algorithm based motor controller development method according to any one of claims 1 to 6, characterized in that, The identification module is used for parameter identification of the motor system to obtain motor parameters, and the motor parameters are input into the adaptive differential evolution algorithm to optimize the parameters of the PID controller and obtain the optimal PID control parameters. An adjusting module is configured to construct a motor double-loop control structure according to the optimal PID control parameters, and to perform parameter adjustment to obtain an optimized double-loop control structure; A constructing module is configured to design an extended Kalman filter and a sliding mode observer as a virtual sensor based on the optimized double-loop control structure, and to construct a fault feature vector to obtain a sensor health index; An input module is configured to input the sensor health index and actual sensor and virtual sensor signals into a neural network to calculate a weight coefficient and perform signal fusion to obtain a fused speed signal; A verifying module is configured to implement a backstepping sliding mode controller with a double-integral sliding surface according to the fused speed signal to complete hardware design and performance verification of a motor control system.
8. A computer device, comprising: A processor and a memory are included, the memory stores a computer program capable of running on the processor, and the processor implements the computer program to realize the motor controller development method based on intelligent algorithms in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, A computer program is stored thereon, and the computer program causes the processor to execute the motor controller development method based on intelligent algorithms in any one of claims 1 to 6 when the computer program is run by the processor.
Citation Information
Patent Citations
Industrial robot servo motor vibration fault detection method and device
CN115683235A
High-precision motor driving method
CN117792190A