Motor speed control method, device, electronic device and storage medium
Through the state prediction algorithm and the proportional integral differential control algorithm, the motor can be switched to the target speed quickly and accurately, solving the problems of slow response speed, long time and low accuracy of the existing motor control methods.
Patent Information
- Application Number
- CN202411907853.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-24
AI Technical Summary
The existing motor control methods have slow response speed, long time and low accuracy when switching speed, which affects production efficiency and equipment performance.
The state prediction algorithm and proportional integral differential control algorithm are used to obtain the initial and current state information of the motor, predict the speed status of the motor, and determine the control signal based on the target speed and predicted speed to quickly and accurately achieve the target speed.
The motor response speed and control accuracy are improved, the time to reach the target speed is shortened, and the shortcomings of traditional methods are solved without increasing costs.
Smart Images

Figure CN119362947B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and in particular to a motor speed control method, device, electronic equipment and storage medium. Background Art
[0002] In scenarios where motors are used, such as fans, it is often necessary for the motor to be able to switch to the target speed quickly and accurately to meet different working requirements. However, existing motor control methods have some problems when switching speeds. Traditional control methods have a slow response speed, and it takes a long time for the motor to transition from the current speed to the target speed. This will seriously affect production efficiency and equipment performance in situations where high response speed requirements are required. In addition, the existing methods have poor accuracy and it is difficult to ensure that the motor accurately reaches the target speed. Large speed deviations may occur, affecting the normal operation of the equipment. Summary of the invention
[0003] In order to solve the above problems, the embodiments of the present invention disclose a motor speed control method, device, electronic device and storage medium.
[0004] In a first aspect, an embodiment of the present invention provides a motor speed control method, the method comprising:
[0005] Obtaining initial state information, current state information and target speed of the motor;
[0006] Obtaining predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm; the predicted state information includes a predicted rotation speed of the motor;
[0007] Determining a control signal of the motor according to a target speed of the motor and a predicted speed of the motor by a proportional-integral-differential control algorithm;
[0008] The motor is controlled according to the control signal so that the rotation speed of the motor reaches the target rotation speed.
[0009] Optionally, the method further comprises:
[0010] Obtaining the state information range of the motor;
[0011] When the value of the current state information of the motor exceeds the state information range of the motor, the state prediction algorithm is adjusted, and the parameters of the proportional integral differential control algorithm are adjusted.
[0012] Optionally, obtaining predicted state information of the motor according to initial state information of the motor and current state information of the motor through a state prediction algorithm includes:
[0013] Obtaining an initial error covariance matrix and a noise covariance matrix of the state prediction algorithm;
[0014] Obtaining a prediction error covariance matrix according to an initial error covariance matrix of the state prediction algorithm;
[0015] Determining an error gain based on a noise covariance matrix of the state prediction algorithm and the prediction error covariance matrix;
[0016] The predicted state information of the motor is obtained according to the error gain and the current state information of the motor.
[0017] Optionally, the obtaining an initial error covariance matrix and a noise covariance matrix of the state prediction algorithm includes:
[0018] Obtaining an initial state vector according to the initial state information of the motor;
[0019] Obtaining an initial prediction vector of the state prediction algorithm;
[0020] Obtaining an initial error covariance matrix of the state prediction algorithm according to the initial state vector and the initial prediction vector;
[0021] A noise covariance matrix of the state prediction algorithm is obtained according to the operating noise and the observed noise of the motor.
[0022] Optionally, the parameters of the proportional-integral-differential control algorithm include: a proportional coefficient, an integral coefficient and a differential coefficient; the control signal of the motor is determined according to the target speed of the motor and the predicted speed of the motor by the proportional-integral-differential control algorithm, including:
[0023] Obtaining an error signal according to a difference between a target speed of the motor and a predicted speed of the motor;
[0024] multiplying the proportional coefficient by the error signal to obtain a proportional term;
[0025] Performing an integration operation on the integral coefficient and the error signal to obtain an integral term;
[0026] Performing a differential operation on the differential coefficient and the error signal to obtain a differential term;
[0027] The sum of the proportional term, the integral term and the differential term is used as the control signal of the motor.
[0028] Optionally, when the value of the current state information of the motor exceeds the state information range of the motor, adjusting the state prediction algorithm includes:
[0029] When the value of the current state information of the motor exceeds the state information range of the motor, an error parameter of the state prediction algorithm is adjusted; the error parameter includes a measurement error of the current state information and a prediction error of the predicted state information.
[0030] Optionally, adjusting the parameters of the proportional-integral-derivative control algorithm includes:
[0031] Obtaining load information of the motor;
[0032] According to the load information of the motor, the parameters of the proportional-integral-derivative control algorithm are adjusted.
[0033] In a second aspect, an embodiment of the present invention provides a motor speed control device, the device comprising:
[0034] A motor state information acquisition module, used to acquire the initial state information, current state information and target speed of the motor;
[0035] A predicted state information determination module, used to obtain predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm; the predicted state information includes a predicted rotation speed of the motor;
[0036] A motor control signal determination module, used to determine a control signal of the motor according to a target speed of the motor and a predicted speed of the motor by using a proportional-integral-differential control algorithm;
[0037] The motor target speed control module is used to control the motor according to the control signal so that the speed of the motor reaches the target speed.
[0038] Optionally, the device further comprises:
[0039] A state information range acquisition module, used to acquire the state information range of the motor;
[0040] The control algorithm parameter adjustment module is used to adjust the state prediction algorithm and the parameters of the proportional-integral-differential control algorithm when the value of the current state information of the motor exceeds the state information range of the motor.
[0041] Optionally, the predicted state information determination module includes:
[0042] An algorithm variance matrix acquisition submodule, used to acquire the initial error covariance matrix and noise covariance matrix of the state prediction algorithm;
[0043] A prediction variance matrix determination submodule, used to obtain a prediction error covariance matrix according to an initial error covariance matrix of the state prediction algorithm;
[0044] An error gain determination submodule, used to determine an error gain according to a noise covariance matrix of the state prediction algorithm and the prediction error covariance matrix;
[0045] The predicted state information determination submodule is used to obtain the predicted state information of the motor according to the error gain and the current state information of the motor.
[0046] Optionally, the algorithm variance matrix acquisition submodule includes:
[0047] An initial state vector determining unit, used to obtain an initial state vector according to the initial state information of the motor;
[0048] An initial prediction vector acquisition unit, used to acquire an initial prediction vector of the state prediction algorithm;
[0049] An error variance matrix acquisition unit, used to obtain an initial error covariance matrix of the state prediction algorithm according to the initial state vector and the initial prediction vector;
[0050] The noise variance matrix acquisition unit is used to obtain the noise covariance matrix of the state prediction algorithm according to the operating noise and observed noise of the motor.
[0051] Optionally, the parameters of the proportional-integral-differential control algorithm include: a proportional coefficient, an integral coefficient and a differential coefficient; the motor control signal determination module includes:
[0052] an error signal determination submodule, configured to obtain an error signal according to a difference between a target speed of the motor and a predicted speed of the motor;
[0053] A proportional term determination submodule, used for multiplying the proportional coefficient by the error signal to obtain a proportional term;
[0054] An integral term determination submodule, used for performing an integration operation on the integral coefficient and the error signal to obtain an integral term;
[0055] A differential term determination submodule, used for performing a differential operation on the differential coefficient and the error signal to obtain a differential term;
[0056] The motor control signal determination submodule is used to use the sum of the proportional term, the integral term and the differential term as the control signal of the motor.
[0057] Optionally, the control algorithm parameter adjustment module includes:
[0058] The first parameter adjustment submodule is used to adjust the error parameter of the state prediction algorithm when the value of the current state information of the motor exceeds the state information range of the motor; the error parameter includes the measurement error of the current state information and the prediction error of the predicted state information.
[0059] Optionally, the control algorithm parameter adjustment module further includes:
[0060] A load information acquisition submodule, used to acquire the load information of the motor;
[0061] The second parameter adjustment submodule is used to adjust the parameters of the proportional-integral-derivative control algorithm according to the load information of the motor.
[0062] In a third aspect, the present invention shows an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned motor speed control method when executing the computer program.
[0063] In a fourth aspect, the present invention shows a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned motor speed control method are implemented.
[0064] The embodiments of the present invention include the following advantages:
[0065] The embodiments of the present invention can obtain the initial state information, current state information and target speed of the motor; obtain the predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm, so that the control accuracy and stability of the motor can be improved through the state prediction algorithm; the predicted state information includes the predicted speed of the motor; determine the control signal of the motor according to the target speed of the motor and the predicted speed of the motor through a proportional-integral-differential control algorithm, so that the speed at which the motor reaches the target speed can be improved through the proportional-integral-differential control algorithm; control the motor according to the control signal so that the speed of the motor reaches the target speed, so that the problems of slow response speed of traditional motors, long time for the motor to reach the target speed and low accuracy can be solved without increasing costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0067] Figure 1 is a flow chart of steps of a motor speed control method according to an embodiment of the present invention;
[0068] Figure 2 is a flowchart of another motor speed control method according to an embodiment of the present invention;
[0069] Figure 3 is a logic diagram of a motor speed control method according to an embodiment of the present invention;
[0070] Figure 4 It is a structural block diagram of a motor speed control device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The present invention proposes a motor speed control method, the purpose of which is to solve the problem that the conventional motor has a slow response speed, takes a long time to reach the target speed and has low accuracy. To achieve this goal, the embodiment of the present invention improves the control accuracy and stability of the motor through a state prediction algorithm, and improves the speed at which the motor reaches the target speed through a proportional integral differential control algorithm, thereby improving the response speed of the motor and the accuracy of the motor speed control without increasing the cost.
[0072] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0073] Reference Figure 1 , shows a flow chart of a motor speed control method according to an embodiment of the present invention, the method may specifically include the following steps:
[0074] Step 101, obtaining initial state information, current state information and target speed of the motor;
[0075] In an embodiment of the present invention, the initial state information of the motor includes the initial speed of the motor, the initial position of the motor relative to the steering mechanism, the initial current passing through the motor, the type of the motor and the application scenario, etc. The current state information can be collected in real time through sensors, for example, the current speed of the motor is collected through a speed sensor, the current position of the motor relative to the steering mechanism is collected through a position sensor, and the current current passing through the motor is collected through a current sensor. The target speed can be set by the user or can be intelligently selected according to the application scenario of the motor.
[0076] Step 102, obtaining predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm; the predicted state information includes a predicted speed of the motor;
[0077] In an embodiment of the present invention, the initial state information of the motor and the current state information of the motor can be calculated by a state prediction algorithm to obtain the predicted state information of the motor, and the predicted state information can include the predicted speed of the motor. The state prediction algorithm can perform data processing on the initial state information and the current state information of the motor, such as mean filtering, median filtering, etc. The embodiment of the present invention can improve the control accuracy and stability of the motor through the state prediction algorithm.
[0078] Step 103, determining a control signal of the motor according to a target speed of the motor and a predicted speed of the motor by using a proportional-integral-differential control algorithm;
[0079] In an embodiment of the present invention, a PID (Proportional-Integral-Derivative) control algorithm can be used to determine a control signal for the motor according to the target speed of the motor and the predicted speed of the motor. In an embodiment of the present invention, a proportional-integral-derivative control algorithm can be used to increase the speed at which the motor reaches the target speed.
[0080] Step 104: Control the motor according to the control signal so that the rotation speed of the motor reaches the target rotation speed.
[0081] In the embodiment of the present invention, a control signal may be sent to the motor driver, so that the motor driver drives the motor to operate according to the control signal, so that the rotation speed of the motor reaches the target rotation speed quickly and accurately.
[0082] The embodiments of the present invention can obtain the initial state information, current state information and target speed of the motor; obtain the predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm, so that the control accuracy and stability of the motor can be improved through the state prediction algorithm; the predicted state information includes the predicted speed of the motor; determine the control signal of the motor according to the target speed of the motor and the predicted speed of the motor through a proportional-integral-differential control algorithm, so that the speed at which the motor reaches the target speed can be improved through the proportional-integral-differential control algorithm; control the motor according to the control signal so that the speed of the motor reaches the target speed, so that the problems of slow response speed of traditional motors, long time for the motor to reach the target speed and low accuracy can be solved without increasing costs.
[0083] Reference Figure 2 , shows a flowchart of another motor speed control method according to an embodiment of the present invention, the method may specifically include the following steps:
[0084] Step 201, obtaining initial state information, current state information and target speed of the motor;
[0085] In an embodiment of the present invention, the initial state information of the motor includes the initial speed of the motor, the initial position of the motor relative to the steering mechanism, the initial current passing through the motor, the type of the motor and the application scenario, etc. The current state information can be collected in real time through sensors, for example, the current speed of the motor is collected through a speed sensor, the current position of the motor relative to the steering mechanism is collected through a position sensor, and the current current passing through the motor is collected through a current sensor. The target speed can be set by the user or can be intelligently selected according to the application scenario of the motor.
[0086] Step 202, obtaining predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm; the predicted state information includes a predicted speed of the motor;
[0087] In an embodiment of the present invention, the initial state information of the motor and the current state information of the motor can be calculated by a state prediction algorithm to obtain the predicted state information of the motor, and the predicted state information may include the predicted speed of the motor. The state prediction algorithm can perform data processing on the initial state information and the current state information of the motor, such as mean filtering, median filtering, etc. At the same time, according to experience and actual conditions, combined with factors such as the type, specification, and application scenario of the motor, the error parameters can be reasonably set. The error parameters may include the measurement error of the current state information and the prediction error of the predicted state information, etc.
[0088] For example, taking the drive motor of a small electric vehicle as an example, the motor is a permanent magnet synchronous AC motor with a power of 50kW and a rated speed of 3000 rpm. The application scenario is driving the vehicle normally on urban roads. The measurement error range of the current state information of the motor can be as follows:
[0089] Speed measurement error parameter: Considering that the permanent magnet synchronous AC motor itself has good speed synchronization, and although there are certain requirements for vehicle speed control in this application scenario, it does not require ultra-high precision (compared to industrial processing and other scenarios), the speed measurement error parameter can be set to a standard deviation of ±3~±5 rpm;
[0090] Current measurement error parameter: 50kW is a medium power. Considering the characteristics of the permanent magnet synchronous AC motor and the stability of the electrical system during vehicle driving, the current measurement error parameter can be set to a standard deviation of ±2~±3 amperes.
[0091] Position measurement error parameters (assuming there are relevant position control requirements, such as the coordinated position control of the motor and steering mechanism when the vehicle is turning): Since the position control accuracy requirements during vehicle driving are not particularly high, it can be set to a standard deviation of ±2~±3 mm. By comprehensively considering factors such as the type, specification, and application scenario of the motor to reasonably set the error parameters, the control and monitoring of the motor can be more in line with actual needs, improving the performance and reliability of the entire control system.
[0092] In one embodiment, the step of obtaining the predicted state information of the motor according to the initial state information of the motor and the current state information of the motor by using a state prediction algorithm may further include the following sub-steps:
[0093] Sub-step S11, obtaining the initial error covariance matrix and noise covariance matrix of the state prediction algorithm;
[0094] Sub-step S12, obtaining a prediction error covariance matrix according to the initial error covariance matrix of the state prediction algorithm;
[0095] Sub-step S13, determining an error gain according to the noise covariance matrix of the state prediction algorithm and the prediction error covariance matrix;
[0096] Sub-step S14, obtaining predicted state information of the motor according to the error gain and the current state information of the motor.
[0097] Among them, the method of obtaining the initial error covariance matrix and noise covariance matrix of the state prediction algorithm includes: obtaining an initial state vector based on the initial state information of the motor; obtaining the initial prediction vector of the state prediction algorithm; obtaining the initial error covariance matrix of the state prediction algorithm based on the initial state vector and the initial prediction vector; and obtaining the noise covariance matrix of the state prediction algorithm based on the operating noise and observed noise of the motor.
[0098] In an embodiment of the present invention, a prediction error covariance matrix can be obtained according to the initial error covariance matrix of the state prediction algorithm, and then the error gain can be determined according to the noise covariance matrix and the prediction error covariance matrix of the state prediction algorithm, and then the predicted state information of the motor can be obtained according to the error gain and the current state information of the motor. For example, taking the state prediction algorithm as the Kalman filter algorithm as an example, the specific process of obtaining the predicted state information of the motor is as follows:
[0099] The first step is initialization. Determine the initial state vector, such as the vector composed of the motor's speed, position and other state information. Set the motor's initial prediction vector, which can be obtained based on the motor's initial state information. At the same time, determine the initial error covariance matrix to describe the uncertainty of the initial estimate (initial prediction vector).
[0100] Then enter the prediction step. According to the state transfer equation, combined with the initial prediction vector of the previous moment, the prediction vector of the current moment is calculated. Then, according to the error covariance matrix of the previous moment, the state transfer matrix and the process noise covariance matrix, the initial error covariance matrix of the current moment prediction is calculated.
[0101] The next step is the update step. First, the Kalman gain is calculated, which is determined by the predicted initial error covariance matrix, the observation matrix, and the observation noise covariance matrix. Then, based on the current state information of the motor and the predicted state estimate, the Kalman gain is used to update the current state estimate, that is, the predicted state information. Finally, based on the Kalman gain and the predicted error covariance matrix, the error covariance matrix at the current moment is updated for the next iteration.
[0102] By repeating the prediction and update steps, at each sampling moment, the Kalman filter algorithm can combine the real-time collected information and the previous estimated values, effectively handle measurement noise and system uncertainty, and accurately estimate and predict the state of the motor and other systems.
[0103] Step 203, determining a control signal of the motor according to the target speed of the motor and the predicted speed of the motor by using a proportional-integral-differential control algorithm;
[0104] In one embodiment, the parameters of the proportional-integral-differential control algorithm include: a proportional coefficient, an integral coefficient and a differential coefficient; the step of determining the control signal of the motor according to the target speed of the motor and the predicted speed of the motor by the proportional-integral-differential control algorithm may further include the following sub-steps:
[0105] Sub-step S21, obtaining an error signal according to a difference between the target speed of the motor and the predicted speed of the motor;
[0106] Sub-step S22, multiplying the proportional coefficient by the error signal to obtain a proportional term;
[0107] Sub-step S23, performing an integration operation on the integral coefficient and the error signal to obtain an integral term;
[0108] Sub-step S24, performing a differential operation on the differential coefficient and the error signal to obtain a differential term;
[0109] Sub-step S25, taking the sum of the proportional term, the integral term and the differential term as the control signal of the motor.
[0110] In an embodiment of the present invention, a PID (Proportional-Integral-Derivative) control algorithm can be used to determine the control signal of the motor according to the target speed of the motor and the predicted speed of the motor. Specifically, the parameters of the proportional-integral-derivative control algorithm include: a proportional coefficient, an integral coefficient, and a differential coefficient. According to the difference between the target speed of the motor and the predicted speed of the motor, an error signal can be obtained; the proportional coefficient is multiplied by the error signal to obtain a proportional term; the integral coefficient is integrated with the error signal to obtain an integral term; the differential coefficient is differentiated with the error signal to obtain a differential term; the proportional term, the integral term, and the differential term are added to obtain the control signal of the motor. At the same time, considering the stability and reliability of the control signal, the control signal can be appropriately limited and filtered.
[0111] Step 204, controlling the motor according to the control signal so that the rotation speed of the motor reaches the target rotation speed;
[0112] In the embodiment of the present invention, a control signal may be sent to the motor driver, so that the motor driver drives the motor to operate according to the control signal, so that the rotation speed of the motor reaches the target rotation speed quickly and accurately.
[0113] Step 205, obtaining the state information range of the motor;
[0114] In an embodiment of the present invention, the state information range of the motor may be the safe operating range of the motor. Exemplarily, the speed safety range may be: ±20% of the rated speed of an ordinary industrial motor (such as a three-phase asynchronous motor driving a conveyor belt), such as a rated speed of 1500 rpm, the safety range is 1200-1800 rpm. The rated speed of a high-speed motor (such as a high-speed cutting spindle motor) is ±5%, such as a rated speed of 10,000 rpm, the safety range is 9500-10500 rpm.
[0115] The current safety range can be: ±15% of the rated current for small DC motors (such as toys and small equipment). For example, if the rated current is 1 ampere, the safety range is 0.85-1.15 amperes. For large industrial motors (such as large factory power equipment), the rated current is ±10%. For example, if the rated current is 100 amperes, the safety range is 90-110 amperes.
[0116] The temperature safety range can be: the ambient temperature of ordinary motors (such as household and general industrial motors) is +50℃ to +80℃. If the ambient temperature is 20℃, the safety range is 70℃ to 100℃. The ambient temperature of large industrial motors (such as motors in high temperature environments such as metallurgy and glass manufacturing) is +150℃ to +200℃. If the ambient temperature is 30℃, the safety range is 180℃ to 230℃. These values will vary depending on factors such as motor type and specifications, and actual applications need to be analyzed and determined.
[0117] Step 206 , when the value of the current state information of the motor exceeds the state information range of the motor, adjusting the state prediction algorithm and adjusting the parameters of the proportional-integral-derivative control algorithm.
[0118] In one embodiment, when the value of the current state information of the motor exceeds the state information range of the motor, the step of adjusting the state prediction algorithm and adjusting the parameters of the proportional integral differential control algorithm may further include the following sub-steps:
[0119] Sub-step S31, when the value of the current state information of the motor exceeds the state information range of the motor, adjusting the error parameter of the state prediction algorithm; the error parameter includes the measurement error of the current state information and the prediction error of the predicted state information;
[0120] In the embodiment of the present invention, the adjustment and optimization process of the state prediction algorithm is as follows, taking the Kalman filter algorithm as an example:
[0121] Noise-related adjustments: Process noise covariance matrix Q: In-depth analysis of factors that generate process noise during motor operation, such as friction, temperature changes, etc. Experiments are conducted to determine the impact of these factors on state changes under different operating conditions, and the corresponding element values in Q are adjusted accordingly to reflect the process noise characteristics. Observation noise covariance matrix R: Considers the observation noise caused by the accuracy of the measurement equipment and environmental interference. The error of the test equipment in the actual environment is used to reasonably set the relevant element values in R to accurately reflect the measurement uncertainty.
[0122] Initial value optimization: Initial state estimation: Perform multiple sets of initial measurements, such as motor speed, position, etc. Use data fusion methods such as weighted average to process the measured values to obtain more accurate initial state estimation values. Initial error covariance matrix P0: Considering that the initial measurement is affected by many factors and has large uncertainty. Combined with the initial measurement accuracy assessment, motor type, etc., the P0 element value is reasonably set, and the diagonal elements can be set larger initially.
[0123] Optimization of prediction and update steps: Prediction step: Real-time monitoring of motor parameter changes, such as temperature and load changes, timely update the state transfer matrix A element value to accurately reflect the state evolution law. Accurately set the input matrix B element value and analyze the impact of control input on the state. Update step: Adjust the observation matrix H according to changes in measurement equipment or methods. Analyze the error between the predicted and actual measured state, and adaptively adjust the Kalman gain K value to make the state estimation more accurate.
[0124] Through these adjustments and optimizations, the embodiments of the present invention can improve the performance of the state prediction algorithm under noise interference and measurement uncertainty.
[0125] Sub-step S32, obtaining load information of the motor;
[0126] Sub-step S33, adjusting the parameters of the proportional-integral-derivative control algorithm according to the load information of the motor.
[0127] In an embodiment of the present invention, when the value of the current state information of the motor exceeds the state information range of the motor, a safety protection mechanism can be used to ensure that the motor operates within a safe range. The motor speed can be continuously monitored, and the load changes that the motor may be subjected to during operation can be considered to load compensate the control algorithm. At the same time, the parameters of the PID control algorithm are dynamically adjusted according to the operating state and performance requirements of the motor. Anti-interference measures are taken to improve the stability and reliability of the system.
[0128] Specifically, the process of load compensation is as follows: monitor the load through parameters such as motor current, torque, and speed change rate. For example, use a current sensor to measure current, and if there is a torque sensor, measure torque. You can also process the speed data to get the speed change rate. When the motor is running, collect the selected parameter data at a certain frequency. The collected data must be filtered to remove noise and obtain an accurate value. According to the type of motor, etc., use previous experience and experimental data to establish a load and monitoring parameter relationship model. For example, a linear relationship model between torque and current can be built for DC motors, and a more complex model may be built for AC motors. Substitute the processed monitoring parameter data into the model to calculate the current load estimate of the motor. Determine the compensation strategy based on the motor control objectives and scenarios. For example, to maintain a constant speed, increase the input power when the load increases; to keep the torque constant, adjust the control parameters when the load changes. Adjust the motor control parameters according to the strategy. For example, when using PID to control the speed, the speed decreases when the load increases. You can increase the proportional coefficient or integral coefficient to restore the speed, and you can also increase the input voltage according to the situation.
[0129] During the operation of the motor, sensors and monitoring equipment can also be used to continuously monitor the state and control effect of the motor. Monitor the actual operating parameters of the motor, such as speed, position, and current, compare them with the target parameters, and evaluate the control effect. Monitor the operating conditions of the motor, such as temperature and vibration, to ensure that the motor operates within a safe range. If there is a deviation between the actual operation and the expected target, optimize it. Specifically, adjust the parameters of the state prediction algorithm, such as adjusting the error parameters according to the change of the motor load. At the same time, adjust the parameters of the state prediction algorithm according to the changes in the operating environment of the motor to improve the adaptability of the mechanism. You can also adjust the parameters of the PID control algorithm, such as adjusting the proportional coefficient, integral coefficient, and differential coefficient. The PID parameters can be automatically adjusted through experiments and optimization algorithms to adapt to different operating conditions.
[0130] For example, the process of adjusting PID parameters can be as follows: continuously monitor the motor speed, position, current, temperature and other operating state parameters, and compare the error and other information with the target value as the basis for adjusting the parameters. Clarify the performance requirements of the motor in different scenarios, see whether the current PID control effect meets the standard, and determine whether to adjust the parameters and the direction.
[0131] Adjust the proportional coefficient Kp: Kp affects the response speed and overshoot. If the response is slow, increase Kp, but it may cause overshoot. If the overshoot exceeds the range, reduce Kp. Do not adjust Kp too much. First adjust it according to a certain ratio, and then adjust it further after seeing the effect.
[0132] Adjust the integral coefficient Ki: Ki is used to eliminate steady-state errors. If there is a steady-state error, adjust the Ki value according to its positive or negative value. For positive deviations, increase Ki, and for negative deviations, reduce Ki. When increasing Ki, be careful not to let the integral term saturate. You can set upper and lower limits.
[0133] Adjust the differential coefficient Kd: Kd improves system stability and response speed. If the system is unstable, increase Kd, but it may make the system sensitive to noise. If it is sensitive, reduce Kd. When adjusting Kd, it is usually necessary to combine Kp and Ki for adjustment, because the three coefficients affect each other.
[0134] The embodiments of the present invention can obtain the initial state information, current state information and target speed of the motor; obtain the predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm, so that the control accuracy and stability of the motor can be improved through the state prediction algorithm; the predicted state information includes the predicted speed of the motor; determine the control signal of the motor according to the target speed of the motor and the predicted speed of the motor through a proportional-integral-differential control algorithm, so that the speed at which the motor reaches the target speed can be improved through the proportional-integral-differential control algorithm; control the motor according to the control signal so that the speed of the motor reaches the target speed, so that the problems of slow response speed of traditional motors, long time for the motor to reach the target speed and low accuracy can be solved without increasing costs.
[0135] Reference Figure 3 , shows a logic diagram of a motor speed control method provided by an embodiment of the present invention, in order to enable those skilled in the art to better understand the embodiment of the present invention, the following Figure 3 The embodiments of the present invention are described as follows:
[0136] Step 301, establish a mathematical model of the motor. In-depth analysis of the structure of the motor, including the characteristics of the stator, rotor, winding and other components, study the working principle of the motor, such as electromagnetic induction, torque generation and other processes, and construct a mathematical model of the motor through theoretical deduction and experimental data fitting to provide a theoretical basis for subsequent steps.
[0137] Step 302, initialize the state prediction algorithm. First, perform initial measurement on the motor to obtain the initial speed, position, current and other data of the motor. Then, process the initial measurement value through data processing algorithms, such as mean filtering, median filtering, etc., to determine the initial state estimation value. Then, based on experience and actual conditions, combined with factors such as the type, specification, and application scenario of the motor, reasonably set the error parameters, including measurement error, estimation error, etc.
[0138] Step 303, obtaining the current state information of the motor. During the operation of the motor, sensors (such as speed sensors, position sensors, current sensors, etc.) are used to collect the state information of the motor such as speed, position, current, etc. in real time.
[0139] Step 304, process the current state information of the motor through the state prediction algorithm. The state prediction algorithm is used to process the collected information. Through continuous iterative calculation, the motor state changes are tracked in real time to provide accurate state information. At the same time, considering noise interference and measurement uncertainty, the state prediction algorithm is appropriately adjusted and optimized.
[0140] Step 305, determine the control signal of the motor according to the current speed and the target speed of the motor through the PID algorithm. Calculate the error signal, which is the difference between the target speed and the actual speed. Calculate the proportional term, which is the product of the proportional coefficient and the error signal. Calculate the integral term, which is the sum of the integral coefficient and the integral of the error signal. Calculate the differential term, which is the product of the differential coefficient and the rate of change of the error signal. Calculate the control signal, which is the sum of the proportional term, the integral term and the differential term.
[0141] Step 306, control the motor according to the control signal. Send the control signal to the motor driver to drive the motor to run. At the same time, considering the stability and reliability of the control signal, the control signal is appropriately limited and filtered.
[0142] Step 307, determine whether the value of the current state information of the motor exceeds the range. Continuously monitor the actual speed of the motor, and consider the load changes that the motor may be subjected to during operation, and perform load compensation on the control algorithm. Dynamically adjust the parameters of the PID control algorithm according to the operating state and performance requirements of the motor. Take anti-interference measures to improve the stability and reliability of the system. Then set up a safety protection mechanism to ensure that the motor operates within a safe range.
[0143] Step 308: If the value of the current state information of the motor exceeds the range, adjust the error parameter of the state prediction algorithm.
[0144] Step 309, when the value of the current state information of the motor exceeds the range, adjust the parameters of the PID algorithm. During the operation of the motor, use sensors and monitoring equipment to continuously monitor the state and control effect of the motor. Monitor the actual operating parameters of the motor, such as speed, position, current, etc., compare with the target parameters, and evaluate the control effect. Monitor the operating conditions of the motor, such as temperature and vibration, to ensure that the motor operates within a safe range. If there is a deviation between the actual operating conditions and the expected target, optimize: adjust the parameters of the state estimation and prediction mechanism, such as adjusting the error parameters according to the change of the motor load. At the same time, adjust the parameters of the state estimation and prediction algorithm according to the changes in the operating environment of the motor to improve the adaptability of the mechanism. Adjust the parameters of the PID control algorithm, such as adjusting the proportional coefficient, integral coefficient and differential coefficient. The PID parameters can be automatically adjusted through experiments and optimization algorithms to adapt to different operating conditions.
[0145] Step 310, determining whether the motor speed has reached the target speed. If the motor speed has not reached the target speed, return to step 303. If the motor speed has reached the target speed, the process ends.
[0146] The embodiments of the present invention can obtain the initial state information, current state information and target speed of the motor; obtain the predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm, so that the control accuracy and stability of the motor can be improved through the state prediction algorithm; the predicted state information includes the predicted speed of the motor; determine the control signal of the motor according to the target speed of the motor and the predicted speed of the motor through a proportional-integral-differential control algorithm, so that the speed at which the motor reaches the target speed can be improved through the proportional-integral-differential control algorithm; control the motor according to the control signal so that the speed of the motor reaches the target speed, so that the problems of slow response speed of traditional motors, long time for the motor to reach the target speed and low accuracy can be solved without increasing costs.
[0147] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0148] Reference Figure 4 , shows a structural block diagram of a motor speed control device provided by an embodiment of the present invention, which may specifically include the following modules:
[0149] The motor state information acquisition module 401 is used to acquire the initial state information, current state information and target speed of the motor;
[0150] A predicted state information determination module 402, configured to obtain predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm; the predicted state information includes a predicted rotation speed of the motor;
[0151] A motor control signal determination module 403, configured to determine a control signal of the motor according to a target speed of the motor and a predicted speed of the motor by using a proportional-integral-differential control algorithm;
[0152] The motor target speed control module 404 is used to control the motor according to the control signal so that the speed of the motor reaches the target speed.
[0153] In an embodiment of the present invention, the device further includes:
[0154] A state information range acquisition module, used to acquire the state information range of the motor;
[0155] The control algorithm parameter adjustment module is used to adjust the state prediction algorithm and the parameters of the proportional-integral-differential control algorithm when the value of the current state information of the motor exceeds the state information range of the motor.
[0156] In the embodiment of the present invention, the predicted state information determination module 402 includes:
[0157] An algorithm variance matrix acquisition submodule, used to acquire the initial error covariance matrix and noise covariance matrix of the state prediction algorithm;
[0158] A prediction variance matrix determination submodule, used to obtain a prediction error covariance matrix according to an initial error covariance matrix of the state prediction algorithm;
[0159] An error gain determination submodule, used to determine an error gain according to a noise covariance matrix of the state prediction algorithm and the prediction error covariance matrix;
[0160] The predicted state information determination submodule is used to obtain the predicted state information of the motor according to the error gain and the current state information of the motor.
[0161] In the embodiment of the present invention, the algorithm variance matrix acquisition submodule includes:
[0162] An initial state vector determining unit, used to obtain an initial state vector according to the initial state information of the motor;
[0163] An initial prediction vector acquisition unit, used to acquire an initial prediction vector of the state prediction algorithm;
[0164] An error variance matrix acquisition unit, used to obtain an initial error covariance matrix of the state prediction algorithm according to the initial state vector and the initial prediction vector;
[0165] The noise variance matrix acquisition unit is used to obtain the noise covariance matrix of the state prediction algorithm according to the operating noise and observed noise of the motor.
[0166] In the embodiment of the present invention, the parameters of the proportional-integral-differential control algorithm include: a proportional coefficient, an integral coefficient and a differential coefficient; the motor control signal determination module 403 includes:
[0167] an error signal determination submodule, configured to obtain an error signal according to a difference between a target speed of the motor and a predicted speed of the motor;
[0168] A proportional term determination submodule, used for multiplying the proportional coefficient by the error signal to obtain a proportional term;
[0169] An integral term determination submodule, used for performing an integration operation on the integral coefficient and the error signal to obtain an integral term;
[0170] A differential term determination submodule, used for performing a differential operation on the differential coefficient and the error signal to obtain a differential term;
[0171] The motor control signal determination submodule is used to use the sum of the proportional term, the integral term and the differential term as the control signal of the motor.
[0172] In an embodiment of the present invention, the control algorithm parameter adjustment module includes:
[0173] The first parameter adjustment submodule is used to adjust the error parameters of the state prediction algorithm when the value of the current state information of the motor exceeds the state information range of the motor; the error parameters include the measurement error of the current state information and the prediction error of the predicted state information.
[0174] In an embodiment of the present invention, the control algorithm parameter adjustment module further includes:
[0175] A load information acquisition submodule, used to acquire the load information of the motor;
[0176] The second parameter adjustment submodule is used to adjust the parameters of the proportional-integral-derivative control algorithm according to the load information of the motor.
[0177] The embodiments of the present invention can obtain the initial state information, current state information and target speed of the motor; obtain the predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm, so that the control accuracy and stability of the motor can be improved through the state prediction algorithm; the predicted state information includes the predicted speed of the motor; determine the control signal of the motor according to the target speed of the motor and the predicted speed of the motor through a proportional-integral-differential control algorithm, so that the speed at which the motor reaches the target speed can be improved through the proportional-integral-differential control algorithm; control the motor according to the control signal so that the speed of the motor reaches the target speed, so that the problems of slow response speed of traditional motors, long time for the motor to reach the target speed and low accuracy can be solved without increasing costs.
[0178] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0179] An embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned motor speed control method when executing the computer program.
[0180] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned motor speed control method are implemented.
[0181] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0182] It should be understood by those skilled in the art that embodiments of the present invention may provide methods, devices or computer program products. Therefore, embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware aspects. Moreover, embodiments of the present invention may take the form of a computer program product implemented on one or more machine-readable media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0183] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0184] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0185] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0186] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0187] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0188] The motor speed control method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A motor speed control method, characterized in that: The method comprises: Obtaining initial state information, current state information and target speed of the motor; Obtaining predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm; the predicted state information includes a predicted rotation speed of the motor; Determining a control signal of the motor according to a target speed of the motor and a predicted speed of the motor by a proportional-integral-differential control algorithm; controlling the motor according to the control signal so that the rotation speed of the motor reaches the target rotation speed; The method further comprises: Obtaining the state information range of the motor; When the value of the current state information of the motor exceeds the state information range of the motor, the error parameters of the state prediction algorithm and the parameters of the proportional integral differential control algorithm are adjusted; the error parameters include the measurement error of the current state information and the prediction error of the predicted state information.
2. The method according to claim 1, characterized in that The state prediction algorithm is used to obtain the predicted state information of the motor according to the initial state information of the motor and the current state information of the motor, including: Obtaining an initial error covariance matrix and a noise covariance matrix of the state prediction algorithm; Obtaining a prediction error covariance matrix according to an initial error covariance matrix of the state prediction algorithm; Determining an error gain based on a noise covariance matrix of the state prediction algorithm and the prediction error covariance matrix; The predicted state information of the motor is obtained according to the error gain and the current state information of the motor.
3. The method according to claim 2, characterized in that The obtaining of the initial error covariance matrix and the noise covariance matrix of the state prediction algorithm comprises: Obtaining an initial state vector according to the initial state information of the motor; Obtaining an initial prediction vector of the state prediction algorithm; Obtaining an initial error covariance matrix of the state prediction algorithm according to the initial state vector and the initial prediction vector; A noise covariance matrix of the state prediction algorithm is obtained according to the operating noise and the observed noise of the motor.
4. The method according to claim 1, characterized in that The parameters of the proportional-integral-differential control algorithm include: a proportional coefficient, an integral coefficient and a differential coefficient; the control signal of the motor is determined according to the target speed of the motor and the predicted speed of the motor by the proportional-integral-differential control algorithm, including: Obtaining an error signal according to a difference between a target speed of the motor and a predicted speed of the motor; multiplying the proportional coefficient by the error signal to obtain a proportional term; Performing an integration operation on the integral coefficient and the error signal to obtain an integral term; Performing a differential operation on the differential coefficient and the error signal to obtain a differential term; The sum of the proportional term, the integral term and the differential term is used as the control signal of the motor.
5. The method according to claim 4, characterized in that The adjusting the parameters of the proportional integral derivative control algorithm comprises: Obtaining load information of the motor; According to the load information of the motor, the parameters of the proportional-integral-derivative control algorithm are adjusted.
6. A motor speed control device, characterized in that: The device comprises: A motor state information acquisition module, used to acquire the initial state information, current state information and target speed of the motor; A predicted state information determination module, used to obtain predicted state information of the motor according to the initial state information of the motor and the current state information of the motor through a state prediction algorithm; the predicted state information includes a predicted rotation speed of the motor; A motor control signal determination module, used to determine a control signal of the motor according to a target speed of the motor and a predicted speed of the motor by using a proportional-integral-differential control algorithm; a motor target speed control module, used to control the motor according to the control signal so that the speed of the motor reaches the target speed; The device also includes: A state information range acquisition module, used to acquire the state information range of the motor; A control algorithm parameter adjustment module is used to adjust the error parameters of the state prediction algorithm and the parameters of the proportional-integral-differential control algorithm when the value of the current state information of the motor exceeds the state information range of the motor; the error parameters include the measurement error of the current state information and the prediction error of the predicted state information.
7. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the steps of a motor speed control method as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a motor speed control method as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Torque compensation method and device of motor, storage medium and electronic equipment
CN116198339A