Motor stator and rotor speed regulation control method and system based on reinforcement learning

By employing a reinforcement learning-based method for motor stator and rotor speed control, defining state vectors and control actions hierarchically, and designing a safety risk cost function and a continuous reward function, the problems of hierarchical operating condition characteristic matching and safety risk in motor speed control are solved, achieving higher speed control reliability and effectiveness.

CN121567003APending Publication Date: 2026-02-24WENLING XIEDA MECHANICAL & ELECTRICAL PARTS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511557554.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing motor stator and rotor speed control methods cannot match the characteristics of hierarchical operating conditions, ignore safety risks, and lead to rotor overheating failures and poor speed control reliability. Sudden changes in control quantities cause severe torque fluctuations, resulting in poor adaptability to operating conditions and unsatisfactory speed control performance.

Method used

A reinforcement learning-based approach is adopted to define state vectors and control actions hierarchically, design safety risk cost functions and continuous reward functions, and dynamically match motor operating conditions and optimize speed regulation strategies through smooth filtering of control inputs and smooth switching of multiple levels.

Benefits of technology

It improves the reliability and effectiveness of motor speed control, avoids rotor overheating and torque fluctuations, and enhances adaptability and safety under operating conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121567003A_ABST
    Figure CN121567003A_ABST
Patent Text Reader

Abstract

The invention discloses a motor stator and rotor speed regulation control method and system based on reinforcement learning. The method comprises the steps of data acquisition, speed regulation strategy optimization, speed regulation track correction and real-time speed regulation execution. The invention belongs to the field of intelligent control, and particularly relates to a motor stator and rotor speed regulation control method and system based on reinforcement learning. Considering the working condition optimization amplitude and the safety improvement amplitude based on a continuous reward function; through self-adaptive weight design, the control priority of the motor under multiple working conditions is dynamically matched, and the safety of motor control is improved; torque abrupt change is inhibited through control quantity smooth filtering; through multi-level smooth switching, switching impact is avoided; the transition time constant is dynamically adjusted according to the real-time rotating speed change rate, so that the transition speed is dynamically matched with the working condition, and dynamic response lag and transition disturbance aggravation are avoided; and the speed regulation control effect is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent control technology, specifically to a method and system for motor stator and rotor speed control based on reinforcement learning. Background Technology

[0002] The stator-rotor speed control method for electric motors changes the motor speed by adjusting parameters such as input voltage, current, and frequency to control the electromagnetic coupling between the stator and rotor. However, general stator-rotor speed control methods often fail to match the hierarchical operating conditions of stator-rotor speed regulation, neglect safety risks associated with stator-rotor speed regulation, leading to rotor overheating failures and poor reliability of speed control. Furthermore, these methods suffer from sudden changes in control inputs causing drastic torque fluctuations, poor adaptability to operating conditions, and abrupt parameter switching, resulting in poor speed control performance. Summary of the Invention

[0003] To address the above issues and overcome the shortcomings of existing technologies, this invention provides a motor stator and rotor speed control method and system based on reinforcement learning. Addressing the problems of conventional motor stator and rotor speed control methods failing to match the hierarchical operating conditions of stator and rotor speed regulation, neglecting safety risks associated with stator and rotor speed regulation, and consequently leading to rotor overheating failures and poor speed control reliability, this solution dynamically defines state vectors hierarchically and designs control actions, ensuring that the state perception and control actions of stator and rotor speed regulation accurately match the requirements of each level. It enhances risk sensitivity through a safety risk cost function and balances the optimization range of operating conditions with the improvement range of safety based on a continuous reward function, thus approaching the optimal operating condition while avoiding safety risks. By employing adaptive weight design, the control priority under multiple motor operating conditions is dynamically matched, improving the safety of motor control and thus enhancing the reliability of speed control. Addressing the issues of drastic torque fluctuations, poor adaptability to operating conditions, and abrupt parameter switching in conventional motor stator and rotor speed control methods, which result in poor speed control performance, this solution uses smoothing filtering of the control input to suppress torque abrupt changes and match motor inertia. Multi-level smooth switching dynamically adapts to operating conditions, avoiding switching shocks. The transition time constant is dynamically adjusted based on the real-time speed change rate, allowing the transition speed to dynamically match the operating conditions, avoiding dynamic response lag and exacerbated transition disturbances, thereby improving the speed control effect.

[0004] The technical solution adopted by this invention is as follows: The motor stator and rotor speed control method based on reinforcement learning provided by this invention includes the following steps:

