CN113391551A - Motor electrical angle compensation method and device, electronic equipment and storage medium - Google Patents
Motor electrical angle compensation method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113391551A CN113391551A CN202110607388.1A CN202110607388A CN113391551A CN 113391551 A CN113391551 A CN 113391551A CN 202110607388 A CN202110607388 A CN 202110607388A CN 113391551 A CN113391551 A CN 113391551A
- Authority
- CN
- China
- Prior art keywords
- data
- electrical angle
- current
- angle data
- read
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B13/00—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion
- G05B13/02—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric
- G05B13/04—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators
- G05B13/042—Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators in which a parameter or coefficient is automatically adjusted to optimise the performance
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Automation & Control Theory (AREA)
- Control Of Motors That Do Not Use Commutators (AREA)
Abstract
The invention provides a method and a device for compensating an electrical angle of a motor, electronic equipment and a storage medium, wherein electrical angle data and acquisition time data acquired by an encoder are read by using a preset carrier frequency, and reading time data at the moment of reading the electrical angle data and the acquisition time data are acquired; calculating current speed data according to a plurality of recently read electrical angle data; calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; outputting the compensated current electrical angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the real electric angle data can be effectively reduced, the conditions of low control output efficiency and torque fluctuation of the torque loop can be improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Description
Technical Field
The invention relates to the technical field of permanent magnet synchronous motor control, in particular to a motor electrical angle compensation method and device, electronic equipment and a storage medium.
Background
At present, a permanent magnet synchronous motor is mainly used for precise torque control, speed control and position control. As shown in fig. 4, an existing permanent magnet synchronous motor control system generally uses a communication type absolute value encoder as a position feedback unit of a motor rotor, and since a communication rate of the encoder cannot keep up with a torque loop control frequency, the encoder generally cannot refresh position information in real time during control of each torque loop, and a current controller of the torque loop has a time deviation between a time when the current controller reads electrical angle data acquired by the encoder and a time when the encoder acquires the electrical angle data, so that when the current controller reads the electrical angle data, an electrical angle of a motor has changed, and thus a deviation exists between the electrical angle data read by the current controller and real electrical angle data. Because the encoder cannot obtain real-time and correct updating of the position information, the problems of low efficiency and torque fluctuation exist in the torque loop control output, so that the operation efficiency of the motor is influenced, and the motor vibrates.
Disclosure of Invention
In view of the foregoing disadvantages of the prior art, an object of the embodiments of the present application is to provide a method and an apparatus for compensating an electrical angle of a motor, an electronic device, and a storage medium, which are beneficial to improving the conditions of low output efficiency and torque ripple of torque loop control, so as to improve the operating efficiency of the motor and reduce the vibration of the motor.
In a first aspect, an embodiment of the present application provides a motor electrical angle compensation method, which is applied to a current controller of a permanent magnet synchronous motor control system, and includes the steps of:
A1. reading electrical angle data and acquisition time data acquired by an encoder at a preset carrier frequency, and acquiring reading time data at the moment of reading the electrical angle data and the acquisition time data; the acquisition time data refers to time data of the moment when the encoder acquires the electrical angle data;
A2. calculating current speed data according to a plurality of recently read electrical angle data;
A3. calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; the current electrical angle data refers to currently read electrical angle data;
A4. and outputting the compensated current electrical angle data as a feedback value of the encoder.
According to the motor electrical angle compensation method provided by the embodiment of the application, the current speed data is calculated according to the read electrical angle data, then the electrical angle compensation value needing to be compensated is calculated according to the current speed data, the acquisition time data and the read time data, the electrical angle compensation value is used for compensating the previous electrical angle data and then outputting the compensated electrical angle data as the feedback value, the deviation between the electrical angle data output by the current controller and the real electrical angle data can be effectively reduced, the conditions of low torque loop control output efficiency and torque fluctuation are favorably improved, the running efficiency of a motor is improved, and the vibration of the motor is reduced.
Preferably, step a2 includes:
the current speed data is calculated according to the following formula:
wherein the content of the first and second substances,for the current speed data, n is a preset positive integer value and n>1,As the present electrical angle data, it is,is composed ofThe corresponding data of the acquisition time is acquired,toRespectively the 1 st to nth last electrical angle data read before the present electrical angle data,toAre respectivelyToThe time of acquisition of the data is,is the start time of the current carrier cycle,toRespectively, the start times of the 1 st to nth last carrier periods before the current carrier period.
Preferably, in step a2, n = 2.
Preferably, step a2 further includes:
calculating a speed deviation value between the current speed data and the speed data obtained by the last calculation;
judging whether the speed deviation value is larger than a preset speed deviation threshold value or not;
if not, judging that the current speed data is valid;
if so, judging that the current speed data is invalid, and calculating new speed data according to the speed data obtained by the previous m-time calculation to serve as the current speed data; wherein m is a preset positive integer.
Preferably, step a2 further includes:
checking the read current electrical angle data to judge whether the current electrical angle data is valid;
and if the current electric angle data is invalid, taking the speed data obtained by the previous calculation as the current speed data.
Preferably, step a3 includes:
if the read current electrical angle data is valid, calculating the compensated current electrical angle data according to the following formula:
wherein the content of the first and second substances,for the compensated current electrical angle data,in order to compensate for the current electrical angle data before compensation,as an electrical angle compensation value, is set,as the current speed data, it is,in order to compensate for the time offset that needs to be compensated,is composed ofCorresponding reading time data;
if the read current electrical angle data is invalid, calculating the compensated current electrical angle data according to the following formula:
wherein the content of the first and second substances,for the last time valid electrical angle data is read,is composed ofCorresponding read time data.
In a second aspect, an embodiment of the present application provides an electrical angle compensation apparatus for a motor, including:
the first acquisition module is used for reading the electrical angle data and the acquisition time data acquired by the encoder at a preset carrier frequency and acquiring the reading time data of the moment when the electrical angle data and the acquisition time data are read; the acquisition time data refers to time data of the moment when the encoder acquires the electrical angle data;
the first calculation module is used for calculating current speed data according to a plurality of recently read electrical angle data;
the compensation module is used for calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; the current electrical angle data refers to currently read electrical angle data;
and the feedback module is used for outputting the compensated current electrical angle data as a feedback value of the encoder.
Preferably, the first calculation module, when calculating the current speed data from the plurality of electrical angle data read most recently:
the current speed data is calculated according to the following formula:
wherein the content of the first and second substances,for the current speed data, n is a preset positive integer value and n>1,As the present electrical angle data, it is,is composed ofThe corresponding data of the acquisition time is acquired,toRespectively the 1 st to nth last electrical angle data read before the present electrical angle data,toAre respectivelyToThe time of acquisition of the data is,is the start time of the current carrier cycle,toRespectively, the start times of the 1 st to nth last carrier periods before the current carrier period.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, where the memory stores a computer program, and the processor is configured to execute the steps of the motor electrical angle compensation method by calling the computer program stored in the memory.
In a fourth aspect, embodiments of the present application provide a storage medium having a computer program stored thereon, where the computer program is executed by a processor to execute the steps of the motor electrical angle compensation method as described.
Has the advantages that:
according to the method, the device, the electronic equipment and the storage medium for compensating the electrical angle of the motor, the electrical angle data and the acquisition time data acquired by an encoder are read by using the preset carrier frequency, and the reading time data at the moment of reading the electrical angle data and the acquisition time data is acquired; calculating current speed data according to a plurality of recently read electrical angle data; calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; outputting the compensated current electrical angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the real electric angle data can be effectively reduced, the conditions of low control output efficiency and torque fluctuation of the torque loop can be improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Drawings
Fig. 1 is a flowchart of a method for compensating an electrical angle of a motor according to an embodiment of the present disclosure.
Fig. 2 is a block diagram of an electrical angle compensation apparatus of a motor according to an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of a conventional permanent magnet synchronous motor control system.
Fig. 5 is an exemplary carrier cycle timing diagram.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, a method for compensating an electrical angle of a motor provided in an embodiment of the present application is applied to a current controller of a permanent magnet synchronous motor control system, and includes the steps of:
A1. reading electrical angle data and acquisition time data acquired by an encoder at a preset carrier frequency, and acquiring reading time data at the moment of reading the electrical angle data and the acquisition time data; the acquisition time data refers to time data of the moment when the encoder acquires the electrical angle data;
A2. calculating current speed data according to a plurality of recently read electrical angle data;
A3. calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; the current electrical angle data refers to currently read electrical angle data;
A4. and outputting the compensated current electrical angle data as a feedback value of the encoder.
The structure of the permanent magnet synchronous motor control system is shown in fig. 4, and the current controller is connected with the output end of the encoder to process the output data of the encoder. The current speed data is calculated according to the read electrical angle data, then the electrical angle compensation value needing to be compensated is calculated according to the current speed data, the acquisition time data and the read time data, the electrical angle compensation value is used for compensating the previous electrical angle data and then outputting the previous electrical angle data as a feedback value, and the deviation between the electrical angle data output by the current controller and the real electrical angle data (which means the real electrical angle of the motor at the moment of the read electrical angle data) can be effectively reduced, so that the conditions of low torque loop control output efficiency and torque fluctuation can be favorably improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
The carrier frequency in step a1 is not less than the torque loop control frequency of the permanent magnet synchronous motor control system, for example, the carrier frequency is the same as the torque loop control frequency of the permanent magnet synchronous motor control system. To avoid the feedback frequency of the electrical angle data not keeping up with the torque loop control frequency.
In some embodiments, step a2 includes:
A201. the current speed data is calculated according to the following formula:
wherein the content of the first and second substances,for the current speed data, n is a preset positive integer value and n>1,As the present electrical angle data, it is,is composed ofThe corresponding data of the acquisition time is acquired,toRespectively the 1 st to nth last electrical angle data read before the present electrical angle data,toAre respectivelyToThe time of acquisition of the data is,is the start time of the current carrier cycle,toRespectively, the start times of the 1 st to nth last carrier periods before the current carrier period.
The speed data is obtained by calculating by integrating a plurality of electric angle data read in advance, so that the current speed data can be accurately estimated, and the deviation between the electric angle data output by the current controller and the real electric angle data can be ensured to be small.
Wherein, the value of n can be set according to actual needs; preferably, n =2, so that the electrical angle data used span less in time, so that the current velocity data calculated is more accurate.
Where, in theory, the carrier period is fixed, and therefore,、……、the values of (a) are equal to the carrier period; in practice, however, the time control is erroneous, and therefore、……、There is also a difference between them, as used herein、……、The calculation result can be further improved by replacing the carrier period as the denominator for operation.
In some preferred embodiments, step a2 further comprises:
A202. calculating a speed deviation value between the current speed data and the last calculated speed data (which refers to the final effective speed data calculated in the last carrier period);
A203. judging whether the speed deviation value is larger than a preset speed deviation threshold value or not;
A204. if not, judging that the current speed data is valid;
A205. if so, judging that the current speed data is invalid, and calculating new speed data according to the speed data obtained by the previous m-time calculation to serve as the current speed data; wherein m is a preset positive integer.
The speed deviation value between the current speed data and the last calculated speed data (referring to the final valid speed data calculated in the last carrier period) reflects the acceleration condition of the motor, the acceleration capability of the motor is limited, if the speed deviation value between the current speed data and the last calculated speed data indicates that the calculated current speed data is not reliable, the current speed data cannot be used for calculating the electrical angle compensation value, otherwise, the control effect on the motor is affected.
The current velocity data is valid and will be used for subsequent electrical angle compensation value calculations.
In step a205, the value of m may be set according to implementation requirements, and m may be 1 or greater than 1.
For example, in a first example, m =1, step a205 comprises: the speed data obtained by the previous calculation (referring to the final effective speed data obtained by calculation in the last carrier period) is used as the current speed data.
For example, in a second example, m is greater than 1, and in some embodiments, step a205 includes: calculating the average value of the speed data obtained by the previous m times of calculation as the current speed data; in other embodiments, step a205 comprises: and fitting according to the speed data obtained by the previous m-time calculation to obtain a speed change curve formula, and substituting the reading time data of the moment when the current electrical angle data is read into the speed change curve formula to obtain the current speed data.
Or for example, when m is greater than 1, in step a205, current speed data (specifically, refer to the second example described above) is calculated according to the speed data obtained by the previous m times of calculation, a speed deviation value between the current speed data and the speed data obtained by the previous calculation (refer to the final valid speed data obtained by calculation in the previous carrier cycle) is calculated, whether the speed deviation value is greater than a preset speed deviation threshold value is determined, if not, the current speed data is determined to be valid, and if yes, the speed data obtained by the previous calculation (refer to the final valid speed data obtained by calculation in the previous carrier cycle) is used as the current speed data.
In practical applications, the read current electrical angle data may be invalid, and if the read current electrical angle data is invalid, the current speed data calculated according to the current electrical angle data is also invalid (that is, the current speed data calculated according to the formula (1) is invalid), in this case, step a2 may further include:
A206. checking the read current electrical angle data to judge whether the current electrical angle data is valid;
A207. and if the current electrical angle data is invalid, taking the speed data obtained by the previous calculation (which refers to the final valid speed data obtained by the calculation in the last carrier period) as the current speed data.
The step of checking the read current electrical angle data comprises the following steps: monitoring a communication data frame and recalculating a check value according to a communication rule of an encoder to judge whether data errors exist in the communication process (for example, adopting a CRC (cyclic redundancy check) mode), if the data errors exist, judging that the current electrical angle data are invalid, otherwise, judging that the current electrical angle data are valid.
When the read current electrical angle data is invalid, the speed data obtained by the last calculation is directly used as the current speed data, although the deviation exists between the speed data obtained by the last calculation and the current real speed data, the deviation is controllable, and the deviation between the current speed data obtained by the calculation by using the invalid current electrical angle data and the current real speed data is uncontrollable, so that the accuracy of the calculation result can be better ensured.
Further, step a3 includes:
A301. if the read current electrical angle data is valid, calculating the compensated current electrical angle data according to the following formula:
wherein the content of the first and second substances,for the compensated current electrical angle data,to compensate for the current electrical angle data before compensation (i.e. the read current electrical angle data),as an electrical angle compensation value, is set,as the current speed data, it is,in order to compensate for the time offset that needs to be compensated,is composed ofCorresponding reading time data;
A302. if the read current electrical angle data is invalid, calculating the compensated current electrical angle data according to the following formula:
wherein the content of the first and second substances,for the last time valid electrical angle data is read,is composed ofCorresponding read time data.
Such as the carrier cycle timing diagram shown in fig. 5, where the acquisition time at which the encoder acquires the electrical angle data is after the reading time at which the current controller reads the electrical angle data in each carrier cycle, and thus, the electrical angle data is acquired in each carrier cycleThe electrical angle data read by the flow controller are all the electrical angle data collected by the encoder in the last carrier period. If the current period reads the electrical angle data (i.e. the read current electrical angle data)) If the result is valid, calculating according to the step A301; if the electrical angle data read in the current period is invalid, the electrical angle data read last time is assumed to be valid, that is, the electrical angle data read last time is valid、Then handle、And substituting the calculation formula of the step A302 for calculation.
According to the motor electrical angle compensation method, electrical angle data and acquisition time data acquired by an encoder are read by a preset carrier frequency, and reading time data of the electrical angle data and the acquisition time data are acquired; calculating current speed data according to a plurality of recently read electrical angle data; calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; outputting the compensated current electrical angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the real electric angle data can be effectively reduced, the conditions of low control output efficiency and torque fluctuation of the torque loop can be improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Referring to fig. 2, an embodiment of the present application provides a motor electrical angle compensation apparatus, including:
the first acquisition module 1 is used for reading electrical angle data and acquisition time data acquired by an encoder at a preset carrier frequency and acquiring reading time data at the moment of reading the electrical angle data and the acquisition time data; the acquisition time data refers to time data of the moment when the encoder acquires the electrical angle data;
the first calculation module 2 is used for calculating current speed data according to a plurality of recently read electrical angle data;
the compensation module 3 is used for calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; the current electrical angle data refers to currently read electrical angle data;
and the feedback module 4 is used for outputting the compensated current electrical angle data as a feedback value of the encoder.
In some embodiments, the first calculation module 2, when calculating the current speed data from the plurality of electrical angle data most recently read:
the current speed data is calculated according to the following formula:
wherein the content of the first and second substances,for the current speed data, n is a preset positive integer value and n>1,As the present electrical angle data, it is,is composed ofThe corresponding data of the acquisition time is acquired,toRespectively the 1 st to nth last electrical angle data read before the present electrical angle data,toAre respectivelyToThe time of acquisition of the data is,is the start time of the current carrier cycle,toRespectively, the start times of the 1 st to nth last carrier periods before the current carrier period.
Wherein, the value of n can be set according to actual needs; preferably, n =2, so that the electrical angle data used span less in time, so that the current velocity data calculated is more accurate.
In some preferred embodiments, the first calculation module 2, when calculating the current speed data from the plurality of electrical angle data that have been most recently read, further:
calculating a speed deviation value between the current speed data and the last calculated speed data (which refers to the final effective speed data calculated in the last carrier period);
judging whether the speed deviation value is larger than a preset speed deviation threshold value or not;
if not, judging that the current speed data is valid;
if so, judging that the current speed data is invalid, and calculating new speed data according to the speed data obtained by the previous m-time calculation to serve as the current speed data; wherein m is a preset positive integer.
The speed deviation value between the current speed data and the last calculated speed data (referring to the final valid speed data calculated in the last carrier period) reflects the acceleration condition of the motor, the acceleration capability of the motor is limited, if the speed deviation value between the current speed data and the last calculated speed data indicates that the calculated current speed data is not reliable, the current speed data cannot be used for calculating the electrical angle compensation value, otherwise, the control effect on the motor is affected.
The current velocity data is valid and will be used for subsequent electrical angle compensation value calculations.
Wherein, the value of m can be set according to the implementation requirement, and m can be 1 or more than 1.
For example, in a first example, where m =1, the first calculation module 2, when calculating new speed data as current speed data from the speed data obtained from the previous m calculations: the speed data obtained by the previous calculation (referring to the final effective speed data obtained by calculation in the last carrier period) is used as the current speed data.
For example, in a second example, m is greater than 1, and in some embodiments, the first calculating module 2, when calculating new speed data as the current speed data from the speed data obtained from the previous m times of calculation: calculating the average value of the speed data obtained by the previous m times of calculation as the current speed data; in other embodiments, the first calculation module 2, when calculating new speed data as the current speed data from the speed data obtained from the previous m calculations: and fitting according to the speed data obtained by the previous m-time calculation to obtain a speed change curve formula, and substituting the reading time data of the moment when the current electrical angle data is read into the speed change curve formula to obtain the current speed data.
Or for example, when m is greater than 1, the first calculation module 2, when calculating new speed data as the current speed data according to the speed data obtained by the previous m times of calculation: first, current speed data (specifically, refer to the second example mentioned above) is calculated according to the speed data obtained by the previous m times of calculation, then, a speed deviation value between the current speed data and the speed data obtained by the previous calculation (referring to the final valid speed data obtained by calculation in the previous carrier cycle) is calculated, whether the speed deviation value is greater than a preset speed deviation threshold value is determined, if not, the current speed data is determined to be valid, and if so, the speed data obtained by the previous calculation (referring to the final valid speed data obtained by calculation in the previous carrier cycle) is used as the current speed data.
In practical applications, the read current electrical angle data may be invalid, and if the read current electrical angle data is invalid, the current speed data calculated according to the current electrical angle data is also invalid, and at this time, when the first calculating module 2 calculates the current speed data according to the plurality of electrical angle data read recently, the first calculating module further:
checking the read current electrical angle data to judge whether the current electrical angle data is valid;
and if the current electrical angle data is invalid, taking the speed data obtained by the previous calculation (which refers to the final valid speed data obtained by the calculation in the last carrier period) as the current speed data.
The step of checking the read current electrical angle data comprises the following steps: monitoring a communication data frame and recalculating a check value according to a communication rule of an encoder to judge whether data errors exist in the communication process (for example, adopting a CRC (cyclic redundancy check) mode), if the data errors exist, judging that the current electrical angle data are invalid, otherwise, judging that the current electrical angle data are valid.
Further, when calculating the electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data, the compensation module 3 is configured to:
if the read current electrical angle data is valid, calculating the compensated current electrical angle data according to the following formula:
wherein the content of the first and second substances,for the compensated current electrical angle data,to compensate for the current electrical angle data before compensation (i.e. the read current electrical angle data),as an electrical angle compensation value, is set,as the current speed data, it is,in order to compensate for the time offset that needs to be compensated,is composed ofCorresponding reading time data;
if the read current electrical angle data is invalid, calculating the compensated current electrical angle data according to the following formula:
wherein the content of the first and second substances,for the last time valid electrical angle data is read,is composed ofCorresponding read time data.
As can be seen from the above, the electric angle compensation device of the motor reads the electric angle data and the acquisition time data acquired by the encoder at the preset carrier frequency, and acquires the read time data at the moment when the electric angle data and the acquisition time data are read; calculating current speed data according to a plurality of recently read electrical angle data; calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; outputting the compensated current electrical angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the real electric angle data can be effectively reduced, the conditions of low control output efficiency and torque fluctuation of the torque loop can be improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Referring to fig. 3, an electronic device 100 according to an embodiment of the present application further includes a processor 101 and a memory 102, where the memory 102 stores a computer program, and the processor 101 is configured to execute the steps of the motor electrical angle compensation method by calling the computer program stored in the memory 102.
The processor 101 is electrically connected to the memory 102. The processor 101 is a control center of the electronic device 100, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or calling a computer program stored in the memory 102 and calling data stored in the memory 102, thereby performing overall monitoring of the electronic device.
The memory 102 may be used to store computer programs and data. The memory 102 stores computer programs containing instructions executable in the processor. The computer program may constitute various functional modules. The processor 101 executes various functional applications and data processing by calling a computer program stored in the memory 102.
In this embodiment, the processor 101 in the electronic device 100 loads instructions corresponding to one or more processes of the computer program into the memory 102, and the processor 101 runs the computer program stored in the memory 102 according to the following steps, so as to implement various functions: reading electrical angle data and acquisition time data acquired by an encoder at a preset carrier frequency, and acquiring reading time data at the moment of reading the electrical angle data and the acquisition time data; calculating current speed data according to a plurality of recently read electrical angle data; calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; and outputting the compensated current electrical angle data as a feedback value of the encoder.
As can be seen from the above, the electronic device reads the electrical angle data and the acquisition time data acquired by the encoder at a preset carrier frequency, and acquires the read time data at the time when the electrical angle data and the acquisition time data are read; calculating current speed data according to a plurality of recently read electrical angle data; calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; outputting the compensated current electrical angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the real electric angle data can be effectively reduced, the conditions of low control output efficiency and torque fluctuation of the torque loop can be improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
An embodiment of the present application further provides a storage medium, on which a computer program is stored, where the computer program runs the steps of the above-mentioned motor electrical angle compensation method when being executed by a processor, so as to implement the following functions: reading electrical angle data and acquisition time data acquired by an encoder at a preset carrier frequency, and acquiring reading time data at the moment of reading the electrical angle data and the acquisition time data; calculating current speed data according to a plurality of recently read electrical angle data; calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; and outputting the compensated current electrical angle data as a feedback value of the encoder.
The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
In summary, although the present invention has been described with reference to the preferred embodiments, the above-described preferred embodiments are not intended to limit the present invention, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, which are substantially the same as the present invention.
Claims (10)
1. A motor electrical angle compensation method is characterized in that a current controller applied to a permanent magnet synchronous motor control system comprises the following steps:
A1. reading electrical angle data and acquisition time data acquired by an encoder at a preset carrier frequency, and acquiring reading time data at the moment of reading the electrical angle data and the acquisition time data; the acquisition time data refers to time data of the moment when the encoder acquires the electrical angle data;
A2. calculating current speed data according to a plurality of recently read electrical angle data;
A3. calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; the current electrical angle data refers to currently read electrical angle data;
A4. and outputting the compensated current electrical angle data as a feedback value of the encoder.
2. The method of compensating electrical angle of motor of claim 1, wherein step a2 includes:
the current speed data is calculated according to the following formula:
wherein the content of the first and second substances,for the current speed data, n is a preset positive integer value and n>1,As the present electrical angle data, it is,is composed ofThe corresponding data of the acquisition time is acquired,toRespectively the 1 st to nth last electrical angle data read before the present electrical angle data,toAre respectivelyToThe time of acquisition of the data is,is the start time of the current carrier cycle,toRespectively, the start times of the 1 st to nth last carrier periods before the current carrier period.
3. The electrical angle compensation method of claim 2, wherein in step a2, n = 2.
4. The method of compensating electrical angle of motor of claim 2, wherein step a2 further comprises:
calculating a speed deviation value between the current speed data and the speed data obtained by the last calculation;
judging whether the speed deviation value is larger than a preset speed deviation threshold value or not;
if not, judging that the current speed data is valid;
if so, judging that the current speed data is invalid, and calculating new speed data according to the speed data obtained by the previous m-time calculation to serve as the current speed data; wherein m is a preset positive integer.
5. The method of compensating electrical angle of motor of claim 2, wherein step a2 further comprises:
checking the read current electrical angle data to judge whether the current electrical angle data is valid;
and if the current electric angle data is invalid, taking the speed data obtained by the previous calculation as the current speed data.
6. The electrical angle compensation method of claim 5, wherein step A3 comprises:
if the read current electrical angle data is valid, calculating the compensated current electrical angle data according to the following formula:
wherein the content of the first and second substances,for the compensated current electrical angle data,in order to compensate for the current electrical angle data before compensation,as an electrical angle compensation value, is set,as the current speed data, it is,in order to compensate for the time offset that needs to be compensated,is composed ofCorresponding reading time data;
if the read current electrical angle data is invalid, calculating the compensated current electrical angle data according to the following formula:
7. An electric angle compensation device of a motor, comprising:
the first acquisition module is used for reading the electrical angle data and the acquisition time data acquired by the encoder at a preset carrier frequency and acquiring the reading time data of the moment when the electrical angle data and the acquisition time data are read; the acquisition time data refers to time data of the moment when the encoder acquires the electrical angle data;
the first calculation module is used for calculating current speed data according to a plurality of recently read electrical angle data;
the compensation module is used for calculating an electrical angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electrical angle data; the current electrical angle data refers to currently read electrical angle data;
and the feedback module is used for outputting the compensated current electrical angle data as a feedback value of the encoder.
8. The electrical angle compensation device of claim 7, wherein the first calculation module, when calculating the current speed data from the plurality of electrical angle data read most recently:
the current speed data is calculated according to the following formula:
wherein the content of the first and second substances,for the current speed data, n is a preset positive integer value and n>1,As the present electrical angle data, it is,is composed ofThe corresponding data of the acquisition time is acquired,toRespectively the 1 st to nth last electrical angle data read before the present electrical angle data,toAre respectivelyToThe time of acquisition of the data is,is the start time of the current carrier cycle,toRespectively, the start times of the 1 st to nth last carrier periods before the current carrier period.
9. An electronic device, characterized by comprising a processor and a memory, in which a computer program is stored, the processor being adapted to carry out the steps of the method of electrical angle compensation of an electrical machine according to any one of claims 1 to 6 by invoking the computer program stored in the memory.
10. A storage medium having a computer program stored thereon, wherein the computer program, when being executed by a processor, executes the steps of the method for electrical angle compensation of an electrical machine according to any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110607388.1A CN113391551B (en) | 2021-06-01 | 2021-06-01 | Motor electric angle compensation method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110607388.1A CN113391551B (en) | 2021-06-01 | 2021-06-01 | Motor electric angle compensation method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113391551A true CN113391551A (en) | 2021-09-14 |
CN113391551B CN113391551B (en) | 2023-08-01 |
Family
ID=77619765
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110607388.1A Active CN113391551B (en) | 2021-06-01 | 2021-06-01 | Motor electric angle compensation method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113391551B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114089625A (en) * | 2021-11-16 | 2022-02-25 | 深圳市威科达科技有限公司 | Method for compensating position of absolute value encoder |
CN115296583A (en) * | 2022-07-01 | 2022-11-04 | 重庆智能机器人研究院 | Servo system electrical angle compensation method |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4999558A (en) * | 1987-12-01 | 1991-03-12 | Matsushita Electric Industrial Co., Ltd. | Position control system |
US5525885A (en) * | 1994-02-25 | 1996-06-11 | Mitsubishi Denki Kabushiki Kaisha | Position detecting apparatus and position compensating method therefor |
CN101924510A (en) * | 2010-07-06 | 2010-12-22 | 奇瑞汽车股份有限公司 | Compensation method for rotor position angle of permanent-magnet motor |
CN205843685U (en) * | 2016-06-28 | 2016-12-28 | 上海雷尼威尔技术有限公司 | Rotary encoder for integrated-type industrial machinery sensing control |
CN108981758A (en) * | 2018-08-15 | 2018-12-11 | 江门市蒙德电气股份有限公司 | A kind of kinematic error compensation method and device of rotary transformer |
US20190097555A1 (en) * | 2017-09-22 | 2019-03-28 | Nidec Motor Corporation | System and computer-implemented method for reducing angle error in electric motors |
CN112269131A (en) * | 2020-12-21 | 2021-01-26 | 季华实验室 | Speed ring PI oscillation detection method and device, electronic equipment and storage medium |
US20210044234A1 (en) * | 2018-02-20 | 2021-02-11 | Nidec Corporation | Motor control system and power steering system |
CN112539771A (en) * | 2019-09-20 | 2021-03-23 | 九江精密测试技术研究所 | Multi-axis absolute encoder resolving circuit system |
WO2021062725A1 (en) * | 2019-09-30 | 2021-04-08 | 深圳市大疆创新科技有限公司 | Electric motor control method, electric motor and movable platform |
-
2021
- 2021-06-01 CN CN202110607388.1A patent/CN113391551B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4999558A (en) * | 1987-12-01 | 1991-03-12 | Matsushita Electric Industrial Co., Ltd. | Position control system |
US5525885A (en) * | 1994-02-25 | 1996-06-11 | Mitsubishi Denki Kabushiki Kaisha | Position detecting apparatus and position compensating method therefor |
CN101924510A (en) * | 2010-07-06 | 2010-12-22 | 奇瑞汽车股份有限公司 | Compensation method for rotor position angle of permanent-magnet motor |
CN205843685U (en) * | 2016-06-28 | 2016-12-28 | 上海雷尼威尔技术有限公司 | Rotary encoder for integrated-type industrial machinery sensing control |
US20190097555A1 (en) * | 2017-09-22 | 2019-03-28 | Nidec Motor Corporation | System and computer-implemented method for reducing angle error in electric motors |
US20210044234A1 (en) * | 2018-02-20 | 2021-02-11 | Nidec Corporation | Motor control system and power steering system |
CN108981758A (en) * | 2018-08-15 | 2018-12-11 | 江门市蒙德电气股份有限公司 | A kind of kinematic error compensation method and device of rotary transformer |
CN112539771A (en) * | 2019-09-20 | 2021-03-23 | 九江精密测试技术研究所 | Multi-axis absolute encoder resolving circuit system |
WO2021062725A1 (en) * | 2019-09-30 | 2021-04-08 | 深圳市大疆创新科技有限公司 | Electric motor control method, electric motor and movable platform |
CN112269131A (en) * | 2020-12-21 | 2021-01-26 | 季华实验室 | Speed ring PI oscillation detection method and device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
李艳 等: "永磁同步电机MTPA控制系统设计", 《湖北汽车工业学院学报》, vol. 35, no. 1, pages 65 - 70 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114089625A (en) * | 2021-11-16 | 2022-02-25 | 深圳市威科达科技有限公司 | Method for compensating position of absolute value encoder |
CN115296583A (en) * | 2022-07-01 | 2022-11-04 | 重庆智能机器人研究院 | Servo system electrical angle compensation method |
Also Published As
Publication number | Publication date |
---|---|
CN113391551B (en) | 2023-08-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113391551A (en) | Motor electrical angle compensation method and device, electronic equipment and storage medium | |
CN111600519B (en) | Servo motor control method and device, electronic equipment and storage medium | |
CN108663080B (en) | Fault diagnosis method for absolute value encoder in servo drive system | |
WO2021078259A1 (en) | Flight control method, aircraft and flight system | |
WO2019114474A1 (en) | Method and device for correcting position of motor rotor, and equipment and storage medium | |
CN105630585A (en) | Periodic task processing method and apparatus | |
CN113255792B (en) | Data anomaly point detection method, device, system and storage medium | |
CN114151373A (en) | Server fan rotating speed regulating method, system, terminal and storage medium | |
CN106655958A (en) | Permanent magnet motor torque compensation method and device | |
CN111082725A (en) | Magnetic rotary encoder angle compensation method, compensation system and motor | |
CN111585478A (en) | Servo motor driving voltage control method, servo motor driving voltage control device, electronic equipment and storage medium | |
CN114518109B (en) | Zero offset compensation method of gyroscope | |
CN115931036A (en) | Magnetic encoder fault detection method and device, electronic equipment and storage medium | |
CN111600526B (en) | Servo motor driving control method and device, electronic equipment and storage medium | |
CN113051700B (en) | Equipment reliability monitoring method and device | |
CN113794414A (en) | Permanent magnet synchronous motor Hall signal online correction method | |
CN112197802A (en) | Communication fault processing method for absolute value encoder | |
JP2008236959A (en) | Motor controller and motor system | |
CN114977941B (en) | Inertia identification method, device and medium for alternating current servo system | |
CN114233470B (en) | Engine crankcase pressure correction method and related equipment | |
CN113328673B (en) | Method and device for determining position of motor rotor, motor and storage medium | |
CN114172415B (en) | Motor position sensor error compensation method, motor position sensor error compensation device, computer equipment and medium | |
CN117782164A (en) | Zero offset compensation method and related device of gyroscope | |
CN109659901B (en) | Protection method and device for direct current motor and electronic equipment | |
JPH034174A (en) | Speed detecting device for vehicle |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |