A method, system, and related device for controlling a motor based on an adaptive algorithm.

By extracting motor data features through adaptive algorithms and deep learning models and dynamically adjusting PID controller parameters, the problem of speed fluctuation when the motor load changes suddenly in the existing technology is solved, and precise dynamic control of the motor is achieved, improving responsiveness and stability.

CN120915200BActive Publication Date: 2026-07-17雷文斯(深圳)科技有限公司

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
雷文斯(深圳)科技有限公司
Filing Date
2025-08-04
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

Existing PID control strategies cannot predict in advance 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

An adaptive algorithm combined with a deep learning model is used to extract the dynamic time-frequency features of motor data through empirical mode decomposition and marginal spectrum analysis, generate multi-dimensional feature vectors, construct a target prediction model, and dynamically adjust the weights and parameters of the PID controller 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 CN120915200B_ABST
    Figure CN120915200B_ABST
Patent Text Reader

Abstract

This application discloses a method, system, and related apparatus for controlling a motor based on an adaptive algorithm, used to improve the accuracy of motor control. The method includes: acquiring initial data of the motor; decomposing the initial data into intrinsic mode function (IMF) components and performing time-frequency transformation on the IMF components; extracting dynamic time-frequency features of the IMF components and performing cross-band weighted fusion of the dynamic time-frequency features through a preset attention weighting mechanism to generate a multi-dimensional feature vector; inputting the multi-dimensional feature vector into a preset deep learning model and constructing a target prediction model by combining a loss function and an adaptive momentum optimization algorithm; transmitting the target prediction model to the motor's analytical module to obtain the load change trend and confidence level; dynamically adjusting the weight ratio of the PID controller according to the load change trend and confidence level, and optimizing the parameters of the adjusted units using gradient descent; and dynamically controlling the motor based on the PID controller.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of motor technology, and in particular to a method, system and related device for controlling a motor based on an adaptive algorithm. Background Technology

[0002] With the deepening advancement of intelligent manufacturing, the development of motor control technology is crucial, as the core power unit of industrial production and automated equipment. From drive motors in new energy vehicles to servo motors in industrial robots, from spindle motors in CNC machine tools to micro motors in smart homes, the application scenarios of motors in various fields are constantly expanding and becoming increasingly complex. In these scenarios, motors not only need to cope with conventional workloads, but also frequently face sudden load changes caused by equipment start-up and shutdown, changes in workpiece size, and production task switching, as well as disturbances caused by factors such as environmental temperature and electromagnetic interference. Therefore, high requirements are needed to achieve rapid response, stability, and accuracy in motor control.

[0003] In existing technologies, motor regulation is typically achieved using a feedback-based PID control strategy. Specifically, this involves first collecting actual operating data of the motor and feeding this data back to the PID controller. This data is then compared to a pre-set target value to calculate the error between the actual output value and the target setpoint. The proportional, integral, and derivative units of the PID controller are then used to process this error. Finally, the motor is adjusted based on the processed data, thereby achieving regulation of the motor's operating state.

[0004] However, when the motor encounters extreme conditions such as inertial shock during equipment startup, production task switching, or environmental changes that cause sudden load changes, using a PID control strategy based on feedback mechanisms to regulate the motor can only start adjusting parameters after the actual error occurs. This can lead to drastic fluctuations in motor speed and large oscillations in control output, thereby reducing the stability and reliability of equipment operation. For example, in industrial automated production lines, lagging adjustment can cause production rhythm disorder and seriously affect the dimensional accuracy of precision machined parts. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a method, system, and related apparatus for controlling a motor based on an adaptive algorithm.

[0006] The technical solution provided in this application is described below:

[0007] The first aspect of this application provides a method for controlling a motor based on an adaptive algorithm, the method comprising:

[0008] Acquire initial data of the motor, including current data, position data, power data, and vibration data;

[0009] The initial data is decomposed into intrinsic mode function components using a preset empirical mode decomposition method, and the intrinsic mode function components are then subjected to time-frequency transformation using a preset marginal spectrum analysis method.

[0010] The dynamic time-frequency features of the intrinsic mode function components that have completed time-frequency changes are extracted, and the dynamic time-frequency features are weighted and fused across frequency bands through a preset attention weighting mechanism to generate a multi-dimensional state feature vector;

[0011] The multidimensional feature vector is input into a preset deep learning model, and a target prediction model is constructed by combining a preset loss function and a preset adaptive momentum optimization algorithm.

[0012] The target prediction model is transmitted to the parsing module of the motor for inference and parsing to obtain the load change trend and confidence level;

[0013] The weight ratios of the proportional, integral, and derivative units of the preset PID controller are dynamically adjusted based on the load change trend and the confidence level, and the parameters of the adjusted proportional, integral, and derivative units are optimized using a preset gradient descent method.

