Method, system and related device for controlling motor based on adaptive algorithm

By combining adaptive algorithms with deep learning models, dynamic time-frequency features of motor data are extracted, a target prediction model is constructed, and PID controller parameters are dynamically adjusted. This solves the problem of speed fluctuation when the motor load changes abruptly, and achieves high-precision motor control.

CN120915200AActive Publication Date: 2025-11-07雷文斯(深圳)科技有限公司

Patent Information

Application Number
CN202511084321.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-04
Publication Date
2025-11-07
Estimated Expiration
2045-08-04

AI Technical Summary

Technical Problem

In existing technologies, PID control strategies based on feedback mechanisms cannot adjust in time when the motor faces sudden load changes, resulting in speed fluctuations and control oscillations, which affect the stability and accuracy of the equipment.

Method used

By combining adaptive algorithms with deep learning models, dynamic time-frequency features of motor data are extracted through empirical mode decomposition and marginal spectrum analysis. A target prediction model is constructed, and the weights and parameters of the PID controller are dynamically adjusted to achieve forward-looking control.

Benefits of technology

It improves the motor's rapid response, stability, and accuracy under complex load scenarios, and avoids speed fluctuations and control oscillations caused by the lag adjustment of traditional PID control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120915200A_ABST
    Figure CN120915200A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a system and a related device for controlling a motor based on an adaptive algorithm, which are used for improving the accuracy of motor control. The method comprises the following steps: acquiring initial data of a motor; decomposing the initial data into intrinsic mode function components, and performing time-frequency transformation on the intrinsic mode function components; dynamic time-frequency features of the intrinsic mode function component are extracted, cross-band weighted fusion is carried out on the dynamic time-frequency features through a preset attention weighting mechanism, and a multi-dimensional feature vector is generated; inputting the multi-dimensional feature vector into a preset deep learning model, and constructing a target prediction model in combination with a loss function and an adaptive momentum optimization algorithm; transmitting the target prediction model to an analysis module of the motor to obtain a load change trend and a confidence coefficient; dynamically adjusting the proportion of the weight of the PID controller according to the load change trend and the confidence coefficient, and optimizing the parameters of the unit of which the proportion is adjusted through a gradient descent method; and dynamically regulating and controlling the motor based on the PID controller.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electric machines, and in particular to a method and system for controlling an electric machine based on an adaptive algorithm and related devices. BACKGROUND

[0002] With the deepening of intelligent manufacturing, electric machines, as the core power units of industrial production and automation equipment, are crucial to the development of their control technology. From the drive motor of new energy vehicles to the servo motor of industrial robots, from the spindle motor of numerical control machine tools to the micro motor of smart homes, electric machines are constantly expanding and becoming increasingly complex in various application scenarios. In these scenarios, electric machines not only need to cope with regular workloads, but also often face load mutations caused by factors such as equipment start-stop, workpiece size changes, production task switching, and environmental temperature, electromagnetic interference, etc. Therefore, it is necessary to achieve rapid response, stability, and precision in electric machine control.

[0003] In the prior art, a PID control strategy based on a feedback mechanism is usually used to regulate and control electric machines. Specifically, actual running data of the electric machine is first collected and fed back to the PID controller, and then compared with the pre-set target value to calculate the error between the actual output value and the target set value. The error is then processed using the proportional, integral, and derivative units of the PID controller. Finally, the electric machine is adjusted based on the processed data to regulate and control the running state of the electric machine. However, when the electric machine encounters extreme conditions such as inertia impact during equipment start-up, load mutation during production task switching or environmental changes, using the PID control strategy based on the feedback mechanism to regulate and control the electric machine can only start adjusting the parameters after the actual error occurs, which can cause the electric machine speed to fluctuate dramatically, the control output to oscillate significantly, and thus reduce the stability and reliability of the equipment operation. For example, in an industrial automation production line, lagging regulation can cause production rhythm disorder, seriously affecting the size accuracy of precision workpieces. SUMMARY

[0004] To solve the above technical problems, the present application provides a method and system for controlling an electric machine based on an adaptive algorithm and related devices.

[0005] The technical solutions provided in the present application are described as follows: The first aspect of the present application provides a method for controlling an electric machine based on an adaptive algorithm, comprising: obtaining initial data of the electric machine, the initial data including current data, position data, power data, and vibration data; decomposing the initial data into intrinsic mode function components using a preset empirical mode decomposition method, and performing time-frequency transformation on the intrinsic mode function components in combination with a preset marginal spectrum analysis method; extracting dynamic time-frequency features of the intrinsic mode function components after time-frequency transformation, and performing cross-band weighting fusion on the dynamic time-frequency features through a preset attention weighting mechanism to generate a multi-dimensional state feature vector; inputting the multi-dimensional state feature vector into a preset deep learning model, and constructing a target prediction model in combination with a preset loss function and a preset adaptive momentum optimization algorithm; transmitting the target prediction model to an analysis module of the motor for push analysis to obtain a load change trend and a confidence level; dynamically adjusting a proportion of weights of a proportional unit, an integral unit and a differential unit of a preset PID controller according to the load change trend and the confidence level, and optimizing parameters of the proportional unit, the integral unit and the differential unit with an adjusted proportion through a preset gradient descent method; dynamically regulating and controlling the motor based on the preset PID controller after parameter optimization.

[0006] Optionally, after the parameters of the proportional unit, the integral unit and the differential unit with the adjusted proportion of weights are optimized through the preset gradient descent method, the method further includes: transmitting the preset PID controller after parameter optimization to a preset test mirror model for testing, and generating a test score in combination with a performance scoring standard determined based on user needs; determining whether the test score is less than the preset score threshold; If not, the step of dynamically regulating and controlling the motor based on the preset PID controller after parameter optimization is performed.

