CN113391551B - Motor electric angle compensation method and device, electronic equipment and storage medium - Google Patents
Motor electric angle compensation method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN113391551B CN113391551B CN202110607388.1A CN202110607388A CN113391551B CN 113391551 B CN113391551 B CN 113391551B CN 202110607388 A CN202110607388 A CN 202110607388A CN 113391551 B CN113391551 B CN 113391551B
- Authority
- CN
- China
- Prior art keywords
- data
- current
- angle data
- electrical angle
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 27
- 238000004364 calculation method Methods 0.000 claims description 45
- 238000004590 computer program Methods 0.000 claims description 16
- 230000001360 synchronised effect Effects 0.000 claims description 10
- 230000006854 communication Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000001133 acceleration Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
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 motor electric angle compensation method, a device, electronic equipment and a storage medium, wherein electric angle data and acquisition time data acquired by an encoder are read at a preset carrier frequency, and reading time data of the electric angle data and the acquisition time data are obtained; calculating current speed data according to the recently read plurality of 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 electric angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the actual electric angle data can be effectively reduced, the conditions of low output efficiency and torque fluctuation of the torque ring control are improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Description
Technical Field
The present invention relates to the field of permanent magnet synchronous motor control technology, and in particular, to a motor electrical angle compensation method, apparatus, electronic device, and storage medium.
Background
Currently, permanent magnet synchronous motors are used for precise torque control, speed control and position control. As shown in fig. 4, the existing permanent magnet synchronous motor control system generally uses a communication absolute value encoder as a position feedback unit of a motor rotor, and the encoder cannot refresh position information in real time when each torque ring is controlled because the communication rate is not kept up with the torque ring control frequency, and a current controller of the torque ring has time deviation when the current controller reads electric angle data collected by the encoder and when the current controller collects the electric angle data, so that when the current controller reads the electric angle data, the electric angle of the motor is changed, and therefore, the deviation exists between the electric angle data read by the current controller and the real electric angle data. Because the encoder cannot obtain real-time and correct update of the position information, the torque ring control output has the problems of low efficiency and torque fluctuation, thereby affecting the running efficiency of the motor and causing the motor to vibrate.
Disclosure of Invention
In view of the above-mentioned shortcomings of the prior art, an object of an embodiment of the present application is to provide a method, an apparatus, an electronic device, and a storage medium for compensating an electrical angle of a motor, which are beneficial to improving the situations of low output efficiency and torque fluctuation of torque loop control, so as to improve the operation 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, applied to a current controller of a permanent magnet synchronous motor control system, including the steps of:
A1. reading electric angle data and acquisition time data acquired by an encoder with a preset carrier frequency, and acquiring read time data of the electric angle data and the acquisition time data at the moment; the acquisition time data refers to time data when the encoder acquires the electrical angle data;
A2. calculating current speed data according to the recently read plurality of 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 the current read electrical angle data;
A4. and outputting the compensated current electric angle data as a feedback value of the encoder.
According to the motor electric angle compensation method, the current speed data is calculated according to the read electric angle data, then the electric angle compensation value needing to be compensated is calculated according to the current speed data, the acquisition time data and the reading time data, the electric angle compensation value is used for compensating the front electric angle data and then outputting the front electric angle data as a feedback value, and deviation between the electric angle data output by the current controller and the real electric angle data can be effectively reduced, so that the situations of low torque loop control output efficiency and torque fluctuation are improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Preferably, step A2 comprises:
the current speed data is calculated according to the following formula:
;
wherein,,for the current speed data, n is a preset positive integer value and n>1,/>For the current electrical angle data, +.>Is->Corresponding acquisition time data,/>To->Respectively the last 1 to the last n electrical angle data read before the current electrical angle data, +.>To->Are respectively->To->Is>Is the start time of the current carrier period, +.>To->The start times of the 1 st to n th last carrier periods before the current carrier period, respectively.
Preferably, in step A2, n=2.
Preferably, step A2 further comprises:
calculating a speed deviation value between 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 yes, judging that the current speed data is invalid, and calculating new speed data as current speed data according to the speed data obtained by the previous m times of calculation; wherein m is a preset positive integer.
Preferably, step A2 further comprises:
checking the read current electric angle data to judge whether the current electric angle data is valid or not;
and if the current electrical angle data is invalid, taking the speed data obtained by the previous calculation as the current speed data.
Preferably, step A3 comprises:
if the read current electric angle data is valid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the compensated current electrical angle data, +.>To compensate for the current electrical angle data before,for the electrical angle compensation value, < >>For the current speed data, +.>For the time offset to be compensated for, +.>Is->Corresponding read time data;
if the read current electric angle data is invalid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the last time the valid electrical angle data read is +.>Is->Corresponding read time data.
In a second aspect, an embodiment of the present application provides a motor electrical angle compensation device, including:
the first acquisition module is used for reading the electric angle data and the acquisition time data acquired by the encoder at a preset carrier frequency and acquiring the read time data of the electric angle data and the acquisition time data at the moment; the acquisition time data refers to time data when the encoder acquires the electrical angle data;
the first calculation module is used for calculating current speed data according to the plurality of recently read electric angle data;
the compensation module is used for calculating an electric angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electric angle data; the current electrical angle data refers to the current read electrical angle data;
and the feedback module is used for outputting the compensated current electric angle data as a feedback value of the encoder.
Preferably, the first calculation module calculates the current speed data from a plurality of electrical angle data that have been recently read:
the current speed data is calculated according to the following formula:
;
wherein,,for the current speed numberAccording to the above, n is a preset positive integer value and n>1,/>For the current electrical angle data, +.>Is->Corresponding acquisition time data,/>To->Respectively the last 1 to the last n electrical angle data read before the current electrical angle data, +.>To->Are respectively->To->Is>Is the start time of the current carrier period, +.>To->The start times of the 1 st to n th last carrier periods before the current carrier period, respectively.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores a computer program, and the processor is configured to execute the steps of the electromechanical angle compensation method according to the above by calling the computer program stored in the memory.
In a fourth aspect, embodiments of the present application provide a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of a method of electromechanical angle compensation as described.
The beneficial effects are that:
according to the electric angle compensation method, the electric angle compensation device, the electronic equipment and the storage medium of the motor, electric angle data and acquisition time data acquired by an encoder are read at a preset carrier frequency, and reading time data of the electric angle data and the acquisition time data are obtained; calculating current speed data according to the recently read plurality of 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 electric angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the actual electric angle data can be effectively reduced, the conditions of low output efficiency and torque fluctuation of the torque ring control are 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 motor electrical angle compensation method according to an embodiment of the present application.
Fig. 2 is a block diagram of an electrical angle compensation device for a motor according to an embodiment of the present application.
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 following description of the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only to distinguish the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, a motor electrical angle compensation method 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 electric angle data and acquisition time data acquired by an encoder with a preset carrier frequency, and acquiring read time data of the electric angle data and the acquisition time data at the moment; the acquisition time data refers to time data when the encoder acquires the electrical angle data;
A2. calculating current speed data according to the recently read plurality of 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 the current read electrical angle data;
A4. and outputting the compensated current electric 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. According to the current speed data calculated according to the read electric angle data, then an electric angle compensation value needing to be compensated is calculated according to the current speed data, the acquisition time data and the reading time data, the electric angle compensation value is used for compensating the front electric angle data and then outputting the front electric angle data as a feedback value, and the deviation between the electric angle data output by the current controller and the real electric angle data (the real electric angle of the motor at the moment of the read electric angle data) can be effectively reduced, so that the situations of lower output efficiency and torque fluctuation of torque loop control are improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Wherein, 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 that the feedback frequency of the electrical angle data does not follow the torque loop control frequency.
In some embodiments, step A2 comprises:
A201. the current speed data is calculated according to the following formula:
(1);
wherein,,for the current speed data, n is a preset positive integer value and n>1,/>For the current electrical angle data, +.>Is->Corresponding acquisition time data,/>To->Respectively the last 1 to the last n electrical angle data read before the current electrical angle data, +.>To->Are respectively->To->Is>Is the start time of the current carrier period, +.>To->The start times of the 1 st to n th last carrier periods before the current carrier period, respectively.
The speed data is obtained by integrating a plurality of previously read electric angle data and can accurately estimate the current speed data, so that the deviation between the electric angle data output by the current controller and the real electric angle data can be ensured to be smaller.
Wherein, the value of n can be set according to actual needs; preferably, n=2, so that the electrical angle data employed spans a small time, so that the calculated current speed data is more accurate.
In which, in theory, the carrier period is fixed, and therefore,、/>……、the value of (2) is equal to the carrier period; in practice, however, the time control is erroneous, and therefore +.>、……、/>There is also a difference between them, here +.>、/>……、The method replaces the carrier period as a denominator to operate, and can further improve the accuracy of the calculation result.
In some preferred embodiments, step A2 further comprises:
A202. calculating a speed deviation value between current speed data and the last calculated speed data (namely the last valid 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 yes, judging that the current speed data is invalid, and calculating new speed data as current speed data according to the speed data obtained by the previous m times of calculation; wherein m is a preset positive integer.
The 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 cycle) reflects the acceleration condition of the motor, and 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 current speed data calculated is unreliable, the current speed data cannot be used for calculating an electric angle compensation value, otherwise, the control effect of the motor is affected.
The current speed 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 includes: the velocity data calculated last time (refer to the final valid velocity data calculated in the last carrier cycle) is used as the current velocity data.
For example, in a second example, m is greater than 1, and in some embodiments, step a205 comprises: calculating an average value of the speed data obtained by the previous m times of calculation as current speed data; in other embodiments, step a205 comprises: fitting according to the speed data obtained by the previous m times of calculation to obtain a speed change curve formula, and substituting the read time data of the moment when the current electric angle data are read into the speed change curve formula to obtain the current speed data.
Or for example, if m is greater than 1, in step a205, current speed data is calculated according to the speed data obtained by previous m times of calculation (specifically referring to the second example described above), then a speed deviation value between the current speed data and the speed data obtained by previous calculation (which refers to the final valid speed data obtained by calculation in the previous carrier period) is calculated, and it is determined whether the speed deviation value is greater than a preset speed deviation threshold, if not, it is determined that the current speed data is valid, and if yes, the speed data obtained by previous calculation (which refers to the final valid speed data obtained by calculation in the previous carrier period) is taken as the current speed data.
In practical applications, the current electrical angle data obtained by reading may be invalid, if the current electrical angle data obtained by reading is invalid, the current speed data obtained by calculating according to the current electrical angle data is also invalid (i.e. the current speed data obtained by calculating according to the formula (1) is invalid), and at this time, step A2 may further include:
A206. checking the read current electric angle data to judge whether the current electric angle data is valid or not;
A207. and if the current electrical angle data is invalid, taking the speed data obtained by the last calculation (namely the final valid speed data obtained by the calculation in the last carrier period) as the current speed data.
The step of verifying the read current electrical angle data comprises the following steps: and monitoring the communication data frame and recalculating the check value according to the communication rule of the encoder so as to judge whether the communication process has data errors (for example, a CRC check mode is adopted), if so, judging that the current electric angle data is invalid, and if not, judging that the current electric angle data is valid.
When the current electric angle data read 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 of the invalid current electric angle data and the current real speed data is uncontrollable, so that the embodiment can better ensure the accuracy of the calculation result.
Further, step A3 includes:
A301. if the read current electric angle data is valid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the compensated current electrical angle data, +.>To compensate the previous current electrical angle data (i.e. the current electrical angle data read),/>For the electrical angle compensation value, < >>For the current speed data, +.>For the time offset to be compensated for, +.>Is->Corresponding read time data;
A302. if the read current electric angle data is invalid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the last time the valid electrical angle data read is +.>Is->Corresponding read time data.
Such as the carrier cycle timing diagram shown in fig. 5, wherein the acquisition time of the electrical angle data acquired by the encoder is after the reading time of the electrical angle data by the current controller in each carrier cycle, and thus the electrical angle data read by the current controller in each carrier cycle is the electrical angle data acquired by the encoder in the last carrier cycle. If the current cycle reads the electrical angle data (i.e. the current electrical angle data is read) And (3) if the result is valid, calculating according to the step A301; if the electrical angle data read in the current period is invalid, the last electrical angle data read is assumed to be valid, namely、/>Then (4) handle->、/>Substituting the calculation formula of the step A302 for calculation.
According to the motor electric angle compensation method, electric angle data and acquisition time data acquired by an encoder are read at a preset carrier frequency, and reading time data of the electric angle data and the acquisition time data are obtained; calculating current speed data according to the recently read plurality of 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 electric angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the actual electric angle data can be effectively reduced, the conditions of low output efficiency and torque fluctuation of the torque ring control are 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 device, including:
the first acquisition module 1 is used for reading the electric angle data and the acquisition time data acquired by the encoder at a preset carrier frequency and acquiring the read time data of the electric angle data and the acquisition time data at the moment; the acquisition time data refers to time data when the encoder acquires the electrical angle data;
a first calculation module 2 for calculating current speed data from a plurality of electrical angle data that have been recently read;
the compensation module 3 is used for calculating an electric angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electric angle data; the current electrical angle data refers to the current read electrical angle data;
and the feedback module 4 is used for outputting the compensated current electric angle data as a feedback value of the encoder.
In some embodiments, the first calculation module 2 calculates the current speed data from the plurality of electrical angle data that was recently read:
the current speed data is calculated according to the following formula:
;
wherein,,for the current speed data, n is a preset positive integer value and n>1,/>For the current electrical angle data, +.>Is->Corresponding acquisition time data,/>To->Respectively the last 1 to the last n electrical angle data read before the current electrical angle data, +.>To->Are respectively->To->Is>Is the start time of the current carrier period, +.>To->The start times of the 1 st to n th last carrier periods before the current carrier period, respectively.
Wherein, the value of n can be set according to actual needs; preferably, n=2, so that the electrical angle data employed spans a small time, so that the calculated current speed data 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 were recently read, also:
calculating a speed deviation value between current speed data and the last calculated speed data (namely the last valid 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 yes, judging that the current speed data is invalid, and calculating new speed data as current speed data according to the speed data obtained by the previous m times of calculation; wherein m is a preset positive integer.
The 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 cycle) reflects the acceleration condition of the motor, and 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 current speed data calculated is unreliable, the current speed data cannot be used for calculating an electric angle compensation value, otherwise, the control effect of the motor is affected.
The current speed 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 realization requirement, and m can be 1 or more than 1.
For example, in the first example, m=1, and the first calculation module 2 calculates new speed data as current speed data from the speed data calculated in the previous m times: the velocity data calculated last time (refer to the final valid velocity data calculated in the last carrier cycle) is used as the current velocity data.
For example, in a second example, m is greater than 1, and in some embodiments, the first calculation module 2 calculates new speed data as current speed data from the speed data calculated from the previous m times: calculating an average value of the speed data obtained by the previous m times of calculation as current speed data; in other embodiments, the first calculation module 2 calculates new speed data as current speed data based on the speed data obtained by the previous m times of calculation: fitting according to the speed data obtained by the previous m times of calculation to obtain a speed change curve formula, and substituting the read time data of the moment when the current electric angle data are 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 calculates new speed data as current speed data from the speed data calculated in the previous m times: the current speed data is calculated according to the speed data obtained by the previous m times of calculation (specifically referring to the second example), then the speed deviation value between the current speed data and the last calculated speed data (referring to the last valid speed data obtained by calculation in the last carrier cycle) is calculated, whether the speed deviation value is larger than a preset speed deviation threshold value is judged, if not, the current speed data is judged to be valid, and if yes, the last calculated speed data (referring to the last valid speed data obtained by calculation in the last carrier cycle) is taken as the current speed data.
In practical application, the current electrical angle data obtained by reading may be invalid, if the current electrical angle data obtained by reading is invalid, the current speed data obtained by calculating according to the current electrical angle data is also invalid, and at this time, the first calculating module 2 further calculates the current speed data according to a plurality of electrical angle data which are recently read:
checking the read current electric angle data to judge whether the current electric angle data is valid or not;
and if the current electrical angle data is invalid, taking the speed data obtained by the last calculation (namely the final valid speed data obtained by the calculation in the last carrier period) as the current speed data.
The step of verifying the read current electrical angle data comprises the following steps: and monitoring the communication data frame and recalculating the check value according to the communication rule of the encoder so as to judge whether the communication process has data errors (for example, a CRC check mode is adopted), if so, judging that the current electric angle data is invalid, and if not, judging that the current electric angle data is valid.
Further, the compensation module 3 calculates 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:
if the read current electric angle data is valid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the compensated current electrical angle data, +.>To compensate the previous current electrical angle data (i.e. the current electrical angle data read),/>For the electrical angle compensation value, < >>For the current speed data, +.>For the time offset to be compensated for, +.>Is->Corresponding read time data;
if the read current electric angle data is invalid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the last time the valid electrical angle data read is +.>Is->Corresponding read time data.
According to the electric angle compensation device of the motor, the electric angle data and the acquisition time data acquired by the encoder are read at the preset carrier frequency, and the read time data of the electric angle data and the acquisition time data are obtained; calculating current speed data according to the recently read plurality of 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 electric angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the actual electric angle data can be effectively reduced, the conditions of low output efficiency and torque fluctuation of the torque ring control are improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
Referring to fig. 3, the embodiment of the present application further provides an electronic device 100, including 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 electromechanical 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 computer programs stored in the memory 102, and calling data stored in the memory 102, thereby performing overall monitoring of the electronic device.
Memory 102 may be used to store computer programs and data. The memory 102 stores a computer program having instructions executable in a 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 the processes of one or more computer programs into the memory 102 according to the following steps, and the processor 101 executes the computer programs stored in the memory 102, so as to implement various functions: reading electric angle data and acquisition time data acquired by an encoder with a preset carrier frequency, and acquiring read time data of the electric angle data and the acquisition time data at the moment; calculating current speed data according to the recently read plurality of 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 electric angle data as a feedback value of the encoder.
According to the electronic equipment, the electric angle data and the acquisition time data acquired by the encoder are read at the preset carrier frequency, and the read time data of the electric angle data and the acquisition time data are obtained; calculating current speed data according to the recently read plurality of 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 electric angle data as a feedback value of the encoder; therefore, the deviation between the electric angle data output by the current controller and the actual electric angle data can be effectively reduced, the conditions of low output efficiency and torque fluctuation of the torque ring control are improved, the running efficiency of the motor is improved, and the vibration of the motor is reduced.
The embodiment of the application also provides a storage medium, on which a computer program is stored, which when executed by a processor, performs the steps of the electromechanical angle compensation method described above, so as to implement the following functions: reading electric angle data and acquisition time data acquired by an encoder with a preset carrier frequency, and acquiring read time data of the electric angle data and the acquisition time data at the moment; calculating current speed data according to the recently read plurality of 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 electric angle data as a feedback value of the encoder.
The storage medium may be implemented by any type of volatile or nonvolatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM), electrically erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
In summary, although the present invention has been described with reference to the preferred embodiments, it is not limited thereto, and various modifications and variations can be made by those skilled in the art without departing from the spirit and scope of the present invention.
Claims (10)
1. The motor electric angle compensation method is characterized by being applied to a current controller of a permanent magnet synchronous motor control system and comprising the following steps of:
A1. reading electric angle data and acquisition time data acquired by an encoder with a preset carrier frequency, and acquiring read time data of the electric angle data and the acquisition time data at the moment; the acquisition time data refers to time data when the encoder acquires the electrical angle data;
A2. calculating current speed data according to the recently read plurality of 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 the current read electrical angle data;
A4. and outputting the compensated current electric angle data as a feedback value of the encoder.
2. The electromechanical angle compensation method according to claim 1, characterized in that step A2 comprises:
the current speed data is calculated according to the following formula:
;
wherein,,for the current speed data, n is a preset positive integer value and n>1,/>For the current electrical angle data, +.>Is->Corresponding acquisition time data,/>To->Respectively the last 1 to the last n electrical angle data read before the current electrical angle data, +.>To->Are respectively->To->Is>Is the start time of the current carrier period, +.>To->The start times of the 1 st to n th last carrier periods before the current carrier period, respectively.
3. The electromechanical angle compensation method according to claim 2, characterized in that in step A2, n=2.
4. The electromechanical angle compensation method according to claim 2, characterized in that step A2 further comprises:
calculating a speed deviation value between 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 yes, judging that the current speed data is invalid, and calculating new speed data as current speed data according to the speed data obtained by the previous m times of calculation; wherein m is a preset positive integer.
5. The electromechanical angle compensation method according to claim 2, characterized in that step A2 further comprises:
checking the read current electric angle data to judge whether the current electric angle data is valid or not;
and if the current electrical angle data is invalid, taking the speed data obtained by the previous calculation as the current speed data.
6. The method of claim 5, wherein step A3 includes:
if the read current electric angle data is valid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the compensated current electrical angle data, +.>To compensate for the current electrical angle data before,/>for the electrical angle compensation value, < >>For the current speed data, +.>For the time offset to be compensated for, +.>Is->Corresponding read time data;
if the read current electric angle data is invalid, calculating compensated current electric angle data according to the following formula:
;
;
;
wherein,,for the last time the valid electrical angle data read is +.>Is->Corresponding read time data.
7. An electromechanical angle compensation device, comprising:
the first acquisition module is used for reading the electric angle data and the acquisition time data acquired by the encoder at a preset carrier frequency and acquiring the read time data of the electric angle data and the acquisition time data at the moment; the acquisition time data refers to time data when the encoder acquires the electrical angle data;
the first calculation module is used for calculating current speed data according to the plurality of recently read electric angle data;
the compensation module is used for calculating an electric angle compensation value according to the current speed data, the acquisition time data and the reading time data so as to compensate the current electric angle data; the current electrical angle data refers to the current read electrical angle data;
and the feedback module is used for outputting the compensated current electric angle data as a feedback value of the encoder.
8. The motor electrical angle compensation apparatus of claim 7 wherein the first calculation module, when calculating current speed data from a plurality of recently read electrical angle data:
the current speed data is calculated according to the following formula:
;
wherein,,for the current speed data, n is a preset positive integer value and n>1,/>For the current electrical angle data, +.>Is->Corresponding acquisition time data,/>To->Respectively the last 1 to the last n electrical angle data read before the current electrical angle data, +.>To->Are respectively->To->Is>Is the start time of the current carrier period, +.>To->The start times of the 1 st to n th last carrier periods before the current carrier period, respectively.
9. An electronic device comprising a processor and a memory, said memory having stored therein a computer program for executing the steps of the electromechanical angle compensation method according to any of the claims 1-6 by invoking said computer program stored in said memory.
10. A storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the electromechanical angle compensation method according to any of the 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 CN113391551A (en) | 2021-09-14 |
CN113391551B true 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) |
Families Citing this family (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 (8)
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 |
CN112269131A (en) * | 2020-12-21 | 2021-01-26 | 季华实验室 | Speed ring PI oscillation detection method and device, electronic equipment and storage medium |
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 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019060753A1 (en) * | 2017-09-22 | 2019-03-28 | Nidec Motor Corporation | System and computer-implemented method for reducing angle error in electric motors |
JPWO2019163552A1 (en) * | 2018-02-20 | 2021-03-04 | 日本電産株式会社 | Motor control system and power steering system |
-
2021
- 2021-06-01 CN CN202110607388.1A patent/CN113391551B/en active Active
Patent Citations (8)
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 |
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控制***设计;李艳 等;《湖北汽车工业学院学报》;第35卷(第1期);第65-70页 * |
Also Published As
Publication number | Publication date |
---|---|
CN113391551A (en) | 2021-09-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113391551B (en) | Motor electric angle compensation method and device, electronic equipment and storage medium | |
CN111600519B (en) | Servo motor control method and device, electronic equipment and storage medium | |
CN110686352B (en) | Temperature detection value compensation method and device, storage medium and air conditioner | |
CN105783900B (en) | A kind of calibration method and device of sensing data | |
CN111953469B (en) | Method and device for synchronizing servo driver and Ethercat DC clock and electronic equipment | |
WO2019114474A1 (en) | Method and device for correcting position of motor rotor, and equipment and storage medium | |
CN105630585A (en) | Periodic task processing method and apparatus | |
EP2988186B1 (en) | Detection of consistent steady-state behavior in process plants | |
EP1959324B1 (en) | Resonant frequency identification | |
CN109660310B (en) | Clock synchronization method and device, computing equipment and computer storage medium | |
CN103314554A (en) | Dynamic host profiles for option modules | |
CN111585478A (en) | Servo motor driving voltage control method, servo motor driving voltage control device, electronic equipment and storage medium | |
CN109600092B (en) | Permanent magnet synchronous motor rotor position monitoring and correcting method and system and motor | |
CN111082725A (en) | Magnetic rotary encoder angle compensation method, compensation system and motor | |
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 | |
CN114518109B (en) | Zero offset compensation method of gyroscope | |
CN112197802A (en) | Communication fault processing method for absolute value encoder | |
CN114977941B (en) | Inertia identification method, device and medium for alternating current servo system | |
CN114172415B (en) | Motor position sensor error compensation method, motor position sensor error compensation device, computer equipment and medium | |
CN116827475B (en) | Flowmeter clock synchronization method, device, equipment and medium based on Internet of things | |
CN117434907B (en) | Method and equipment for controlling number of servo drivers based on CoDeSys controller | |
CN113992101B (en) | Current compensation method and device based on vector control of permanent magnet synchronous motor | |
CN114483325B (en) | Memory, and gas generator additional control method, device, equipment and system | |
CN117782164A (en) | Zero offset compensation method and related device of gyroscope |
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 |