[0014] The motor is dynamically controlled based on the preset PID controller with optimized parameters.

[0015] Optionally, after optimizing the parameters of the proportional unit, the integral unit, and the differential unit with adjusted proportional weights using a preset gradient descent method, the method further includes:

[0016] The preset PID controller with optimized parameters is transmitted to the preset test mirror model for testing, and a test score is generated based on the performance scoring criteria determined according to user requirements.

[0017] Determine whether the test score is less than the preset score threshold;

[0018] If not, then the step of dynamically controlling the motor based on the preset PID controller with optimized parameters is executed.

[0019] Optionally, after determining whether the test score is lower than the preset score threshold, the method further includes:

[0020] If so, the error gradient output by the test mirror model is obtained, and the parameters of the proportional unit, integral unit and derivative unit of the preset PID controller are adjusted based on the error gradient. The test score is then retested and generated until the test score is greater than or equal to the preset score threshold.

[0021] Optionally, the proportion of the weights of the proportional unit, integral unit, and derivative unit of the preset PID controller that are dynamically adjusted according to the load change trend and the confidence level is expressed by the following formula:

[0022] ;

[0023] in, This 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.

[0024] 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:

[0025] The multidimensional feature vector is divided into training feature vector and test feature vector;

[0026] The training feature vectors are input into the preset deep learning model for training to obtain an initial prediction model;

[0027] The initial prediction model is used to verify its accuracy using the test feature vector, and a verification index value is obtained.

[0028] 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.

[0029] Optionally, the backpropagation gradient update is represented by the following formula:

[0030] ;

[0031] 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.

[0032] Optionally, after acquiring the initial data of the motor, the method further includes:

[0033] The initial data is preprocessed;

[0034] The preprocessing of the initial data includes:

[0035] 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.

[0036] The removed current data, position data, power data, and vibration data are normalized using a preset quantization algorithm;

[0037] The outliers in the normalized current data, position data, power data, and vibration data are corrected according to the Raida criterion.

[0038] A second aspect of this application provides a system for controlling a motor based on an adaptive algorithm, the system comprising:

[0039] An acquisition unit is used to acquire initial data of the motor, including current data, position data, power data, and vibration data.

[0040] The transformation unit 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.

[0041] The generation unit 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.

[0042] The construction unit is used to input the multidimensional feature vector into a preset deep learning model and combine it with a preset loss function and a preset adaptive momentum optimization algorithm to construct a target prediction model;

[0043] The parsing unit 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;

[0044] An optimization unit is used to dynamically adjust the weight ratios of the proportional unit, integral unit, and derivative unit of a preset PID controller according to the load change trend and the confidence level, and to optimize the parameters of the proportional unit, integral unit, and derivative unit whose weight ratios have been adjusted using a preset gradient descent method.

[0045] The control unit is used to dynamically control the motor based on the preset PID controller with optimized parameters.

[0046] Optionally, a judgment unit may also be included, specifically used for:

[0047] The preset PID controller with optimized parameters is transmitted to the preset test mirror model for testing, and a test score is generated based on the performance scoring criteria determined according to user requirements.

[0048] Determine whether the test score is less than the preset score threshold;

[0049] If not, then the step of dynamically controlling the motor based on the preset PID controller with optimized parameters is executed.

[0050] Optionally, an adjustment unit may also be included, specifically for:

[0051] If so, the error gradient output by the test mirror model is obtained, and the parameters of the proportional unit, integral unit and derivative unit of the preset PID controller are adjusted based on the error gradient. The test score is then retested and generated until the test score is greater than or equal to the preset score threshold.

[0052] Optionally, the proportion of the weights of the proportional unit, integral unit, and derivative unit of the preset PID controller that are dynamically adjusted according to the load change trend and the confidence level is expressed by the following formula:

[0053] ;

[0054] in, This 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.

[0055] Optionally, the building block is specifically used for:

[0056] The multidimensional feature vector is divided into training feature vector and test feature vector;

[0057] The training feature vectors are input into the preset deep learning model for training to obtain an initial prediction model;

[0058] The initial prediction model is used to verify its accuracy using the test feature vector, and a verification index value is obtained.

[0059] 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.

[0060] Optionally, the backpropagation gradient update is represented by the following formula:

[0061] ;

[0062] 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.

[0063] Optionally, it also includes a processing unit, specifically used for:

[0064] The initial data is preprocessed;

[0065] The preprocessing of the initial data includes:

[0066] 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.

[0067] The removed current data, position data, power data, and vibration data are normalized using a preset quantization algorithm;

[0068] The outliers in the normalized current data, position data, power data, and vibration data are corrected according to the Raida criterion.

[0069] A third aspect of this application provides a device for controlling a motor based on an adaptive algorithm, the device comprising:

[0070] Processor, memory, input / output units, and bus;

[0071] The processor is connected to the memory, the input / output unit, and the bus;

[0072] The memory stores a program, which the processor invokes to execute the first aspect and any optional method of the first aspect.

[0073] A fourth aspect of this application provides a computer-readable storage medium on which a program is stored, which, when executed on a computer, performs the first aspect and any optional method of the first aspect.

[0074] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:

[0075] This application achieves precise dynamic control of a motor under complex load surge scenarios by combining adaptive algorithms with deep learning models. First, initial data of the motor, including current, position, power, and vibration data, is acquired and decomposed into intrinsic mode function (IMF) components using empirical mode decomposition (EMD). Marginal spectrum analysis is then used for time-frequency transformation to more clearly reflect the dynamic characteristics of the motor's operation. After time-frequency transformation, the dynamic time-frequency features of the IMF components are extracted and weighted across frequency bands using an attention-weighted mechanism to generate a multidimensional feature vector. This multidimensional feature vector accurately captures subtle signal changes before load surges. Subsequently, the multidimensional feature vector is input into a pre-defined deep learning model, and an adaptive momentum optimization algorithm is used to construct a target prediction model. This model can predict load change trends and confidence levels in advance, improving upon existing feedback-based control to proactive control. Finally, the weight ratios of each unit in the PID controller are dynamically adjusted based on the prediction results, and parameters are optimized using gradient descent to achieve real-time calibration of the motor's operating state. The entire solution avoids the speed fluctuations and control oscillations caused by the lag in adjustment when the load changes suddenly in traditional PID control, and improves the fast response, stability and accuracy of motor control. Attached Figure Description

[0076] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0077] Figure 1 A schematic flowchart of an embodiment of the method for controlling a motor based on an adaptive algorithm provided in this application;

[0078] Figure 2 This is a schematic flowchart of another embodiment of the method for controlling a motor based on an adaptive algorithm provided in this application;

[0079] Figure 3 This is a schematic flowchart of an embodiment of the process of preprocessing initial data in the method for controlling a motor based on an adaptive algorithm provided in this application;

[0080] Figure 4 A schematic diagram of an embodiment of the system for controlling a motor based on an adaptive algorithm provided in this application;

[0081] Figure 5 This is a schematic diagram of an embodiment of the device for controlling a motor based on an adaptive algorithm provided in this application. Detailed Implementation

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

[0083] It should be noted that the method, apparatus, and related devices for controlling a motor based on an adaptive algorithm provided in this application can be applied to terminals, systems, and servers. For example, a terminal can be a smartphone, computer, tablet, smart TV, smartwatch, portable computer, or a desktop computer, etc. For ease of explanation, this application uses a terminal as the execution subject for illustrative purposes.

[0084] Please see Figure 1 This application first provides an embodiment of a method for controlling a motor based on an adaptive algorithm, which includes:

[0085] S101. Obtain the initial data of the motor, including current data, position data, power data, and vibration data;

[0086] In this embodiment, data acquisition equipment is used to collect current, position, power, and vibration data during motor operation. Current data directly reflects the energy consumption of the motor during operation; different loads cause corresponding changes in current. Position data records the rotor's position information, used to determine the motor's operating status and position accuracy. Power data reflects the motor's energy conversion efficiency, thereby evaluating motor performance. Vibration data monitors the motor's mechanical state. By collecting multi-dimensional initial data, a foundation of raw information can be provided for subsequent comprehensive analysis of the motor's operating status, enabling subsequent analysis to comprehensively consider the motor's actual situation from multiple perspectives and avoid the limitations of single-data sets.

[0087] S102. Use the preset empirical mode decomposition method to decompose the initial data into intrinsic mode function components, and combine the preset marginal spectrum analysis method to perform time-frequency transformation on the intrinsic mode function components;

[0088] In this embodiment, the acquired initial motor data is first decomposed using a preset empirical mode decomposition method. Specifically, the empirical mode decomposition method, based on the local features of the signal, continuously filters and separates feature components at different levels. It gradually decomposes complex, nonlinear, and non-stationary initial data into several intrinsic mode function components, each of which represents a feature at a different time scale.

[0089] After decomposition, a time-frequency transformation is performed on these intrinsic mode function components using a pre-defined marginal spectrum analysis method. Marginal spectrum analysis delves into these components from a frequency perspective, uncovering hidden dynamic characteristics within the data. Specifically, it transforms the intrinsic mode function components into a three-dimensional distribution of "time-frequency-energy," allowing the initial data to present the frequency characteristic changes during motor operation in a more intuitive and clear manner.

[0090] S103. Extract the dynamic time-frequency features of the intrinsic mode function components that have completed time-frequency changes, and 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.