[0007] Optionally, after the determination of whether the test score is less than the preset score threshold, the method further includes: If yes, an error gradient output by the test mirror model is obtained, parameters of the proportional unit, the integral unit and the differential unit of the preset PID controller are adjusted based on the error gradient, and a test score is generated by retesting until the test score is greater than or equal to the preset score threshold.

[0008] Optionally, the dynamic adjustment of the proportion of weights of the proportional unit, the integral unit and the differential unit of the preset PID controller according to the load change trend and the confidence level is represented by the following formula: ; wherein, represents the weight of the proportional unit, This represents the error factor in the preset PID controller. This represents the adjustment coefficient in the preset PID controller. The first derivative represents the trend of the load change. This represents the weight of the integration unit. This represents the confidence level. This represents the proportional weight of the differential unit. The second derivative represents the trend of the load change.

[0009] Optionally, the step of inputting the multidimensional feature vector into a preset deep learning model and constructing a target prediction model by combining a preset loss function and a preset adaptive momentum optimization algorithm includes: The multidimensional feature vector is divided into training feature vector and test feature vector; The training feature vectors are input into the preset deep learning model for training to obtain an initial prediction model; The initial prediction model is used to verify its accuracy using the test feature vector, and a verification index value is obtained. Based on the verification index value, the initial prediction model is updated by backpropagation gradient using a preset loss function, and the parameters of the initial prediction model that has completed the backpropagation gradient update are iteratively adjusted by a preset adaptive momentum optimization algorithm to obtain the target prediction model.

[0010] Optionally, the backpropagation gradient update is represented by the following formula: ; Among them, the This represents the matrix parameters in the initial prediction model. This represents the learning rate of the initial prediction model. This represents the preset loss function. This represents the gradient of the preset loss function with respect to the matrix parameters. This represents the momentum factor in the initial prediction model. This represents the value of the verification index.

[0011] Optionally, after acquiring the initial data of the motor, the method further includes: The initial data is preprocessed; The preprocessing of the initial data includes: The current data, the position data, the vibration data, and high-frequency noise in the vibration data are removed by using a preset sliding window mean filter or wavelet transform method. normalize the current data, the position data, the power data and the vibration data after removal by a preset quantization algorithm; correct outliers of the current data, the position data, the power data and the vibration data after normalization according to the Laiyida criterion.

[0012] The second aspect of the application provides a system for controlling a motor based on an adaptive algorithm, the system comprising: an acquisition unit configured to acquire initial data of the motor, the initial data comprising current data, position data, power data and vibration data; a transformation unit configured to decompose the initial data into intrinsic mode function components using a preset empirical mode decomposition method, and perform time-frequency transformation on the intrinsic mode function components using a preset marginal spectrum analysis method; a generation unit configured to extract dynamic time-frequency features of the intrinsic mode function components after time-frequency transformation, and perform cross-band weighting fusion on the dynamic time-frequency features using a preset attention weighting mechanism to generate a multi-dimensional state feature vector; a construction unit configured to input the multi-dimensional state feature vector into a preset deep learning model, and construct a target prediction model in combination with a preset loss function and a preset adaptive momentum optimization algorithm; an analysis unit configured to transmit the target prediction model to an analysis module of the motor for push analysis to obtain a load change trend and a confidence level; an optimization unit configured to dynamically adjust the weights of the proportional unit, the integral unit and the differential unit of a preset PID controller according to the load change trend and the confidence level, and optimize the parameters of the proportional unit, the integral unit and the differential unit of the preset PID controller after the adjustment of the weights using a preset gradient descent method; a regulation and control unit configured to dynamically regulate and control the motor based on the preset PID controller after the optimization of the parameters.

[0013] Optionally, the system further comprises a judgment unit configured to: transmit the preset PID controller after the optimization of the parameters to a preset test mirror model for testing, and generate a test score in combination with a performance scoring standard determined based on user needs; determine whether the test score is less than the preset score threshold; if not, perform the step of dynamically regulating and controlling the motor based on the preset PID controller after the optimization of the parameters.

[0014] Optionally, the system further comprises an adjustment unit configured to: If yes, an error gradient outputted by the test image model is acquired, parameters of the proportional unit, the integral unit and the differential unit of the preset PID controller are adjusted based on the error gradient, and a test score is retested until the test score is greater than or equal to the preset score threshold.

[0015] Optionally, the proportion of the weights of the proportional unit, the integral unit and the differential unit of the preset PID controller which are dynamically adjusted according to the load change trend and the confidence degree is represented by the following formula: ; wherein, represents the weight of the proportional unit, represents an error factor in the preset PID controller, represents an adjustment coefficient in the preset PID controller, represents a first derivative of the load change trend, represents the weight of the integral unit, represents the confidence degree, represents the proportion weight of the differential unit, represents a second derivative of the load change trend.

[0016] Optionally, the constructing unit is specifically configured to: divide the multi-dimensional state feature vector into a training feature vector and a test feature vector; input the training feature vector into the preset deep learning model for training to obtain an initial prediction model; verify the accuracy of the initial prediction model using the test feature vector to obtain a verification index value; based on the verification index value, perform back propagation gradient update on the initial prediction model using a preset loss function, and perform iterative adjustment on parameters of the initial prediction model which has completed the back propagation gradient update by a preset adaptive momentum optimization algorithm to obtain a target prediction model.

[0017] Optionally, the back propagation gradient update is represented by the following formula: ; wherein, the represents a matrix parameter in the initial prediction model, represents a learning rate of the initial prediction model, represents the preset loss function, represents a gradient of the preset loss function on the matrix parameter, represents a momentum factor in the initial prediction model, representing the verification index value.

[0018] Optionally, further comprising a processing unit, specifically for: preprocessing the initial data; The preprocessing the initial data comprises: removing high-frequency noise in the current data, the position data, the power data and the vibration data by a preset sliding window mean filtering or wavelet transform method; normalizing the current data, the position data, the power data and the vibration data after removal by a preset quantization algorithm; correcting abnormal values of the current data, the position data, the power data and the vibration data after normalization according to a Ralard criterion.