[0005] Step S1: Data Acquisition;

[0006] Step S2: Speed ​​regulation strategy optimization;

[0007] Step S3: Speed ​​adjustment trajectory correction;

[0008] Step S4: Real-time speed adjustment execution.

[0009] Further, in step S1, the data acquisition involves obtaining historical motor operating status data and dividing the operating range into three levels; defining the operating status of key operating conditions; normalizing the acquired data using max-min normalization and dividing it into key operating condition datasets and regular operating condition datasets; and applying K-means clustering to the key operating condition datasets at each level.

[0010] Furthermore, in step S2, the speed regulation strategy optimization specifically includes:

[0011] Step S21: Define the hierarchical state space; for a normal operating condition dataset, state s is the current operating state vector of the motor; for a critical operating condition dataset, the dimensions of state s are adjusted according to the hierarchy;

[0012] Step S22: Action space definition; For the critical operating condition dataset, action a is a set of speed control strategies; For the critical operating condition dataset, action a is designed with specific control strategies for different levels;

[0013] Step S23: Reward function design; Construct the D-index, which for critical operating condition data is the Euclidean distance between the current state and the optimal center of the critical operating condition, and design adaptive dynamic weights for the operating condition, adjusting them in real time based on the current operating state; for regular operating condition data, the D-index is obtained by using the nearest cluster center of the critical operating condition as the target benchmark; Construct For critical operating condition data, the index represents the action to be performed. After that, the new state With the optimal center The distance; for normal operating condition data, it is obtained by measuring the distance between the new state after the action is executed and the nearest critical cluster center. The system employs an index; it constructs a safety risk cost function to quantify overcurrent and overheat risks for critical operating condition data; and enhances risk sensitivity for routine operating condition data. Finally, it designs a continuous reward function r, which is dynamically assigned based on the magnitude of improvement.

[0014] Step S24: Policy optimization; use the Q-table to store the expected reward of the state-action pair, and learn the optimal policy through iterative updates; after N iterations, select the top 3 actions with the highest Q values ​​to form the optimal speed adjustment policy set.

[0015] Furthermore, in step S3, the speed regulation trajectory correction specifically includes:

[0016] Smoothing filtering of the control input; exponential moving average is used for the control input output of reinforcement learning.

[0017] Rotational speed trajectory curvature constraint; the rotational speed trajectory curvature is defined as the second derivative of the rotational speed, and the absolute value is limited by feedforward compensation;

[0018] Multi-level smooth switching; when switching between operating conditions across levels, the smoothing coefficient is dynamically adjusted through a transition function.

[0019] Further, in step S4, the real-time speed regulation execution involves acquiring motor operating state parameters in real time, calculating state variables, calling the offline training Q-table, querying the Q-values ​​of all actions corresponding to the current state s in the Q-table, selecting the top 3 actions with the highest Q-values, pre-calculating the safety risk cost after execution for the selected actions, and prioritizing the selection of the selected actions. The smallest action is to smooth the control quantity corresponding to the selected action. If the current level is different from the previous level, it is dynamically adjusted through a transition function. The control quantity is corrected through feedforward compensation, and the smoothed control quantity is output to the motor controller to execute the speed regulation action. After the action is executed, the new state is acquired and the next round of real-time speed regulation is executed.

[0020] The present invention provides a motor stator and rotor speed control system based on reinforcement learning, which includes a data acquisition module, a speed control strategy optimization module, a speed control trajectory correction module, and a real-time speed control execution module.

[0021] The data acquisition module obtains historical motor operating status data, divides it into three levels, and constructs a key operating condition dataset and a regular operating condition dataset.

[0022] The speed regulation strategy optimization module is based on reinforcement learning, defines the state space and dedicated action space in a hierarchical manner, and generates a speed regulation strategy through a safety risk cost function and a continuous reward function.

[0023] The speed regulation trajectory correction module corrects the control quantity output by reinforcement learning based on dynamically adjusting the smoothing coefficient.

[0024] The real-time speed control module acquires the motor's operating status parameters in real time and performs speed control.

[0025] The beneficial effects achieved by the present invention using the above solution are as follows:

[0026] (1) In view of the problem that the general motor stator and rotor speed control method cannot match the hierarchical working conditions of stator and rotor speed regulation, ignores the safety risks of stator and rotor speed regulation, and thus leads to rotor overheating failure and poor speed control reliability, this scheme dynamically defines the state vector according to the hierarchy and designs the control action, so that the state perception and control action of stator and rotor speed regulation can accurately match the needs of each level; strengthen the risk sensitivity through the safety risk cost function; take into account the working condition optimization range and the safety improvement range based on the continuous reward function, and avoid safety risks while approaching the optimal working condition; improve the safety of motor control by dynamically matching the control priority under multiple working conditions of the motor through adaptive weight design; and thus improve the reliability of speed control.

[0027] (2) In view of the problems of sudden changes in control quantity leading to violent torque fluctuations, poor adaptability to working conditions, and abrupt parameter switching in general motor stator and rotor speed control methods, which in turn lead to poor speed control effect, this solution suppresses sudden torque changes and matches motor inertia by smoothing and filtering the control quantity; dynamically adapts to working conditions through multi-level smooth switching to avoid switching shock; and dynamically adjusts the transition time constant according to the real-time speed change rate to make the transition speed dynamically match the working conditions, avoiding dynamic response lag and aggravation of transition disturbance; thereby improving the speed control effect. Attached Figure Description

[0028] Figure 1 A flowchart illustrating the reinforcement learning-based motor stator and rotor speed control method provided by this invention.

[0029] Figure 2 This is a schematic diagram of the motor stator and rotor speed control system based on reinforcement learning provided by the present invention.

[0030] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof. Detailed Implementation

[0031] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0032] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0033] Example 1, see Figure 1 The present invention provides a motor stator and rotor speed control method based on reinforcement learning, which includes the following steps:

[0034] Step S1: Data Acquisition; Obtain historical motor operating status data, divide it into three levels, and construct key operating condition datasets and routine operating condition datasets;

[0035] Step S2: Speed ​​adjustment strategy optimization; Based on reinforcement learning, define the state space and dedicated action space hierarchically, and generate a speed adjustment strategy through the safety risk cost function and continuous reward function;

[0036] Step S3: Speed ​​trajectory correction; Based on the dynamic adjustment of the smoothing coefficient, the control quantity output by the reinforcement learning is corrected;

[0037] Step S4: Real-time speed regulation execution; real-time acquisition of motor operating status parameters and execution of speed regulation.

[0038] Example 2, see Figure 1 This embodiment is based on the above embodiment. In step S1, data acquisition involves obtaining historical motor operating status data, including speed, stator current, rotor voltage, input power, and load torque. Based on the speed range and load characteristics, the operating range is divided into three levels: fine level (speed below 800 r / min), medium level (speed between 800 r / min and 1500 r / min), and coarse level (speed above 1500 r / min). The critical operating condition is defined as speed error. And energy consumption The running status, It is the minimum energy consumption; the collected data is normalized (inverse normalization is required during final speed control), using max-min normalization, and divided into key operating condition datasets (containing three levels) and regular operating condition datasets; K-means clustering (based on Euclidean distance) is used for the key operating condition datasets at each level to cluster similar key operating conditions into K sub-clusters, with the center of each sub-cluster being the optimal operating state of the operating condition.

[0039] Example 3, see Figure 1 This embodiment is based on the above embodiment. In step S2, the speed regulation strategy optimization is an optimization reinforcement learning method. A reward mechanism is designed based on the optimal center of the critical operating condition, and safety risk costs are incorporated to construct a multi-level Q-learning strategy, enabling the agent to avoid safety risks while approaching the optimal center. Specifically, the operation is as follows:

[0040] Step S21: Define the hierarchical state space; for a typical operating condition dataset, state s is the current operating state vector of the motor, including speed error. ; It is the target rotational speed; This refers to the actual rotational speed; current fluctuations are also a factor. Load change rate ;

[0041] For the key operating condition dataset, the dimensions of state s are dynamically adjusted hierarchically to ensure matching with the characteristics of the operating conditions:

[0042] Fine-grained hierarchy: Focusing speed error and current stability; It's a current fluctuation;

[0043] Intermediate level: Balance the relationship among the three;

[0044] Coarseness level: Prioritize dynamic security; It is the rotor temperature change rate;

[0045] Step S22: Action space definition; For the critical operating condition dataset, action a is a set of executable speed control strategies, including: stator voltage frequency adjustment, rotor excitation current adjustment, PID controller proportional coefficient adjustment, and PID controller integral time adjustment;

[0046] For the critical operating condition dataset, action a is designed with specific control strategies for different levels:

[0047] Fine-grained level: Action a includes stator voltage frequency adjustment and PID integral time adjustment;