[0091] In this embodiment, by extracting dynamic time-frequency features and performing cross-band weighted fusion, key features sensitive to load changes can be effectively highlighted, while redundant or secondary information is discarded. Specifically, after completing the time-frequency transformation of the intrinsic mode function components, dynamic time-frequency features are extracted from these transformed intrinsic mode function components. For example, subtle signal features that reflect load changes, such as energy distribution in different frequency bands and entropy values ​​of time-frequency distributions, are extracted.

[0092] Furthermore, a pre-defined attention weighting mechanism is used to process the extracted dynamic time-frequency features. The attention weighting mechanism evaluates features in different frequency bands and assigns corresponding weights based on the importance of each frequency band feature in reflecting load changes. These dynamic time-frequency features are then fused across frequency bands with weights to generate a multi-dimensional feature vector. The generated multi-dimensional feature vector can accurately capture subtle signals before load abrupt changes, providing high-quality feature data for subsequent predictions.

[0093] S104. Input the multi-dimensional feature vector into the preset deep learning model, and combine it with the preset loss function and the preset adaptive momentum optimization algorithm to construct the target prediction model;

[0094] In this embodiment, the generated multidimensional feature vector is used as input to a preset deep learning model. The deep learning model here can be an LSTM model, Transformer model, or other models suitable for processing time-series data and feature learning; no specific limitation is made here.

[0095] While inputting multidimensional feature vectors into a preset deep learning model, a preset loss function is used to measure the difference between the model's prediction results and the actual situation. A preset adaptive momentum optimization algorithm is used to automatically adjust the learning rate. During the training process, the parameters of the preset deep learning model are continuously optimized. 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 and confidence of load changes.

[0096] By learning and analyzing multi-dimensional feature vectors through a pre-set deep learning model, the changing trend of motor load 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 lag adjustment, significantly improve the fast response, stability and accuracy of motor control, and provide a reliable guarantee for the efficient operation of motors in complex load scenarios.

[0097] S105. The target prediction model is transmitted to the motor's parsing module for inference and parsing to obtain the load change trend and confidence level.

[0098] After constructing the target prediction model, it is transmitted to the motor's analysis module. Upon receiving the target prediction model, the analysis module collects relevant motor operating data in real time and inputs it into the model. Because the target prediction model has been trained on a large amount of data, it has learned the inherent mapping relationship between the motor's initial data and load changes. The analysis module calls the target prediction model, substitutes the motor's real-time operating data into this mapping relationship, and thus infers and analyzes the motor's load change trend. Simultaneously, it outputs the confidence level of the inferred load change trend. The obtained load change trend and confidence level provide a clear basis for subsequent motor control. Compared to control methods that rely solely on real-time feedback, this ability to obtain load change trends in advance allows the motor control system to formulate response strategies ahead of time, avoiding motor instability caused by delayed adjustments.

[0099] S106. Dynamically adjust the weight ratios of the proportional, integral, and derivative units of the preset PID controller according to the load change trend and confidence level, and optimize the parameters of the adjusted proportional, integral, and derivative units using the preset gradient descent method.

[0100] In this embodiment, the weights of each unit in the preset PID controller are first adjusted according to the load change trend and confidence level. The proportional unit in the preset PID controller can respond quickly to errors, the integral unit can eliminate steady-state errors, and the derivative unit can predict error change trends.

[0101] Specifically, the current motor operating state is determined based on the load change trend. When the load change trend is upward, the weight of the proportional unit is appropriately increased to accelerate the motor response. When the load change trend is about to appear or has already shown an overshoot trend, the weight of the derivative unit is adjusted. When the load change trend is stable, the weight of the integral unit is decreased to reduce the accumulation of steady-state error. Subsequently, the error function is continuously calculated using a preset gradient descent method. Along the direction of the fastest descent of the error function, the parameters of the proportional unit, integral unit, and derivative unit are iteratively optimized to gradually reduce the error and bring the parameters of the preset PID controller to the optimal state.

[0102] S107. Dynamic control of the motor based on a preset PID controller with optimized parameters.

[0103] In this embodiment, after adjusting the weights and optimizing the parameters of the proportional, integral, and derivative units of the preset PID controller, the optimized preset PID controller outputs a control signal. This control signal is transmitted to the motor drive module, which controls the motor according to the control signal, thereby achieving dynamic regulation of the motor and enabling it to adapt to constantly changing load demands.