[0019] The third aspect of the present application provides a device for controlling a motor based on an adaptive algorithm, the device comprising: a processor, a memory, an input / output unit and a bus; The processor is connected to the memory, the input / output unit and the bus; The memory stores a program, and the processor invokes the program to execute the first aspect and any optional method in the first aspect.

[0020] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium stores a program, and the program executes the first aspect and any optional method in the first aspect when executed on a computer.

[0021] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages: The application realizes accurate dynamic regulation and control of the motor in a complex load sudden change scene by combining an adaptive algorithm with a deep learning model. First, initial data of the motor including current data, position data, power data and vibration data are obtained and decomposed into intrinsic mode function components using an empirical mode decomposition method. Time-frequency transformation is performed in combination with a marginal spectrum analysis method, so that the data can more clearly reflect the dynamic characteristics of the motor operation. After time-frequency transformation, dynamic time-frequency characteristics of the intrinsic mode function components after time-frequency transformation are extracted, and a multi-dimensional state feature vector is generated through cross-band weighting fusion by an attention weighting mechanism. The generated multi-dimensional state feature vector can accurately capture subtle signal changes before load mutation. Subsequently, the multi-dimensional state feature vector is input into a preset deep learning model, and a target prediction model is constructed in combination with an adaptive momentum optimization algorithm, which can predict the load change trend and confidence in advance, improving the feedback regulation in the prior art to forward-looking regulation. Finally, the weights of each unit of the PID controller are dynamically adjusted according to the prediction result, and the parameters are optimized by the gradient descent method, realizing real-time calibration of the motor operating state. The whole scheme avoids the speed fluctuation and control oscillation caused by lagging regulation of the traditional PID control when the load suddenly changes, and improves the rapid response, stability and accuracy of the motor control. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0023] Figure 1 An embodiment flowchart of a method for controlling a motor based on an adaptive algorithm provided by the present application is shown in the figure. Figure 2 Another embodiment flowchart of a method for controlling a motor based on an adaptive algorithm provided by the present application is shown in the figure. Figure 3 An embodiment flowchart of a process for pre-processing initial data in a method for controlling a motor based on an adaptive algorithm provided by the present application is shown in the figure. Figure 4 An embodiment structure diagram of a system for controlling a motor based on an adaptive algorithm provided by the present application is shown in the figure. Figure 5 An embodiment structure diagram of a device for controlling a motor based on an adaptive algorithm provided by the present application is shown in the figure. DETAILED DESCRIPTION

[0024] The present application provides a method for controlling a motor based on an adaptive algorithm, which can improve the accuracy of motor control.

[0025] It should be noted that the method, device and related device for controlling motor based on adaptive algorithm provided in the present application can be applied to a terminal, a system or a server. For example, the terminal can be a smart phone, a computer, a tablet computer, a smart television, a smart watch or a fixed terminal such as a desktop computer. For convenience of description, the terminal is taken as an example in the present application.

[0026] Please refer to Figure 1 The present application first provides an embodiment of a method for controlling motor based on adaptive algorithm, which comprises the following steps: S101, obtaining initial data of the motor, the initial data comprising current data, position data, power data and vibration data; In the embodiment, the data acquisition device is used to collect the current data, position data, power data and vibration data during the operation of the motor. The current data can directly reflect the energy consumption of the motor during operation, and different loads will cause corresponding changes in the current. The position data can record the position information of the motor rotor, which is used to determine the running state and position accuracy of the motor. The power data reflects the efficiency of energy conversion of the motor, thereby evaluating the performance of the motor. The vibration data monitors the mechanical state of the motor. By collecting multi-dimensional initial data, the original information basis for subsequent comprehensive analysis of the running state of the motor can be provided, so that the subsequent analysis can comprehensively consider the actual situation of the motor from multiple angles, avoiding the limitations brought by single data.

[0027] S102, decomposing the initial data into intrinsic mode function components using a preset empirical mode decomposition method, and performing time-frequency transformation on the intrinsic mode function components by combining a preset marginal spectrum analysis method; In the embodiment, the preset empirical mode decomposition method is first used to decompose the obtained initial data of the motor. Specifically, the empirical mode decomposition method is based on the local characteristics of the signal, and separates different levels of characteristic components by continuous screening. It gradually decomposes the complex, nonlinear and non-stationary initial data into a plurality of intrinsic mode function components, each of which represents the characteristics at different time scales.

[0028] After the decomposition is completed, the intrinsic mode function components are subjected to time-frequency transformation by combining the preset marginal spectrum analysis method. The marginal spectrum analysis method is used to analyze the components in depth from the frequency angle and to mine the hidden dynamic characteristics in the data. Specifically, the intrinsic mode function components are converted into a three-dimensional distribution form of "time-frequency-energy", so that the initial data presents the frequency characteristic change during the operation of the motor in a more intuitive and clear manner.

[0029] S103, extract the dynamic time-frequency features of the completed time-frequency changed intrinsic modal function components, and perform cross-band weighted fusion on the dynamic time-frequency features through a preset attention weighting mechanism to generate a multi-dimensional state feature vector; In this embodiment, by extracting the dynamic time-frequency features and performing cross-band weighted fusion, the key features sensitive to load changes can be effectively highlighted, and redundant or secondary information can be discarded. Specifically, after completing the time-frequency transformation of the intrinsic modal function components, the dynamic time-frequency features are extracted from the time-frequency transformed intrinsic modal function components, such as the energy distribution of different frequency bands, the entropy value of the time-frequency distribution, and other signal features that can reflect the subtle changes in the load.

[0030] Further, the extracted dynamic time-frequency features are processed using a preset attention weighting mechanism. The attention weighting mechanism evaluates the features of different frequency bands and assigns corresponding weights according to the importance of each frequency band feature in reflecting load changes. Then, the dynamic time-frequency features are cross-band weighted and fused to generate a multi-dimensional state feature vector. The generated multi-dimensional state feature vector can accurately capture subtle signals before load mutation, providing high-quality feature data for subsequent prediction.