[0048] Medium level: Action a includes rotor excitation current adjustment and PID proportional coefficient adjustment;

[0049] Coarse level: Action a includes voltage frequency jump and feedforward compensation correction;

[0050] Step S23: Reward function design; Construct the D-index, which, for critical operating condition data, is the Euclidean distance between the current state and the optimal center of the critical operating condition, reflecting the current degree of deviation, and is expressed as: ;in, , and These are weighting coefficients, adaptive dynamic weights for design operating conditions, adjusted in real time based on the current operating status, and are expressed as: speed error weights. , It is the speed reference coefficient. It is a stability factor; current fluctuation weight. , It is the current reference coefficient. This is the current load. The maximum load is used; the weight increases linearly when the load exceeds 70% of the rated value, and overcurrent is suppressed preferentially under high load; the load change rate weight is also used. , It is the load reference coefficient. It is a safety threshold; the weight increases when the rate of temperature change approaches the safety threshold to prevent overheating caused by sudden load changes. , and These are the rotational speed error, current fluctuation, and load change rate of the k-th cluster center under critical operating conditions, respectively; for data from normal operating conditions, the D-index is obtained by using the nearest cluster center of the critical operating condition as the target benchmark; [The last part, "constructing," appears to be incomplete and requires further context.] For critical operating condition data, the index represents the action to be performed. After that, the new state With the optimal center The distance is expressed as: ;in, , and It is to perform an action The subsequent speed error, current fluctuation, and load change rate; for normal operating condition data, the distance between the new state after the action and the nearest critical cluster center is used. Index; Constructing a security risk cost function For critical operating condition data, quantify the risks of overcurrent and overheating to avoid states that are close to the optimal center but have high safety risks, represented as: ; ; ; ; ;in, It is a risk adjustment coefficient; It is the current safety hazard coefficient; It is the temperature safety hazard coefficient; This is the rated stator current; for data under normal operating conditions, the operating state under normal operating conditions is closer to non-ideal or even risky, therefore the risk cost function needs to strengthen risk sensitivity to avoid the state deteriorating to the dangerous threshold, expressed as: The exponential constant is reduced from 1 to 0.8, resulting in a higher risk value and earlier warning for the same volatility. A continuous reward function r is designed, dynamically assigned based on the improvement magnitude, and expressed as: ; and It is the weight of the reward sub-item;

[0051] Step S24: Policy optimization; Store the expected reward Q(s,a) of the state-action pair in the Q-table, and learn the optimal policy through iterative updates, represented as: ;in, and These are the Q values ​​before and after the update, respectively. A is the learning rate; A is the action space. It is an action index; It is a discount factor; after N iterations, the top 3 actions with the highest Q values ​​are selected to form the optimal speed regulation strategy set.

[0052] By performing the above operations, this solution addresses the problems of conventional motor stator and rotor speed control methods failing to match the hierarchical operating conditions of stator and rotor speed regulation, neglecting the safety risks of stator and rotor speed regulation, and consequently leading to rotor overheating failures and poor speed control reliability. Instead, it dynamically defines state vectors hierarchically and designs control actions to ensure that the state perception and control actions of stator and rotor speed regulation accurately match the needs of each level. It enhances risk sensitivity through a safety risk cost function; it balances the optimization range of operating conditions with the improvement range of safety based on a continuous reward function, avoiding safety risks while approaching the optimal operating condition; and it improves the safety of motor control by dynamically matching the control priority under multiple motor operating conditions through adaptive weight design, thereby enhancing the reliability of speed control.

[0053] Example 4, see Figure 1 This embodiment is based on the above embodiment. In step S3, the speed regulation trajectory correction is performed because sudden changes in the control quantity during motor stator and rotor speed regulation can cause torque fluctuations, exacerbate mechanical wear, and reduce operational stability. Therefore, dynamic smoothing processing is applied to the control quantity output by reinforcement learning to make the speed regulation process conform to the inertial characteristics of the motor. The specific operation is as follows:

[0054] Control input smoothing filtering; the control input output from reinforcement learning is subjected to exponential moving average to suppress abrupt changes, expressed as: ;in, It is the smoothed control quantity corresponding to the time interval, where t is the time interval; It is the smoothing coefficient, with values ​​of 0.3, 0.5, and 0.7 for fine, medium, and coarse levels, respectively. It is the original control quantity output by reinforcement learning;

[0055] Rotational speed trajectory curvature constraint; the rotational speed trajectory curvature is defined as the second derivative of the rotational speed, and its absolute value is limited by feedforward compensation, expressed as: ;in, It is the second derivative of the rotational speed; It is the load torque;