[0104] This embodiment achieves precise dynamic control of a motor under complex load surge scenarios by combining adaptive algorithms with deep learning models. First, initial data from the motor, including current, position, power, and vibration data, is acquired and decomposed into intrinsic mode function (IMF) components using empirical mode decomposition (EMD). Marginal spectrum analysis is then used for time-frequency transformation to more clearly reflect the dynamic characteristics of the motor's operation. After time-frequency transformation, the dynamic time-frequency features of the IMF components are extracted and weighted across frequency bands using an attention-weighted mechanism to generate a multidimensional feature vector. This multidimensional feature vector accurately captures subtle signal changes before load surges. Subsequently, the multidimensional feature vector is input into a pre-defined deep learning model, and an adaptive momentum optimization algorithm is used to construct a target prediction model. This model can predict load change trends and confidence levels in advance, improving upon existing feedback-based control to proactive control. Finally, the weight ratios of each unit in the PID controller are dynamically adjusted based on the prediction results, and parameters are optimized using gradient descent to achieve real-time calibration of the motor's operating state. The entire solution avoids the speed fluctuations and control oscillations caused by the lag in adjustment when the load changes suddenly in traditional PID control, and improves the fast response, stability and accuracy of motor control.

[0105] Please see Figure 2 This application also provides another embodiment of a method for controlling a motor based on an adaptive algorithm, which includes:

[0106] S201. Obtain the initial data of the motor, including current data, position data, power data, and vibration data;

[0107] S202. Use the preset empirical mode decomposition method to decompose the initial data into intrinsic mode function components, and combine the preset marginal spectrum analysis method to perform time-frequency transformation on the intrinsic mode function components;

[0108] S203. Extract the dynamic time-frequency features of the intrinsic mode function components that have completed time-frequency changes, and 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;

[0109] S204. Input the multidimensional feature vector into the preset deep learning model, and combine it with the preset loss function and the preset adaptive momentum optimization algorithm to construct the target prediction model;

[0110] In this embodiment, steps S201 to S204 are similar to steps S101 to S104 in the previous embodiment, and will not be described again here.

[0111] S205. Divide the multidimensional feature vector into training feature vector and test feature vector;

[0112] In this embodiment, to effectively train the subsequent preset deep learning model, the multidimensional feature vectors need to be divided into training feature vectors and test feature vectors. The division process uses a random allocation ratio of 8:2 or 7:3, ensuring that the majority of the multidimensional feature vectors are used as training feature vectors and a smaller portion as test feature vectors. This division simulates a real-world application scenario: the training feature vectors are used to teach the model the relationship between features and load changes; while the test feature vectors are used to test the predictive ability of the trained model and evaluate its performance on unknown data.

[0113] This division method ensures that the subsequent preset deep learning model can fully learn the feature patterns during the training process, and at the same time, it can verify the generalization ability of the prediction model after training through the testing phase, thus avoiding overfitting of the prediction model.

[0114] S206. Input the training feature vector into the preset deep learning model for training to obtain the initial prediction model;

[0115] In this embodiment, the predefined training feature vectors are input into a preset deep learning model for training. During training, the neural network structure within the preset deep learning model processes the training feature vectors layer by layer. Starting from the input layer of the neural network structure, the training feature vectors are extracted, transformed, and combined through the hidden layers of the neural network structure, and finally output at the output layer of the neural network structure.

[0116] Each time a training feature vector is input, the preset deep learning model calculates and outputs a prediction result based on the parameter settings adjusted after the previous input. By repeatedly inputting training feature vectors and adjusting parameters, the preset deep learning model gradually learns the mapping relationship between training feature vectors and load changes, and finally obtains an initial prediction model that can preliminarily predict the trend of load changes.

[0117] S207. Use the test feature vector to verify the accuracy of the initial prediction model and obtain the verification index value;

[0118] In this embodiment, after obtaining the initial prediction model, the accuracy of the initial prediction model is verified using the previously divided test feature vectors. Specifically, the test feature vectors are input into the initial prediction model, which processes the test feature vectors according to the trained parameters and structure, and outputs the prediction results. Then, the prediction results of the initial prediction model are compared with the actual load changes to obtain the verification index value.

[0119] Using test feature vectors to verify the accuracy of the initial prediction model and obtain verification index values ​​provides an objective and quantitative standard for evaluating the performance of the initial prediction model. By verifying the index values, we can not only clearly understand the prediction capability of the initial prediction model in real-world application scenarios, but also determine whether the initial prediction model meets actual requirements, thus avoiding the application of poorly performing initial prediction models to actual motor control and causing control errors.

[0120] S208. 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.

[0121] In this embodiment, the initial prediction model is first updated using backpropagation gradients based on the validation index value and a preset loss function. The backpropagation algorithm calculates the gradients of each parameter in the initial prediction model based on the prediction error reflected by the validation index value. The gradient represents the degree and direction of the influence of parameter changes on the error. Then, the parameters of the initial prediction model are adjusted along the opposite direction of the gradient to reduce the error.

[0122] During the backpropagation gradient update process, the learning rate is automatically adjusted by combining the information from historical gradients with the preset adaptive momentum optimization algorithm, which can update the parameters of the initial prediction model more efficiently.