[0031] S104, input the multi-dimensional state feature vector into a preset deep learning model, and construct a target prediction model combining a preset loss function and a preset adaptive momentum optimization algorithm; In this embodiment, the generated multi-dimensional state feature vector is input into a preset deep learning model. The deep learning model can be an LSTM model, a Transformer model, or other models suitable for processing time series data and feature learning, which are not limited here.

[0032] While inputting the multi-dimensional state feature vector into the preset deep learning model, a preset loss function is used to measure the difference between the model prediction results and the actual situation, and a preset adaptive momentum optimization algorithm is used to automatically adjust the learning rate. The parameters of the preset deep learning model are optimized during the training process. Through repeated iterative training, the difference of the preset loss function is gradually reduced, thereby constructing a target prediction model that can accurately predict the trend of load changes and the confidence level.

[0033] Through the learning and analysis of the multi-dimensional state feature vector by the preset deep learning model, the trend of motor load changes and the confidence level of the prediction results can be predicted in advance. This can effectively avoid problems such as speed fluctuations and control oscillations caused by lagging adjustment, significantly improving the rapid response, stability, and accuracy of motor control, and providing reliable protection for efficient operation of the motor in complex load scenarios.

[0034] S105, transmit the target prediction model to the analysis module of the motor for reasoning analysis to obtain the load change trend and the confidence; After the construction of the target prediction model is completed, the target prediction model is transmitted to the analysis module of the motor. After the analysis module receives the target prediction model, it will collect the motor related operation data in real time and input into the target prediction model. Since the target prediction model has learned the internal mapping relationship between the initial data of the motor and the load change through a large amount of data training in the early stage, the analysis module calls the target prediction model to substitute the real-time operation data of the motor into the mapping relationship, thereby reasoning and analyzing the load change trend of the motor, and outputting the confidence of the reasoning result load change trend. The obtained load change trend and confidence provide a clear basis for subsequent regulation and control of the motor. Compared with the control method relying only on real-time feedback, this ability to obtain the load change trend in advance enables the motor control system to make a response strategy in advance, avoiding the problem of unstable operation of the motor caused by lagging regulation.

[0035] S106, dynamically adjust the weights of the proportional unit, integral unit and differential unit of the preset PID controller according to the load change trend and the confidence, and optimize the parameters of the proportional unit, integral unit and differential unit of the preset PID controller with the preset gradient descent method; In this embodiment, first, the weights of each unit in the preset PID controller are adjusted according to the load change trend and the confidence. The proportional unit in the preset PID controller can quickly respond to errors, the integral unit can eliminate steady-state errors, and the differential unit can predict error change trends.

[0036] Specifically, the current motor operating state is determined according to the load change trend. When the load change trend shows an upward trend, the weight of the proportional unit is appropriately increased in order to speed up the response speed of the motor. When the load change trend is about to appear or has appeared an overshoot trend, the weight of the differential unit is adjusted. When the load change trend is a stable trend, the weight of the integral unit is reduced to reduce the accumulation of steady-state errors. Then, the preset gradient descent method is used to continuously calculate the error function, and the parameters of the proportional unit, integral unit and differential unit are iteratively optimized along the direction in which the error function decreases fastest, gradually reducing the error, so that the parameters of the preset PID controller reach the optimal state.

[0037] S107, dynamically regulate and control the motor based on the preset PID controller whose parameters have been optimized.

[0038] In this embodiment, after the proportion adjustment and parameter optimization of the weights of the proportional unit, integral unit and derivative unit of the preset PID controller are completed, the optimized preset PID controller output control signal is used. This control signal will be transmitted to the motor drive module, and the drive module will control the motor according to the control signal, thereby realizing dynamic regulation and control of the motor, so that the motor can adapt to the changing load demand.

[0039] This embodiment realizes precise dynamic regulation and control of the motor in the complex load sudden change scene by combining the adaptive algorithm with the deep learning model. First, the initial data of the motor including current data, position data, power data and vibration data are obtained, and the empirical mode decomposition method is used to decompose them into intrinsic mode function components. Combined with the marginal spectrum analysis method, time-frequency transformation is performed, so that the data can more clearly reflect the dynamic characteristics of the motor operation. After completing the time-frequency transformation, the dynamic time-frequency characteristics of the intrinsic mode function components after time-frequency transformation are extracted, and the multi-dimensional state feature vector is generated by cross-band weighting fusion through the attention weighting mechanism. The generated multi-dimensional state feature vector can accurately capture the subtle signal changes before the load mutation. Then, the multi-dimensional state feature vector is input into the preset deep learning model, and a target prediction model is constructed by combining the adaptive momentum optimization algorithm, which can predict the load change trend and confidence in advance, and improve the feedback control in the prior art to forward-looking control. Finally, the proportion of the weights of each unit of the PID controller is dynamically adjusted according to the prediction result, and the parameters are optimized by the gradient descent method to realize real-time calibration of the motor operating state. The whole scheme avoids the speed fluctuation and control oscillation caused by lagging adjustment of the traditional PID control when the load suddenly changes, and improves the rapid response, stability and accuracy of the motor control.

[0040] Please refer to Figure 2 The application also provides another embodiment of a method for controlling a motor based on an adaptive algorithm, which comprises: S201, obtaining initial data of the motor, the initial data including current data, position data, power data and vibration data; S202, decomposing the initial data into intrinsic mode function components using a preset empirical mode decomposition method, and performing time-frequency transformation on the intrinsic mode function components in combination with a preset marginal spectrum analysis method; S203, extracting the dynamic time-frequency characteristics of the intrinsic mode function components after time-frequency transformation, and generating a multi-dimensional state feature vector by cross-band weighting fusion of the dynamic time-frequency characteristics through a preset attention weighting mechanism; S204, inputting the multi-dimensional state feature vector into a preset deep learning model, and constructing a target prediction model in combination with a preset loss function and a preset adaptive momentum optimization algorithm; In the embodiment, steps S201 to S204 are similar to the aforementioned embodiment steps S101 to S104, which will not be described here again.

