Motor rotating speed control method and device
By constructing a behavior prediction model based on reinforcement learning, the problems of large workload and low efficiency caused by repeated testing of torque pulsation characteristics of rotor compressors are solved, and automatic identification and compensation control of torque pulsation of rotor compressors are realized, speed fluctuations and noise are reduced, and the operation stability of air conditioning compressors is improved.
Patent Information
- Application Number
- CN202411325006.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, the torque pulsation characteristics of rotor compressors need to be tested repeatedly, resulting in large workload and low development efficiency, and the torque pulsation of the air conditioner compressor cannot be effectively suppressed, resulting in pipeline vibration and noise problems.
The behavior prediction model is constructed by using reinforcement learning methods. By obtaining the compressor speed command and the current status of the motor, predicting the motor behavior, the automatic identification and compensation control of the torque pulsation of the rotor compressor is realized, and the motor is used to control the compressor to execute the speed command, reducing manual intervention, and improving the robustness and adaptability of the model.
Automatic identification and compensation control of the torque pulsation of the rotor compressor is realized, speed fluctuations are reduced, vibration and noise of the compressor and pipelines are suppressed, development efficiency is improved, and rapid changes in motor behavior are adapted to.
Smart Images

Figure CN120377728A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and particularly to a method and device for controlling the rotational speed of a motor. Background Art
[0002] Due to its cost advantage and the continuous expansion of its capacity range, the rotary compressor is increasingly used in air conditioners. However, due to the influence of the internal mechanical structure and working characteristics of the rotary compressor, torque pulsation occurs during operation, which is particularly obvious at low speeds. During operation, torque pulsation exists, and the torque pulsation is reflected in the instability of the control current in electrical parameters, which will bring pipeline vibration and noise in the whole machine structure, and this situation is more obvious at low speeds. This vibration and noise reduce the user experience, so it is necessary for the air conditioner inverter to compensate and control the torque pulsation of the compressor to reduce the speed fluctuation, thereby suppressing the vibration and noise of the compressor and the pipeline.
[0003] Currently, in the household appliance industry, a compressor load torque compensation control scheme that adds feedforward control on the basis of PID speed control is usually adopted. However, the design of this controller is relatively complex, and it is necessary to repeatedly test the torque pulsation characteristics of the motor, and design the feedforward parameters according to the test results; the workload is large, the development efficiency is low, and through actual tests, the compensation effect is not very ideal. Summary of the Invention
[0004] The present invention provides a method and device for controlling the rotational speed of a motor, which are used to solve the defect in the prior art that the workload is large and the development efficiency is low due to the repeated testing of the torque pulsation characteristics of the rotary compressor, and realizes a control method for suppressing the torque pulsation of the air conditioner compressor, and can automatically identify and compensate and control the torque pulsation of the rotary compressor.
[0005] The present invention provides a method for controlling the rotational speed of a motor, including: obtaining a compressor speed command and the current state of the motor; predicting the behavior of the motor according to the compressor speed command and the motor state to obtain a predicted motor behavior; controlling the corresponding motor according to the predicted motor behavior so as to use the motor to control the compressor to execute the compressor speed command.
[0006] It should be noted that by obtaining the compressor speed command and the current state of the motor, the behavior of the motor is predicted, so as to accurately estimate the rotor position of the compressor driven by the motor based on the rapid change of the motor behavior, thereby facilitating the control of the motor by using the predicted motor behavior obtained by prediction, driving the compressor through the motor, so as to realize the operation of the compressor at the speed limited by the compressor speed command, realizing the control of suppressing the torque pulsation of the air conditioner compressor, and can automatically identify and compensate and control the torque pulsation of the rotary compressor.
[0007] According to the present invention, a method for controlling the speed of an electric motor is provided. Based on the compressor speed command and the motor state, the behavior of the motor is predicted to obtain the predicted motor behavior, including: inputting the compressor speed command and the current state of the motor into the behavior prediction model to obtain the predicted motor behavior output by the behavior prediction model; wherein, the behavior prediction model is trained by reinforcement learning based on the compressor speed training command, the motor historical state corresponding to the compressor speed training command, the behavior corresponding to each motor historical state, the motor historical state at the next historical moment corresponding to each motor historical state, and the value estimation corresponding to each behavior.
[0008] It should be noted that by adopting the method of reinforcement learning, the behavior of the motor at the next moment is predicted, so as to accurately estimate the rotor position of the compressor driven by the motor based on the rapid change of the motor behavior, improve the estimation accuracy of the rotor position, and avoid the situation that the development efficiency of the compressor load torque compensation combined with the traditional PID speed control and the feedforward control cannot adapt to the rapid change of the motor behavior in time.
[0009] According to the present invention, a method for controlling the speed of an electric motor is provided. The behavior prediction model includes action prediction. Inputting the compressor speed command and the current state of the motor into the behavior prediction model includes: inputting the compressor speed command and the current state of the motor into the action prediction layer. The action prediction layer predicts the quadrature-axis current of the motor based on the compressor speed command and the current state of the motor extracted from the replay buffer to obtain the predicted motor behavior, determines the motor state at the corresponding next moment according to the predicted motor behavior, and inputs the motor state at the next moment into the replay buffer; wherein, the replay buffer is used to store the motor states at each previously obtained moment. Before inputting the compressor speed command and the current state of the motor into the behavior prediction model, it includes: obtaining the compressor speed training command and the motor historical state corresponding to the compressor speed training command; inputting the compressor speed training command and the motor historical state corresponding to the compressor speed training command into the behavior prediction model to be trained, and using reinforcement learning to train the behavior prediction model to be trained.
[0010] It should be noted that for the rotary compressor, when it operates at low speed, the torque pulsation during operation is manifested as unstable control current in electrical parameters and obvious pipeline and noise conditions in the overall structure. Therefore, when the motor speed is lower than the speed command value, it is necessary to increase the output torque of the motor, that is, increase the quadrature (q) axis of the motor, thereby increasing the current of the frequency converter, so that the motor reaches the speed command value, and the speed of the compressor is controlled by the motor in real time; by predicting the motor behavior, the motor state is adjusted in real time to avoid the unstable control current caused by torque pulsation in electrical parameters and the resulting pipeline and noise conditions in the overall structure, realizing the supplementary control of the torque pulsation of the compressor by the frequency converter, reducing the speed fluctuation, and suppressing the vibration and noise of the compressor and the pipeline.
[0011] In addition, by obtaining the compressor speed training command and the corresponding motor historical state of the compressor speed training command, the behavior prediction model to be trained is trained to perform customized learning for the scenario of realizing compressor speed control by the motor driving the compressor, so as to better adapt to the actual needs, and continuously improve the performance of the model by continuous training, thereby improving the prediction accuracy of the motor behavior, having good robustness, reducing the dependence on manual intervention, and improving the automation level of motor behavior prediction.
[0012] According to the present invention, a method for controlling the motor speed is provided. The behavior prediction model to be trained includes an action prediction layer and a value evaluation layer. The compressor speed training command and the corresponding motor historical state of the compressor speed training command are input into the behavior prediction model to be trained, and the behavior prediction model to be trained is trained by using reinforcement learning, including: inputting the compressor speed training command and the corresponding motor historical state into the action prediction layer to predict the corresponding motor training behavior in combination with a preset policy function, and determining the corresponding motor historical state at the next historical moment according to the motor training behavior; inputting the motor historical state at the next historical moment and the training motor behavior into the value evaluation layer to obtain the corresponding value estimate; storing the motor historical state, the motor training behavior, the motor historical state at the next historical moment and the corresponding value estimate as a set of training samples in the replay buffer; extracting training samples from the replay buffer to update the value evaluation layer, and using the updated value evaluation layer to update the action prediction layer to obtain the trained behavior prediction model.
[0013] It should be noted that by using the motor historical state, motor training behavior, motor historical state at the next historical moment, and corresponding value estimation as training samples, the value evaluation layer is updated, and the value evaluation layer is used to select the corresponding policy gradient to update the action prediction layer, so as to encourage the policy to have greater randomness and exploration, which helps to discover a wider range of potential optimal policies, is suitable for dealing with complex tasks with continuous actions, and balances exploration and exploitation, and has good robustness. In addition, by parallelizing the three operations of updating the action prediction layer using the updated value evaluation layer, predicting the motor behavior based on the input motor historical state and speed training instruction, and obtaining the motor state at the next historical moment based on the predicted behavior and obtaining the reward and storing it in the replay buffer, the update frequency of the q-axis current command value and the learning process are accelerated, which is used for the real-time control of the compressor.
[0014] According to the present invention, a method for controlling the motor speed is provided. Training samples are extracted from the replay buffer to update the value evaluation layer, including: extracting training samples from the replay buffer; for the motor historical state in each group of training samples, obtaining the corresponding value estimation, where the value estimation includes a first value estimation based on the motor historical state at the next historical moment and a second value estimation based on the motor training behavior; based on the first value estimation and the second value estimation, constructing a loss function, and ending the training when the loss function converges to obtain a trained value evaluation layer.
[0015] It should be added that by using the first value estimation based on the motor historical state at the next historical moment as the true estimation and the second value estimation based on the motor training behavior as the predicted estimation to calculate the loss function, on the basis of optimizing the performance of the value evaluation layer, the estimation accuracy of the state value function is improved, thereby improving the accuracy of the policy value evaluation, providing a more reliable basis for the update of the action prediction layer policy, and helping the policy to better develop in the direction of improving performance, promoting the optimization of the policy, reducing fluctuations and instabilities in the training process, and improving the adaptability of the model.
[0016] According to the present invention, a method for controlling the motor speed is provided. The updated value evaluation layer is used to update the action prediction layer to obtain a trained behavior prediction model, including: based on the updated value evaluation layer, combining with the policy function to determine the corresponding policy gradient, and using the determined policy gradient to update the parameters of the action prediction layer to obtain a trained behavior prediction model.
[0017] It should be noted that the action prediction layer can select actions based on probability, and the value evaluation layer can evaluate and guide actions, making the model more effective in processing continuous actions. By using the updated value evaluation layer to update the action prediction layer, single-step updates can be achieved, thereby improving the learning speed. Additionally, through the feedback of the value evaluation layer, the action prediction layer can better balance exploration and exploitation, reduce fluctuations and instabilities during training, and help the action prediction layer make better decisions through the accurate evaluation of the value evaluation layer, so as to improve the overall performance.
[0018] According to the present invention, a method for controlling the motor speed is provided, and the behavior prediction model adopts the maximum entropy reinforcement learning algorithm. It should be noted that since in the compressor speed control, the current command must be processed as a continuous value, the maximum entropy reinforcement learning algorithm can be adopted to efficiently solve the reinforcement learning problem in the continuous action space, especially suitable for problems with high-dimensional state spaces and action spaces, and can estimate parameters with relatively high accuracy and has good robustness.
[0019] According to a method for controlling the motor speed provided by the present invention, obtaining the compressor speed command and the current state of the motor includes: receiving the speed command issued by other controllers other than the air conditioner main controller based on adjusting the compressor speed; extracting the current state of the motor from the replay buffer.
[0020] It should be noted that the state of the motor needs to be monitored in real time and stored in the replay buffer, so as to facilitate timely obtaining the current state of the motor, so as to subsequently predict the motor behavior based on the compressor speed command and the current state of the motor, and thus realize the compensation control of the rotor compressor torque pulsation by controlling the motor.
[0021] The present invention also provides a device for controlling the motor speed, including: a data acquisition module for obtaining the compressor speed command and the current state of the motor; a behavior prediction module for predicting the motor behavior according to the compressor speed command and the motor state to obtain the predicted motor behavior; and a behavior control module for controlling the corresponding motor according to the predicted motor behavior to use the motor to control the compressor to execute the compressor speed command.
[0022] It should be noted that through the behavior prediction module, using the compressor speed command and the current state of the motor obtained by the data acquisition module, the behavior of the motor is predicted, so as to accurately estimate the rotor position of the compressor driven by the motor based on the rapid change of the motor behavior, thereby facilitating the behavior control module to control the motor using the predicted motor behavior, driving the compressor through the motor, so as to make the compressor operate at the speed limited by the compressor speed command, realizing the suppression of the air conditioner compressor torque pulsation control, and can automatically identify and compensate the control of the rotor compressor torque pulsation.
[0023] The present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of any of the above-mentioned motor speed control methods are implemented.
[0024] The present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned motor speed control methods are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0026] Figure 1 is a flowchart showing the motor speed control method provided by the present invention; Figure 2 is one of the flowcharts showing the method for training a behavior prediction model provided by the present invention; Figure 3 is another flowchart showing the method for training a behavior prediction model provided by the present invention; Figure 4 is a schematic structural diagram of the motor speed control device provided by the present invention; Figure 5 is a schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0027] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the accompanying drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention fall within the protection scope of the present invention.
[0028] Figure 1 A flowchart showing the process of a motor speed control method of the present invention is described. The method includes: S11, obtaining a compressor speed command and the current state of the motor; S12, predicting the motor behavior based on the compressor speed command and the motor state to obtain a predicted motor behavior; S13, controlling the corresponding motor according to the predicted motor behavior to use the motor to control the compressor to execute the compressor speed command.
[0029] It should be noted that the step numbers "S1N" in this specification do not represent the sequence of the motor speed control method. Specifically, the motor speed control method of the present invention will be described below in combination with Figures 2 - 3 the following content.
[0030] Step S11: Obtain the compressor speed command and the current state of the motor.
[0031] In this embodiment, obtaining the compressor speed command and the current state of the motor includes: receiving the speed command issued by other controllers other than the air conditioner main controller based on adjusting the compressor speed; extracting the current state of the motor from the playback buffer.
[0032] It should be noted that the state of the motor needs to be monitored in real time and stored in the playback buffer, so as to facilitate timely obtaining of the current state of the motor, and then to predict the motor behavior according to the compressor speed command and the current state of the motor, so as to realize the compensation control of the rotor compressor torque pulsation by controlling the motor.
[0033] In addition, the data stored in the playback buffer is stored in groups based on the current state of the motor, the predicted behavior, and the state of the motor at the next moment. And the predicted behavior and the state of the motor at the next moment in each group of data are predicted based on the obtained compressor speed command and the motor state at the corresponding moment, so as to facilitate timely clearing of the historical data stored in the playback buffer, avoid occupying memory, and affect the operation rate.
[0034] Step S12: Predict the motor behavior according to the compressor speed command and the motor state to obtain the predicted motor behavior.
[0035] In this embodiment, predicting the motor behavior according to the compressor speed command and the motor state to obtain the predicted motor behavior includes: inputting the compressor speed command and the current state of the motor into the behavior prediction model to obtain the predicted motor behavior output by the behavior prediction model; wherein, the behavior prediction model is trained by reinforcement learning based on the compressor speed training command, the motor historical state corresponding to the compressor speed training command, the behavior corresponding to each motor historical state, the motor historical state at the next historical moment corresponding to each motor historical state, and the value estimation corresponding to each behavior.
[0036] It should be noted that by using the method of reinforcement learning to predict the behavior of the motor at the next moment, it is convenient to accurately estimate the rotor position of the compressor driven by the motor based on the rapid change of the motor behavior, improve the estimation accuracy of the rotor position, and avoid the situation that the development efficiency of the compressor load torque compensation by the traditional PID speed control combined with the feedforward control is always unable to adapt to the rapid change of the motor behavior in time.
[0037] Furthermore, the behavior prediction model includes an action prediction layer (Actor). Accordingly, inputting the compressor speed command and the current state of the motor into the behavior prediction model includes: inputting the compressor speed command and the current state of the motor into the action prediction layer. The action prediction layer predicts the quadrature-axis current of the motor based on the compressor speed command and the current state of the motor extracted from the replay buffer, obtains the predicted behavior of the motor, determines the corresponding motor state at the next moment according to the predicted behavior of the motor, and inputs the motor state at the next moment into the replay buffer; wherein the replay buffer is used to store the motor states at each moment obtained previously.
[0038] It should be added that the motor includes a quadrature (q)-axis. The predicted behavior output by the behavior prediction model includes the current command value of the q-axis. The motor state includes the motor speed feedback value, the input current value, and the input voltage command at the corresponding moment.
[0039] It should be noted that for a rotary compressor at low speed, the torque pulsation during operation is reflected in unstable control current in electrical parameters and obvious pipeline and noise conditions in the overall structure. Therefore, when the motor speed is lower than the speed command value, it is necessary to increase the output torque of the motor, that is, increase the quadrature (q)-axis of the motor, thereby increasing the current of the frequency converter, so that the motor reaches the speed command value, and the speed of the compressor is controlled in real time through the motor; by predicting the motor behavior, the motor state can be adjusted in real time to avoid unstable control current in electrical parameters caused by torque pulsation and the resulting pipeline and noise conditions in the overall structure, realizing supplementary control of the torque pulsation of the compressor by the frequency converter, reducing the speed fluctuation, and suppressing the vibration and noise of the compressor and the pipeline.
[0040] In an alternative embodiment, the behavior prediction model adopts the Soft-Actor-Critic (SAC) algorithm, which is a type of maximum entropy reinforcement learning. It should be added that the agent of the algorithm is the drive control board.
[0041] It should be noted that since the current command must be processed as a continuous value in compressor speed control, the maximum entropy reinforcement learning algorithm can be used to efficiently solve the reinforcement learning problem in a continuous action space, especially suitable for problems with high-dimensional state spaces and action spaces, and can estimate parameters with relatively high accuracy and has good robustness.
[0042] In an alternative embodiment, before inputting the compressor speed command and the current state of the motor into the behavior prediction model, it includes: obtaining the compressor speed training command and the historical motor state corresponding to the compressor speed training command; inputting the compressor speed training command and the historical motor state corresponding to the compressor speed training command into the behavior prediction model to be trained, and using reinforcement learning to train the behavior prediction model to be trained.
[0043] It should be noted that by obtaining the compressor speed training instruction and the motor historical state corresponding to the compressor speed training instruction, the behavior prediction model to be trained is trained to perform customized learning for the scenario of realizing compressor speed control by the motor driving the compressor, so as to better adapt to the actual needs. And by continuously training to continuously improve the performance of the model, thereby improving the prediction accuracy of the motor behavior, having better robustness, reducing the dependence on manual intervention, and improving the automation level of the motor behavior prediction.
[0044] Specifically, the behavior prediction model to be trained includes an action prediction layer (Actor) and a value evaluation layer (Critic). Refer to Figure 2 and Figure 3 , the compressor speed training instruction and the motor historical state corresponding to the compressor speed training instruction are input into the behavior prediction model to be trained, and the behavior prediction model to be trained is trained using reinforcement learning, including: inputting the compressor speed training instruction and the motor historical state (S) corresponding to the compressor speed training instruction into the action prediction layer to predict the corresponding motor training behavior (A) in combination with a preset policy function, and determining the motor historical state (S') at the corresponding next historical moment according to the motor training behavior (A); inputting the motor historical state and the motor training behavior at the next historical moment into the value evaluation layer to obtain the corresponding value estimate (R); storing the motor historical state (S), the motor training behavior, the motor historical state (S') at the next historical moment, and the corresponding value estimate (R) as a set of training samples in the replay buffer; extracting training samples from the replay buffer to update the value evaluation layer, and using the updated value evaluation layer to update the action prediction layer to obtain a trained behavior prediction model.
[0045] It should be added that the motor includes a quadrature (q) axis and a direct (d) axis. Among them, the current command value of the d axis, Idref = 0, and the current command value of the q axis is determined according to the motor training behavior output by the behavior prediction model during the training process. That is, the current command value of the q axis is used as the RL object, and the amplitude of the compressor speed pulsation is used as the value estimate, so as to avoid the situation where the value estimate changes positively and negatively, thereby accelerating the optimization process of the value evaluation layer.
[0046] It should be noted that by using the motor historical state, the motor training behavior, the motor historical state at the next historical moment, and the corresponding value estimation as training samples, the value evaluation layer is updated, and the value evaluation layer is used to select the corresponding policy gradient to update the action prediction layer, so as to encourage the policy to have greater randomness and exploration, which helps to discover a wider range of potential optimal policies, is suitable for dealing with complex tasks with continuous actions, and balances exploration and exploitation, and has good robustness. In addition, by paralleling the three operations of updating the action prediction layer with the updated value evaluation layer, predicting the motor behavior according to the input motor historical state and speed training instruction, and obtaining the motor state at the next historical moment and the reward and saving them in the replay buffer, the update frequency of the q-axis current command value and the learning process are accelerated, which is used for the real-time control of the compressor.
[0047] Furthermore, training samples are extracted from the replay buffer to update the value evaluation layer, including: extracting training samples from the replay buffer; for the motor historical state in each group of training samples, obtaining the corresponding value estimation, where the value estimation includes the first value estimation based on the motor historical state at the next historical moment and the second value estimation based on the motor training behavior; based on the first value estimation and the second value estimation, constructing a loss function, and ending the training when the loss function converges to obtain the trained value evaluation layer.
[0048] It should be supplemented that by using the first value estimation based on the motor historical state at the next historical moment as the true estimation and the second value estimation based on the motor training behavior as the predicted estimation to calculate the loss function, on the basis of optimizing the performance of the value evaluation layer, the estimation accuracy of the state value function is improved, thereby improving the accuracy of the policy value evaluation, providing a more reliable basis for the update of the action prediction layer policy, and helping the policy to better develop in the direction of improving performance, promoting the optimization of the policy, reducing the fluctuations and instabilities in the training process, and improving the adaptability of the model.
[0049] In addition, the updated value evaluation layer is used to update the action prediction layer to obtain a trained behavior prediction model, including: based on the updated value evaluation layer, combining with the policy function, determining the corresponding policy gradient, and using the determined policy gradient to update the parameters of the action prediction layer to obtain the trained behavior prediction model.
[0050] It should be noted that the action prediction layer can select actions based on probabilities, and the value evaluation layer can evaluate and guide actions, making the model more effective in processing continuous actions. By using the updated value evaluation layer to update the action prediction layer, single-step updates can be achieved, thereby improving the learning speed. Additionally, through the feedback of the value evaluation layer, the action prediction layer can better balance exploration and exploitation, reduce fluctuations and instabilities during training, and help the action prediction layer make better decisions through the accurate evaluation of the value evaluation layer, so as to improve the overall performance.
[0051] Step S13, control the corresponding motor according to the predicted motor actions, so as to use the motor to control the compressor to execute the compressor speed command.
[0052] In summary, in the embodiment of the present invention, by obtaining the compressor speed command and the current state of the motor, the actions of the motor are predicted, so as to accurately estimate the rotor position of the compressor driven by the motor based on the rapid changes in the motor actions, thereby facilitating the control of the motor using the predicted motor actions, and driving the compressor through the motor to enable the compressor to operate at the speed limited by the compressor speed command, realizing the suppression of the torque ripple control of the air-conditioning compressor, and enabling automatic identification and compensation control of the torque ripple of the rotary compressor.
[0053] Next, the motor speed control device provided by the present invention will be described. The motor speed control device described below can be mutually corresponded and referred to with the motor speed control method described above.
[0054] Figure 4 A motor speed control device is shown. The device includes: A data acquisition module 41, which acquires the compressor speed command and the current state of the motor; An action prediction module 42, which predicts the motor actions according to the compressor speed command and the motor state to obtain the predicted motor actions; An action control module 43, which controls the corresponding motor according to the predicted motor actions, so as to use the motor to control the compressor to execute the compressor speed command.
[0055] In this embodiment, the data acquisition module 41 includes: a command receiving unit that receives the speed command issued by other controllers other than the air-conditioning main controller based on adjusting the compressor speed; and a state extraction unit that extracts the current state of the motor from the replay buffer.
[0056] The behavior prediction module 42 is configured to: input the compressor speed command and the current state of the motor into the behavior prediction model to obtain the predicted behavior of the motor output by the behavior prediction model; wherein, the behavior prediction model is trained by reinforcement learning based on the compressor speed training command, the historical state of the motor corresponding to the compressor speed training command, the behavior corresponding to each historical state of the motor, the historical state of the motor at the next historical moment corresponding to each historical state of the motor, and the value estimation corresponding to each behavior.
[0057] Furthermore, the behavior prediction model includes an action prediction layer. Correspondingly, the behavior prediction module 42 includes: a behavior prediction unit that inputs the compressor speed command and the current state of the motor into the action prediction layer. The action prediction layer predicts the quadrature-axis current of the motor based on the compressor speed command and the current state of the motor extracted from the replay buffer to obtain the predicted behavior of the motor, determines the motor state at the corresponding next moment according to the predicted behavior of the motor, and inputs the motor state at the next moment into the replay buffer; wherein, the replay buffer is used to store the motor states at each previously obtained moment.
[0058] In an alternative embodiment, the behavior prediction model adopts the maximum entropy reinforcement learning (Soft-Actor-Critic, abbreviated as SAC) algorithm.
[0059] In an alternative embodiment, the apparatus includes: a training data acquisition module that acquires the compressor speed training command and the historical state of the motor corresponding to the compressor speed training command before inputting the compressor speed command and the current state of the motor into the behavior prediction model; a training module that inputs the compressor speed training command and the historical state of the motor corresponding to the compressor speed training command into the behavior prediction model to be trained and trains the behavior prediction model to be trained by reinforcement learning.
[0060] Specifically, the behavior prediction model to be trained includes an action prediction layer and a value evaluation layer. The training module includes: an action prediction unit that inputs the compressor speed training command and the historical state of the motor corresponding to the compressor speed training command into the action prediction layer to predict the corresponding motor training behavior in combination with a preset policy function and determines the historical state of the motor at the corresponding next historical moment according to the motor training behavior; a value evaluation unit that inputs the historical state of the motor at the next historical moment and the motor training behavior into the value evaluation layer to obtain the corresponding value estimation; a sample construction unit that stores the historical state of the motor, the motor training behavior, the historical state of the motor at the next historical moment, and the corresponding value estimation as a set of training samples in the replay buffer; a training unit that extracts training samples from the replay buffer to update the value evaluation layer and updates the action prediction layer by using the updated value evaluation layer to obtain the trained behavior prediction model.
[0061] Further, the training unit includes: a sample extraction subunit that extracts training samples from the replay buffer; a value acquisition subunit that obtains corresponding value estimates for the motor historical states in each group of training samples, where the value estimates include a first value estimate obtained based on the motor historical state at the next historical moment and a second value estimate obtained based on the motor training behavior; a loss function construction subunit that constructs a loss function based on the first value estimate and the second value estimate; and a training judgment subunit that ends the training and obtains a trained value evaluation layer based on the convergence of the loss function.
[0062] In addition, the training unit further includes: a policy determination subunit that determines a corresponding policy gradient based on the updated value evaluation layer in combination with the policy function; and a network update subunit that updates the parameters of the action prediction layer using the determined policy gradient to obtain a trained behavior prediction model.
[0063] In summary, in the embodiment of the present invention, the behavior prediction module uses the compressor speed command and the current state of the motor obtained by the data acquisition module to predict the behavior of the motor, so as to accurately estimate the rotor position of the compressor driven by the motor based on the rapid change of the motor behavior, thereby facilitating the behavior control module to control the motor using the predicted motor prediction behavior, driving the compressor by the motor, and enabling the compressor to operate at the speed limited by the compressor speed command, realizing the suppression of the torque ripple control of the air-conditioning compressor, and enabling automatic identification and compensation control of the torque ripple of the rotary compressor.
[0064] Figure 5 An example of the physical structure diagram of an electronic device is shown as Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530, and a communication bus 540. Among them, the processor 510, the communication interface 520, and the memory 530 complete mutual communication through the communication bus 540. The processor 510 can call the logical instructions in the memory 530 to execute the motor speed control method, which includes: obtaining the compressor speed command and the current state of the motor; predicting the behavior of the motor according to the compressor speed command and the motor state to obtain the motor prediction behavior; and controlling the corresponding motor according to the motor prediction behavior to use the motor to control the compressor to execute the compressor speed command.
[0065] In addition, when the logical instructions in the aforementioned memory 530 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, external hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0066] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the motor speed control method provided by the above-mentioned various methods. The method includes: obtaining a compressor speed command and the current state of the motor; predicting the behavior of the motor based on the compressor speed command and the motor state to obtain a predicted motor behavior; and controlling the corresponding motor according to the predicted motor behavior to use the motor to control the compressor to execute the compressor speed command.
[0067] In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is implemented to execute the motor speed control method provided by the above-mentioned various methods. The method includes: obtaining a compressor speed command and the current state of the motor; predicting the behavior of the motor based on the compressor speed command and the motor state to obtain a predicted motor behavior; and controlling the corresponding motor according to the predicted motor behavior to use the motor to control the compressor to execute the compressor speed command.
[0068] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0069] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0070] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling the rotational speed of an electric motor, characterized in that, Including: Obtain the compressor speed command and the current state of the motor; Predict the motor behavior according to the compressor speed command and the motor state to obtain the predicted motor behavior; Control the corresponding motor according to the predicted motor behavior so as to use the motor to control the compressor to execute the compressor speed command.
2. The motor speed control method according to claim 1, wherein Predicting the motor behavior according to the compressor speed command and the motor state to obtain the predicted motor behavior includes: Input the compressor speed command and the current state of the motor into the behavior prediction model to obtain the predicted motor behavior output by the behavior prediction model; wherein, the behavior prediction model is trained by reinforcement learning based on the compressor speed training command, the motor historical state corresponding to the compressor speed training command, the behavior corresponding to each motor historical state, the motor historical state at the next historical moment corresponding to each motor historical state, and the value estimation corresponding to each behavior.
3. The motor speed control method according to claim 2, wherein The behavior prediction model includes an action prediction layer; Inputting the compressor speed command and the current state of the motor into the behavior prediction model includes: Input the compressor speed command and the current state of the motor into the action prediction layer. The action prediction layer predicts the motor quadrature axis current based on the compressor speed command and the current state of the motor extracted from the replay buffer to obtain the predicted motor behavior, determines the motor state at the corresponding next moment according to the predicted motor behavior, and inputs the motor state at the next moment into the replay buffer; wherein, the replay buffer is used to store the motor states at each moment obtained previously. Before inputting the compressor speed command and the current state of the motor into the behavior prediction model, it includes: Obtain the compressor speed training command and the motor historical state corresponding to the compressor speed training command; Input the compressor speed training command and the motor historical state corresponding to the compressor speed training command into the behavior prediction model to be trained, and use reinforcement learning to train the behavior prediction model to be trained.
4. The motor speed control method according to claim 3, wherein The behavior prediction model to be trained includes an action prediction layer and a value evaluation layer. Inputting the compressor speed training command and the motor historical state corresponding to the compressor speed training command into the behavior prediction model to be trained and using reinforcement learning to train the behavior prediction model to be trained includes: Input the compressor speed training command and the motor historical state corresponding to the compressor speed training command into the action prediction layer to predict the corresponding motor training behavior in combination with a preset policy function, and determine the motor historical state at the corresponding next historical moment according to the motor training behavior; Input the motor historical state at the next historical moment and the training motor behavior into the value evaluation layer to obtain the corresponding value estimation; Store the motor historical state, the motor training behavior, the motor historical state at the next historical moment, and the corresponding value estimation as a set of training samples in the replay buffer; Extract training samples from the replay buffer to update the value evaluation layer, and use the updated value evaluation layer to update the action prediction layer to obtain a trained behavior prediction model.
5. The motor speed control method according to claim 4, wherein Extracting training samples from the replay buffer to update the value evaluation layer includes: Extract training samples from the replay buffer; For the motor historical states in each group of training samples, obtain corresponding value estimates, where the value estimates include a first value estimate based on the motor historical state at the next historical moment and a second value estimate based on the motor training behavior; Based on the first value estimate and the second value estimate, construct a loss function, and end the training based on the convergence of the loss function to obtain a trained value evaluation layer.
6. The motor speed control method according to claim 4, wherein Using the updated value evaluation layer to update the action prediction layer to obtain a trained behavior prediction model includes: Based on the updated value evaluation layer, combine with the policy function to determine the corresponding policy gradient, and use the determined policy gradient to update the parameters of the action prediction layer to obtain a trained behavior prediction model.
7. The motor speed control method according to claim 1, wherein The obtaining of the compressor speed command and the current state of the motor includes: Receive a speed command sent by other controllers other than the air conditioner main controller based on adjusting the compressor speed; Extract the current state of the motor from the replay buffer.
8. A motor speed control device, characterized in that, Includes: A data acquisition module that acquires a compressor speed command and the current state of the motor; A behavior prediction module that predicts the motor behavior based on the compressor speed command and the motor state to obtain a motor prediction behavior; A behavior control module that controls the corresponding motor according to the motor prediction behavior to use the motor to control the compressor to execute the compressor speed command.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the motor speed control method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the motor speed control method according to any one of claims 1 to 7.