[0123] Specifically, the backpropagation gradient update is represented by the following formula:

[0124] ;

[0125] in, This represents the matrix parameters in the initial prediction model. This represents the learning rate of the initial prediction model. Indicates 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 indicates the verification index value.

[0126] By using backpropagation gradient updates and iterative parameter adjustments, the parameters of the initial prediction model are gradually optimized, making the prediction results of the initial model increasingly closer to the actual load changes, ultimately resulting in a target prediction model that can accurately predict load changes. Compared to the initial prediction model, the target prediction model provides more accurate trend judgments and more reliable results when dealing with actual motor load change predictions.

[0127] S209. The target prediction model is transmitted to the motor's parsing module for inference and analysis to obtain the load change trend and confidence level.

[0128] S210. Dynamically adjust the weight ratios of the proportional, integral, and derivative units of the preset PID controller according to the load change trend and confidence level, and optimize the parameters of the adjusted proportional, integral, and derivative units using the preset gradient descent method.

[0129] Specifically, the weights of the proportional, integral, and derivative units of the preset PID controller are dynamically adjusted based on the load change trend and confidence level, as expressed by the following formula:

[0130] ;

[0131] in, Indicates 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 load change. Indicates the weight of the integration unit. Indicates the confidence level. Represents the proportional weight of the differential unit. The second derivative represents the trend of load change.

[0132] In this embodiment, steps S209 to S210 are similar to steps S105 to S106 in the previous embodiment, and will not be described again here.

[0133] S211. Transfer the pre-set PID controller with optimized parameters to the pre-set test mirror model for testing, and generate a test score based on the performance scoring criteria determined by the user's requirements.

[0134] In this embodiment, to clearly determine whether the preset PID controller meets the actual operating requirements, after optimizing the parameters of the preset PID controller, it is transferred to a preset test mirror model. In the test mirror model, the model simulates various complex operating conditions of the motor, placing the optimized preset PID controller under these complex conditions.

[0135] During operation, the test mirror model collects various output data from the preset PID controller in real time, such as the adjustment effect of the control signal, motor speed, and torque response. Simultaneously, based on performance scoring criteria determined according to user requirements, the performance of the preset PID controller is evaluated from multiple dimensions. Specifically, the performance scoring criteria cover indicators such as response speed, control accuracy, and stability. For example, in a certain operating condition, a preset PID controller with fast response speed, high control accuracy, and stable operation will receive a higher score. Through comprehensive consideration of various indicators, a final test score is generated, which primarily quantitatively evaluates the performance of the optimized preset PID controller.

[0136] S212. Determine whether the test score is less than the preset score threshold;

[0137] In this embodiment, after generating the test score, the test score is compared with a preset score threshold. The preset score threshold is a standard value set in advance based on the actual operating requirements of the motor and the control objectives. It represents the minimum performance index that the preset PID controller can meet the normal operating 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 index for normal operation; 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 index for normal operation.

[0138] If the test score is determined to be less than the preset score threshold, then step S214 is executed; if the test score is determined to be greater than the preset score threshold, then step S213 is executed.

[0139] S213. Perform the steps of dynamically controlling the motor based on the preset PID controller with optimized parameters.

[0140] In this embodiment, step S213 is similar to step S107 in the previous embodiment, and will not be described again here.

[0141] S214. 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.

[0142] In this embodiment, when the test score is determined to be less than a preset score threshold, it indicates that the performance of the currently optimized preset PID controller does not meet the requirements and further adjustments are needed. First, the error gradient output by the test mirror model is obtained. The error gradient reflects the degree and direction of deviation of various performance indicators of the preset PID controller. Based on the error gradient, the parameters of the proportional unit, integral unit, and derivative unit of the preset PID controller are further adjusted.

[0143] During the adjustment process, the parameters of the corresponding units are increased or decreased according to the magnitude and direction of the error gradient to reduce the error. After the parameters are adjusted, the preset PID controller is transferred to the test mirror model again for testing, and the test score is regenerated according to the performance scoring standard.

[0144] If the adjusted test score is still less than the preset score threshold, the process of acquiring the error gradient, adjusting parameters, and retesting is repeated until the test score is greater than or equal to the preset score threshold, thus ensuring that the performance of the preset PID controller meets the expected requirements. This adjustment mechanism can precisely improve the performance of the preset PID controller, ensuring that the parameters of each unit of the preset PID controller are continuously optimized until the motor operation requirements are met.

[0145] S215. Dynamic control of the motor based on a preset PID controller with optimized parameters.

[0146] In this embodiment, step S215 is similar to step S107 in the previous embodiment, and will not be described again here.