[0041] S205, dividing the multi-dimensional state feature vector into a training feature vector and a test feature vector; In the embodiment, in order to effectively train the subsequent preset deep learning model, the multi-dimensional state feature vector needs to be divided into a training feature vector and a test feature vector. The division process will randomly allocate in the ratio of 8:2 or 7:3, which can divide most of the multi-dimensional state feature vectors as training feature vectors, and a small part of the multi-dimensional state feature vectors as test feature vectors. This division is to simulate the scene in actual application. The training feature vector is used to let the model learn the relationship between the feature and the load change; and the test feature vector is used to test the prediction ability of the trained model and evaluate the performance of the model on unknown data.

[0042] This division method can ensure that the subsequent preset deep learning model can fully learn the feature rule in the training process, and at the same time verify the generalization ability of the prediction model obtained after training through the test stage, avoiding the overfitting phenomenon of the prediction model.

[0043] S206, inputting the training feature vector into the preset deep learning model for training to obtain an initial prediction model; In the embodiment, the divided training feature vector is input into the preset deep learning model for training. In the training process, the neural network structure inside the preset deep learning model will process the training feature vector layer by layer. Starting from the input layer of the neural network structure, the training feature vector is extracted, transformed and combined through the hidden layer of the neural network structure, and finally output at the output layer of the neural network structure.

[0044] After each input of the training feature vector, the preset deep learning model will calculate and output the prediction result according to the parameter setting adjusted after the last input. Through the process of repeatedly inputting the training feature vector and adjusting the parameters, the preset deep learning model gradually learns the mapping relationship between the training feature vector and the load change, and finally obtains an initial prediction model that can preliminarily predict the load change trend.

[0045] S207, using the test feature vector to verify the accuracy of the initial prediction model to obtain a verification index value; In this embodiment, after obtaining the initial prediction model, the initial prediction model is verified for accuracy using the test feature vectors divided previously. Specifically, the test feature vectors are input into the initial prediction model, and the initial prediction model processes the test feature vectors according to the parameters and structure obtained by training, and outputs a prediction result. Then, the prediction result of the initial prediction model is compared with the actual load change to obtain a verification index value.

[0046] The accuracy of the initial prediction model is verified using the test feature vectors to obtain the verification index value, which provides an objective and quantitative standard for evaluating the performance of the initial prediction model. Through the verification index value, not only can the prediction ability of the initial prediction model in the actual application scenario be clearly understood, but also whether the initial prediction model meets the actual demand can be determined, so as to avoid the application of the initial prediction model with poor performance to the actual motor control to cause control failure.

[0047] S208, based on the verification index value, the initial prediction model is updated by gradient back propagation using a preset loss function, and the parameters of the initial prediction model that have completed the gradient back propagation are iteratively adjusted by a preset adaptive momentum optimization algorithm to obtain a target prediction model.

[0048] In this embodiment, first, the initial prediction model is updated by gradient back propagation based on the verification index value using a preset loss function. The back propagation algorithm calculates the gradient of each parameter in the initial prediction model according to the prediction error of the initial prediction model reflected by the verification index value, wherein the gradient represents the influence degree and direction of the parameter change on the error. Then, the parameters of the initial prediction model are adjusted in the opposite direction of the gradient, so that the error is reduced.

[0049] In the gradient back propagation process, the information of historical gradients is considered comprehensively by combining the preset adaptive momentum optimization algorithm to automatically adjust the learning rate, so that the parameters of the initial prediction model can be updated more efficiently.

[0050] Specifically, the gradient back propagation is represented by the following formula: ; wherein, represents a matrix parameter in the initial prediction model, represents a learning rate of the initial prediction model, represents a preset loss function, represents a gradient of the preset loss function on the matrix parameter, represents a momentum factor in the initial prediction model, represents the verification index value.

[0051] Through the gradient update and parameter iterative adjustment, the parameters of the initial prediction model are gradually optimized, so that the prediction result of the initial prediction model is continuously close to the actual load change condition, and finally the target prediction model capable of accurate prediction is obtained. Compared with the initial prediction model, the target prediction model can provide more accurate trend judgment and higher credibility result when processing the actual motor load change prediction.

[0052] S209, transmitting the target prediction model to the analysis module of the motor for push analysis to obtain the load change trend and the confidence; S210, dynamically adjusting the proportion of the weights of the proportional unit, the integral unit and the differential unit of the preset PID controller according to the load change trend and the confidence, and optimizing the parameters of the proportional unit, the integral unit and the differential unit of the preset PID controller with the preset gradient descent method; Specifically, the proportion of the weights of the proportional unit, the integral unit and the differential unit of the preset PID controller is dynamically adjusted according to the load change trend and the confidence, which is expressed by the following formula: ; Among them, represents the weight of the proportional unit, represents the error factor in the preset PID controller, represents the adjustment coefficient in the preset PID controller, represents the first derivative of the load change trend, represents the weight of the integral unit, represents the confidence, represents the proportion weight of the differential unit, represents the second derivative of the load change trend.

[0053] In this embodiment, steps S209 to S210 are similar to steps S105 to S106 of the foregoing embodiment, which will not be described here.

[0054] S211, transmitting the preset PID controller with the optimized parameters to the preset test mirror model for testing, and generating a test score in combination with the performance score standard determined based on the user demand; In this embodiment, in order to clearly determine whether the preset PID controller meets the actual operation requirement in the subsequent process, after completing the parameter optimization of the preset PID controller, the preset PID controller is transmitted to the preset test mirror model. In the test mirror model, the test mirror model simulates various complex working condition environments of the actual motor operation, and places the optimized preset PID controller in these complex working condition environments for operation.

