CN116796114A - FOC algorithm optimization method - Google Patents

FOC algorithm optimization method Download PDF

Info

Publication number
CN116796114A
CN116796114A CN202310747404.6A CN202310747404A CN116796114A CN 116796114 A CN116796114 A CN 116796114A CN 202310747404 A CN202310747404 A CN 202310747404A CN 116796114 A CN116796114 A CN 116796114A
Authority
CN
China
Prior art keywords
motor
function
foc algorithm
algorithm
foc
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
Application number
CN202310747404.6A
Other languages
Chinese (zh)
Other versions
CN116796114B (en
Inventor
黎金海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Baibai Technology Co ltd
Original Assignee
Guangzhou Baibai Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Baibai Technology Co ltd filed Critical Guangzhou Baibai Technology Co ltd
Priority to CN202310747404.6A priority Critical patent/CN116796114B/en
Publication of CN116796114A publication Critical patent/CN116796114A/en
Application granted granted Critical
Publication of CN116796114B publication Critical patent/CN116796114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P21/00Arrangements or methods for the control of electric machines by vector control, e.g. by control of field orientation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/14Fourier, Walsh or analogous domain transformations, e.g. Laplace, Hilbert, Karhunen-Loeve, transforms
    • G06F17/141Discrete Fourier transforms
    • G06F17/142Fast Fourier transforms, e.g. using a Cooley-Tukey type algorithm
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/16Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P2207/00Indexing scheme relating to controlling arrangements characterised by the type of motor
    • H02P2207/01Asynchronous machines

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Algebra (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Power Engineering (AREA)
  • Discrete Mathematics (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

The application discloses an optimization method of a FOC algorithm, and relates to the technical field of virtual photography. The method comprises the following steps: acquiring a trigonometric function in the FOC algorithm; establishing a lookup table according to the trigonometric function; acquiring motor parameters of a motor driving chip; preprocessing motor parameters to generate preprocessed motor parameters; calculating the trigonometric function, and replacing part of functions in the trigonometric function by using the arctangent function; reducing the frequency of Park-Clarke transformation in the FOC algorithm; the cradle head equipment generates a motor control instruction through a FOC algorithm; the motor control instruction is output into the motor system through the motor driving chip. The application reduces the operation amount of the trigonometric function by adopting a faster calculation method, thereby improving the execution efficiency of the algorithm, enabling the control system to respond to the change in time and ensuring the real-time performance thereof; and each item of data of each frame of picture is accurately controlled, so that the performance and picture quality of the virtual photographic equipment are improved.

Description

FOC algorithm optimization method
Technical Field
The application belongs to the technical field of virtual photographing equipment, and particularly relates to an optimization method of a FOC algorithm.
Background
The FOC (Field-oriented control) algorithm is a control algorithm of an induction motor, and the FOC algorithm realizes accurate control of the motor by accurately controlling the position, the speed and the electromagnetic Field of the rotor of the induction motor, thereby improving the efficiency and the performance of the motor. The FOC algorithm has wide application in the field of motor control, and particularly has important application in the fields of high-performance motor systems, automobile motors, electric bicycles and the like.
The FOC algorithm can also be applied to the field of virtual photography, and when the FOC algorithm is applied to virtual photography equipment, the following technical defects and problems exist:
(1) The SVPWM (SpaceVectorPulseWidth Modulation ) method used in the conventional FOC algorithm needs to perform a large amount of trigonometric function operation, resulting in a large overall calculation amount and seriously affecting the real-time performance of the control system.
(2) The conventional FOC algorithm requires frequent trigonometric function operations in performing coordinate transformation, which leads to an increase in computational complexity. This increase in complexity not only increases the demand for hardware resources, but also causes computational delay, thereby affecting the response speed of the control system and the stability of the picture.
(3) Because the conventional FOC algorithm is applied to the driving algorithm of the cradle head equipment, a large amount of calculation is required, the calculation efficiency is limited by hardware resources and cannot meet the requirement of real-time performance, so that the response speed of a control system is low, and the stability and quality of a picture are affected.
Disclosure of Invention
The application aims to provide an optimization method of a FOC algorithm, which optimizes a driving algorithm of virtual photographic equipment, and reduces the influence on pictures by improving the efficiency of driving operation, thereby improving the instantaneity and the performance of the virtual photographic equipment.
The aim of the application can be achieved by the following technical scheme:
the embodiment of the application provides an optimization method of a FOC algorithm, wherein the FOC algorithm is positioned in a cradle head device of virtual photographic equipment, the cradle head device comprises a motor system, a sensor and a control board, and the method comprises the following steps:
s1, acquiring a trigonometric function in the FOC algorithm;
s2, establishing a lookup table according to the trigonometric function;
s3, acquiring motor parameters of a motor driving chip;
s4, preprocessing the motor parameters to generate preprocessed motor parameters;
s5, calculating the trigonometric function, and replacing part of functions in the trigonometric function by using an arc tangent function;
s6, reducing the frequency of Park-Clarke transformation in the FOC algorithm;
s7, the cradle head equipment generates a motor control instruction through the FOC algorithm;
s8, outputting the motor control instruction into the motor system through the motor driving chip;
wherein the trigonometric function comprises a sine function, a cosine function and a tangent function;
wherein, the motor drive chip is located in the control panel.
Preferably, the motor system comprises a motor and a motor controller; the sensor includes a position sensor, a gyroscope, and an accelerometer.
Preferably, the motor parameters include motor pole count, motor rotor position, angular accuracy, magnetic flux, current error, and sampling frequency.
Preferably, said reducing the frequency of the Park-Clarke transform in the FOC algorithm comprises adjusting the sampling time of the Park-Clarke transform or reducing the bandwidth of the motor controller.
Preferably, the establishing a lookup table according to the trigonometric function includes the following steps:
s21, determining pre-calculated and stored data;
s22, determining the size and the precision of the lookup table;
s23, generating a lookup table;
s24, calling the lookup table in the FOC algorithm.
Preferably, the pre-calculated and stored data includes values of the sine function, the cosine function, the arctangent function, the slope of the arctangent function, and the Park-Clarke transformed matrix.
Preferably, the generating the preprocessing motor parameter includes the steps of:
s41, acquiring the motor parameters;
s42, calculating the pretreatment motor parameters according to the motor parameters;
s43, storing the parameters of the preprocessing motor;
s44, calling the preprocessing motor parameters in the FOC algorithm;
wherein, the motor parameters comprise three-phase winding inductance, resistance, magnetic pole number and rotor inertia;
the pre-processing motor parameters include d-axis inductance, q-axis inductance, d-axis resistance, q-axis resistance, magnetic flux constant, and inductance constant.
Preferably, in the FOC algorithm, the arctangent function is used instead of the sine function and the cosine function; matrix operations are also used instead of the trigonometric functions.
Preferably, said reducing the frequency of the Park-Clarke transform in said FOC algorithm comprises increasing the conversion period of said Park-Clarke transform and using model predictive control.
Preferably, in the step S5, the trigonometric function is calculated, and an approximation algorithm is used instead of the trigonometric function; wherein the approximation algorithm includes polynomial expansion, fast fourier transform and CORDIC algorithm.
The beneficial effects of the application are as follows:
(1) The application optimizes the driving algorithm of the virtual photographic equipment, and reduces the influence on the picture by improving the efficiency of driving operation, thereby improving the instantaneity and the performance of the virtual photographic equipment.
(2) According to the method, by adopting a faster calculation method, the number of trigonometric function operations is reduced, so that the execution efficiency of the whole algorithm is improved; further, the control system can respond to the change more timely, and the real-time performance of the control system is ensured; and each item of data of each frame of picture can be accurately controlled, and the performance and picture quality of the virtual photographic equipment are improved.
(3) According to the application, by acquiring all trigonometric functions in the FOC algorithm and establishing the check list according to the trigonometric functions, and pre-calculating and storing a certain amount of data, the time and complexity of real-time calculation are reduced, and the execution efficiency of the FOC algorithm is improved.
(4) The application generates the preprocessed motor parameters by preprocessing the motor parameters, thereby effectively reducing the calculated amount of the trigonometric function; the preprocessing motor parameters can be used for calculating and storing the motor parameters in an initialization stage, and then the parameters are directly used in the FOC algorithm, so that repeated calculation is avoided, and the calculation efficiency of the FOC algorithm is improved.
(5) According to the application, in the calculation of the trigonometric function, the arc tangent function is used for replacing partial functions such as a sine function, a cosine function and the like in the trigonometric function, and an angle value is calculated, and then the arc tangent function is used for extracting the sine value and the cosine value from the angle value, so that all trigonometric function operations required by Park-Clarke transformation in the FOC algorithm are realized, the calculated amount and the calculated time are reduced, and the calculation efficiency of the FOC algorithm is further improved.
(6) According to the application, the frequency of Park-Clarke transformation is reduced by adjusting the sampling time of Park-Clarke transformation or reducing the bandwidth of a motor controller, and the trigonometric function calculated amount in the FOC algorithm is reduced by properly reducing the transformation frequency in a certain range, so that the calculation efficiency of the FOC algorithm is further improved.
(7) In the calculation of the trigonometric function, the matrix operation and the approximation algorithm are used for replacing the trigonometric function, the lookup table and the preprocessing of the motor parameters can be combined, and the calculated amount of the trigonometric function in the FOC algorithm is reduced in multiple aspects through the combination of the modes, so that the calculated amount of the trigonometric function in the virtual photography is effectively reduced, the algorithm execution efficiency is improved, the influence on pictures is reduced, and the real-time performance and the performance of the virtual photographic equipment are finally improved.
Drawings
For a better understanding and implementation, the technical solution of the present application is described in detail below with reference to the accompanying drawings.
FIG. 1 is a flow chart of steps of an optimization method of a FOC algorithm according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps for creating a lookup table according to an embodiment of the present application;
fig. 3 is a flowchart of steps for generating parameters of a preprocessing motor according to an embodiment of the present application.
Detailed Description
For further explanation of the technical means and effects adopted by the present application for achieving the intended purpose, exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the application. Rather, they are merely examples of methods and systems that are consistent with aspects of the application as detailed in the accompanying claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to any or all possible combinations including one or more of the associated listed items.
The following detailed description of specific embodiments, features and effects according to the present application is provided with reference to the accompanying drawings and preferred embodiments.
Referring to fig. 1, an embodiment of the present application provides a method for optimizing a FOC algorithm, where the FOC algorithm is located in a pan-tilt device of a virtual photographing device, the pan-tilt device includes a motor system, a sensor, and a control board, and the method includes the following steps:
s1, acquiring a trigonometric function in a FOC algorithm;
s2, establishing a lookup table according to the trigonometric function;
s3, acquiring motor parameters of a motor driving chip;
s4, preprocessing the motor parameters to generate preprocessed motor parameters;
s5, calculating the trigonometric function, and replacing part of functions in the trigonometric function by using the arc tangent function;
s6, reducing the frequency of Park-Clarke transformation in the FOC algorithm;
s7, the cradle head equipment generates a motor control instruction through a FOC algorithm;
s8, outputting a motor control instruction into a motor system through a motor driving chip;
the trigonometric function comprises a sine function, a cosine function and a tangent function;
wherein, motor drive chip is located the control panel.
Specifically, the FOC algorithm is mainly applied to the virtual photographing direction, and is mainly used for optimizing driving algorithms of various cradle head devices required by the virtual photographing device. The FOC algorithm of the present application is located within a cradle head device of a virtual photography device, which includes a motor system, a sensor, and a control board.
The FOC algorithm is an improved algorithm which is made aiming at the fact that a large amount of trigonometric function calculation needs to be carried out in the traditional FOC algorithm, and the main improvement steps are as follows: acquiring all calculated trigonometric functions including tangent function, cosine function, sine function and the like in the FOC algorithm; then, according to trigonometric functions such as sine function, cosine function, tangent function and the like required by the FOC algorithm, a lookup table is established, and the step reduces the time and the calculation complexity of the FOC algorithm in real time by pre-calculating and storing a certain amount of data, so that the execution efficiency of the FOC algorithm is improved; the method comprises the steps of obtaining motor parameters of a motor driving chip, and preprocessing the motor parameters to generate preprocessed motor parameters, wherein the step can improve the execution efficiency and accuracy of the FOC algorithm, so that the control of a motor in the holder equipment is more stable and accurate, and the performance of the virtual photographic equipment is further improved; when the trigonometric function is calculated, the arc tangent function is used for replacing partial functions such as sine function, cosine function and the like in the trigonometric function; it should be noted that, the arctangent function may implement the substitution of the partial trigonometric function by creating an arctangent function lookup table, that is: combining the establishment of the lookup table with the replacement of part of the trigonometric function by the arctangent function, and reducing the calculated amount of the trigonometric function in the FOC algorithm by establishing the arctangent function lookup table, thereby improving the execution efficiency of the FOC algorithm; next, the frequency of Park-Clarke transformation in the FOC algorithm is reduced; in the FOC algorithm, the Park-Clarke transformation needs to carry out high-frequency transformation on the state of the motor, which possibly causes the calculation amount of the FOC algorithm to be increased so as to reduce the execution efficiency of the FOC algorithm, so that the application reduces the frequency of the Park-Clarke transformation in order to avoid reducing the execution efficiency of the FOC algorithm; finally, the cradle head equipment generates motor control instructions by utilizing the FOC algorithm through the steps, and outputs the motor control instructions into a motor system through a motor driving chip, and the motor system realizes accurate rotation angle and speed control by utilizing the motor control instructions, so that the real-time performance and performance of the virtual photographic equipment are improved.
In the virtual photographing device of the present application, the FOC algorithm needs to sample parameters such as current, voltage, angle, etc. of the motor system at a high speed, and calculate parameters such as position, speed, acceleration, etc. of the motor rotor at each moment; based on these parameters, the FOC algorithm is capable of generating motor control commands having precise directions and magnitudes for controlling the movement of the motor rotor. These motor control commands are typically encoded as digital signals and output to the motor system via a motor drive chip to ultimately achieve accurate angular and speed control. In virtual photography, the motor control instruction generated by the tripod head equipment through the FOC algorithm can control parameters such as rotation, pitching and the like of a camera or other equipment, so that stable conversion of a visual angle and stable shooting effect are realized, influence on a picture is reduced, and performance of the virtual photographic equipment is improved.
In one embodiment provided by the application, the motor system includes a motor and a motor controller; the sensor includes a position sensor, a gyroscope, and an accelerometer.
Specifically, in the cradle head equipment, the motor system comprises a horizontal motor system, a vertical motor system and a lens motor system, and the three motor systems are accurately controlled by combining the FOC algorithm, so that the precise positioning and movement of the cradle head equipment and the lens are realized; meanwhile, the motor system is matched with a motor controller and related sensors, so that the positioning and movement precision of the cradle head equipment is improved.
In the application, the sensor comprises a position sensor, a gyroscope, an accelerometer, a magnetometer, a pressure sensor, a temperature sensor and the like, and the sensor is used in combination through a sensor array or an IMU (Inertial MeasurementUnit ) and the like to obtain the information of the attitude angle, the position, the speed and the like of the equipment. In the application of the application, the data of the sensor is processed as a feedback signal, so that the cradle head equipment can be helped to realize high-precision motion control and safe operation.
In one embodiment provided by the application, the motor parameters include motor pole count, motor rotor position, angular accuracy, magnetic flux, current error, and sampling frequency.
Specifically, the application preprocesses the motor parameters to generate preprocessed motor parameters, wherein the motor parameters comprise the number of motor poles, the position of a motor rotor, the angle precision, the magnetic flux, the current error, the sampling frequency and the like; in the application, the motor parameter has great influence on the calculated amount of the trigonometric function in the FOC algorithm, so the calculated amount of the trigonometric function can be reduced by preprocessing the motor parameter. Therefore, the FOC algorithm of the application is used for directly using the motor parameters in the FOC algorithm by calculating and storing the motor parameters in the initialization stage, thereby avoiding repeated calculation, reducing the calculated amount of trigonometric functions and further improving the execution efficiency of the whole algorithm. It should be noted that the present application may also combine the preprocessing motor parameters with the establishment of the lookup table, namely: the preprocessed motor parameters can be quickly accessed and used in the form of a lookup table, so that the operation speed and efficiency of the FOC algorithm are improved. Meanwhile, as the motor parameters may change along with factors such as time, temperature and the like, the preprocessed motor parameters also need to be continuously updated and optimized, and therefore, parameter adjustment and correction can be more conveniently carried out by combining a lookup table mode.
In one embodiment of the present application, the reducing the frequency of the Park-Clarke transform in the FOC algorithm includes adjusting a sampling time of the Park-Clarke transform or reducing a bandwidth of the motor controller.
Specifically, park-Clarke transformation is a key step in converting three-phase currents into a rotational coordinate system (dq coordinate system), and trigonometric function operations such as sine functions, cosine functions, and the like are required. These operations require a significant amount of computational resources, and therefore the present application optimizes the FOC algorithm by reducing the frequency of Park-Clarke transforms in the FOC algorithm, reducing the amount of computation of trigonometric functions therein. While the frequency of the Park-Clarke transform can be reduced by adjusting the sampling time of the transform or reducing the bandwidth of the motor controller. The transformation frequency can be reduced appropriately within a certain range to reduce the amount of trigonometric function calculation in the FOC algorithm.
As shown in fig. 2, in one embodiment provided by the present application, the creating a lookup table according to the trigonometric function includes the following steps:
s21, determining pre-calculated and stored data;
s22, determining the size and the precision of a lookup table;
s23, generating a lookup table;
s24, calling a lookup table in the FOC algorithm.
Specifically, in step S21, it is determined which data needs to be calculated and stored in advance, such as values of sine and cosine, values and slopes of arctangent function, and a matrix of Park transformation, according to functions such as sine, cosine, arctangent, and the like, and motor parameters and the like required by the FOC algorithm; in step S22, since the size and accuracy of the lookup table affect the performance of the cradle head device, the size and accuracy of the lookup table need to be determined according to the requirements of the FOC algorithm and the performance of the cradle head device. It should be noted that the accuracy of the lookup table also affects the calculation efficiency of the FOC algorithm, so that when determining the accuracy of the lookup table, it is also necessary to balance the relationship between the accuracy and the calculation efficiency; in step S23, the generation of the lookup table may be implemented by codes of languages such as Python or MATLAB; in step S24, when the FOC algorithm calls the lookup table, data calculated in advance and stored in the lookup table is taken as an input, and numerical interpolation or approximate function calculation is performed, thereby obtaining desired data information. In the virtual photography of the present application, the size of the lookup table determines the memory size required for storage, so that the memory size of the virtual photographic device needs to be considered in determining the size; the precision of the lookup table directly influences the performance and stability of the control system, so that factors such as the speed, precision, motion requirement and the like of the virtual photographic equipment are considered when the precision of the lookup table is determined; in summary, the application can balance the size and the precision of the lookup table according to the actual requirements and resources, and adjust and determine the lookup table.
Further, the pre-calculated and stored data includes values of the sine function, the cosine function, the arctangent function, the slope of the arctangent function, and the Park-Clarke transformed matrix.
In one embodiment provided by the present application, as shown in fig. 3, the generating the preprocessing motor parameter includes the following steps:
s41, acquiring motor parameters;
s42, calculating pretreatment motor parameters according to the motor parameters;
s43, storing the parameters of the preprocessing motor;
s44, calling the parameters of the preprocessing motor in the FOC algorithm;
the motor parameters comprise three-phase winding inductance, resistance, magnetic pole number and rotor inertia;
the pre-processing motor parameters include d-axis inductance, q-axis inductance, d-axis resistance, q-axis resistance, magnetic flux constant, and inductance constant.
Specifically, the application obtains each parameter of the motor from a motor data table or other sources, including three-phase winding inductance, resistance, pole number, rotor inertia and the like, and then calculates various pretreatment motor parameters, such as d-axis inductance, q-axis inductance, d-axis resistance, q-axis resistance, magnetic flux constant, inductance constant and the like according to the mathematical formulas of the parameters; the resulting preprocessed motor parameters are then stored, which the application stores in a array or table; and finally, when FOC algorithm calculation is carried out, the parameters of the preprocessing motor are used as input, and the needed parameter information is obtained through a lookup table and other modes.
In one embodiment provided by the present application, in the FOC algorithm, the arctangent function is used instead of the sine function and the cosine function; matrix operations are also used instead of the trigonometric functions.
Specifically, the present application uses an arctangent function to replace the operation of sine and cosine functions, and can combine the forms of establishing a check list and preprocessing parameters, namely: establishing an arctangent function check list, calling the arctangent function check list when the sine and cosine functions in the trigonometric function are required to be calculated, preprocessing some related parameters according to parameters (such as the slope and intercept of the arctangent function) of the arctangent function required by the FOC algorithm, and further improving the execution efficiency of the FOC algorithm. In the present application, however, matrix transformation operation may be used instead of trigonometric function operation in performing operations such as translation, rotation, and scaling.
In one embodiment of the present application, the reducing the frequency of the Park-Clarke transform in the FOC algorithm includes increasing the conversion period of the Park-Clarke transform and using model predictive control.
In particular, the frequency of Park-Clarke transformation is related to the control period of the FOC algorithm, and the application reduces the frequency of Park-Clarke transformation in the FOC algorithm by increasing the conversion period of Park-Clarke transformation and using model predictive control. Regarding the addition of the conversion period of Park-Clarke transformation, the response speed of the FOC algorithm is reduced due to the fact that the control period of the FOC algorithm is prolonged, so that the response speed of the FOC algorithm can be improved under the condition that the control period of the FOC algorithm is longer by increasing the nested layer number of the control period. With respect to predictive control using models, the present application predicts future states and output signals by building mathematical models of the motor to generate an optimal control strategy. The model predictive control can be directly calculated under the dq coordinate system without Park-Clarke transformation, so that the frequency problem of Park-Clarke transformation can be avoided, and the response speed of the FOC algorithm is further improved.
In one embodiment of the present application, in the step S5, the calculating the trigonometric function further uses an approximation algorithm instead of the trigonometric function; wherein the approximation algorithm includes polynomial expansion, fast fourier transform and CORDIC algorithm.
Specifically, in the present application, an approximation method is used instead of trigonometric function operation in the FOC algorithm, thereby reducing the amount of calculation of the trigonometric function. For example, in the smoothing processing, a method such as a fast trigonometric function or a taylor expansion may be used.
Regarding polynomial expansion, specifically: approximating the trigonometric function as a polynomial form and calculating in the form of a polynomial; since polynomial expansion increases the amount of computation and errors when replacing trigonometric functions, the present application also avoids the increased amount of computation and errors by using a local approximation method, using a series expansion method, using a lookup table, using preprocessing, and the like; the method for using the lookup table specifically includes: the value of the trigonometric function in a certain range is calculated in advance and stored in a lookup table so as to directly look up the table to obtain the result when needed. Therefore, the application can combine the similar algorithm with the establishment of the lookup table, thereby reducing the calculation amount of the trigonometric function in the FOC algorithm.
Regarding the fast Fourier transformation, the application converts the trigonometric function into sine and cosine functions in the frequency domain and calculates the sine and cosine functions in the frequency domain, thereby achieving the purpose of accelerating operation.
Regarding the CORDIC (coordinated rotation digital computer) algorithm, which is an iterative algorithm, sine, cosine and arctangent functions can be approximately calculated by rotating an arctangent operation in a coordinate system. The specific operation comprises the following steps: selecting a coordinate system, calculating a rotation angle, calculating a rotation factor, performing iterative calculation, and calculating coordinate transformation.
In summary, the method optimizes the driving algorithm of the virtual photographing device, and reduces the influence on the picture by improving the efficiency of driving operation, thereby improving the real-time performance and the performance of the virtual photographing device.
According to the method, by adopting a faster calculation method, the number of trigonometric function operations is reduced, so that the execution efficiency of the whole algorithm is improved; further, the control system can respond to the change more timely, and the real-time performance of the control system is ensured; and each item of data of each frame of picture can be accurately controlled, and the performance and picture quality of the virtual photographic equipment are improved.
According to the application, by acquiring all trigonometric functions in the FOC algorithm and establishing the check list according to the trigonometric functions, and pre-calculating and storing a certain amount of data, the time and complexity of real-time calculation are reduced, and the execution efficiency of the FOC algorithm is improved.
The application generates the preprocessed motor parameters by preprocessing the motor parameters, thereby effectively reducing the calculated amount of the trigonometric function; the preprocessing motor parameters can be used for calculating and storing the motor parameters in an initialization stage, and then the parameters are directly used in the FOC algorithm, so that repeated calculation is avoided, and the calculation efficiency of the FOC algorithm is improved.
According to the application, in the calculation of the trigonometric function, the arc tangent function is used for replacing partial functions such as a sine function, a cosine function and the like in the trigonometric function, and an angle value is calculated, and then the arc tangent function is used for extracting the sine value and the cosine value from the angle value, so that all trigonometric function operations required by Park-Clarke transformation in the FOC algorithm are realized, the calculated amount and the calculated time are reduced, and the calculation efficiency of the FOC algorithm is further improved.
According to the application, the frequency of Park-Clarke transformation is reduced by adjusting the sampling time of Park-Clarke transformation or reducing the bandwidth of a motor controller, and the trigonometric function calculated amount in the FOC algorithm is reduced by properly reducing the transformation frequency in a certain range, so that the calculation efficiency of the FOC algorithm is further improved.
In the calculation of the trigonometric function, the matrix operation and the approximation algorithm are used for replacing the trigonometric function, the lookup table and the preprocessing of the motor parameters can be combined, and the calculated amount of the trigonometric function in the FOC algorithm is reduced in multiple aspects through the combination of the modes, so that the calculated amount of the trigonometric function in the virtual photography is effectively reduced, the algorithm execution efficiency is improved, the influence on pictures is reduced, and the real-time performance and the performance of the virtual photographic equipment are finally improved.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The present application is not limited to the above embodiments, but is not limited to the above embodiments, and any modifications, equivalents and variations made to the above embodiments according to the technical matter of the present application can be made by those skilled in the art without departing from the scope of the technical matter of the present application.

Claims (10)

1. The FOC algorithm is located in a cradle head device of a virtual photographing device, and the cradle head device comprises a motor system, a sensor and a control board, and is characterized in that: the method comprises the following steps:
s1, acquiring a trigonometric function in the FOC algorithm;
s2, establishing a lookup table according to the trigonometric function;
s3, acquiring motor parameters of a motor driving chip;
s4, preprocessing the motor parameters to generate preprocessed motor parameters;
s5, calculating the trigonometric function, and replacing part of functions in the trigonometric function by using an arc tangent function;
s6, reducing the frequency of Park-Clarke transformation in the FOC algorithm;
s7, the cradle head equipment generates a motor control instruction through the FOC algorithm;
s8, outputting the motor control instruction into the motor system through the motor driving chip;
wherein the trigonometric function comprises a sine function, a cosine function and a tangent function;
wherein, the motor drive chip is located in the control panel.
2. The method for optimizing a FOC algorithm according to claim 1, wherein: the motor system comprises a motor and a motor controller; the sensor includes a position sensor, a gyroscope, and an accelerometer.
3. The method for optimizing a FOC algorithm according to claim 1, wherein: the motor parameters include the number of motor poles, motor rotor position, angular accuracy, magnetic flux, current error, and sampling frequency.
4. A method for optimizing a FOC algorithm according to claim 2, wherein: the reducing the frequency of the Park-Clarke transform in the FOC algorithm includes adjusting a sampling time of the Park-Clarke transform or reducing a bandwidth of the motor controller.
5. The method for optimizing a FOC algorithm according to claim 1, wherein: the step of establishing a lookup table according to the trigonometric function comprises the following steps:
s21, determining pre-calculated and stored data;
s22, determining the size and the precision of the lookup table;
s23, generating a lookup table;
s24, calling the lookup table in the FOC algorithm.
6. The method for optimizing a FOC algorithm according to claim 5, wherein: the pre-calculated and stored data includes values of the sine function, the cosine function, the arctangent function, the slope of the arctangent function, and the Park-Clarke transformed matrix.
7. The method for optimizing a FOC algorithm according to claim 1, wherein: the generation of the preprocessing motor parameters comprises the following steps:
s41, acquiring the motor parameters;
s42, calculating the pretreatment motor parameters according to the motor parameters;
s43, storing the parameters of the preprocessing motor;
s44, calling the preprocessing motor parameters in the FOC algorithm;
wherein, the motor parameters comprise three-phase winding inductance, resistance, magnetic pole number and rotor inertia;
the pre-processing motor parameters include d-axis inductance, q-axis inductance, d-axis resistance, q-axis resistance, magnetic flux constant, and inductance constant.
8. The method for optimizing a FOC algorithm according to claim 1, wherein: in the FOC algorithm, the arctangent function is used instead of the sine function and the cosine function; matrix operations are also used instead of the trigonometric functions.
9. The method for optimizing a FOC algorithm according to claim 1, wherein: the reducing the frequency of the Park-Clarke transform in the FOC algorithm includes increasing the conversion period of the Park-Clarke transform and using model predictive control.
10. The method for optimizing a FOC algorithm according to claim 1, wherein: in the step S5, the trigonometric function is calculated, and an approximation algorithm is used to replace the trigonometric function; wherein the approximation algorithm includes polynomial expansion, fast fourier transform and CORDIC algorithm.
CN202310747404.6A 2023-06-25 2023-06-25 FOC algorithm optimization method Active CN116796114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310747404.6A CN116796114B (en) 2023-06-25 2023-06-25 FOC algorithm optimization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310747404.6A CN116796114B (en) 2023-06-25 2023-06-25 FOC algorithm optimization method

Publications (2)

Publication Number Publication Date
CN116796114A true CN116796114A (en) 2023-09-22
CN116796114B CN116796114B (en) 2024-03-29

Family

ID=88037164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310747404.6A Active CN116796114B (en) 2023-06-25 2023-06-25 FOC algorithm optimization method

Country Status (1)

Country Link
CN (1) CN116796114B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105572503A (en) * 2015-12-21 2016-05-11 东营东齐石油科技有限公司 Oil pumping unit electrical parameter data pre-processing method based on multiple scale sampling
CN105978441A (en) * 2016-06-15 2016-09-28 零度智控(北京)智能科技有限公司 Unmanned aerial vehicle/motor control device and method
CN106197238A (en) * 2015-05-27 2016-12-07 法国大陆汽车公司 For using inductosyn to determine the mobile parts method along the position of axle
CN107147343A (en) * 2017-06-02 2017-09-08 深圳市奇诺动力科技有限公司 Brushless electric machine Field orientable control drive system and control method
CN110350482A (en) * 2019-07-12 2019-10-18 四川虹美智能科技有限公司 Motor rotation blockage guard method and device
CN110471336A (en) * 2019-08-02 2019-11-19 上海交通大学 The servo control system realized based on Verilog
CN115659110A (en) * 2022-10-27 2023-01-31 深圳元象信息科技有限公司 Trigonometric function calculation method, device, equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106197238A (en) * 2015-05-27 2016-12-07 法国大陆汽车公司 For using inductosyn to determine the mobile parts method along the position of axle
CN105572503A (en) * 2015-12-21 2016-05-11 东营东齐石油科技有限公司 Oil pumping unit electrical parameter data pre-processing method based on multiple scale sampling
CN105978441A (en) * 2016-06-15 2016-09-28 零度智控(北京)智能科技有限公司 Unmanned aerial vehicle/motor control device and method
CN107147343A (en) * 2017-06-02 2017-09-08 深圳市奇诺动力科技有限公司 Brushless electric machine Field orientable control drive system and control method
CN110350482A (en) * 2019-07-12 2019-10-18 四川虹美智能科技有限公司 Motor rotation blockage guard method and device
CN110471336A (en) * 2019-08-02 2019-11-19 上海交通大学 The servo control system realized based on Verilog
CN115659110A (en) * 2022-10-27 2023-01-31 深圳元象信息科技有限公司 Trigonometric function calculation method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN116796114B (en) 2024-03-29

Similar Documents

Publication Publication Date Title
US6339308B2 (en) Vector control method for synchronous reluctance motor
KR101565693B1 (en) Optimized control for synchronous motors
US20180234043A1 (en) Alternator with harmonic compensation
EP2493067B1 (en) Method and apparatus for estimating rotor angle of synchronous reluctance motor
WO2017159236A1 (en) Method and system for controlling electric motor
KR102228441B1 (en) Sensorless control system and method for permanent magnet synchronous motor
JPH05111280A (en) Magnetic flux feedback device
JP2002238278A (en) Electric motor controller
CN105955328A (en) Holder camera speed control method and device
CN116796114B (en) FOC algorithm optimization method
US20180248501A1 (en) Motor drive apparatus and motor drive apparatus control method
CN115566954B (en) Embedded motor speed regulation control compensation method and system
CN113078865B (en) Built-in permanent magnet synchronous motor sensorless control method
CN113437921B (en) Starting control method in free rotation of synchronous motor, synchronous motor and storage medium
CN111525860B (en) Motor maximum torque current ratio control method, apparatus and computer readable medium
CN111224600B (en) Permanent magnet synchronous motor speed control method, device, computer equipment and medium
CN114826071A (en) Permanent magnet synchronous motor rotor position and speed estimation method based on Hall sensor
CN110061666B (en) Permanent magnet synchronous motor speed regulation performance improvement method based on full-order terminal sliding mode control
CN114221593B (en) Permanent magnet synchronous motor speed sensorless control method
CN110277941B (en) Permanent magnet motor and rotor position control method and device
KR101478675B1 (en) Apparatus and method for controlling phase compensated microstepping for permanent magnet stepper motors
CN114928288B (en) Underwater propeller sensorless control method and system based on parameter identification
JP4557605B2 (en) Control device for synchronous machine
CN115056237B (en) Pipeline transportation robot transportation system
CN113497579B (en) Operation control method, device, motor control system, motor and storage medium

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