[0147] In step S201 above, after obtaining the initial data of the motor, it is necessary to determine whether to preprocess the initial data. Please refer to [link to relevant documentation]. Figure 3 , Figure 3 An embodiment of the method for controlling a motor based on an adaptive algorithm provided in this application, which involves preprocessing initial data, includes:

[0148] S301. Remove high-frequency noise from current data, position data, vibration data, and vibration data by using a preset sliding window mean filter or wavelet transform method.

[0149] The initial data of motor operation is susceptible to noise from electromagnetic interference, mechanical vibration, and other factors during acquisition, which can interfere with subsequent analysis if left untreated. In this embodiment, after acquiring the motor's current, position, power, and vibration data, the high-frequency noise present in these data is processed using either a preset sliding window mean filter or a wavelet transform method. The preset sliding window mean filter weakens high-frequency fluctuations through local averaging, while the wavelet transform method selectively removes noise frequency components by utilizing the differences in signal and noise characteristics at different frequencies.

[0150] Specifically, using a preset sliding window mean filtering method involves setting a fixed-length sliding window on the data sequences of current, position, and vibration data. The sliding window slides point by point on the data sequence, calculating the average value of the data within the window each time, and using this average value as the new value for the center data point of the window, thereby achieving the effect of removing high-frequency noise. Using wavelet transform, the current, position, power, and vibration data need to be decomposed into wavelet coefficients of different frequencies. High-frequency noise usually corresponds to larger high-frequency wavelet coefficients. By setting a threshold, the high-frequency wavelet coefficients are processed, setting those smaller than the threshold to zero or shrinking them. Then, the processed high-frequency wavelet coefficients are used for reconstruction to obtain the initial data after removing high-frequency noise. After removing high-frequency noise, the initial data can more accurately reflect the motor's operating state, providing a reliable data foundation for load change trend prediction and precise motor control.

[0151] S302, Normalize the removed current data, position data, power data and vibration data using a preset quantization algorithm;

[0152] In this embodiment, after removing high-frequency noise from the initial data, a preset quantization algorithm is used to normalize the removed current data, position data, power data, and vibration data. Specifically, the normalization process requires first calculating the mean and standard deviation of the current data, position data, power data, and vibration data respectively, and then subtracting the mean from each data point and dividing by the standard deviation to make the initial data conform to a standard normal distribution.

[0153] Normalized initial data are at the same scale, enabling the pre-defined deep learning model to better learn data features and improve the accuracy of load change trend prediction.

[0154] S303. Correct outliers in the normalized current, position, power, and vibration data according to the Raida criterion.

[0155] In this embodiment, after normalizing the initial data to remove high-frequency noise, the initial data follows a normal distribution. Therefore, outliers in the current, position, power, and vibration data can be corrected according to the Laida criterion. Correcting outliers in the initial data based on the Laida criterion avoids interference from abnormal data in the motor operation analysis.

[0156] In the actual correction process, the mean and standard deviation of the current, location, power, and vibration data are first calculated. The data sequence is then traversed to identify all data points that deviate from the mean by more than three times the standard deviation. For these outliers, the mean of the adjacent normal data is used as a substitute, or linear interpolation is performed based on the data trend.

[0157] 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:

[0158] The acquisition unit 401 is used to acquire the initial data of the motor, including current data, position data, power data and vibration data;

[0159] 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.

[0160] 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.

[0161] 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.

[0162] 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;

[0163] 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.

[0164] The control unit 407 is used to dynamically control the motor based on a preset PID controller with optimized parameters.

[0165] Optionally, a judgment unit 408 is also included, specifically used for:

[0166] 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.

[0167] Determine if the test score is less than a preset score threshold;

[0168] If not, then the steps of dynamically controlling the motor based on the preset PID controller with optimized parameters will be executed.

[0169] Optionally, an adjustment unit 409 is also included, specifically for:

[0170] 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.

[0171] Optionally, the weights of the proportional, integral, and derivative units of the preset PID controller can be dynamically adjusted based on the load change trend and confidence level, as expressed by the following formula:

[0172] ;

[0173] in, Indicates 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 load change. Indicates the weight of the integration unit. Indicates the confidence level. Represents the proportional weight of the differential unit. The second derivative represents the trend of load change.

[0174] Optionally, building unit 404 is specifically used for:

[0175] The multidimensional feature vector is divided into training feature vector and test feature vector;

[0176] The training feature vectors are input into a pre-defined deep learning model for training to obtain an initial prediction model;

[0177] The initial prediction model is validated using test feature vectors to obtain validation index values.

[0178] Based on the validation 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.

[0179] Optionally, backpropagation gradient updates are represented by the following formula:

[0180] ;

[0181] in, This represents the matrix parameters in the initial prediction model. This represents the learning rate of the initial prediction model. Indicates 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 indicates the verification index value.

[0182] Optionally, it also includes a processing unit 410, specifically used for:

[0183] Preprocess the initial data;

