Motor control method and device, motor controller and storage medium
By obtaining the angle and speed data of the motor, determining the angle correction data and calculating the actual speed data, the problem of complex algorithm conversion of low-precision sensors in the prior art is solved, and high-precision control of small and medium-sized motors is realized.
Patent Information
- Application Number
- CN202510349943.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-06-24
AI Technical Summary
In the existing motor control scheme, when using low-precision position sensors, complex algorithms need to convert low-precision position information into high-precision position information, resulting in large volume and poor stability, which is not suitable for small and medium-sized motors.
By acquiring the motor's angle acquisition data and speed reference data, determining the angle correction data, and calculating the actual speed data, the motor is then controlled to realize motor control based on high-precision position, simplifying the algorithm process.
It realizes the simplicity, convenience, reliability and stability of motor control, and is suitable for use in small and medium-sized motors, avoiding the use of complex algorithms.
Smart Images

Figure CN120200519A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and particularly to a motor control method, device, motor controller, and storage medium. Background Art
[0002] In current motor control solutions, when a motor uses a low-precision position sensor such as a Hall sensor, low-precision position information is usually converted into high-precision position information through some complex algorithms. The commonly used algorithms are as follows: Model estimation method: Perform motor modeling on the motor to be controlled to obtain a motor mathematical model, and use the motor mathematical model to estimate the motor speed based on the input voltage and current, and integrate the speed to obtain high-precision position information; Speed recursion method: Use the previous position sampling period to calculate the previous position speed of the motor, use the previous moment speed to estimate the current moment motor speed, and then integrate the current moment motor speed to obtain high-precision position information; High-frequency injection method: Inject a high-frequency signal into the motor body, and analyze the motor position from the high-frequency feedback current signal.
[0003] Since the above algorithms are relatively complex, with a large program volume and poor stability, they are not suitable for most small and medium-sized motor usage scenarios. Summary of the Invention
[0004] In order to solve the above technical problems, the present invention provides a motor control method, device, motor controller, and storage medium, which are simple and convenient to implement, have high reliability and stability, and are suitable for the usage scenarios of small and medium-sized motors.
[0005] The technical solution adopted by the present invention is as follows:
[0006] A motor control method includes the following steps: obtaining angle acquisition data of the motor; obtaining speed given data of the motor; determining angle correction data of the motor according to the angle acquisition data and the speed given data; calculating actual speed data of the motor according to the angle correction data; and controlling the motor according to the speed given data and the actual speed data.
[0007] Further, the angle acquisition data is obtained through a Hall sensor.
[0008] Further, obtaining the speed given data of the motor specifically includes: obtaining given initial speed given data; and performing smoothing processing on the initial speed given data to obtain the speed given data.
[0009] Further, determine the angle correction data of the motor according to the angle acquisition data and the speed given data, specifically including: integrating the speed given data to obtain the angle given data of the motor; adding the angle acquisition data and the angle given data to obtain a sum value data; if the sum value data jumps relative to the angle acquisition data, then use the angle acquisition data as the angle correction data; if the sum value data does not jump relative to the angle acquisition data, then use the sum value data as the angle correction data.
[0010] Further, control the motor according to the speed given data and the actual speed data, specifically including: obtaining the q-axis current given data through PI control according to the speed given data and the actual speed data; giving the d-axis current given data; obtaining the actual three-phase current data of the motor; transforming the actual three-phase current data into the actual d-axis current data and the actual q-axis current data according to the angle correction data; performing SVPWM (Space Vector Pulse Width Modulation) control on the motor according to the q-axis current given data, the actual q-axis current data, the d-axis current given data, and the actual d-axis current data.
[0011] A motor control device, including: a first acquisition module for acquiring the angle acquisition data of the motor; a second acquisition module for acquiring the speed given data of the motor; a determination module for determining the angle correction data of the motor according to the angle acquisition data and the speed given data; a calculation module for calculating the actual speed data of the motor according to the angle correction data; a control module for controlling the motor according to the speed given data and the actual speed data.
[0012] Further, the first acquisition module is connected to a Hall sensor, and the angle acquisition data is acquired through the Hall sensor.
[0013] Further, the second acquisition module is specifically configured to acquire the given initial speed given data and perform smoothing processing on the initial speed given data to obtain the speed given data.
[0014] Further, the determining module is specifically configured to integrate the given rotational speed data to obtain the given angle data of the motor, add the angle acquisition data to the given angle data to obtain a sum value data, when the sum value data jumps relative to the angle acquisition data, use the angle acquisition data as the angle correction data, and when the sum value data does not jump relative to the angle acquisition data, use the sum value data as the angle correction data.
[0015] Further, the control module is specifically configured to obtain the given q-axis current data through PI control according to the given rotational speed data and the actual rotational speed data, give the given d-axis current data, obtain the actual three-phase current data of the motor, and transform the actual three-phase current data into the actual d-axis current data and the actual q-axis current data according to the angle correction data, and finally perform SVPWM control on the motor according to the given q-axis current data, the actual q-axis current data, the given d-axis current data, and the actual d-axis current data.
[0016] A motor controller includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the motor control method described above is implemented.
[0017] A non-transitory computer-readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the motor control method described above is implemented.
[0018] Advantages of the present invention:
[0019] The present invention determines the angle correction data of the motor according to the angle acquisition data and the given rotational speed data, calculates the actual rotational speed data of the motor according to the angle correction data, and controls the motor according to the given rotational speed data and the actual rotational speed data. Thus, a continuous and smooth angle is given based on the given rotational speed, so as to obtain the corrected true angle, and then obtain the actual rotational speed. It is equivalent to realizing the control of the motor based on a high-precision position. There is no need to convert the low-precision detected position to a high-precision position through a complex algorithm during the process. The implementation is simple and convenient, and the reliability and stability are relatively high, which is applicable to the usage scenarios of medium and small motors. Description of the Drawings
[0020] Figure 1 is a flowchart of the motor control method according to an embodiment of the present invention;
[0021] Figure 2 is a block diagram of the motor control principle according to an embodiment of the present invention;
[0022] Figure 3Schematic diagram of parametric calculus calculation according to an embodiment of the present invention;
[0023] Figure 4 Block diagram of the motor control device according to an embodiment of the invention. Detailed implementation manners
[0024] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0025] As Figure 1 shown, the motor control method according to the embodiment of the present invention includes the following steps:
[0026] S1, obtaining the angle acquisition data of the motor.
[0027] S2, obtaining the speed set data of the motor.
[0028] S3, determining the angle correction data of the motor according to the angle acquisition data and the speed set data.
[0029] S4, calculating the actual speed data of the motor according to the angle correction data.
[0030] S5, controlling the motor according to the speed set data and the actual speed data.
[0031] Next, the motor control method according to the embodiment of the present invention will be described in detail in conjunction with Figure 2 the motor control principle block diagram shown.
[0032] In an embodiment of the present invention, the angle acquisition data Theta1 can be obtained through a Hall sensor. Specifically, the Hall sensor can be installed at 60° in a vector control motor. The actual rotor angle corresponding to the angle acquisition data Theta1 collected by the Hall sensor is a range, and it can be considered that the error can reach nearly 60° without calibration, and the accuracy is low. Moreover, since the Hall sensor updates a collection result every 60°, the signal corresponding to the obtained angle acquisition data Theta1 is a kind of oscillating waveform, and each period includes 6 segments of equally spaced oscillating waves.
[0033] The speed reference data SpdRef of the motor can be obtained from the motor speed control command. In an embodiment of the present invention, the motor speed control command may include initial speed reference data. The signal corresponding to the initial speed reference data may have sudden increases or decreases. Therefore, after obtaining the given initial speed reference data, the initial speed reference data can be smoothed to obtain the speed reference data SpdRef. Specifically, a common waveform processing method can be used to convert the rectangular wave component in the waveform corresponding to the initial speed reference data into a trapezoidal wave to obtain the speed reference data SpdRef. Alternatively, a filtering method, such as first-order low-pass filtering, can be used to process the initial speed reference data into the speed reference data SpdRef.
[0034] After obtaining the angle acquisition data Theta1 and the speed reference data SpdRef of the motor, first refer to Figure 3 , the speed reference data SpdRef can be integrated to obtain the angle reference data ThetaRef of the motor. Since the speed reference data SpdRef is a continuous and smooth signal, the angle reference data ThetaRef is also continuous and smooth. Then, the angle acquisition data Theta1 is added to the angle reference data ThetaRef to obtain the sum data Theta1+ThetaRef. Furthermore, it can be determined whether the sum data Theta1+ThetaRef has a jump relative to the angle acquisition data Theta1. Here, whether there is a jump means whether the angle acquisition data Theta1 jumps at least one sector after adding the angle reference data ThetaRef. Taking the example of each 60° as a sector mentioned above, if the added angle value is greater than or equal to 60°, it is determined that a jump has occurred. If the sum data Theta1+ThetaRef has a jump relative to the angle acquisition data Theta1, the angle acquisition data Theta1 is used as the angle correction data, that is, the angle correction data Theta2 = Theta1; if the sum data Theta1+ThetaRef has no jump relative to the angle acquisition data Theta1, the sum data Theta1+ThetaRef is used as the angle correction data, that is, the angle correction data Theta2 = Theta1+ThetaRef.
[0035] After obtaining the angle correction data Theta2 of the motor, the actual speed data SpdFeed of the motor can be calculated based on it. Generally speaking, as Figure 3As shown, the actual rotational speed data SpdFeed is obtained based on the angle correction data Theta2 using the differential principle. Specifically, in an embodiment of the present invention, the angle correction data Theta2 of the motor can be measured, and the fixed time TimeDeta1, for example, the change amount ThetaDeta1 of the angle correction data Theta2 in 1 s, is measured. Then the actual rotational speed data SpdFeed = ThetaDeta1 / TimeDeta1. In another embodiment of the present invention, the time can be measured, and the operating time TimeDeta2 of the system is measured under the fixed change amount ThetaDeta2 of the angle correction data Theta2. Then the actual rotational speed data SpdFeed = ThetaDeta2 / TimeDeta2. In yet another embodiment of the present invention, the speed can also be extracted based on the angle through the phase-locked loop (PLL) algorithm to obtain the actual rotational speed data SpdFeed.
[0036] After obtaining the actual rotational speed data SpdFeed of the motor, based on the given rotational speed data SpdRef and the actual rotational speed data SpdFeed, the control of the motor can be achieved. In an embodiment of the present invention, referring to Figure 2 , the q-axis current reference data IqRef can be obtained through PI control according to the given rotational speed data SpdRef and the actual rotational speed data SpdFeed, and at the same time, the d-axis current reference data IdRef is given. For example, IdRef = 0 can be given. And the actual three-phase current data Iabc of the motor is obtained through current acquisition, and then the actual three-phase current data Iabc is transformed into the actual d-axis current data IdFeed and the actual q-axis current data IqFeed according to the angle correction data Theta2, specifically through the Park transformation. This transformation process is a prior art and will not be elaborated here. Finally, based on the q-axis current reference data IqRef, the actual q-axis current data IqFeed, the d-axis current reference data IdRef, and the actual d-axis current data IdFeed, SVPWM control is performed on the motor. The SVPWM control process also belongs to the prior art and will not be elaborated here. In other embodiments of the present invention, the motor can also be controlled through common algorithms such as PID according to the given rotational speed data SpdRef and the actual rotational speed data SpdFeed, which will not be elaborated one by one here.
[0037] The motor control method according to an embodiment of the present invention determines the angle correction data of the motor based on the angle acquisition data and the speed given data, calculates the actual speed data of the motor according to the angle correction data, and controls the motor according to the speed given data and the actual speed data. Thus, a continuous and smooth angle is given based on the given speed, so as to obtain the corrected true angle, and then the actual speed is obtained. It is equivalent to realizing the control of the motor based on high-precision position. There is no need to convert the low-precision detected position to a high-precision position through complex algorithms during the process, and the implementation is simple and convenient, with high reliability and stability, and is applicable to the usage scenarios of medium and small motors.
[0038] Corresponding to the motor control method of the above embodiment, the present invention also proposes a motor control device.
[0039] As Figure 4 shown, the motor control device according to an embodiment of the present invention includes a first acquisition module 10, a second acquisition module 20, a determination module 30, a calculation module 40, and a control module 50. Among them, the first acquisition module 10 is used to acquire the angle acquisition data of the motor; the second acquisition module 20 is used to acquire the speed given data of the motor; the determination module 30 is used to determine the angle correction data of the motor according to the angle acquisition data and the speed given data; the calculation module 40 is used to calculate the actual speed data of the motor according to the angle correction data; the control module 50 is used to control the motor according to the speed given data and the actual speed data.
[0040] The following Figure 2 shown motor control principle block diagram is used to explain the motor control device according to an embodiment of the present invention in detail.
[0041] In an embodiment of the present invention, the first acquisition module 10 is connected to a Hall sensor, and the angle acquisition data is acquired through the Hall sensor. Specifically, the Hall sensor can be installed at 60° in a vector control motor. The actual rotor angle corresponding to the angle acquisition data Theta1 acquired by the Hall sensor is a range, and it can be considered that the error can reach nearly 60° without losing accuracy, and the accuracy is low. Moreover, since the Hall sensor updates a collection result every 60°, the signal corresponding to the acquired angle acquisition data Theta1 is a kind of oscillating waveform, and each period includes 6 segments of equally spaced oscillating waves.
[0042] The speed reference data SpdRef of the motor can be obtained from the motor speed control command. In an embodiment of the present invention, the motor speed control command may include initial speed reference data, and the signal corresponding to the initial speed reference data may have sudden increases or decreases. Therefore, after the second acquisition module 20 acquires the given initial speed reference data, it can also smooth the initial speed reference data to obtain the speed reference data SpdRef. Specifically, the second acquisition module 20 can adopt common waveform processing methods to convert the rectangular wave component in the waveform corresponding to the initial speed reference data into a trapezoidal wave to obtain the speed reference data SpdRef. Alternatively, the second acquisition module 20 can adopt a filtering method, such as first-order low-pass filtering, to process the initial speed reference data into the speed reference data SpdRef.
[0043] After obtaining the angle acquisition data Theta1 and the speed reference data SpdRef of the motor, first referring to Figure 3 , the determination module 30 can integrate the speed reference data SpdRef to obtain the angle reference data ThetaRef of the motor. Since the speed reference data SpdRef is a continuous and smooth signal, the angle reference data ThetaRef is also continuous and smooth. Then, the determination module 30 adds the angle acquisition data Theta1 to the angle reference data ThetaRef to obtain the sum data Theta1 + ThetaRef. Furthermore, the determination module 30 can determine whether the sum data Theta1 + ThetaRef has a jump relative to the angle acquisition data Theta1. Here, whether there is a jump means whether the angle acquisition data Theta1 jumps at least one sector after adding the angle reference data ThetaRef. Taking the example of one sector every 60° as described above, if the added angle value is greater than or equal to 60°, it is determined that a jump has occurred. If the sum data Theta1 + ThetaRef has a jump relative to the angle acquisition data Theta1, the angle acquisition data Theta1 is used as the angle correction data, that is, the angle correction data Theta2 = Theta1; if the sum data Theta1 + ThetaRef has no jump relative to the angle acquisition data Theta1, the sum data Theta1 + ThetaRef is used as the angle correction data, that is, the angle correction data Theta2 = Theta1 + ThetaRef.
[0044] After obtaining the angle correction data Theta2 of the motor, the calculation module 40 can calculate the actual speed data SpdFeed of the motor based on it. Generally speaking, as Figure 3As shown, the actual rotational speed data SpdFeed is obtained based on the angle correction data Theta2 using the differential principle. Specifically, in an embodiment of the present invention, the angle correction data Theta2 of the motor can be measured, and a fixed time TimeDeta1, such as 1 s, is measured for the change amount ThetaDeta1 of the angle correction data Theta2. Then the actual rotational speed data SpdFeed = ThetaDeta1 / TimeDeta1. In another embodiment of the present invention, the time can be measured, and the running time TimeDeta2 of the system is measured under a fixed change amount ThetaDeta2 of the angle correction data Theta2. Then the actual rotational speed data SpdFeed = ThetaDeta2 / TimeDeta2. In yet another embodiment of the present invention, the speed can also be extracted based on the angle through the phase-locked loop (PLL) algorithm to obtain the actual rotational speed data SpdFeed.
[0045] After obtaining the actual rotational speed data SpdFeed of the motor, the control module 50 can control the motor based on the reference rotational speed data SpdRef and the actual rotational speed data SpdFeed. In an embodiment of the present invention, referring to Figure 2 , the control module 50 can obtain the q-axis current reference data IqRef through PI control according to the reference rotational speed data SpdRef and the actual rotational speed data SpdFeed, and at the same time give the d-axis current reference data IdRef. For example, IdRef = 0 can be given. And the control module 50 obtains the actual three-phase current data Iabc of the motor through current acquisition, and then transforms the actual three-phase current data Iabc into the actual d-axis current data IdFeed and the actual q-axis current data IqFeed according to the angle correction data Theta2, specifically through the Park transformation. This transformation process is prior art and will not be elaborated here. Finally, the control module 50 performs SVPWM control on the motor according to the q-axis current reference data IqRef, the actual q-axis current data IqFeed, the d-axis current reference data IdRef, and the actual d-axis current data IdFeed. The SVPWM control process also belongs to the prior art and will not be elaborated here either. In other embodiments of the present invention, the control module 50 can also control the motor through common algorithms such as PID according to the reference rotational speed data SpdRef and the actual rotational speed data SpdFeed, which will not be elaborated one by one here.
[0046] The motor control device according to an embodiment of the present invention determines the angle correction data of the motor based on the angle acquisition data and the speed given data, calculates the actual speed data of the motor according to the angle correction data, and controls the motor according to the speed given data and the actual speed data. Thus, a continuous and smooth angle is given based on the given speed, so as to obtain the corrected true angle, and then the actual speed is obtained. It is equivalent to realizing the control of the motor based on high-precision position. There is no need to convert the low-precision detected position to a high-precision position through complex algorithms during the process. The implementation is simple and convenient, and the reliability and stability are relatively high, which is applicable to the usage scenarios of medium and small motors.
[0047] Corresponding to the above embodiment, the present invention also proposes a motor controller.
[0048] The motor controller according to an embodiment of the present invention includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it can implement the motor control method according to the above embodiment of the present invention.
[0049] The motor controller according to an embodiment of the present invention is simple and convenient to implement, has relatively high reliability and stability, and is applicable to the usage scenarios of medium and small motors.
[0050] Corresponding to the above embodiment, the present invention also proposes a non-transitory computer-readable storage medium.
[0051] The non-transitory computer-readable storage medium according to an embodiment of the present invention stores a computer program thereon. When the computer program is executed by a processor, it can implement the motor control method according to the above embodiment of the present invention.
[0052] The non-transitory computer-readable storage medium according to an embodiment of the present invention is simple and convenient to implement, has relatively high reliability and stability, and is applicable to the usage scenarios of medium and small motors.
[0053] In the description of the present invention, the terms "first" and "second" are only used for descriptive purposes, and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. The meaning of "plurality" is two or more, unless otherwise specifically defined.
[0054] In the present invention, unless otherwise clearly defined or limited, terms such as "installed", "connected", "coupled", "fixed", etc. shall be construed in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the internal communication of two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0055] In the present invention, unless otherwise clearly defined or limited, the first feature being "on" or "under" the second feature may be that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, the first feature being "above", "over" and "on top of" the second feature may be that the first feature is directly above or obliquely above the second feature, or merely indicates that the first feature has a higher horizontal height than the second feature. The first feature being "under", "below" and "beneath" the second feature may be that the first feature is directly below or obliquely below the second feature, or merely indicates that the first feature has a lower horizontal height than the second feature.
[0056] In the description of this specification, the descriptions with reference to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0057] Any process or method description shown in the flowchart or described in other ways herein may be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. The scope of the preferred embodiments of the present invention includes additional implementations, where the functions may be executed in a substantially simultaneous manner or in a reverse order according to the functions involved, rather than in the order shown or discussed, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0058] The logic and / or steps represented in the flowchart or otherwise described herein can, for example, be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in conjunction with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then storing it in a computer memory.
[0059] It should be understood that various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0060] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of implementing the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0061] In addition, in each embodiment of the present invention, each functional unit may be integrated into one processing module, may exist separately as individual units physically, or two or more units may be integrated into one module. The above integrated module may be implemented in the form of hardware or in the form of a software functional module. If the above integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0062] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A motor control method, characterized in that: The following steps are involved: Get the angle data of the motor; Obtaining given speed data of the motor; Determine angle correction data of the motor according to the angle acquisition data and the speed setting data; Calculating actual speed data of the motor according to the angle correction data; The motor is controlled according to the given speed data and the actual speed data.
2. The motor control method according to claim 1, characterized in that: The angle acquisition data is obtained through a Hall sensor.
3. The motor control method according to claim 1, characterized in that: Obtaining the given speed data of the motor, specifically including: Get the given initial speed given data; The initial speed setting data is smoothed to obtain the speed setting data.
4. The motor control method according to claim 1, characterized in that: Determining the angle correction data of the motor according to the angle acquisition data and the speed setting data specifically includes: Integrating the given speed data to obtain given angle data of the motor; Add the angle acquisition data to the angle given data to obtain sum value data; If the sum value data jumps relative to the angle acquisition data, the angle acquisition data is used as the angle correction data; If the sum value data does not jump relative to the angle acquisition data, the sum value data is used as the angle correction data.
5. The motor control method according to claim 1, characterized in that: Controlling the motor according to the given speed data and the actual speed data specifically includes: According to the given speed data and the actual speed data, the q-axis current given data is obtained through PI control; Given d-axis current given data; Acquiring actual three-phase current data of the motor; transforming the three-phase current actual data into d-axis current actual data and q-axis current actual data according to the angle correction data; The motor is subjected to SVPWM control according to the q-axis current given data, the q-axis current actual data, the d-axis current given data, and the d-axis current actual data.
6. A motor control device, characterized in that: include: A first acquisition module, the first acquisition module is used to acquire angle acquisition data of the motor; A second acquisition module, the second acquisition module is used to acquire the given speed data of the motor; A determination module, the determination module is used to determine the angle correction data of the motor according to the angle acquisition data and the speed given data; A calculation module, the calculation module is used to calculate the actual speed data of the motor according to the angle correction data; A control module is used to control the motor according to the given speed data and the actual speed data.
7. The motor control device according to claim 6, characterized in that: The first acquisition module is connected to a Hall sensor, and acquires the angle acquisition data through the Hall sensor.
8. The motor control device according to claim 6, characterized in that: The second acquisition module is specifically used to acquire given initial speed given data, and perform smoothing processing on the initial speed given data to obtain the speed given data.
9. The motor control device according to claim 6, characterized in that: The determination module is specifically used to integrate the given speed data to obtain the given angle data of the motor, and add the angle acquisition data to the given angle data to obtain sum data. When the sum data jumps relative to the angle acquisition data, the angle acquisition data is used as the angle correction data. When the sum data does not jump relative to the angle acquisition data, the sum data is used as the angle correction data.
10. The motor control device according to claim 6, characterized in that: The control module is specifically used to obtain the q-axis current given data and the d-axis current given data through PI control according to the speed given data and the speed actual data, and to obtain the three-phase current actual data of the motor, and to transform the three-phase current actual data into d-axis current actual data and q-axis current actual data according to the angle correction data, and finally to perform SVPWM control on the motor according to the q-axis current given data, the q-axis current actual data, the d-axis current given data and the d-axis current actual data.
11. A motor controller, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the motor control method according to any one of claims 1 to 5 is implemented.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the motor control method according to any one of claims 1 to 5 is implemented.