Motor control method and device, electronic device and storage medium
By building an extended load observer, calculating the current compensation value when the external load of the motor changes, the problem of slow motor control speed in the prior art is solved, and the control efficiency and response speed are improved.
Patent Information
- Application Number
- CN202410936732.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-07-12
AI Technical Summary
When the external load changes, the existing motor control method requires multiple calculations of the speed error and adjusting the current command, resulting in slower control speed and low efficiency.
By building an extended load observer, calculate the current compensation value required for changes in the external load of the motor, reducing the amount of current that the motor needs to increase or decrease, so as to quickly achieve the target speed.
Improves the efficiency of motor control, reduces the time to reach the target speed, and achieves a fast response to changes in external loads.
Smart Images

Figure CN118826553B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automation control technology, and in particular to a motor control method and device, electronic equipment and storage medium. Background Art
[0002] At present, a proportional integral differential (PID) controller is usually used to process the feedback signal of the motor, so as to achieve the purpose of making the motor operation data and the command data the same. For example, by processing the output current of the motor, it can be ensured that the torque data of the motor is the same as the torque data issued by the host computer. However, when the external load of the motor changes, the speed of the motor will also change, which will cause the error between the current speed of the motor and the target speed of the motor to gradually increase. At this time, due to the performance factors of the PID controller, the PID controller needs to calculate the speed error of the motor multiple times and convert it into a current command. Then, the motor is controlled according to the current command to ensure that the motor recovers and stabilizes. This process consumes a lot of time and causes the motor control speed to slow down. Therefore, how to improve the efficiency of motor control has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to provide a motor control method and device, an electronic device and a storage medium, aiming to improve the efficiency of motor control.
[0004] To achieve the above object, a first aspect of an embodiment of the present application provides a motor control method, the method comprising:
[0005] Acquire motor parameters of the motor, and construct an extended load observer according to the motor parameters;
[0006] Acquire the current speed of the motor, and obtain the incremental speed according to the current speed and a preset target speed;
[0007] Calculating a current compensation value using the extended load observer to obtain a compensation current of the motor;
[0008] Calculating the current error of the motor according to the incremental speed and the compensation current to obtain an error current;
[0009] The speed of the motor is controlled according to the error current.
[0010] In some embodiments, constructing an extended load observer according to the motor parameters includes:
[0011] Acquire the current current and external torque of the motor, wherein the external torque refers to the torque applied to the motor by the load borne by the motor;
[0012] Calculating the disturbance of the motor according to the preset target current, the current current, the external torque and the motor parameters to obtain the disturbance parameters;
[0013] Calculating input matrix data according to the motor parameters and the disturbance parameters;
[0014] Calculate gain matrix data according to the preset observer bandwidth;
[0015] Using the input matrix data and the gain matrix data, data replacement is performed on a pre-constructed extended load observer state function to obtain a target observer state function;
[0016] The extended load observer is constructed according to the target observer state function.
[0017] In some embodiments, calculating the disturbance of the motor according to the preset target current, the current current, the external torque and the motor parameter to obtain the disturbance parameter includes:
[0018] Performing a product operation on the motor parameter and the target current to obtain a target torque;
[0019] Performing a product operation on the motor parameter and the current current to obtain an actual torque;
[0020] Calculating the difference between the target torque and the actual torque to obtain the motor internal disturbance parameter;
[0021] Calculating the difference between the actual torque and the external torque to obtain motor external disturbance parameters;
[0022] The disturbance parameter is obtained according to the motor internal disturbance parameter and the motor external disturbance parameter.
[0023] In some embodiments, controlling the speed of the motor according to the error current includes:
[0024] Performing a current loop operation on the error current to obtain a target voltage;
[0025] The target voltage is data packaged to obtain a voltage instruction, and the voltage instruction is used to control the speed of the motor.
[0026] In some embodiments, the step of calculating the current compensation value using the extended load observer to obtain the compensation current of the motor includes:
[0027] According to preset load calculation parameters, the extended load observer is used to perform load estimation to obtain an observed load;
[0028] The current is calculated according to the observed load and the motor parameters to obtain the compensation current.
[0029] In some embodiments, calculating the current error of the motor according to the incremental speed and the compensation current to obtain the error current includes:
[0030] Performing data packaging on the incremental speed to obtain a speed instruction;
[0031] Processing the speed command with a control algorithm to obtain a current command;
[0032] According to the current command, using a preset current controller to generate an incremental current;
[0033] The difference between the incremental current and the compensation current is calculated to obtain the error current.
[0034] In some embodiments, obtaining the incremental speed according to the current speed and the preset target speed includes:
[0035] Calculating the difference between the target speed and the current speed to obtain an error speed;
[0036] The error speed is calculated using a proportional-integral control algorithm to obtain the incremental speed.
[0037] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a motor control device, the device comprising:
[0038] A motor observer building module, used for acquiring motor parameters of the motor and building an extended load observer according to the motor parameters;
[0039] A motor incremental speed calculation module, used to obtain the current speed of the motor, and obtain the incremental speed according to the current speed and a preset target speed;
[0040] A motor compensation current calculation module, used to calculate the current compensation value using the extended load observer to obtain the compensation current of the motor;
[0041] A motor error current calculation module, used to calculate the current error of the motor according to the incremental speed and the compensation current to obtain the error current;
[0042] A motor speed control module is used to control the speed of the motor according to the error current.
[0043] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0044] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0045] The motor control method and device, electronic device and storage medium proposed in the present application, by constructing an extended load observer, can calculate the current that the motor needs to compensate when the external load of the motor changes, and then reduce the amount of current that the motor needs to increase or decrease through the compensation current, thereby reducing the time it takes for the motor to reach the target speed and improving the control efficiency of the motor. In addition, the extended load observer can also monitor the external load of the motor in real time, and when the external load of the motor changes, it can achieve a rapid response, thereby accelerating the speed at which the motor recovers to the target speed and improving the control efficiency of the motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flow chart of a motor control method provided by an embodiment of the present application;
[0047] Figure 2 yes Figure 1 Flow chart of step S101 in FIG.
[0048] Figure 3 yes Figure 2 Flow chart of step S202 in FIG.
[0049] Figure 4 yes Figure 1 Flow chart of step S102 in FIG.
[0050] Figure 5 yes Figure 1 Flow chart of step S103 in FIG.
[0051] Figure 6 yes Figure 1 Flow chart of step S104 in FIG.
[0052] Figure 7 yes Figure 1 Flow chart of step S105 in FIG.
[0053] Figure 8 is a schematic diagram of the structure of a motor control device provided in an embodiment of the present application;
[0054] Fig. 9It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0058] First, some nouns involved in this application are analyzed:
[0059] Motor control system: refers to a system that accurately controls the motor's operating status, speed, torque and other performance by controlling the motor's current, voltage or other parameters. Motor control systems are widely used in industry, machinery, automobiles, aerospace and other fields. Motor control systems are usually composed of sensors, controllers, actuators and feedback loops. The sensors are used to collect information about the motor's operating status. The controller calculates the control algorithm based on the collected information and outputs the control signal. The actuator converts the control signal into the motor's control quantity. The feedback loop is used to monitor the motor's operating status in real time and provide feedback to the controller. Different types of motors have different control methods and technologies. Common motor control technologies include PID control, vector control, position closed-loop control, etc. The design and implementation of motor control systems are of great significance to improving motor performance, energy saving, and precise control.
[0060] Proportional-integral control algorithm: It is a commonly used control method that controls the system through three controllers, namely proportional, integral and differential, combined with the error signal. The proportional-integral control algorithm includes proportional controller, integral controller and differential controller. Among them, the proportional controller refers to the relationship between the output control quantity and the error proportional to the current error signal, which is used to eliminate the steady-state error of the system. The role of the proportional controller is to determine the size of the control quantity according to the error size, so that the system responds faster, but it may cause oscillation or overshoot; the integral controller refers to the control quantity that is proportional to the accumulated error according to the accumulated amount of the error signal, which is used to eliminate the steady-state error of the system and reduce the steady-state deviation. The role of the integral controller is to continuously monitor the error and actively correct the error as time accumulates. The differential controller refers to the relationship between the output control quantity and the error change rate proportional to the current error signal change rate, which is used to suppress the oscillation of the system and improve the stability of the system. The role of the differential controller is to predict the future change trend of the error and take measures to reduce the rate of error, thereby improving the response speed of the system and suppressing oscillation. The proportional-integral control algorithm can obtain the final control output by integrating the outputs of the proportional controller, integral controller and differential controller, and realize the adjustment of the steady-state performance and dynamic performance of the system. The proportional-integral control algorithm is widely used in industrial control, automation control, robot control and other fields, and is a simple and effective control method.
[0061] At present, a proportional integral derivative (PID) controller is usually used to process the feedback signal of the motor, so as to achieve the purpose of making the motor operation data and the command data the same. For example, by processing the output current of the motor, it can ensure that the torque data of the motor is the same as the torque data issued by the host computer. However, when the external load of the motor changes, the speed of the motor will also change, which will cause the error between the current speed of the motor and the target speed of the motor to gradually increase. At this time, due to the performance factors of the PID controller, the PID controller needs to calculate the speed error of the motor multiple times and convert it into a current command. Then, the motor is controlled according to the current command to ensure that the motor recovers and stabilizes. This process consumes a lot of time and causes the motor control speed to slow down. Therefore, how to improve the efficiency of motor control has become a technical problem that needs to be solved urgently.
[0062] Based on this, the embodiments of the present application provide a motor control method and device, an electronic device and a storage medium, aiming to improve the efficiency of motor control.
[0063] The motor control method and device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the motor control method in the embodiments of the present application is described.
[0064] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0065] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0066] The motor control method provided in the embodiment of the present application relates to the field of automation control technology. The motor control method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the motor control method, etc., but is not limited to the above forms.
[0067] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0068] Figure 1is an optional flow chart of the motor control method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S105.
[0069] Step S101, obtaining motor parameters of the motor, and constructing an extended load observer according to the motor parameters;
[0070] Step S102, obtaining the current speed of the motor, and obtaining the incremental speed according to the current speed and the preset target speed;
[0071] Step S103, using the extended load observer to calculate the current compensation value to obtain the compensation current of the motor;
[0072] Step S104, calculating the current error of the motor according to the incremental speed and the compensation current to obtain the error current;
[0073] Step S105, controlling the speed of the motor according to the error current.
[0074] In the steps S101 to S105 shown in the embodiment of the present application, the present application obtains the motor parameters of the motor by querying the parameter data of the motor, and then constructs an extended load observer according to the motor parameters to observe the motor load in real time, obtain the speed of the motor at the current moment, and obtain the current speed. Further, according to the current speed and the target speed set in advance, the incremental speed of the motor is calculated, and then the current compensation value is calculated by the extended load observer to obtain the compensation current of the motor. Secondly, according to the incremental speed and the compensation current of the motor, the current error of the motor is calculated to obtain the error current. Finally, according to the error current, the speed of the motor control system is changed to achieve control of the motor. Therefore, the present application can calculate the current required to be compensated by the motor when the external load of the motor changes by constructing an extended load observer, and then reduce the size of the current that the motor needs to increase or decrease by the compensation current, thereby reducing the time for the motor to reach the target speed and improving the control efficiency of the motor. In addition, the extended load observer can also monitor the external load of the motor in real time. When the external load of the motor changes, it can achieve rapid response, thereby accelerating the speed at which the motor recovers the target speed and improving the control efficiency of the motor.
[0075] It should be noted that the motor control system mentioned in the present application includes a motor module, a motor speed control module, a motor current control module and an extended load observer module.
[0076] In one application scenario, taking an automobile motor as an example, an extended load observer is constructed in an automobile motor control system where the automobile motor is located according to the motor parameters of the automobile motor. When the vehicle is driving, the current speed of the automobile motor and the target speed in the target speed instruction issued by the automobile host computer are obtained to calculate the automobile motor speed increment and obtain the automobile motor incremental speed. Furthermore, the extended load observer is used to calculate the current compensation value of the automobile motor to obtain the automobile motor compensation current. Then, according to the automobile motor incremental speed and the automobile motor compensation current, the current error of the automobile motor is calculated to obtain the automobile motor error current. Finally, the speed of the automobile motor is controlled according to the automobile motor error current.
[0077] In step S101 of some embodiments, the motor parameters refer to parameters such as the moment of inertia and torque constant of the motor. An extended load observer refers to an observer for estimating the load of the motor and unmodeled disturbances. The present application obtains the motor parameters by querying the built-in performance parameters of the motor, and then constructs an extended load observer for real-time monitoring of the motor load based on the motor parameters.
[0078] It should be noted that in existing motor control systems, extended load observers are usually not used to estimate the external load of the motor, resulting in the controller module in the motor control system being unable to accurately estimate the system load when there are unmodeled disturbances or external interferences in the motor control system, causing the motor control system to respond slowly and have low control efficiency. The present application estimates the unmodeled disturbances of the motor control system by constructing an extended state observer and monitoring the external load of the motor in real time, thereby improving the robustness and stability of the motor control system and the efficiency of motor control.
[0079] See also Figure 2 In some embodiments, step S101 may include but is not limited to steps S201 to S206:
[0080] Step S201, obtaining the current current and external torque of the motor, wherein the external torque refers to the torque applied to the motor by the load borne by the motor;
[0081] Step S202, calculating the disturbance of the motor according to the preset target current, current current, external torque and motor parameters to obtain disturbance parameters;
[0082] Step S203, calculating input matrix data according to motor parameters and disturbance parameters;
[0083] Step S204, calculating gain matrix data according to a preset observer bandwidth;
[0084] Step S205, using the input matrix data and the gain matrix data, performing data replacement on the pre-built extended load observer state function to obtain a target observer state function;
[0085] Step S206: construct an extended load observer according to the target observer state function.
[0086] In step S201 of some embodiments, the current current refers to the actual current of the motor at the current moment. The external torque refers to the torque applied to the motor by the load borne by the motor. The present application obtains the current current of the motor through the current sensor in the motor control system, and obtains the external torque of the motor through the load sensor.
[0087] In step S202 of some embodiments, the target current refers to the current that the upper computer of the motor control system expects the motor in the motor control system to reach. Disturbance refers to the interference factors that affect the operation of the motor. It should be noted that the disturbance includes internal disturbance and external disturbance, wherein the internal disturbance refers to the difference between the target current received by the current control module of the motor and the current current of the motor, and the external disturbance refers to the disturbance caused by the change of the load borne by the motor. This application calculates the disturbance parameters of the motor control system based on the target current, torque constant, current current and external torque data set in advance.
[0088] See also Figure 3 In some embodiments, step S202 may include but is not limited to steps S301 to S305:
[0089] Step S301, performing a product operation on the motor parameter and the target current to obtain a target torque;
[0090] Step S302, performing product operation on the motor parameter and the current current to obtain the actual torque;
[0091] Step S303, calculating the difference between the target torque and the actual torque to obtain the motor internal disturbance parameter;
[0092] Step S304, calculating the difference between the actual torque and the external torque to obtain the motor external disturbance parameter;
[0093] Step S305 , combining the motor internal disturbance parameters and the motor external disturbance parameters to obtain disturbance parameters.
[0094] In step S301 and step S302 of some embodiments, the target torque refers to the torque value that the motor control system expects to achieve. The actual torque is the torque value of the motor in the motor control system at the current moment. According to the torque calculation formula, the present application obtains the target torque by multiplying the torque constant in the motor parameters with the target current, and obtains the actual torque by multiplying the torque constant in the motor parameters with the current current.
[0095] In steps S303 and S304 of some embodiments, the motor internal disturbance parameter is the disturbance data caused by the internal factors of the motor control system. The motor external disturbance parameter is the disturbance data generated by the external disturbance factors on the motor control system. The present application obtains the motor internal disturbance parameter by calculating the difference between the target torque and the actual torque, and obtains the motor external disturbance parameter by calculating the difference between the actual torque and the external torque.
[0096] In detail, the present application can calculate the motor internal disturbance parameters and the motor external disturbance parameters by the following formula:
[0097] S 内 =k t *i q * -k t *i q ;
[0098] S 外 =k t *i q -T load ;
[0099] Among them, S 内 represents the motor internal disturbance parameter, k t represents the torque constant, i q * represents the target current, i q Indicates the current, S 外 Represents the motor external disturbance parameter, T load Indicates external torque.
[0100] In an optional embodiment, the torque constant of the motor is 0.048, the current current is 0.5, the target current is 0.6, the external torque is 1, and according to the calculation formula of the motor internal disturbance parameter, the motor internal disturbance parameter can be obtained as 0.0048, and according to the calculation formula of the motor external disturbance parameter, the motor external disturbance parameter can be obtained as -0.076.
[0101] In step S305 of some embodiments, the internal disturbance parameter of the motor is added to the external disturbance parameter of the motor to obtain the total disturbance data of the motor, that is, the disturbance parameter, so as to improve the robustness of the motor control.
[0102] In steps S301 to S305 shown in this embodiment, the target torque and actual torque of the motor are calculated by the torque calculation formula, and then the internal disturbance parameters of the motor and the external disturbance parameters of the motor are calculated according to the target torque, the actual torque and the external torque. Then, the internal disturbance parameters of the motor and the external disturbance parameters of the motor are added and combined to obtain the disturbance parameters, so that the extended load observer can not only observe the external disturbance factors of the motor, but also observe the internal disturbance factors of the motor, thereby improving the robustness of the extended load observer and the accuracy of motor control.
[0103] In step S203 of some embodiments, when the motor disturbance parameters are obtained, a speed function of the motor is constructed according to the moment of inertia in the motor parameters, and the speed function is compared with a preset motor state space function to obtain input matrix data.
[0104] In detail, the speed function of the motor can be expressed in the following equation form:
[0105]
[0106] in, represents the motor speed vector, J represents the motor moment of inertia, and S represents the motor disturbance parameter;
[0107] In an optional embodiment, the disturbance parameter of the motor is 0.036, the moment of inertia is 0.0005, and according to the speed function of the motor, the speed of the motor is 72.
[0108] The motor state space function can be expressed in the following equation form:
[0109]
[0110] in, represents the speed vector of the motor, b0 represents the input matrix data, u represents the input data of the motor, and f represents the interference term of the motor.
[0111] It should be noted that the above-mentioned interference items refer to factors that affect the motor speed, such as the external load borne by the motor or the current loss of the internal circuit of the motor. In this case, the interference items are the same as the disturbance parameters of the motor.
[0112] In step S204 of some embodiments, the observer bandwidth is the bandwidth of the extended load observer set in advance. It should be noted that the pole position of the extended load observer can be calculated by the sampling pole configuration method, and then the pole position is used as the observer bandwidth. The present application calculates the gain matrix data according to the motor parameters and the observer bandwidth.
[0113] In steps S205 and S206 of some embodiments, the extended load observer state function may be expressed in the following form:
[0114]
[0115] in, represents the first state estimation vector of the motor, b0 represents the input matrix data of the extended load observer state function, u represents the input data of the motor, x2 represents the second state estimation value of the motor, β1 represents the first gain matrix of the extended load observer state function, y represents the output data of the motor, x1 represents the first state estimation value of the motor, represents the second state estimation vector of the motor, and β2 represents the second gain matrix of the extended load observer state function.
[0116] It should be noted that, in the present application, the input data of the motor refers to the target current input to the motor, and the output data of the motor refers to the current current output by the motor.
[0117] The present application replaces the data in the extended load observer state function with the calculated input matrix data and gain matrix data to obtain the target observer state function, and then constructs an extended load observer based on the target observer state function to achieve the effect of estimating the external load of the motor.
[0118] In an optional embodiment, the input matrix data is 96, the input data of the motor is 0.6, the first gain matrix is 1000, the second gain matrix is 250000, and the output data of the motor is 0.5. According to the above-mentioned extended load observer state function, the first state estimation vector of the motor can be obtained as 0.5, and the second state estimation vector of the motor is 56.87.
[0119] In steps S201 to S206 shown in this embodiment, the target observer state function is obtained by calculating the input matrix data and gain matrix data in the pre-constructed extended load observer state function, and then the extended load observer is constructed according to the target observer state function, ensuring that the constructed extended load observer can estimate the load change of the motor by observing the disturbance of the motor control system, thereby achieving rapid response to the motor load change and improving the motor control efficiency.
[0120] In step S102 of some embodiments, the current speed refers to the motor speed of the motor control system at the current moment. The target speed refers to the speed that the upper computer of the motor control system expects the motor in the motor control system to reach. The present application can obtain the current speed of the motor by building a motor speed sensor in the motor control system. In the motor control system, in order to ensure that the motor can reach the target speed in the speed command, it is necessary to calculate the motor speed increment according to the current speed and the target speed set in advance to obtain the incremental speed.
[0121] See also Figure 4 In some embodiments, step S102 includes but is not limited to steps S401 to S402:
[0122] Step S401, calculating the difference between the target speed and the current speed to obtain an error speed;
[0123] Step S402, performing proportional-integral control algorithm calculation on the error speed to obtain an incremental speed.
[0124] In step S401 of some embodiments, the present application calculates the target speed and the current speed to obtain the difference between the current speed of the motor and the target speed sent by the host computer.
[0125] In step S402 of some embodiments, the proportional-integral control algorithm refers to a PID control algorithm, wherein the PID control algorithm adjusts the output value of the PID controller by measuring the error between the current speed of the motor control system and the target speed, and then uses the output value to make the current speed of the motor control system as close to the target speed as possible. The present application calculates the error speed by using the PID control algorithm, adjusts the output value of the motor speed control module in the motor control system, and thus obtains the incremental speed of the motor.
[0126] In steps S401 to S402 shown in this embodiment, the present application calculates the difference between the target speed and the current speed to obtain the error speed, and then uses the proportional calculus control algorithm to calculate the error speed to obtain the incremental speed, so that the current speed of the motor control system approaches the target speed as quickly as possible, thereby improving the efficiency of motor control.
[0127] In step S103 of some embodiments, the motor load is estimated using the constructed extended load observer, and then the current compensation value of the motor is calculated according to the estimation result to obtain the compensation current.
[0128] See also Figure 5 In some embodiments, step S103 includes but is not limited to steps S501 to S502:
[0129] Step S501, according to preset load calculation parameters, using an extended load observer to perform load estimation to obtain an observed load;
[0130] Step S502, calculating the current according to the observed load and motor parameters to obtain the compensation current.
[0131] In step S501 of some embodiments, the load calculation parameter refers to the parameter data of the motor that needs to be obtained when the extended load observer calculates the load of the motor. In the present application, the extended load observer is composed of a target observer state function, so the obtained load calculation parameter is input into the target observer state function to obtain the observed load. It should be noted that the observed load is not necessarily the same as the current actual load of the motor.
[0132] In step S502 of some embodiments, the compensation current of the motor may be calculated using the following formula:
[0133] I com =f * / k t ;
[0134] Among them, I com Indicates the compensation current of the motor, f * represents the observed load, k t Indicates the torque constant of the motor.
[0135] In an optional embodiment, the observed load is 1, the torque constant is 0.048, and the compensation current can be obtained as 20.83 according to the above compensation current calculation formula.
[0136] The present application calculates the compensation current of the motor through the above formula, reducing the amount of current that needs to be changed in the motor current control module in the motor control system, so that the motor can quickly reach the target current, thereby improving the efficiency of motor control.
[0137] In steps S501 to S502 shown in this embodiment, the load of the motor is estimated using an extended load observer based on the load calculation parameters to obtain the observed load, and then the compensation current is calculated based on the observed load and the torque constant in the motor parameters. This can reduce the number of times the current change is calculated in the motor control system, allowing the motor to quickly recover stability, thereby improving the efficiency of motor control.
[0138] In step S104 of some embodiments, the present application converts the incremental speed into an incremental current so that the incremental speed and the compensation current are in the same dimension, and then calculates the incremental current and the compensation current to obtain the error current.
[0139] See also Figure 6 In some embodiments, step S104 includes but is not limited to steps S601 to S604:
[0140] Step S601, encapsulating the incremental speed data to obtain a speed instruction;
[0141] Step S602, processing the speed command by a control algorithm to obtain a current command;
[0142] Step S603, generating an incremental current using a preset current controller according to the current instruction;
[0143] Step S604, calculating the difference between the incremental current and the compensation current to obtain the error current.
[0144] In step S601 and step S602 of some embodiments, the speed instruction refers to an instruction containing an incremental speed transmitted by the motor speed control module to the motor current control module. The current instruction refers to an instruction containing current data transmitted by the motor speed control module to the motor current control module. The present application obtains the speed instruction by encapsulating the output of the motor speed control module, and then processes the speed instruction by a control algorithm to obtain a current instruction that can be received by the motor current control module.
[0145] In step S603 of some embodiments, the preset current controller is used to generate incremental current data according to the current data contained in the current instruction. The incremental current refers to the difference between the current current of the motor and the expected current of the motor without calculating external interference. The present application generates the current data contained in the current instruction by using the current controller, so that the motor current control module can receive the difference between the current current of the motor and the expected current of the motor without calculating external interference.
[0146] In step S604 of some embodiments, the compensation current generated by the extended load observer has performed current compensation on the motor. Therefore, the present application only needs to input the difference current between the incremental current and the compensation current, ie, the error current, into the motor current control module.
[0147] In steps S601 to S604 shown in the present embodiment, the incremental speed is converted into the incremental current so that the incremental speed and the incremental current are in the same dimension, which facilitates the motor control system to calculate the error current, and then the difference between the incremental current and the compensation current is calculated to obtain the error current, which can reduce the processing time of the motor current control module and improve the efficiency of motor control.
[0148] In step S105 of some embodiments, after the error current is obtained, the error current is input into the motor in the form of an instruction, thereby achieving speed control of the motor.
[0149] See also Figure 7 In some embodiments, step S105 may include but is not limited to steps S701 to S702:
[0150] Step S701, performing current loop operation on the error current to obtain a target voltage;
[0151] Step S702, encapsulating the target voltage to obtain a voltage instruction, and using the voltage instruction to control the speed of the motor.
[0152] In step S701 of some embodiments, after the error current is obtained, the difference between the error current and the current current is calculated to obtain the supplementary current, and then the supplementary current is calculated by a proportional calculus control algorithm to obtain the filling current. Furthermore, the filling current is subjected to a current loop operation to obtain the target voltage.
[0153] In step S702 of some embodiments, after the target voltage is obtained, data is packaged for the target voltage to obtain a voltage instruction, and the voltage instruction is used to control the speed of the motor, thereby ensuring that the motor can run at the target speed.
[0154] In steps S701 to S702 shown in this embodiment, the target voltage is obtained by performing a current loop operation on the error current, and then the target voltage is converted into a voltage command, and the voltage command is used to control the speed of the motor, thereby achieving motor control, so that the motor can operate at the target speed expected by the host computer.
[0155] The embodiment of the present application constructs an extended load observer, which can calculate the current that the motor needs to compensate when the external load of the motor changes, and then reduce the current that the motor needs to increase or decrease through the compensation current, thereby reducing the time it takes for the motor to reach the target speed and improving the control efficiency of the motor. In addition, the extended load observer can also monitor the external load of the motor in real time. When the external load of the motor changes, the extended load observer can respond quickly, thereby speeding up the speed at which the motor recovers to the target speed and improving the control efficiency of the motor.
[0156] See also Figure 8 The present application also provides a motor control device that can implement the above motor control method. The device includes:
[0157] A motor observer building module 801 is used to obtain motor parameters of the motor and build an extended load observer according to the motor parameters;
[0158] The motor incremental speed calculation module 802 is used to obtain the current speed of the motor and obtain the incremental speed according to the current speed and the preset target speed;
[0159] The motor compensation current calculation module 803 is used to calculate the current compensation value using the extended load observer to obtain the compensation current of the motor;
[0160] The motor error current calculation module 804 is used to calculate the current error of the motor according to the incremental speed and the compensation current to obtain the error current;
[0161] The motor speed control module 805 is used to control the speed of the motor according to the error current.
[0162] The specific implementation of the motor control device is basically the same as the specific implementation of the above motor control method, and will not be repeated here.
[0163] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above motor control method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0164] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0165] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0166] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the motor control method of the embodiment of this application;
[0167] Input / output interface 903, used to implement information input and output;
[0168] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0169] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0170] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0171] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned motor control method is implemented.
[0172] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0173] The motor control method, motor control device, electronic device and storage medium provided in the embodiments of the present application can calculate the current that the motor needs to compensate for when the external load of the motor changes by constructing an extended load observer, and then reduce the amount of current that the motor needs to increase or decrease by compensating the current, thereby reducing the time it takes for the motor to reach a target speed and improving the control efficiency of the motor. In addition, the extended load observer can also monitor the external load of the motor in real time. When the external load of the motor changes, the extended load observer can achieve rapid response, thereby accelerating the speed at which the motor recovers to the target speed and improving the control efficiency of the motor.
[0174] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0175] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0176] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0177] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0178] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0179] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0180] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0181] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0182] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0183] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0184] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A motor control method, characterized in that: Applied to a motor control system, the method comprises: Acquire the current current and external torque of the motor, wherein the external torque refers to the torque applied to the motor by the load borne by the motor; Calculating the disturbance of the motor according to the preset target current, the current current, the external torque and the motor parameters to obtain the disturbance parameters; Calculating input matrix data according to the motor parameters and the disturbance parameters; Calculate gain matrix data according to the preset observer bandwidth; Using the input matrix data and the gain matrix data, data replacement is performed on a pre-constructed extended load observer state function to obtain a target observer state function; constructing the extended load observer according to the target observer state function; Acquire the current speed of the motor, and obtain the incremental speed according to the current speed and a preset target speed; Calculating a current compensation value using the extended load observer to obtain a compensation current of the motor; Calculating the current error of the motor according to the incremental speed and the compensation current to obtain an error current; The speed of the motor is controlled according to the error current.
2. The method according to claim 1, characterized in that: The step of calculating the disturbance of the motor according to the preset target current, the current current, the external torque and the motor parameters to obtain the disturbance parameters includes: Performing a product operation on the motor parameter and the target current to obtain a target torque; Performing a product operation on the motor parameter and the current current to obtain an actual torque; Calculating the difference between the target torque and the actual torque to obtain the motor internal disturbance parameter; Calculating the difference between the actual torque and the external torque to obtain motor external disturbance parameters; The disturbance parameter is obtained according to the motor internal disturbance parameter and the motor external disturbance parameter.
3. The method according to claim 1, characterized in that The step of controlling the speed of the motor according to the error current includes: Performing a current loop operation on the error current to obtain a target voltage; The target voltage is data packaged to obtain a voltage instruction, and the voltage instruction is used to control the speed of the motor.
4. The method according to claim 1, characterized in that: The step of calculating the current compensation value by using the extended load observer to obtain the compensation current of the motor includes: According to preset load calculation parameters, the extended load observer is used to perform load estimation to obtain an observed load; The current is calculated according to the observed load and the motor parameters to obtain the compensation current.
5. The method according to any one of claims 1 to 4, characterized in that: The step of calculating the current error of the motor according to the incremental speed and the compensation current to obtain the error current includes: Performing data packaging on the incremental speed to obtain a speed instruction; Processing the speed command with a control algorithm to obtain a current command; According to the current command, using a preset current controller to generate an incremental current; The difference between the incremental current and the compensation current is calculated to obtain the error current.
6. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining an incremental speed according to the current speed and the preset target speed includes: Calculating the difference between the target speed and the current speed to obtain an error speed; The error speed is calculated using a proportional-integral control algorithm to obtain the incremental speed.
7. A motor control device, characterized in that: The device comprises: A motor observer construction module is used to obtain the current current and external torque of the motor, wherein the external torque refers to the torque applied to the motor by the load borne by the motor, calculate the disturbance of the motor according to the preset target current, the current current, the external torque and the motor parameters, obtain the disturbance parameters, calculate the input matrix data according to the motor parameters and the disturbance parameters, calculate the gain matrix data according to the preset observer bandwidth, use the input matrix data and the gain matrix data to replace the data of the pre-constructed extended load observer state function, obtain the target observer state function, and construct the extended load observer according to the target observer state function; A motor incremental speed calculation module, used to obtain the current speed of the motor, and obtain the incremental speed according to the current speed and a preset target speed; A motor compensation current calculation module, used to calculate the current compensation value using the extended load observer to obtain the compensation current of the motor; A motor error current calculation module, used to calculate the current error of the motor according to the incremental speed and the compensation current to obtain the error current; A motor speed control module is used to control the speed of the motor according to the error current.
8. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the motor control method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the motor control method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for observing speed of industrial electric vehicle at extremely low speed
CN114499326A
Motor control method and device and computer readable storage medium
CN117792178A