[0056] Multi-level smooth switching; when switching between operating conditions across levels, the smoothing coefficient is dynamically adjusted through a transition function, expressed as: ;in, It is the smoothing coefficient at time t; It is the smoothing coefficient before switching; no switching will occur if the operating conditions do not cross levels. It is the target smoothing coefficient after the switch; It is the transition time constant, based on the real-time speed change rate. Dynamic adjustment to match the transition speed with the change in rotational speed is expressed as: ; It is the baseline transition time; It is the adjustment coefficient;

[0057] Training process:

[0058] Data retrieval; Load the normalized data completed in step S1, and load the cluster center parameters obtained from K-means clustering in step S1;

[0059] Training parameter initialization; Based on the policy optimization logic in step S2, initialize the core parameters: Q-table structure, divided into 3 Q-tables according to hierarchy, each Q-table dimension being the state space dimension × action space dimension; and initialize the Q-value: for (s,a) pairs existing in the key working condition data, the initial Q-value = the average reward obtained after historically executing this action; for (s,a) pairs without historical data, the initial Q-value = 0.2; reinforcement learning parameters, including learning rate, discount factor, number of iterations, and exploration probability;

[0060] Offline training; extracting "state-action-new state-reward" quadruples from key and regular work condition datasets; batch updating the Q-table, training independently by level; after training, randomly selecting 1000 key work condition samples for verification; if the actions recommended by the Q-table are executed, On average, it is more than 40% lower than D, and average ratio If the efficiency is reduced by more than 30%, the offline training is considered successful; otherwise, the parameters are adjusted and the training is repeated using the particle swarm optimization algorithm.

[0061] By performing the above operations, this solution addresses the problems of drastic torque fluctuations, poor adaptability to operating conditions, and abrupt parameter switching in general motor stator and rotor speed control methods, which lead to poor speed control performance. It addresses these issues by using smooth filtering of the control input to suppress torque fluctuations and match motor inertia; by employing multi-level smooth switching to dynamically adapt to operating conditions and avoid switching shocks; and by dynamically adjusting the transition time constant based on the real-time speed change rate to dynamically match the transition speed with the operating conditions, avoiding dynamic response lag and exacerbated transition disturbances. This ultimately improves the speed control performance.

[0062] Example 5, see Figure 1 This embodiment is based on the above embodiment. In step S4, real-time speed regulation is performed by acquiring motor operating state parameters in real time, calculating state variables, calling the offline training Q-table, querying the Q-values ​​of all actions corresponding to the current state s in the Q-table, selecting the top 3 actions with the highest Q-values, pre-calculating the safety risk cost after execution for the selected actions, and prioritizing the selection of the selected actions. The smallest action is to smooth the control quantity corresponding to the selected action. If the current level is different from the previous level, it is dynamically adjusted through a transition function. The control quantity is corrected through feedforward compensation, and the smoothed control quantity is output to the motor controller to execute the speed regulation action. After the action is executed, the new state is acquired and the next round of real-time speed regulation is executed.

[0063] Example 6, see Figure 2 Based on the above embodiments, the reinforcement learning-based motor stator and rotor speed control system provided by the present invention includes a data acquisition module, a speed control strategy optimization module, a speed control trajectory correction module, and a real-time speed control execution module.

[0064] The data acquisition module obtains historical motor operating status data, divides it into three levels, and constructs a key operating condition dataset and a regular operating condition dataset.

[0065] The speed regulation strategy optimization module is based on reinforcement learning, defines the state space and dedicated action space in a hierarchical manner, and generates a speed regulation strategy through a safety risk cost function and a continuous reward function.

[0066] The speed regulation trajectory correction module corrects the control quantity output by reinforcement learning based on dynamically adjusting the smoothing coefficient.

[0067] The real-time speed control module acquires the motor's operating status parameters in real time and performs speed control.

[0068] It should be noted that, in this document, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0069] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention.

[0070] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.

Claims

1. A motor stator and rotor speed control method based on reinforcement learning, characterized in that: The method includes the following steps: Step S1: Data Acquisition; Obtain historical motor operating status data, divide it into three levels, and construct key operating condition datasets and routine operating condition datasets; Step S2: Speed ​​adjustment strategy optimization; Based on reinforcement learning, define the state space and dedicated action space hierarchically, and generate a speed adjustment strategy through the safety risk cost function and continuous reward function; Step S3: Speed ​​trajectory correction; Based on the dynamic adjustment of the smoothing coefficient, the control quantity output by the reinforcement learning is corrected; Step S4: Real-time speed regulation execution; real-time acquisition of motor operating status parameters and execution of speed regulation.

