A calculation and correction method for motor speed
By introducing reference signals that depend on the MCU clock and calculation speed, update the correction coefficient K, solve the problem of large motor speed calculation errors in the low -cost motor speed regulating system, and achieve higher calculation accuracy and error reduction.
Patent Information
- Application Number
- CN202210354774.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-06
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2042-04-06
AI Technical Summary
The low-cost motor speed regulation system has a large error in the calculation of motor speed due to the system clock accuracy error of the RC oscillator internal MCU, especially in high temperature situations.
By introducing a reference signal that depends on the MCU clock and calculating speed, compare the reference signal generated by the electrical angle of the motor operation itself, and update the correction coefficient K to reduce the motor speed calculation error.
This method can reduce the motor speed error by more than 50 %, improve the speed calculation accuracy, and reduce the effect of the clock error on the calculation speed.
Smart Images

Figure BDA0003581954660000011 
Figure BDA0003581954660000021 
Figure BDA0003581954660000032
Abstract
Description
Technical Field
[0001] The invention belongs to the field of motor equipment, and in particular relates to a calculation and correction method for motor speed. Background Art
[0002] The motor speed regulation system needs to regulate the speed according to the motor speed. The motor speed refers to the angle that the motor rotates per unit time, and the motor speed is generally obtained by calculation. However, there is a time variable in the calculation process, so the accuracy of the time reference value will affect the calculation accuracy of the speed. Many low-cost speed regulation systems directly use the RC oscillator inside the MCU as the system clock of the MCU, but the system clock accuracy has an error of about 1%, especially under high temperature conditions, the system clock error even reaches about 3%, resulting in the speed calculated according to the system clock also has this error. The present invention proposes a speed calculation correction method, which can reduce the influence of the clock error on the calculation speed, and the speed calculation error can be reduced by more than 50%. Summary of the invention
[0003] In order to solve the existing technical problems, the present invention provides a calculation correction method for motor speed. By introducing a reference signal that depends on the MCU clock and the calculation speed, the speed calculation error can be reduced by more than 50%, thereby reducing the influence of the clock error on the calculation speed.
[0004] The main technical solutions adopted in the present invention are:
[0005] A method for calculating and correcting the motor speed, assuming that the correction formula of the motor angular velocity is as shown in formula (1):
[0006]
[0007] Where k is the correction coefficient, θ is the angle rotated in time t;
[0008] The specific steps for correcting the angular velocity of the motor are as follows:
[0009] Step 1: Set the reference signal count. When the motor's electrical angle increases by an angle β, the reference signal count S1 generated by the motor's electrical angle increases by 1.
[0010] Step 2: Set the reference signal count, calculate the time required for the motor to rotate by an angle of β according to the current motor angular velocity, and when the time is reached, add 1 to the reference signal count S2, and then calculate the time required for the motor to rotate by an angle of β according to the current speed, and when the time is reached, add 1 to the reference signal count S2, and repeat this cycle to update the reference signal count S2;
[0011] Step 3: Within a unit time, compare the reference signal count S1 and the reference signal count S2. If the reference signal count S2 is greater than the reference signal count S1, adjust the correction coefficient k to decrease; if the reference signal count S2 is less than the reference signal count S1, adjust the correction coefficient k to increase; if the reference signal count S2 is equal to the reference signal count S1, keep the correction coefficient k unchanged.
[0012] Preferably, in step 2, the time required for the motor to rotate by an angle β is calculated as follows:
[0013]
[0014] Where ω is the current motor angular velocity, which can be calculated by formula (1).
[0015] Preferably, adjusting the correction coefficient k reduces the preset change step width, and adjusting the correction coefficient k increases the preset change step width.
[0016] Preferably, the initial value of the correction coefficient k is 1, and the change step amplitude is 0.001.
[0017] Preferably, the angle β is an arbitrary angle. Beneficial effects: The present invention provides a method for calculating and correcting the motor speed, which has the following advantages:
[0018] (1) The correction method of the present invention is simple and reliable, and does not require additional hardware;
[0019] (2) The correction method of the present invention can reduce the motor speed error by more than 50%;
[0020] (3) Since the calculation of T is related to the clock error of the single-chip microcomputer, the present invention adopts the correction time formula to perform reverse correction, which is different from the existing Compared with the calculation formula, the speed calculation accuracy can be further improved. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application are clearly and completely described below. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0022] Example 1
[0023] A method for calculating and correcting the motor speed, assuming that the correction formula of the motor angular velocity is as shown in formula (1):
[0024]
[0025] Where k is the correction coefficient, and its initial value is 1; θ is the angle rotated in time t;
[0026] The specific steps for correcting the angular velocity of the motor are as follows:
[0027] Step 1: Set the reference signal count. When the motor's electrical angle increases by an angle β, the reference signal count S1 generated by the motor's electrical angle increases by 1.
[0028] Step 2: Set the reference signal count, and calculate the time required for the motor to rotate by an angle of β according to the current motor angular velocity combined with formula (2). When the time is reached, add 1 to the reference signal count S2, and then calculate the time required for the motor to rotate by an angle of β according to the current speed combined with formula (2). When the time is reached, add 1 to the reference signal count S2, and repeat this cycle to update the reference signal count S2, where formula (2) is as follows:
[0029]
[0030] Where, ω is the current motor angular velocity;
[0031] Step 3: Within unit time, compare the reference signal count S1 and the reference signal count S2. If the reference signal count S2 is greater than the reference signal count S1, adjust the correction coefficient k to decrease by 0.001; if the reference signal count S2 is less than the reference signal count S1, adjust the correction coefficient k to increase by 0.001; if the reference signal count S2 is equal to the reference signal count S1, keep the correction coefficient k unchanged.
[0032] The core of the correction method of the present invention is to introduce a reference signal that depends on the MCU clock and the calculation speed, and the reference signal is compared with the reference signal generated by the electrical angle of the motor itself. The correction coefficient k is updated according to the size of the reference signal count and the reference signal count per unit time. If the reference signal count is greater than the reference signal count generated by the motor's own angle, the correction coefficient k decreases, otherwise the correction coefficient k increases, and if the two are equal, the coefficient remains unchanged.
[0033] The motor speed calculation correction method in Example 1 is used together with the existing motor speed measurement method (directly using the MCU internal RC oscillator as the MCU system clock, through Calculation shows that the motor angular velocity (rpm) is measured respectively and the measurement errors of the two are compared.
[0034]
[0035] According to the above experimental data, it can be found that the error rate of the motor speed measured by Example 1 is reduced by more than 50% compared with the existing speed measurement method, which means that the motor speed calculation correction method proposed in Example 1 can obtain a more accurate motor speed.
[0036] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for calculating and correcting motor speed, characterized in that: Assume that the correction formula of the motor angular velocity is as shown in formula (1): Where k is the correction coefficient, θ is the angle rotated in time t; The specific steps for correcting the angular velocity of the motor are as follows: Step 1: Set the reference signal count. When the motor's electrical angle increases by an angle β, the reference signal count S1 generated by the motor's electrical angle increases by 1. Step 2: Set the reference signal count, calculate the time required for the motor to rotate by an angle of β according to the current motor angular velocity, and when the time is reached, add 1 to the reference signal count S2, and then calculate the time required for the motor to rotate by an angle of β according to the current speed, and when the time is reached, add 1 to the reference signal count S2, and update the reference signal count S2 repeatedly in this way; the calculation formula for the time required for the motor to rotate by an angle of β is as follows: Where ω is the current motor angular velocity, which can be calculated by formula (1); Step 3: Within a unit time, compare the reference signal count S1 and the reference signal count S2. If the reference signal count S2 is greater than the reference signal count S1, adjust the correction coefficient k to decrease; if the reference signal count S2 is less than the reference signal count S1, adjust the correction coefficient k to increase; if the reference signal count S2 is equal to the reference signal count S1, keep the correction coefficient k unchanged.
2. The method for calculating and correcting the motor speed according to claim 1, characterized in that: Adjusting the correction coefficient k reduces the preset change step amplitude, and adjusting the correction coefficient k increases the preset change step amplitude.
3. The method for calculating and correcting the motor speed according to claim 2, characterized in that: The initial value of the correction coefficient k is 1, and the change step amplitude is 0.
001.
4. The method for calculating and correcting the motor speed according to claim 1, characterized in that: The angle β is an arbitrary angle.
Citation Information
Patent Citations
Dead zone current compensation system and method for three-phase inverter
CN108964440A
Rotation control method and device, computer equipment and storage medium
CN111077852A