Speed control method and device, motor and storage medium
By calculating the weights of speed error and error change rate, the time constant of the internal mold speed controller is adaptively adjusted, solving the problem of poor stability in traditional internal mold control systems and improving the stability and robustness of the motor.
Patent Information
- Application Number
- CN202511389918.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-12-09
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional internal mold control systems cannot adaptively adjust parameters, resulting in poor stability of permanent magnet synchronous motors.
By acquiring the preset reference speed and the real-time speed, the speed error and the rate of change of error are calculated, the actual weight and the expected weight are confirmed, and the first correction weight, the second correction weight and the third correction weight are calculated. Based on these weights, the time constant is calculated and substituted into the internal model speed controller to adjust the speed.
It achieves adaptive adjustment of speed, improving the stability and robustness of the motor.
Smart Images

Figure CN121098170A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor technology, and in particular to a speed control method, device, motor, and storage medium. Background Technology
[0002] The most commonly used control system for permanent magnet synchronous motors is the internal model control system (IMC). IMC is a control strategy based on a mathematical model of the controlled object. Its core principle is to embed the dynamic characteristics of the controlled system into the controller as an internal model. Compared to PI controllers, IMC makes parameter positive definiteness easier. However, when there is a significant mismatch in the model of the permanent magnet synchronous motor, traditional IMC control systems cannot adaptively adjust the parameters, leading to decreased system stability. Summary of the Invention
[0003] This invention provides a speed control method, device, motor, and storage medium, aiming to solve the problem of poor stability caused by the inability of traditional internal model control to adaptively adjust parameters.
[0004] In a first aspect, embodiments of the present invention provide a speed control method applied to a motor, the method comprising: A preset reference speed and a real-time speed are obtained respectively, and the speed error and the rate of change of error at the current moment are calculated based on the preset reference speed and the real-time speed respectively; Confirm the actual weights and expected weights of the preset reference rotation speed, the speed error, and the error change rate, and calculate the first correction weight, the second correction weight, and the third correction weight based on the actual weights and the expected weights, respectively; The time constant is calculated based on the first correction weight, the second correction weight, and the third correction weight; The time constant is substituted into the preset internal mold speed controller, and the real-time rotational speed is adjusted through the preset internal mold speed controller.
[0005] Secondly, embodiments of the present invention also provide a speed control device applied to a motor, the device comprising: The first acquisition unit is used to acquire a preset reference speed and a real-time speed respectively, and to calculate the speed error and the rate of change of error at the current moment based on the preset reference speed and the real-time speed respectively; The first calculation unit is used to confirm the actual weight and expected weight of the preset reference rotation speed, the speed error, and the error change rate, and to calculate the first correction weight, the second correction weight, and the third correction weight based on the actual weight and the expected weight, respectively. The second calculation unit is used to calculate the time constant based on the first correction weight, the second correction weight, and the third correction weight; The first adjustment unit is used to substitute the time constant into the preset inner mold speed controller and adjust the real-time rotation speed through the preset inner mold speed controller.
[0006] Thirdly, embodiments of the present invention also provide an electric motor, which includes a memory and a processor connected to the memory, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0007] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0008] This invention provides a speed control method, device, motor, and storage medium. The method includes: acquiring a preset reference speed and a real-time speed, and calculating the speed error and error change rate at the current moment based on the preset reference speed and the real-time speed; determining the actual weights and expected weights of the preset reference speed, the speed error, and the error change rate, and calculating a first correction weight, a second correction weight, and a third correction weight based on the actual weights and the expected weights; calculating a time constant based on the first correction weight, the second correction weight, and the third correction weight; and substituting the time constant into a preset internal model speed controller and adjusting the real-time speed through the preset internal model speed controller. This invention can calculate the speed error and error change rate based on the preset reference speed and the real-time speed, and calculate the first correction weight, the second correction weight, and the third correction weight based on the actual weights and expected weights of the preset reference speed, the speed error, and the error change rate. Then, it calculates the time constant based on the first correction weight, the second correction weight, and the third correction weight, and substitutes the time constant into the internal model speed controller to adjust the time constant of the internal model speed controller. This enables speed regulation, not only adaptively adjusting the time constant but also improving stability and robustness. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a flowchart illustrating the speed control method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the motor control system provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the first sub-process of the speed control method provided in this embodiment of the invention; Figure 4 This is a schematic diagram of the second sub-process of the speed control method provided in this embodiment of the invention; Figure 5 This is a schematic diagram of the third sub-process of the speed control method provided in this embodiment of the invention; Figure 6 This is a schematic diagram of the third sub-process of the speed control method provided in this embodiment of the invention; Figure 7 This is a schematic block diagram of a speed control device provided in an embodiment of the present invention; Figure 8 This is a schematic block diagram of a motor provided in an embodiment of the present invention. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] It should be understood that, when used in this specification and the appended claims, the terms “comprising” and “including” indicate the presence of the described features, integrals, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, operations, elements, components and / or collections thereof.
[0013] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations.
[0014] Please see Figure 1 , Figure 1 This is a flowchart illustrating the speed control method provided in an embodiment of the present invention. The speed control method of this invention can be applied to motors, such as permanent magnet motors, and can adaptively adjust the time constant to improve motor stability. The method includes steps S100 to S130.
[0015] S100: Obtain the preset reference speed and the real-time speed respectively, and calculate the speed error and error change rate at the current moment based on the preset reference speed and the real-time speed respectively.
[0016] In this embodiment of the invention, the preset reference speed refers to the target speed that the motor control system expects to achieve, which is the reference value for the control task. For example, if the motor is required to operate stably at 1500 r / min, then 1500 r / min is the preset reference speed. The real-time speed refers to the current speed of the motor actually measured by sensors (such as encoders or Hall sensors), used to reflect the actual operating state of the system. For example, when the motor is running, the encoder provides real-time feedback that the current speed is 1450 r / min, that is, the real-time speed is 1450 r / min. The speed error refers to the difference between the reference speed and the real-time speed, used to reflect the magnitude of the gap between the actual speed and the target. For example, if the reference speed is 1500 r / min and the real-time speed is 1450 r / min, then the speed error e(t) = 1500 - 1450 = 50 r / min. The error change rate refers to the trend of speed error change over time, reflecting whether the error is increasing or decreasing, and how fast it changes. For example, if the speed error changes from 50 r / min to 30 r / min after 1 second, then the error change rate = 30 - 50 = -20.
[0017] When the motor is running, the preset reference speed and the real-time speed of the motor can be obtained. Then, the speed error can be calculated based on the preset reference speed and the real-time speed, and the error change rate can be calculated based on the speed error.
[0018] In some embodiments, such as in embodiments of the present invention, as Figure 3 As shown, step S100 includes steps S101-S102.
[0019] S101, calculate the difference between the current preset reference speed and the real-time speed to obtain the speed error; S102, calculate the rate of change of error at the current moment based on the speed error at the previous moment and the speed error at the current moment.
[0020] In this embodiment of the invention, assuming a preset reference rotational speed x1 = 1500 r / min, and the real-time rotational speed w(t) at the current moment (denoted as time t) = 1450 r / min, then according to the speed error = reference rotational speed - real-time rotational speed, we can obtain: x2(t) = rw(t) = 1500 - 1450 = 50 r / min If the real-time rotational speed at the previous moment (denoted as t-1) was w(t-1) = 1480 r / min, then the speed error at the previous moment is: x2(t-1)=1500-1480=20r / min Therefore, according to the error change rate = (current time error - previous time error) ÷ time interval, we can obtain: x3(t) = 50 - 20 = 30 r / min S110, confirm the actual weight and expected weight of the preset reference rotation speed, the speed error and the error change rate, and calculate the first correction weight, the second correction weight and the third correction weight based on the actual weight and the expected weight respectively.
[0021] In this embodiment of the invention, the actual weight refers to the real-time weight value in the internal model speed controller, that is, the actual weight value of the preset reference speed, speed error, and error change rate, and its initial value can be set to any value between 0 and 1. The expected weight is the set ideal weight allocation, which needs to reflect the requirement of prioritizing the response error and the error change trend. That is, the expected weight is related to the changes in the preset reference speed, speed error, and error change rate. The corrected weight refers to the new weight value obtained through weight update at time t+1.
[0022] The first, second, and third correction weights can be used to calculate the time constant in order to achieve adaptive adjustment of the time constant.
[0023] In some embodiments, such as in embodiments of the present invention, as Figure 4 As shown, step S110 includes steps S111-S114.
[0024] S111, Substitute the actual weight and expected weight of the preset reference rotation speed into the preset weight adaptive calculation formula to obtain the first corrected weight; S112, Substitute the actual weight and expected weight of the speed error into the preset weight adaptive calculation formula to obtain the second correction weight; S113, Substitute the actual weight and expected weight of the error change rate into the preset weight adaptive calculation formula to obtain the third correction weight; S114, normalize the first modified weight, the second modified weight and the third modified weight to obtain the normalized first modified weight, the second modified weight and the third modified weight respectively.
[0025] In this embodiment of the invention, weights can be allocated based on the current operating conditions of the motor and the input function positioning. For example, under stable operating conditions, the actual motor speed is close to the preset reference speed (speed error < 5% of rated error), there are no sudden load changes or temperature drift, and the system needs to maintain stable speed without significant parameter adjustments. Expected weight calculation: Preset reference speed (baseline stable) ≈ Error change rate > Speed error (small error, no need for over-response); Expected weight α for preset reference speed. 1= 0.35 (needs to maintain the target benchmark, slightly higher weight); Expected weight of velocity error α2=0.25 (small error, lowest weight); Expected weight of error change rate α3=0.4 (needs to suppress small oscillations, highest weight).
[0026] For sudden load changes, the load torque of a PMSM (Permanent Magnet Synchronous Motor) may suddenly increase or decrease, causing a rapid increase in speed error (error > 10% of rated error). Therefore, it is necessary to prioritize reducing this error to prevent further deterioration of speed deviation. The expected weight calculation (based on input positioning) is as follows: Speed error (core error correction) > Error change rate (predicted deviation trend) > Preset reference speed (fixed target, no reinforcement required); The expected weight of the preset reference speed is α1 = 0.1 (weakening the reference during disturbances, focusing on the error); the expected weight of the speed error is α2 = 0.6; the expected weight of the error change rate is α3 = 0.3 (avoiding over-adjustment leading to oscillation).
[0027] For model mismatch conditions, PMSM parameters drift due to temperature increases / decreases, widening the deviation between the model and the actual object. Velocity error increases slowly with fluctuating error change rate, requiring a balance between error correction and system robustness. Expected weight calculations: Error change rate (suppressing oscillations caused by model mismatch) > Velocity error (slowly correcting error) > Preset reference speed (no change in baseline, lowest weight); Expected weight for preset reference speed α1 = 0.15 (baseline fixed, weight still low); Expected weight for velocity error α2 = 0.4 (error changes slowly, no need for excessive weight, avoid overshoot); Expected weight for error change rate α3 = 0.45 (model mismatch easily leads to oscillations, requiring the highest weight to stabilize the trend).
[0028] The preset adaptive weight calculation formula can be: Where w1(t+1) is the first adjusted weight, w2(t+1) is the second adjusted weight, w3(t+1) is the third adjusted weight, w1(t) is the first actual weight, w2(t+1) is the second actual weight, and w3(t+1) is the third actual weight. The actual weighting ratio for the preset reference speed, This represents the actual weighting ratio of the speed error. d represents the actual weighting ratio of the error change rate, and d is the learning rate (an empirical value, ranging from 0 to 1). The desired weighting ratio for the preset reference rotational speed, The expected weighting ratio of the velocity error. x1 represents the expected weighting ratio of the error change rate, x2 represents the speed error, and x3 represents the error change rate.
[0029] For example, the first correction weight corresponds to the weight update of the preset reference rotation speed, and the parameter setting is the first actual weight as 0.2, the first actual weight ratio is... =0.2; First expected weight ratio =0.1 (When there is load disturbance, the contribution of the reference speed needs to be reduced); the preset reference speed normalized value x1=0.5; the learning rate d=0.4, then w1(t+1)=0.18. The first correction weight is reduced from 0.2 to 0.18, which meets the requirement of reducing the impact of the fixed target (reference speed) on the control when there is disturbance, and frees up weight space for priority response error.
[0030] The second actual weight is 0.5, and the proportion of the second actual weight is... =0.5; Second expected weight ratio =0.6 (A sudden increase in load leads to an increase in error, requiring an increase in weight to enhance error driving); speed error x2 = 50 r / min, after normalization x2 = 0.25; learning rate d: 0.4, then w2(t+1) = 0.51. The second correction weight increases from 0.5 to 0.51, which meets the requirement of enhancing its regulatory contribution when the error increases. Subsequently, the internal model controller will respond faster, driving the real-time speed to converge towards 1500 r / min.
[0031] The third actual weight is 0.3, and the proportion of the third actual weight is... =0.3; Third expected weight ratio =0.3 (The current error rate of change is positive but flat, no adjustment is needed); Error rate of change x3 = 20 r / min 2 After normalization, x3 = 0.4; with a learning rate d = 0.4, we have w3(t+1) = 0.3. The third adjustment weight remains at 0.3, which meets the requirement of avoiding oscillations caused by excessive adjustment of trend weights and ensures a smooth and overshoot-free speed regression process.
[0032] Calculate the total corrected weights S = w1(t+1) + w2(t+1) + w3(t+1) = 0.18 + 0.51 + 0.3 = 0.99. Calculate the normalized weights separately: First normalized corrected weight: w1(t+1) = 0.18 / 0.99 ≈ 0.182; Second normalized corrected weight: w2(t+1) = 0.51 / 0.99 ≈ 0.515; Third normalized corrected weight: w3(t+1) = 0.3 / 0.99 ≈ 0.303.
[0033] S120, calculate the time constant based on the first correction weight, the second correction weight, and the third correction weight.
[0034] In this embodiment of the invention, after calculating the first correction weight, the second correction weight, and the third correction weight, the time constant can be calculated based on the first correction weight, the second correction weight, the third correction weight, and the preset reference rotational speed, speed error, and error change rate.
[0035] In some embodiments, such as in embodiments of the present invention, as Figure 5 As shown, step S120 includes steps S121-S122.
[0036] S121, obtain the preset reference rotation speed and the first correction weight, the speed error and the second correction weight, and the error change rate and the third correction weight; S122, the preset reference rotational speed and the first correction weight, the speed error and the second correction weight, and the error change rate and the third correction weight are substituted into the preset time constant calculation formula to calculate the time constant, wherein the preset time constant calculation formula includes: Where λ(t) is the time constant at time t, and K(t) is the output scaling factor at time t. The first corrected weight at time t after normalization. The second corrected weight at time t after normalization. Let w1 be the normalized third correction weight at time t, w2 be the first correction weight at time t, w3 be the second correction weight at time t, and x be the third correction weight at time t. i x2(t) is the preset reference speed at time t, x3(t) is the speed error at time t, x3(t) is the error change rate at time t, and K(t) is the output proportional coefficient.
[0037] In this embodiment of the invention, the output scaling factor can be calculated using the following formula: Where K0 is the steady-state initial value of the proportional coefficient. ξ This is an adjustment factor (usually one-tenth of K0). The actual weighting ratio for the preset reference speed, This represents the actual weighting ratio of the speed error. The actual weighting ratio of the error change rate. The desired weighting ratio for the preset reference rotational speed, The expected weighting ratio of the velocity error. x1 represents the expected weighting ratio of the error change rate, x2 represents the speed error, and x3 represents the error change rate.
[0038] For example, let K0 = 0.8, ξ = 0.1, =0.6、 =0.5, then the numerator of the above formula is 0.001, the denominator is 0.36, the fractional term is 0.00278, and K(t)≈0.8003.
[0039] Let x1 = 0.5, =0.182 (first corrected weight after normalization), x2=0.25, =0.515 (normalized second corrected weight), x3=0.4, =0.303 (the third corrected weight after normalization). Substituting into the formula, we can calculate that the sum of the products of the normalized corrected weight and their respective parameters is 0.34095. If K(t) is 0.8003, then λ is 0.273.
[0040] S130, the time constant is substituted into the preset inner mold speed controller and the real-time rotation speed is adjusted by the preset inner mold speed controller.
[0041] In embodiments of the present invention, such as Figure 2 As shown, a low-pass filter f(s) is added to the controller, in the form of: In the formula, λ is the filter time constant. Therefore, the internal model controller is Q(s) = M(s). -1 f(s). Therefore, the speed controller is: The standard PI controller structure is as follows Comparing with the above formula, it can be seen that the designed speed controller has a PI control structure, and the proportional and integral coefficients are respectively: , According to the principle of internal model, provided that the permanent magnet synchronous motor model is accurate, the internal model speed controller can achieve zero steady-state error tracking of the motor reference speed.
[0042] A single neuron structure can be configured with input values of a preset speed reference value, speed error, and error change rate, and output value of the time constant λ of a low-pass filter. Thus, the motor speed can be adjusted by adaptively adjusting the time constant, thereby achieving adaptive adjustment of the internal model control system.
[0043] In some embodiments, such as in embodiments of the present invention, as Figure 6 As shown, the method further includes steps S140-S141.
[0044] S140, confirm whether the speed error is greater than a preset threshold; S141, if the speed error is greater than or equal to the preset threshold, then proceed to the step of confirming the actual weight and expected weight of the preset reference rotation speed, the speed error, and the error change rate; S142, if the speed error is less than the preset threshold, the weight is not updated.
[0045] In this embodiment of the invention, a preset threshold is used to determine whether the weights need to be updated. When the speed error is small, it indicates that the operating condition is low speed and light load, and the weights do not need to be updated to eliminate noise interference at low speed and reduce ineffective adjustments. When the speed error is greater than the preset threshold, the weights can be updated.
[0046] The speed control method disclosed in this invention can calculate the speed error and error change rate based on a preset reference speed and a real-time speed. It can also calculate a first correction weight, a second correction weight, and a third correction weight based on the actual weight and expected weight of the preset reference speed, speed error, and error change rate. Then, it can calculate a time constant based on the first correction weight, the second correction weight, and the third correction weight, and substitute the time constant into the internal model speed controller to adjust the time constant of the internal model speed controller. This can achieve speed regulation, which not only adaptively adjusts the time constant but also improves stability and robustness.
[0047] Figure 7 This is a schematic block diagram of a speed control device 200 provided in an embodiment of the present invention. Figure 7 As shown, corresponding to the above speed control method, the present invention also provides a speed control device 200. This speed control device 200 includes a unit for executing the above speed control method. Specifically, please refer to... Figure 7 The speed control device 200 includes a first acquisition unit 201, a first calculation unit 202, a second calculation unit 203, and a first adjustment unit 204.
[0048] The first acquisition unit 201 is used to acquire a preset reference speed and a real-time speed respectively, and calculate the speed error and error change rate at the current moment based on the preset reference speed and the real-time speed respectively; The first calculation unit 202 is used to confirm the actual weight and expected weight of the preset reference rotation speed, the speed error and the error change rate, and to calculate the first correction weight, the second correction weight and the third correction weight based on the actual weight and the expected weight, respectively. The second calculation unit 203 is used to calculate the time constant based on the first correction weight, the second correction weight and the third correction weight; The first adjustment unit 204 is used to substitute the time constant into the preset inner mold speed controller and adjust the real-time rotation speed through the preset inner mold speed controller.
[0049] In some embodiments, such as this one, the first acquisition unit 201 further includes a third calculation unit and a fourth calculation unit.
[0050] The third calculation unit is used to calculate the difference between the preset reference speed and the real-time speed to obtain the speed error; The fourth calculation unit is used to calculate the rate of change of error at the current moment based on the speed error at the previous moment and the speed error at the current moment.
[0051] In some embodiments, such as this one, the first calculation unit 202 further includes a first substitution unit, a second substitution unit, a third substitution unit, and a normalization processing unit.
[0052] The first substitution unit is used to substitute the actual weight and the expected weight of the preset reference rotation speed into the preset weight adaptive calculation formula to obtain the first corrected weight. The second substitution unit is used to substitute the actual weight and the expected weight of the speed error into the preset weight adaptive calculation formula to obtain the second correction weight. The third substitution unit is used to substitute the actual weight and expected weight of the error change rate into the preset weight adaptive calculation formula to obtain the third correction weight. The normalization processing unit is used to normalize the first modified weight, the second modified weight, and the third modified weight to obtain the normalized first modified weight, the second modified weight, and the third modified weight, respectively.
[0053] In some embodiments, such as this one, the second calculation unit 203 includes a second acquisition unit and a fifth calculation unit.
[0054] The second acquisition unit is used to acquire the preset reference rotation speed and the first correction weight, the speed error and the second correction weight, and the error change rate and the third correction weight; The fifth calculation unit is used to substitute the preset reference rotation speed and the first correction weight, the speed error and the second correction weight, and the error change rate and the third correction weight into the preset time constant calculation formula to calculate the time constant.
[0055] In some embodiments, such as this one, the speed control device 200 further includes a first confirmation unit, a first jump unit, and a first judgment unit.
[0056] The first confirmation unit is used to confirm whether the speed error is greater than a preset threshold. The first jump unit is used to proceed to the step of confirming the actual weight and expected weight of the preset reference rotation speed, the speed error, and the error change rate if the speed error is greater than or equal to the preset threshold. The first judgment unit is used to not update the weight if the speed error is less than the preset threshold.
[0057] It should be noted that those skilled in the art can clearly understand that the specific implementation process of the above-mentioned speed control device and each unit can be referred to the corresponding description in the foregoing method embodiments. For the sake of convenience and brevity, it will not be repeated here.
[0058] The aforementioned speed control device can be implemented as a computer program, which can, for example... Figure 8 The motor shown is running.
[0059] Please see Figure 8 , Figure 8 This is a schematic block diagram of a motor provided in an embodiment of this application. It can be a terminal or a server. The terminal can be an electronic device with communication functions, such as a smartphone, tablet, laptop, desktop computer, personal digital assistant, or wearable device. The server can be a standalone server or a server cluster composed of multiple servers.
[0060] See Figure 8 The motor 300 includes a processor 302, a memory, and an interface 307 connected via a system bus 301. The memory may include a non-volatile storage medium 303 and internal memory 304.
[0061] The non-volatile storage medium 303 can store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, it causes the processor 302 to execute a speed control method.
[0062] The processor 302 provides computing and control capabilities to support the operation of the entire motor 300.
[0063] The internal memory 304 provides an environment for the execution of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a speed control method.
[0064] This interface 305 is used for communication with other devices. Those skilled in the art will understand that... Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the motor 300 to which the present application is applied. The specific motor 300 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0065] It should be understood that in the embodiments of this application, the processor 302 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (FSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0066] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.
[0067] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program implements any embodiment of the speed control method described above.
[0068] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0069] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0070] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0071] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0072] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a motor to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0073] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0074] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Since these modifications and variations fall within the scope of the claims and their equivalents, this invention also intends to include these modifications and variations.
[0075] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A speed control method, characterized in that, Applied to an electric motor, the method includes: A preset reference speed and a real-time speed are obtained respectively, and the speed error and the rate of change of error at the current moment are calculated based on the preset reference speed and the real-time speed respectively; Confirm the actual weights and expected weights of the preset reference rotation speed, the speed error, and the error change rate, and calculate the first correction weight, the second correction weight, and the third correction weight based on the actual weights and the expected weights, respectively; The time constant is calculated based on the first correction weight, the second correction weight, and the third correction weight; The time constant is substituted into the preset internal mold speed controller, and the real-time rotational speed is adjusted through the preset internal mold speed controller.
2. The method according to claim 1, characterized in that, The steps of calculating the speed error and the rate of change of error based on the preset reference speed and the real-time speed respectively include: The speed error is obtained by calculating the difference between the preset reference speed and the real-time speed. Calculate the rate of change of error at the current moment based on the velocity error at the previous moment and the velocity error at the current moment.
3. The method according to claim 1, characterized in that, The step of calculating the first corrected weight, the second corrected weight, and the third corrected weight based on the actual weight and the expected weight respectively includes: Substitute the actual weight and the expected weight of the preset reference rotation speed into the preset weight adaptive calculation formula to obtain the first corrected weight; Substitute the actual weight and expected weight of the velocity error into the preset weight adaptive calculation formula to obtain the second correction weight; The actual weight and expected weight of the error change rate are substituted into the preset weight adaptive calculation formula to obtain the third corrected weight.
4. The method according to claim 3, characterized in that, The method further includes: The first modified weight, the second modified weight, and the third modified weight are normalized to obtain the normalized first modified weight, the second modified weight, and the third modified weight, respectively.
5. The method according to claim 3, characterized in that, The step of calculating the time constant based on the first correction weight, the second correction weight, and the third correction weight includes: Obtain the preset reference rotation speed and the first correction weight, the speed error and the second correction weight, and the error change rate and the third correction weight; The preset reference speed and the first correction weight, the speed error and the second correction weight, the error change rate and the third correction weight are substituted into the preset time constant calculation formula to calculate the time constant.
6. The method according to claim 5, characterized in that, The formula for calculating the preset time constant includes: Where λ(t) is the time constant at time t, and K(t) is the output scaling factor at time t. The first corrected weight at time t after normalization. The second corrected weight at time t after normalization. Let w1 be the normalized third correction weight at time t, w2 be the first correction weight at time t, w3 be the second correction weight at time t, and x be the third correction weight at time t. i x2(t) is the preset reference speed at time t, x3(t) is the speed error at time t, x3(t) is the error change rate at time t, and K(t) is the output proportional coefficient.
7. The method according to claim 1, characterized in that, The method further includes: Confirm whether the speed error is greater than a preset threshold; If the speed error is greater than or equal to the preset threshold, then proceed to the step of confirming the actual weight and expected weight of the preset reference rotation speed, the speed error, and the error change rate; If the speed error is less than the preset threshold, the weights will not be updated.
8. A speed control device, characterized in that, Applied to an electric motor, the device includes: The first acquisition unit is used to acquire a preset reference speed and a real-time speed respectively, and to calculate the speed error and the rate of change of error at the current moment based on the preset reference speed and the real-time speed respectively; The first calculation unit is used to confirm the actual weight and expected weight of the preset reference rotation speed, the speed error, and the error change rate, and to calculate the first correction weight, the second correction weight, and the third correction weight based on the actual weight and the expected weight, respectively. The second calculation unit is used to calculate the time constant based on the first correction weight, the second correction weight, and the third correction weight; The first adjustment unit is used to substitute the time constant into the preset inner mold speed controller and adjust the real-time rotation speed through the preset inner mold speed controller.
9. An electric motor, characterized in that, The motor includes a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the steps of the method as described in any one of claims 1-7.