[0055] In the running process, the test mirror model collects various output data of the preset PID controller in real time, such as the adjustment effect of the control signal, the motor speed, and the torque response, etc. At the same time, the performance of the preset PID controller is evaluated from multiple dimensions in combination with the performance score standard determined based on the user demand. Specifically, the performance score standard covers response speed, control accuracy, stability, etc. For example, in a certain working condition, the preset PID controller with fast response speed, high control accuracy, and stable operation will get a higher score. Through comprehensive consideration of various indicators, the test score is finally generated, and the generated test score is mainly to quantitatively evaluate the performance of the optimized preset PID controller.

[0056] S212, determine whether the test score is less than a preset score threshold; In this embodiment, after the test score is generated, the test score is compared with the preset score threshold. The preset score threshold is a standard value set in advance according to the actual operation demand and control target of the motor, which represents the minimum performance indicator that the preset PID controller can meet the normal operation requirements. For example, when the test score is 90 and the preset score threshold is 80, the test score is greater than the preset score threshold, so the current preset PID controller meets the minimum performance indicator of the normal operation requirements; when the test score is 50 and the preset score threshold is 80, the test score is less than the preset score threshold, so the current preset PID controller does not meet the minimum performance indicator of the normal operation requirements.

[0057] If it is determined that the test score is less than the preset score threshold, step S214 is performed; if it is determined that the test score is greater than the preset score threshold, step S213 is performed.

[0058] S213, performing the step of dynamically regulating the motor by the preset PID controller based on the completed parameter optimization.

[0059] In this embodiment, step S213 is similar to step S107 of the foregoing embodiment, which will not be described here.

[0060] S214, obtaining the error gradient output by the test mirror model, adjusting the parameters of the proportional unit, integral unit, and differential unit of the preset PID controller based on the error gradient, and retesting to generate a test score until the test score is greater than or equal to the preset score threshold.

[0061] In this embodiment, when it is determined that the test score is less than the preset score threshold, it means that the performance of the current optimized preset PID controller does not meet the requirements and needs to be further adjusted. First, the error gradient output by the test mirror model is obtained, which can reflect the deviation degree and direction of various performance indicators of the preset PID controller. Based on the error gradient, the parameters of the proportional unit, integral unit, and differential unit of the preset PID controller are further adjusted.

[0062] In the adjustment process, according to the size and direction of the error gradient, the parameters of the corresponding unit are increased or decreased to reduce the error. After adjusting the parameters, the preset PID controller is transmitted to the test mirror model again for testing, and the test score is regenerated according to the performance score standard.

[0063] If the test score generated after adjustment is still less than the preset score threshold, the process of obtaining the error gradient, adjusting the parameters and retesting is repeatedly performed until the test score is greater than or equal to the preset score threshold, so that the performance of the preset PID controller meets the expected requirements. This adjustment mechanism can accurately improve the deficiencies of the performance of the preset PID controller, and ensure that the parameters of each unit of the preset PID controller can be continuously optimized until the motor operation requirements are met.

[0064] S215, dynamically regulating and controlling the motor based on the preset PID controller whose parameters have been optimized.

[0065] In this embodiment, step S215 is similar to step S107 of the foregoing embodiment, which will not be described here.

[0066] In step S201, after obtaining the initial data of the motor, the initial data needs to be preprocessed. Please refer to Figure 3 , Figure 3 An embodiment of preprocessing the initial data in the method for controlling the motor based on the adaptive algorithm provided in the present application includes: S301, removing high-frequency noise in the current data, position data, vibration data and vibration data by preset sliding window mean filtering or wavelet transform method; The initial data of the motor running is easily affected by electromagnetic interference, mechanical vibration and other factors during the collection process to produce noise, which will interfere with subsequent analysis if not processed. In this embodiment, after obtaining the current data, position data, power data and vibration data of the motor, the preset sliding window mean filtering or wavelet transform method is selected to process the high-frequency noise in the current data, position data, power data and vibration data. The preset sliding window mean filtering weakens the high-frequency fluctuation by local averaging, and the wavelet transform method selectively removes the noise frequency component by using the characteristic difference of signals and noise at different frequencies.

[0067] Specifically, a preset sliding window mean filter is used for processing, a fixed length sliding window is set on the data sequence of the current data, position data, vibration data and vibration data, the sliding window slides point by point on the data sequence, the average value of the data in the sliding window is calculated each time, and the average value is taken as the new value of the center data point of the window, so as to achieve the effect of removing high frequency noise; using wavelet transform method, the current data, position data, power data and vibration data need to be decomposed into wavelet coefficients of different frequencies, high frequency noise usually corresponds to large high frequency wavelet coefficients, by setting a threshold value, the high frequency wavelet coefficients less than the threshold value are set to zero or are contracted, and then the processed high frequency wavelet coefficients are used for reconstruction, so that the initial data after removing high frequency noise can be obtained. After removing high frequency noise, the initial data can more truly reflect the running state of the motor, and provide reliable data basis for load change trend prediction and accurate control of the motor.

[0068] S302, normalize the removed current data, position data, power data and vibration data by a preset quantization algorithm; In this embodiment, after removing the high frequency noise of the initial data, the removed current data, position data, power data and vibration data are normalized by using a preset quantization algorithm. Specifically, the normalization processing needs to calculate the mean and standard deviation of the current data, position data, power data and vibration data respectively, and then subtract the mean from each data point and divide by the standard deviation, so that the initial data conforms to the standard normal distribution.

[0069] The normalized initial data is in the same scale, so that the preset deep learning model can better learn the data characteristics and improve the accuracy of load change trend prediction.

[0070] S303, according to the Laiyida criterion, the abnormal values of the normalized current data, position data, power data and vibration data are corrected.

[0071] In this embodiment, after the high frequency noise of the normalized initial data, the initial data is normally distributed, so that the abnormal values in the current data, position data, power data and vibration data can be corrected according to the Laiyida criterion. According to the Laiyida criterion, the abnormal values of the initial data are corrected, which avoids the interference of abnormal data on the analysis of motor operation.

[0072] In the actual correction process, the mean and standard deviation of the current data, position data, power data and vibration data are calculated respectively, the data sequence is traversed, and all data points deviating from the mean more than three times the standard deviation are found. For these abnormal values, the mean of the adjacent normal data is replaced or linear interpolation correction is made according to the data change trend.

[0073] The following provides a detailed description of the motor control system based on adaptive algorithm provided in this application. Please refer to [link / reference]. Figure 4 , Figure 4 An embodiment of the system for controlling a motor based on an adaptive algorithm provided in this application, the system includes: The acquisition unit 401 is used to acquire the initial data of the motor, including current data, position data, power data and vibration data; Transformation unit 402 is used to decompose the initial data into intrinsic mode function components using a preset empirical mode decomposition method, and to perform time-frequency transformation on the intrinsic mode function components in combination with a preset marginal spectrum analysis method. The generation unit 403 is used to extract the dynamic time-frequency features of the intrinsic mode function components that have completed time-frequency changes, and to perform cross-band weighted fusion of the dynamic time-frequency features through a preset attention weighting mechanism to generate a multi-dimensional state feature vector. The building unit 404 is used to input multi-dimensional feature vectors into a preset deep learning model and combine a preset loss function and a preset adaptive momentum optimization algorithm to build a target prediction model. The parsing unit 405 is used to transmit the target prediction model to the parsing module of the motor for inference and parsing to obtain the load change trend and confidence level; The optimization unit 406 is used to dynamically adjust the weight ratios of the proportional unit, integral unit, and derivative unit of the preset PID controller according to the load change trend and confidence level, and to optimize the parameters of the adjusted proportional unit, integral unit, and derivative unit through a preset gradient descent method. The control unit 407 is used to dynamically control the motor based on a preset PID controller with optimized parameters.

[0074] Optionally, a judgment unit 408 is also included, specifically used for: The pre-optimized PID controller is transferred to the pre-optimized test mirror model for testing, and a test score is generated based on the performance scoring criteria determined by user requirements. Determine if the test score is less than a preset score threshold; If not, then the steps of dynamically controlling the motor based on the preset PID controller with optimized parameters will be executed.

[0075] Optionally, an adjustment unit 409 is also included, specifically for: If so, obtain the error gradient output by the test mirror model, adjust the parameters of the proportional unit, integral unit, and derivative unit of the preset PID controller based on the error gradient, and retest to generate a test score until the test score is greater than or equal to the preset score threshold.

[0076] Optionally, the weights of the proportional unit, the integral unit and the differential unit of the preset PID controller are dynamically adjusted according to the load change trend and the confidence level, and the proportion is expressed by the following formula: ; wherein, represents the weight of the proportional unit, represents an error factor in the preset PID controller, represents an adjustment coefficient in the preset PID controller, represents a first derivative of the load change trend, represents the weight of the integral unit, represents the confidence level, represents the proportion weight of the differential unit, represents a second derivative of the load change trend.

[0077] Optionally, the construction unit 404 is specifically configured to: divide the multi-dimensional state feature vector into a training feature vector and a test feature vector; input the training feature vector into a preset deep learning model for training to obtain an initial prediction model; verify the accuracy of the initial prediction model using the test feature vector to obtain a verification index value; based on the verification index value, perform back propagation gradient update on the initial prediction model using a preset loss function, and iteratively adjust the parameters of the initial prediction model that has completed the back propagation gradient update through a preset adaptive momentum optimization algorithm to obtain a target prediction model.

[0078] Optionally, the back propagation gradient update is expressed by the following formula: ; wherein, represents a matrix parameter in the initial prediction model, represents a learning rate of the initial prediction model, represents the preset loss function, represents the gradient of the matrix parameter with respect to the preset loss function, represents a momentum factor in the initial prediction model, represents the verification index value.

[0079] Optionally, the processing unit 410 is further configured to: preprocess the initial data; the preprocessing of the initial data includes: removing high-frequency noise in the current data, the position data, the vibration data and the vibration data by a preset sliding window mean filtering or wavelet transform method; The removed current data, position data, power data and vibration data are normalized by a preset quantization algorithm; According to the Laiyida criterion, the abnormal values of the normalized current data, position data, power data and vibration data are corrected.

[0080] The specific implementation process is described in the embodiments of the method Figures 1-3 Embodiments, which will not be repeated here.

[0081] The application also provides a device for controlling a motor based on an adaptive algorithm, please refer to Figure 5 , Figure 5 An embodiment of the device for controlling a motor based on an adaptive algorithm provided by the application comprises: The processor 501, the memory 502, the input and output unit 503 and the bus 504 are connected; The processor 501 is connected with the memory 502, the input and output unit 503 and the bus 504; The memory 502 stores a program, and the processor 501 calls the program to execute any of the above methods.

[0082] The application also relates to a computer readable storage medium, and the computer readable storage medium stores a program, characterized in that when the program runs on a computer, the computer executes any of the above methods.

[0083] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.

[0084] In the several embodiments provided by the application, it should be understood that the disclosed system, device and method can be implemented by other ways. For example, the device embodiments described above are only schematic, and for the convenience of description, the division of the units is only a logical function division, and there can be another division way in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0085] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.

[0086] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0087] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or in the form of a contribution to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, read-only memory), a random access memory (RAM, random access memory), a magnetic disk or an optical disk, and various media that can store program codes.

Claims