[0184] Preprocessing of the initial data includes:

[0185] High-frequency noise in current data, position data, vibration data, and vibration data is removed by using a preset sliding window mean filter or wavelet transform method.

[0186] The removed current data, position data, power data, and vibration data are normalized using a preset quantization algorithm;

[0187] Outliers in the normalized current, location, power, and vibration data were corrected according to the Raida criterion.

[0188] For details on the implementation method, please refer to [link / reference]. Figures 1-3 Examples will not be described in detail here.

[0189] This application also provides a device for controlling a motor based on an adaptive algorithm; please refer to [link to relevant documentation]. Figure 5 , Figure 5 An embodiment of the device for controlling a motor based on an adaptive algorithm provided in this application includes:

[0190] Processor 501, memory 502, input / output unit 503, bus 504;

[0191] The processor 501 is connected to the memory 502, the input / output unit 503, and the bus 504;

[0192] The memory 502 stores a program, and the processor 501 calls the program to execute any of the methods described above.

[0193] This application also relates to a computer-readable storage medium on which a program is stored, characterized in that, when the program is run on a computer, it causes the computer to perform any of the methods described above.

[0194] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0195] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0196] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0197] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0198] If the integrated unit is implemented as a software functional 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 solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for controlling a motor based on an adaptive algorithm, characterized in that, include: Acquire initial data of the motor, including current data, position data, power data, and vibration data; The initial data is decomposed into intrinsic mode function components using a preset empirical mode decomposition method, and the intrinsic mode function components are then subjected to time-frequency transformation using a preset marginal spectrum analysis method. The dynamic time-frequency features of the intrinsic mode function components that have completed time-frequency changes are extracted, and the dynamic time-frequency features are weighted and fused across frequency bands through a preset attention weighting mechanism to generate a multi-dimensional state feature vector; The multidimensional feature vector is input into a preset deep learning model, and a target prediction model is constructed by combining a preset loss function and a preset adaptive momentum optimization algorithm. The target prediction model is transmitted to the parsing module of the motor for inference and parsing to obtain the load change trend and confidence level; The weight ratios of the proportional, integral, and derivative units of the preset PID controller are dynamically adjusted based on the load change trend and the confidence level, and the parameters of the adjusted proportional, integral, and derivative units are optimized using a preset gradient descent method. The motor is dynamically controlled based on the preset PID controller with optimized parameters.

2. The method according to claim 1, characterized in that, After optimizing the parameters of the proportional unit, the integral unit, and the differential unit, whose proportional weights have been adjusted, using a preset gradient descent method, the method further includes: The preset PID controller with optimized parameters is transmitted to the preset test mirror model for testing, and a test score is generated based on the performance scoring criteria determined according to user requirements. Determine whether the test score is less than a preset score threshold; If not, then the step of dynamically controlling the motor based on the preset PID controller with optimized parameters is executed.

3. The method according to claim 2, characterized in that, After determining whether the test score is lower than the preset score threshold, the method further includes: If so, the error gradient output by the test mirror model is obtained, and the parameters of the proportional unit, integral unit and derivative unit of the preset PID controller are adjusted based on the error gradient. The test score is then retested and generated until the test score is greater than or equal to the preset score threshold.

4. The method according to claim 1, characterized in that, The proportions of the weights of the proportional, integral, and derivative units of the preset PID controller, which are dynamically adjusted according to the load change trend and the confidence level, are expressed by the following formula: ; in, This 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.

5. The method according to claim 1, characterized in that, 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.

6. The method according to claim 5, characterized in that, The backpropagation gradient update is expressed 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.

7. The method according to any one of claims 1 to 6, characterized in that, After acquiring the initial data of the motor, the process also 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. The removed current data, position data, power data, and vibration data are normalized using a preset quantization algorithm; The outliers in the normalized current data, position data, power data, and vibration data are corrected according to the Raida criterion.

8. A system for controlling a motor based on an adaptive algorithm, characterized in that, include: An acquisition unit is used to acquire initial data of the motor, including current data, position data, power data, and vibration data. The transformation unit 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 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 construction unit is used to input the multidimensional feature vector into a preset deep learning model and combine it with a preset loss function and a preset adaptive momentum optimization algorithm to construct a target prediction model; The parsing unit 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; An optimization unit is used to dynamically adjust the weight ratios of the proportional unit, integral unit, and derivative unit of a preset PID controller according to the load change trend and the confidence level, and to optimize the parameters of the proportional unit, integral unit, and derivative unit whose weight ratios have been adjusted using a preset gradient descent method. The control unit is used to dynamically control the motor based on the preset PID controller with optimized parameters.

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

10. A computer-readable storage medium having a program stored thereon, the program performing the method as claimed in any one of claims 1 to 7 when executed on a computer.