A motor control method based on PID
By adding temperature corrections to the PID control model, based on the motor's temperature prediction and control model, the problem that the existing PID control model does not consider temperature changes is solved, extending the service life of the motor and improving the stability and reliability of the system. .
Patent Information
- Application Number
- CN202410831821.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-06-26
AI Technical Summary
The existing PID control model does not consider the impact of temperature changes on motor performance, resulting in motor performance degradation or damage in high temperature environments.
By predicting the temperature in the future based on the temperature value of the motor, if the temperature is lower than the threshold, the PID enhanced control model is used to control the motor speed. If the temperature is higher than or equal to the threshold, a temperature correction is added to the PID enhanced control model to reduce the motor speed. RPM to wait for temperature to drop.
Extend the service life of the motor, improve the stability and reliability of the automation system, and prevent the motor from being damaged in high temperature environments.
Smart Images

Figure CN118399844B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and in particular to a motor control method based on PID. Background Art
[0002] In modern industrial and automation control systems, the motor is the core component of the power source, and its stable performance and efficient operation are crucial. The motor will generate heat during operation, and the increase in temperature will have a significant impact on the performance and life of the motor. Therefore, effective control of the motor temperature is one of the key factors to ensure system reliability and efficiency.
[0003] PID (Proportional-Integral-Derivative) control is a feedback control strategy widely used in the field of industrial control. It adjusts the output of the controller to reduce the error of the system. PID controllers are widely used due to their simple structure, good stability and easy adjustment. However, the standard PID control model does not consider the impact of temperature changes on motor performance, which may cause motor performance degradation or damage in high temperature environments. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a PID-based motor control method which solves the problem that the existing PID control model does not consider the impact of temperature changes on motor performance, resulting in motor performance degradation or damage in a high temperature environment.
[0005] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a motor control method based on PID, comprising the following steps:
[0006] S1. Estimate the temperature value at a future time based on the latest temperature value of the motor;
[0007] S2, when the temperature value at the future moment is less than the temperature threshold, the motor speed is controlled by using the PID enhanced control model;
[0008] S3. When the temperature value at a future moment is greater than or equal to the temperature threshold, a temperature correction amount is added to the PID enhanced control model to control the motor speed.
[0009] The beneficial effects of the present invention are as follows: when the temperature value at a future moment is predicted to be lower than the set temperature threshold, the present invention adopts the PID enhanced control model to control the motor speed. The existing PID is enhanced to improve the response speed. When the predicted temperature value at a future moment is higher than or equal to the temperature threshold, a temperature correction amount is added to the PID enhanced control model to reduce the output of the PID enhanced control model, reduce the motor speed, wait for the temperature to drop, extend the motor service life, and improve the stability and reliability of the entire motor automation system, so as to solve the problem that the existing PID control model does not consider the impact of temperature changes on motor performance, resulting in motor performance degradation or damage in a high temperature environment.
[0010] Furthermore, the S1 comprises the following sub-steps:
[0011] S11, collecting motor temperature values and constructing a motor temperature sequence;
[0012] S12, calculating the temperature rise speed according to the motor temperature sequence;
[0013] S13, estimating the temperature value at a future time based on the temperature estimation model according to the temperature rise speed and the latest temperature value of the motor.
[0014] The beneficial effect of the above-mentioned further scheme is as follows: the present invention continuously collects the temperature value of the motor, constructs a motor temperature sequence, calculates the temperature rise rate according to the motor temperature sequence, and estimates the temperature value at a future time by combining the temperature rise rate and the temperature value of the motor at the latest moment. It can monitor the working status of the motor in real time and promptly detect whether the motor is at risk of overheating.
[0015] Furthermore, the formula for calculating the temperature rise rate in S12 is:
[0016] ,
[0017] Among them, α t is the temperature rise rate at the tth moment, Τ τ+1 is the temperature value collected at the τ+1th moment in the motor temperature sequence, T τ is the temperature value collected at the τth moment in the motor temperature sequence, T t is the temperature value collected at the tth moment in the motor temperature sequence, where the tth moment is the latest moment, t-1 is the temperature value collected at the t-1th moment in the motor temperature sequence, t is the length of the motor temperature sequence, and τ is a positive integer.
[0018] The beneficial effect of the above further scheme is that the present invention integrates the overall temperature change in the motor temperature sequence and the temperature change at the latest moment to obtain the temperature rise rate, thereby avoiding noise interference and improving the accuracy of calculating the temperature rise rate.
[0019] Furthermore, the expression of the temperature estimation model in S13 is:
[0020] ,
[0021] ,
[0022] ,
[0023] Among them, T F is the temperature value at the future time, N is the length of the future time, w α is the temperature rise rate α t The weight of b α is the temperature rise rate α t The bias, w T is the temperature value t The weight of b T is the temperature value t The bias of h1 is the first temperature coefficient, h2 is the second temperature coefficient, and w h1 is the weight of the first temperature coefficient h1, w h2 is the weight of the second temperature coefficient h2, and sigmoid is the activation function.
[0024] The beneficial effect of the above further solution is: the present invention uses activation function to respectively calculate the temperature rise rate α t and temperature value Τ t Assign weights to comprehensively consider the temperature value Τ t and the temperature rise rate α t , improving the prediction accuracy of temperature values at future times.
[0025] Further, the PID enhanced control model in S2 includes: a PID control unit and an enhancement unit;
[0026] The PID control unit is used to obtain an initial execution amount based on a PID algorithm according to a speed difference between a target speed of the motor and an actual speed of the motor;
[0027] The enhancement unit is used to enhance the initial execution amount to obtain an enhanced execution amount, and the enhanced execution amount is used to control the motor speed.
[0028] Furthermore, the expression of the enhancement unit is:
[0029] ,
[0030] in, is the enhanced execution amount of the kth control, u(k) is the initial execution amount of the kth control, E(k) is the speed difference between the motor target speed and the motor actual speed corresponding to the kth control, μ is the proportional coefficient, and e is a natural constant.
[0031] The beneficial effects of the above further scheme are as follows: when the motor target speed is greater than the motor actual speed, the speed difference E(k) is greater than 0, and the execution amount is increased on the basis of the initial execution amount, so that the control amount of the motor speed is further increased, so that the actual motor speed quickly approaches the motor target speed; when the motor target speed is less than the motor actual speed, the speed difference E(k) is less than 0, and the execution amount is reduced on the basis of the initial execution amount, so that the control amount of the motor speed is further reduced, so that the actual motor speed quickly approaches the motor target speed, and when the motor target speed is equal to the motor actual speed, the initial execution amount is equal to the enhanced execution amount.
[0032] Furthermore, S3 includes the following sub-steps:
[0033] S31, when the temperature value at a future moment is greater than or equal to the temperature threshold, calculating a first temperature difference according to the latest temperature value of the motor at the moment and the temperature threshold;
[0034] S32, calculating a second temperature difference according to the temperature value at the future moment and the temperature threshold;
[0035] S33, calculating a first correction coefficient according to the first temperature difference;
[0036] S34, calculating a second correction coefficient according to the second temperature difference;
[0037] S35, calculating a temperature correction amount according to the first correction coefficient and the second correction coefficient;
[0038] S36, adding a temperature correction amount to the enhanced execution amount output by the PID enhanced control model to obtain a corrected execution amount;
[0039] S37, using the corrected execution amount to control the motor speed, and when the temperature value at a future moment is less than the temperature threshold, restoring the control of the motor speed by the PID enhanced control model.
[0040] Furthermore, the formula for calculating the first temperature difference in S31 is:
[0041] ,
[0042] Among them, d1 is the first temperature difference, T is the latest temperature value of the motor, T th is the temperature threshold;
[0043] The formula for calculating the second temperature difference in S32 is:
[0044] ,
[0045] Where d2 is the second temperature difference, T F is the temperature value at the future time.
[0046] Furthermore, the formula for calculating the first correction coefficient in S33 is:
[0047] ,
[0048] Among them, γ1 is the first correction coefficient, | | is the absolute value operation;
[0049] The formula for calculating the second correction coefficient in S34 is:
[0050] ,
[0051] Wherein, γ2 is the second correction coefficient.
[0052] Furthermore, the formula for calculating the temperature correction amount in S35 is:
[0053] ,
[0054] Where r is the temperature correction;
[0055] The formula for obtaining the corrected execution amount in S36 is:
[0056] ,
[0057] Among them, G(k) is the correction execution amount of the k-th control.
[0058] The beneficial effects of the above-mentioned further scheme are: when the temperature value at a future moment is greater than or equal to the temperature threshold, when the temperature value of the motor at the latest moment is greater than or equal to the temperature threshold, the temperature is too high, and the first correction coefficient and the second correction coefficient are both greater than 0, which has the strongest ability to weaken the enhanced execution amount, so that the speed drops rapidly to prevent damage to the motor; when the temperature value at a future moment is greater than or equal to the temperature threshold, when the temperature value of the motor at the latest moment is less than the temperature threshold, the second correction coefficient is greater than 0, and the execution amount is reduced according to the size of the second correction coefficient, thereby ensuring the safety of the motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a flow chart of a motor control method based on PID. DETAILED DESCRIPTION
[0060] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.
[0061] like Figure 1 As shown, a PID-based motor control method includes the following steps:
[0062] S1. Estimate the temperature value at a future time based on the latest temperature value of the motor;
[0063] S2, when the temperature value at the future moment is less than the temperature threshold, the motor speed is controlled by using the PID enhanced control model;
[0064] S3. When the temperature value at a future moment is greater than or equal to the temperature threshold, a temperature correction amount is added to the PID enhanced control model to control the motor speed.
[0065] The S1 comprises the following sub-steps:
[0066] S11, collecting motor temperature values and constructing a motor temperature sequence;
[0067] S12, calculating the temperature rise speed according to the motor temperature sequence;
[0068] S13, estimating the temperature value at a future time based on the temperature estimation model according to the temperature rise speed and the latest temperature value of the motor.
[0069] The present invention continuously collects the temperature values of the motor to construct a motor temperature sequence. According to the motor temperature sequence, the temperature rise rate is calculated. Combined with the temperature rise rate and the latest temperature value of the motor, the temperature value at the future moment is estimated. The working status of the motor can be monitored in real time, and whether the motor is at risk of overheating can be discovered in time.
[0070] The formula for calculating the temperature rise rate in S12 is:
[0071] ,
[0072] Among them, α t is the temperature rise rate at the tth moment, Τ τ+1 is the temperature value collected at the τ+1th moment in the motor temperature sequence, T τ is the temperature value collected at the τth moment in the motor temperature sequence, T t is the temperature value collected at the tth moment in the motor temperature sequence, where the tth moment is the latest moment, t-1is the temperature value collected at the t-1th moment in the motor temperature sequence, t is the length of the motor temperature sequence, and τ is a positive integer.
[0073] The present invention integrates the overall temperature change in the motor temperature sequence and the temperature change at the latest moment to obtain the temperature rise speed, thereby avoiding noise interference and improving the accuracy of calculating the temperature rise speed.
[0074] The expression of the temperature estimation model in S13 is:
[0075] ,
[0076] ,
[0077] ,
[0078] Among them, T F is the temperature value at the future time, N is the length of the future time, w α is the temperature rise rate α t The weight of b α is the temperature rise rate α t The bias, w T is the temperature value t The weight of b T is the temperature value t The bias of h1 is the first temperature coefficient, h2 is the second temperature coefficient, and w h1 is the weight of the first temperature coefficient h1, w h2 is the weight of the second temperature coefficient h2, and sigmoid is the activation function.
[0079] In this embodiment, the length N of the future time is the length from the latest time to the predicted time.
[0080] The present invention uses activation functions to respectively calculate the temperature rise rate α t and temperature value Τ t Assign weights to comprehensively consider the temperature value Τ t and the temperature rise rate α t , improving the prediction accuracy of temperature values at future times.
[0081] In this embodiment, the weights and biases in the temperature estimation model can be obtained through training, and a sample consisting of the temperature rise rate and the latest temperature value of the motor is constructed to train the temperature estimation model.
[0082] The PID enhanced control model in S2 includes: a PID control unit and an enhancement unit;
[0083] The PID control unit is used to obtain an initial execution amount based on a PID algorithm according to a speed difference between a target speed of the motor and an actual speed of the motor;
[0084] In the present invention, the PID control unit adopts the existing PID algorithm;
[0085] The enhancement unit is used to enhance the initial execution amount to obtain an enhanced execution amount, and the enhanced execution amount is used to control the motor speed.
[0086] The expression of the enhancement unit is:
[0087] ,
[0088] in, is the enhanced execution amount of the kth control, u(k) is the initial execution amount of the kth control, E(k) is the speed difference between the motor target speed and the motor actual speed corresponding to the kth control, μ is the proportional coefficient, and e is a natural constant.
[0089] In this embodiment, the proportionality coefficient can be specifically set to adjust the enhanced strength.
[0090] When the motor target speed is greater than the motor actual speed, the speed difference E(k) is greater than 0. On the basis of the initial execution amount, the execution amount is increased, so that the control amount of the motor speed is further increased, so that the actual motor speed quickly approaches the motor target speed; when the motor target speed is less than the motor actual speed, the speed difference E(k) is less than 0. On the basis of the initial execution amount, the execution amount is reduced, so that the control amount of the motor speed is further reduced, so that the actual motor speed quickly approaches the motor target speed. When the motor target speed is equal to the motor actual speed, the initial execution amount is equal to the enhanced execution amount.
[0091] The S3 comprises the following sub-steps:
[0092] S31, when the temperature value at a future moment is greater than or equal to the temperature threshold, calculating a first temperature difference according to the latest temperature value of the motor at the moment and the temperature threshold;
[0093] S32, calculating a second temperature difference according to the temperature value at the future moment and the temperature threshold;
[0094] S33, calculating a first correction coefficient according to the first temperature difference;
[0095] S34, calculating a second correction coefficient according to the second temperature difference;
[0096] S35, calculating a temperature correction amount according to the first correction coefficient and the second correction coefficient;
[0097] S36, adding a temperature correction amount to the enhanced execution amount output by the PID enhanced control model to obtain a corrected execution amount;
[0098] S37, using the corrected execution amount to control the motor speed, and when the temperature value at a future moment is less than the temperature threshold, restoring the control of the motor speed by the PID enhanced control model.
[0099] The formula for calculating the first temperature difference in S31 is:
[0100] ,
[0101] Among them, d1 is the first temperature difference, T is the latest temperature value of the motor, T th is the temperature threshold;
[0102] The formula for calculating the second temperature difference in S32 is:
[0103] ,
[0104] Where d2 is the second temperature difference, T F is the temperature value at the future time.
[0105] The formula for calculating the first correction coefficient in S33 is:
[0106] ,
[0107] Among them, γ1 is the first correction coefficient, | | is the absolute value operation;
[0108] The formula for calculating the second correction coefficient in S34 is:
[0109] ,
[0110] Wherein, γ2 is the second correction coefficient.
[0111] The formula for calculating the temperature correction amount in S35 is:
[0112] ,
[0113] Where r is the temperature correction;
[0114] The formula for obtaining the corrected execution amount in S36 is:
[0115] ,
[0116] Among them, G(k) is the correction execution amount of the k-th control.
[0117] When the temperature value at a future moment is greater than or equal to the temperature threshold, and the temperature value of the motor at the latest moment is greater than or equal to the temperature threshold, the temperature is too high, and the first correction coefficient and the second correction coefficient are both greater than 0, which have the strongest ability to weaken the enhanced execution amount, causing the speed to drop rapidly to prevent damage to the motor; when the temperature value at a future moment is greater than or equal to the temperature threshold, and the temperature value of the motor at the latest moment is less than the temperature threshold, the second correction coefficient is greater than 0, and the execution amount is reduced according to the size of the second correction coefficient, thereby ensuring the safety of the motor.
[0118] In this embodiment, the temperature threshold is specifically set based on experiments or experience.
[0119] The present invention uses a PID enhanced control model to control the motor speed when it is predicted that the temperature value at a future moment is lower than a set temperature threshold. The existing PID is enhanced to improve the response speed. When the predicted temperature value at a future moment is higher than or equal to the temperature threshold, a temperature correction amount is added to the PID enhanced control model to reduce the output of the PID enhanced control model, reduce the motor speed, wait for the temperature to drop, extend the service life of the motor, and improve the stability and reliability of the entire motor automation system, so as to solve the problem that the existing PID control model does not consider the impact of temperature changes on motor performance, resulting in motor performance degradation or damage in a high temperature environment.
[0120] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A motor control method based on PID, characterized in that: The following steps are involved: S1. Estimate the temperature value at a future time based on the latest temperature value of the motor; S2, when the temperature value at the future moment is less than the temperature threshold, the motor speed is controlled by using the PID enhanced control model; The PID enhanced control model in S2 includes: a PID control unit and an enhancement unit; The PID control unit is used to obtain an initial execution amount based on a PID algorithm according to a speed difference between a target speed of the motor and an actual speed of the motor; The enhancement unit is used to enhance the initial execution amount to obtain an enhanced execution amount, and use the enhanced execution amount to control the motor speed; The expression of the enhancement unit is: , in, is the enhanced execution amount of the kth control, u(k) is the initial execution amount of the kth control, E(k) is the speed difference between the motor target speed and the motor actual speed corresponding to the kth control, μ is the proportional coefficient, and e is a natural constant; S3. When the temperature value at a future moment is greater than or equal to the temperature threshold, a temperature correction amount is added to the PID enhanced control model to control the motor speed.
2. The motor control method based on PID according to claim 1, characterized in that: The S1 comprises the following sub-steps: S11, collecting motor temperature values and constructing a motor temperature sequence; S12, calculating the temperature rise speed according to the motor temperature sequence; S13, estimating the temperature value at a future time based on the temperature estimation model according to the temperature rise speed and the latest temperature value of the motor.
3. The PID-based motor control method according to claim 2, characterized in that: The formula for calculating the temperature rise rate in S12 is: , Among them, α t is the temperature rise rate at the tth moment, Τ τ+1 is the temperature value collected at the τ+1th moment in the motor temperature sequence, T τ is the temperature value collected at the τth moment in the motor temperature sequence, T t is the temperature value collected at the tth moment in the motor temperature sequence, where the tth moment is the latest moment, t-1 is the temperature value collected at the t-1th moment in the motor temperature sequence, t is the length of the motor temperature sequence, and τ is a positive integer.
4. The PID-based motor control method according to claim 3, characterized in that: The expression of the temperature estimation model in S13 is: , , , Among them, T F is the temperature value at the future time, N is the length of the future time, w α is the temperature rise rate α t The weight of b α is the temperature rise rate α t The bias, w T is the temperature value t The weight of b T is the temperature value t The bias of h1 is the first temperature coefficient, h2 is the second temperature coefficient, and w h1 is the weight of the first temperature coefficient h1, w h2 is the weight of the second temperature coefficient h2, and sigmoid is the activation function.
5. The motor control method based on PID according to claim 1, characterized in that: The S3 comprises the following sub-steps: S31, when the temperature value at a future moment is greater than or equal to the temperature threshold, calculating a first temperature difference according to the latest temperature value of the motor at the moment and the temperature threshold; S32, calculating a second temperature difference according to the temperature value at the future moment and the temperature threshold; S33, calculating a first correction coefficient according to the first temperature difference; S34, calculating a second correction coefficient according to the second temperature difference; S35, calculating a temperature correction amount according to the first correction coefficient and the second correction coefficient; S36, adding a temperature correction amount to the enhanced execution amount output by the PID enhanced control model to obtain a corrected execution amount; S37, using the corrected execution amount to control the motor speed, and when the temperature value at a future moment is less than the temperature threshold, restoring the control of the motor speed by the PID enhanced control model.
6. The PID-based motor control method according to claim 5, characterized in that: The formula for calculating the first temperature difference in S31 is: , Among them, d1 is the first temperature difference, T is the latest temperature value of the motor, T th is the temperature threshold; The formula for calculating the second temperature difference in S32 is: , Where d2 is the second temperature difference, T F is the temperature value at the future time.
7. The PID-based motor control method according to claim 6, characterized in that: The formula for calculating the first correction coefficient in S33 is: , Among them, γ1 is the first correction coefficient, | | is the absolute value operation; The formula for calculating the second correction coefficient in S34 is: , Wherein, γ2 is the second correction coefficient.
8. The PID-based motor control method according to claim 7, characterized in that: The formula for calculating the temperature correction amount in S35 is: , Where r is the temperature correction; The formula for obtaining the corrected execution amount in S36 is: , Among them, G(k) is the correction execution amount of the k-th control.