1. A method of controlling an electric machine based on an adaptive algorithm, characterized in that, The method comprises the following steps: acquiring initial data of the motor, the initial data comprising current data, position data, power data, and vibration data; decomposing the initial data into intrinsic mode function components using a preset empirical mode decomposition method, and performing time-frequency transformation on the intrinsic mode function components using a preset marginal spectrum analysis method; extracting dynamic time-frequency features of the intrinsic mode function components after time-frequency transformation, and performing cross-band weighting fusion on the dynamic time-frequency features through a preset attention weighting mechanism to generate a multi-dimensional state feature vector; inputting the multi-dimensional state feature vector into a preset deep learning model, and constructing a target prediction model in combination with a preset loss function and a preset adaptive momentum optimization algorithm; transmitting the target prediction model to an analysis module of the motor for push analysis to obtain a load change trend and a confidence level; dynamically adjusting the proportion of the weights of the proportional unit, the integral unit, and the differential unit of a preset PID controller according to the load change trend and the confidence level, and optimizing the parameters of the proportional unit, the integral unit, and the differential unit with the adjusted proportion through a preset gradient descent method; dynamically regulating the motor based on the preset PID controller with the optimized parameters.

2. The method of claim 1, wherein, After the parameters of the proportional unit, the integral unit, and the differential unit with the adjusted proportion are optimized through the preset gradient descent method, the method further comprises the following steps: transmitting the preset PID controller with the optimized parameters to a preset test mirror model for testing, and generating a test score in combination with a performance score standard determined based on user needs; determining whether the test score is less than the preset score threshold; if not, performing the step of dynamically regulating the motor based on the preset PID controller with the optimized parameters.

3. The method of claim 2, wherein, After determining whether the test score is less than the preset score threshold, the method further comprises the following steps: if yes, obtaining an error gradient output by the test mirror model, adjusting the parameters of the proportional unit, the integral unit, and the differential unit of the preset PID controller based on the error gradient, and retesting to generate a test score until the test score is greater than or equal to the preset score threshold.

4. The method of claim 1, wherein, The proportion of the weights of the proportional unit, the integral unit, and the differential unit of the preset PID controller dynamically adjusted according to the load change trend and the confidence level is represented by the following formula: ; wherein, denotes a weight of the proportional unit, denotes an error factor in the preset PID controller, denotes a regulation factor in the preset PID controller, denotes a first derivative of the load change tendency, denotes a weight of the integral unit, denotes the confidence, denotes a proportional weight of the derivative unit, denotes a second derivative of the load change tendency.

5. The method of claim 1, wherein, The step of inputting the multi-dimensional state feature vector into a preset deep learning model, and constructing a target prediction model in combination with a preset loss function and a preset adaptive momentum optimization algorithm comprises the following steps: dividing the multi-dimensional state feature vector into a training feature vector and a test feature vector; inputting the training feature vector into the preset deep learning model for training to obtain an initial prediction model; performing precision verification on the initial prediction model using the test feature vector to obtain a verification index value; Based on the verification index value, the initial prediction model is updated by back propagation gradient, and the parameters of the initial prediction model after the back propagation gradient update are adjusted iteratively by a preset adaptive momentum optimization algorithm to obtain a target prediction model.

6. The method of claim 5, wherein, The back propagation gradient update is represented by the following formula: ; wherein the denotes a matrix parameter in the initial prediction model, denotes a learning rate of the initial prediction model, denotes the preset loss function, denotes a gradient of the preset loss function with respect to the matrix parameter, denotes a momentum factor in the initial prediction model, denotes the validation indicator value.

7. The method according to any one of claims 1 to 6, characterized in that, After the initial data of the motor is obtained, the method further includes: The initial data is preprocessed; The preprocessing of the initial data includes: High-frequency noise in the current data, the position data, the power data, and the vibration data is removed by a preset sliding window mean filtering or wavelet transform method; The removed current data, position data, power data, and vibration data are normalized by a preset quantization algorithm; The abnormal values of the normalized current data, position data, power data, and vibration data are corrected according to the Rayleigh criterion.

8. A system for controlling a motor based on an adaptive algorithm, characterized in that, The method includes: An acquisition unit is configured to acquire initial data of a motor, the initial data including current data, position data, power data, and vibration data; A transformation unit is configured to decompose the initial data into intrinsic mode function components using a preset empirical mode decomposition method, and perform time-frequency transformation on the intrinsic mode function components using a preset marginal spectrum analysis method; A generation unit is configured to extract dynamic time-frequency features of the intrinsic mode function components after time-frequency transformation, and perform cross-band weighting fusion on the dynamic time-frequency features using a preset attention weighting mechanism to generate a multi-dimensional state feature vector; A construction unit is configured to input the multi-dimensional state feature vector into a preset deep learning model, and construct a target prediction model using a preset loss function and a preset adaptive momentum optimization algorithm; An analysis unit is configured to transmit the target prediction model to an analysis module of the motor for push analysis to obtain a load change trend and a confidence level; An optimization unit is configured to dynamically adjust the proportion of weights of a proportional unit, an integral unit, and a differential unit of a preset PID controller according to the load change trend and the confidence level, and optimize parameters of the proportional unit, the integral unit, and the differential unit after the proportion adjustment using a preset gradient descent method; A regulation and control unit is configured to dynamically regulate and control the motor based on the preset PID controller after the parameter optimization.

9. A device for controlling a motor based on an adaptive algorithm, characterized in that, The method includes: A processor, a memory, an input / output unit, and a bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, and the processor invokes the program to execute the method of any one of claims 1 to 7.

10. A computer-readable storage medium, the computer-readable storage medium storing a program, the program being executed on a computer to execute the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • PID permanent magnet synchronous motor control method based on optimization algorithm

    CN111555682A

  • Motor operation control method and system

    CN117458955A

  • Motor operation state self-adaptive adjustment method and system

    CN117639602A

  • A method and system for intelligently controlling generator output

    CN119787513A

  • Dust collector multi-motor cooperative speed regulation and energy efficiency optimization control method and device

    CN120262966A

Cited By

  • Wireless sensor dynamic voltage regulation method and system based on load current prediction

    CN121173076A

  • Motor three-phase current sampling method, system and device and storage medium

    CN122026764A