2. The motor stator and rotor speed control method based on reinforcement learning according to claim 1, characterized in that: In step S2, the speed regulation strategy optimization specifically includes: Step S21: Define the hierarchical state space; for a normal operating condition dataset, state s is the current operating state vector of the motor; for a critical operating condition dataset, the dimensions of state s are adjusted according to the hierarchy; Step S22: Action space definition; For the critical operating condition dataset, action a is a set of speed control strategies; For the critical operating condition dataset, action a is designed with specific control strategies for different levels; Step S23: Design the reward function; Step S24: Policy optimization; use the Q-table to store the expected reward of the state-action pair, and learn the optimal policy through iterative updates; after N iterations, select the top 3 actions with the highest Q values ​​to form the optimal speed adjustment policy set.

3. The motor stator and rotor speed control method based on reinforcement learning according to claim 2, characterized in that: In step S2, the reward function design involves constructing a D-index, which for key operating condition data is the Euclidean distance between the current state and the optimal center of the key operating condition, and designing an adaptive dynamic weight for the operating condition, which is adjusted in real time based on the current operating state. For routine operating condition data, the D-index is obtained by using the nearest cluster center of critical operating conditions as the target benchmark; [The following is a construction / construction process] For critical operating condition data, the index represents the action to be performed. After that, the new state With the optimal center The distance; for normal operating condition data, it is obtained by measuring the distance between the new state after the action is executed and the nearest critical cluster center. index; Construct a safety risk cost function to quantify overcurrent and overheat risks for key operating condition data; For data under normal operating conditions, the risk cost function enhances risk sensitivity; The final design incorporates a continuous reward function r, which is dynamically assigned based on the magnitude of improvement.

4. The motor stator and rotor speed control method based on reinforcement learning according to claim 3, characterized in that: In step S3, the speed regulation trajectory correction specifically includes: Smoothing filtering of the control input; exponential moving average is used for the control input output of reinforcement learning. Rotational speed trajectory curvature constraint; the rotational speed trajectory curvature is defined as the second derivative of the rotational speed, and the absolute value is limited by feedforward compensation; Multi-level smooth switching; when switching between operating conditions across levels, the smoothing coefficient is dynamically adjusted through a transition function.

5. The motor stator and rotor speed control method based on reinforcement learning according to claim 4, characterized in that: In step S1, the data acquisition involves obtaining historical motor operating status data and dividing the operating range into three levels; defining the operating status of key operating conditions; normalizing the collected data using max-min normalization and dividing it into key operating condition datasets and regular operating condition datasets; and applying K-means clustering to the key operating condition datasets at each level.

6. The motor stator and rotor speed control method based on reinforcement learning according to claim 5, characterized in that: In step S4, the real-time speed regulation execution involves acquiring motor operating state parameters in real time, calculating state variables, calling the offline training Q-table, querying the Q-values ​​of all actions corresponding to the current state s in the Q-table, selecting the top 3 actions with the highest Q-values, pre-calculating the safety risk cost after execution for the selected actions, and prioritizing their selection. For the smallest action, the control quantity corresponding to the selected action is smoothed. If the current level is different from the previous level, it is dynamically adjusted through a transition function. The control quantity is corrected by feedforward compensation, and the smoothed control quantity is output to the motor controller to execute the speed regulation action; after the action is executed, the new state is acquired and the next round of real-time speed regulation is executed.

7. A motor stator and rotor speed control system based on reinforcement learning, used to implement the motor stator and rotor speed control method based on reinforcement learning as described in any one of claims 1-6, characterized in that: It includes a data acquisition module, a speed regulation strategy optimization module, a speed regulation trajectory correction module, and a real-time speed regulation execution module; The data acquisition module obtains historical motor operating status data, divides it into three levels, and constructs a key operating condition dataset and a regular operating condition dataset. The speed regulation strategy optimization module is based on reinforcement learning, defines the state space and dedicated action space in a hierarchical manner, and generates a speed regulation strategy through a safety risk cost function and a continuous reward function. The speed regulation trajectory correction module corrects the control quantity output by reinforcement learning based on dynamically adjusting the smoothing coefficient. The real-time speed control module acquires the motor's operating status parameters in real time and performs speed control.