Method and device for calculating tangent value of frequency converter

By using integral processing and error calculation models, the accuracy and efficiency of inverter tangent calculation are improved, solving the problems of resource consumption and large errors in existing technologies.

CN121966401APending Publication Date: 2026-05-01MCC CAPITAL ENGINEERING & RESEARCH INC LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
MCC CAPITAL ENGINEERING & RESEARCH INC LTD
Filing Date
2025-12-23
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing methods for calculating the tangent of frequency converters require a large amount of MCU processor resources, resulting in low calculation efficiency and large errors, which affects precise control.

Method used

The angle value is obtained through integration, the sine table is consulted and the sine value is determined based on rounding, the error value is calculated based on the parabolic function using the error calculation model, and the tangent value is determined by combining the rounding method.

Benefits of technology

It improves the accuracy and efficiency of inverter tangent calculation, reduces the storage space occupied by the MCU processor, and reduces calculation errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121966401A_ABST
    Figure CN121966401A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a device for calculating a tangent value of a frequency converter. The method comprises the following steps of: performing integral processing on a motor rotating speed signal to obtain an angle value; querying a sine table by using the angle value to obtain two integer angle ranges where the angle value is located and a sine value determined based on a rounding-off mode; the sine table comprises sine values of a plurality of integer angles; determining an error value by using the angle value, the two integer angle ranges and a pre-established error calculation model; the error value is an error between a sine value determined based on a rounding-off mode and an actual sine value of the angle value; the error calculation model is used for calculating an error between a sine value obtained by querying the sine table at any angle in different integer angle ranges and an actual sine value based on a parabolic function; and determining a tangent value of the angle value by using the error value and a sine value determined based on a rounding mode. The calculation accuracy and calculation efficiency of the tangent value of the frequency converter can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of frequency converter technology, and in particular to a method and apparatus for calculating the tangent value of a frequency converter. Background Technology

[0002] AC variable frequency drive technology has many advantages, including superior control performance, wide range of applications, large drive capacity, energy saving and low maintenance costs, and has developed rapidly in recent years.

[0003] Frequency converters achieve speed regulation by changing the frequency of the power supply to the stator windings of a motor. The precise control of motor speed, acceleration, torque, and other parameters within the frequency converter requires numerous angle-related calculations, such as sine, cosine, and tangent calculations. Current tangent calculations require floating-point coprocessors, consuming significant MCU processor resources, consuming considerable time, exhibiting extremely low computational efficiency, and resulting in large calculation errors, severely impacting the precise control of the frequency converter. Summary of the Invention

[0004] This invention provides a method for calculating the tangent value of a frequency converter, which improves the accuracy and efficiency of frequency converter tangent value calculation. The method includes:

[0005] The angle value is obtained by integrating the motor speed signal;

[0006] The angle value is used to look up the sine table to obtain the two integer angle ranges in which the angle value falls and the sine value determined based on the rounding method; the sine table includes the sine values ​​of multiple integer angles;

[0007] The error value is determined using the angle value, the two integer angle ranges, and a pre-established error calculation model. The error value is the error between the sine value determined by rounding and the actual sine value of the angle value. The error calculation model is used to calculate the error between the sine value obtained from the lookup sine table for any angle within different integer angle ranges and the actual sine value, based on the parabolic function.

[0008] The tangent of the angle is determined using the error value and the sine value determined based on the rounding method.

[0009] This invention also provides a frequency converter tangent calculation device to improve the accuracy and efficiency of frequency converter tangent calculation. The device includes:

[0010] Angle value determination module is used to integrate the motor speed signal to obtain the angle value;

[0011] The sine table lookup module is used to look up the sine table using the angle value to obtain the two integer angle ranges in which the angle value falls and the sine value determined based on the rounding method; the sine table includes sine values ​​of multiple integer angles;

[0012] The error determination module is used to determine the error value using the angle value, the two integer angle ranges, and a pre-established error calculation model; the error value is the error between the sine value determined by rounding and the actual sine value of the angle value; the error calculation model is used to calculate the error between the sine value obtained from the lookup sine table for any angle within different integer angle ranges and the actual sine value based on the parabolic function;

[0013] The tangent calculation module is used to determine the tangent of an angle value using the error value and the sine value determined based on rounding.

[0014] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described inverter tangent calculation method.

[0015] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described inverter tangent calculation method.

[0016] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described inverter tangent calculation method.

[0017] In this embodiment of the invention, the motor speed signal is integrated to obtain an angle value; the angle value is then used to look up a sine table to obtain two integer angle ranges within which the angle value falls and a sine value determined based on rounding; the sine table includes sine values ​​for multiple integer angles; an error value is determined using the angle value, the two integer angle ranges, and a pre-established error calculation model; the error value is the difference between the sine value determined based on rounding and the actual sine value of the angle value; the error calculation model is used to calculate the error between the sine value obtained from the sine table for any angle within different integer angle ranges and the actual sine value based on a parabolic function; the tangent value of the angle value is determined using the error value and the sine value determined based on rounding. In this embodiment of the invention, an error calculation model is established. The error calculation model is used to calculate the error between the sine value obtained by looking up the sine table for any angle within different integer angle range and the actual sine value based on the parabolic function. The error caused by looking up the sine table is introduced. The tangent value of the angle value is determined by combining the error value and the sine value determined by the rounding method, thereby improving the accuracy and efficiency of the inverter tangent value calculation. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0019] Figure 1 This is a flowchart illustrating the inverter tangent calculation method in an embodiment of the present invention.

[0020] Figure 2 This is a schematic diagram illustrating the error in the sine value retrieved through the sine table in an embodiment of the present invention;

[0021] Figure 3 This is a schematic diagram of the error curve function in an embodiment of the present invention;

[0022] Figure 4 This is a flowchart illustrating a specific example of the inverter tangent calculation method in this invention.

[0023] Figure 5 This is a schematic diagram of the inverter tangent calculation device in an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0025] The acquisition, storage, use, and processing of data in this application comply with relevant laws and regulations.

[0026] To facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish the same or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order.

[0027] In existing technologies, it is necessary to quickly calculate the tangent value of an angle within the frequency converter. The traditional method is to store the relationship between the tangent value and the angle inside the frequency converter controller and obtain the tangent value of the angle by looking up a table. However, as the angle increases, more tangent values ​​need to be stored, occupying more ROM and RAM inside the frequency converter and wasting valuable storage space.

[0028] In existing frequency converter solutions, sine tables for different angles are calculated offline. The sine value is obtained by looking up the table; the corresponding cosine value is then found using trigonometric theorems; finally, the tangent value is obtained by dividing the sine by the cosine. However, sine tables cannot completely cover all angles. Therefore, there will be sine tables for different angles that cannot be found, and only the closest sine value can be found. This leads to errors in the sine value calculation and fails to meet the requirements of frequency converter calculations. For example, the angular resolution of the sine table is stored in 1° increments, meaning that sine values ​​are calculated and stored for angles from 0°, 1°, 2°, 3° to 360°.

[0029] When the MCU processor needs to calculate the sine value of 0.3°, it cannot find the value in the sine table. It can only provide the sine value closest to 0.3° and obtain the sine value of 0° by rounding. This results in a calculation error.

[0030] When the MCU processor needs to calculate the sine value of 0.5°, it cannot find the value in the sine table. The closest angles to 0.5° are 0° and 1°, and the difference between these two angles and 0.5° is the same. When processing this type of data, the MCU processor faces two possibilities: sometimes it will use 0° to represent 0.5°, giving the corresponding sine value; sometimes it will use 1° to represent 0.5°, giving the corresponding sine value. This results in completely different calculation results from the MCU processor, leading to an inability to provide a definitive answer, and consequently, causing the frequency converter to malfunction.

[0031] Another approach is to look up the two nearest angle values ​​to 0.3° (0° and 1°), then find the sine values ​​of 0° (Sin0) and 1° (Sin1), and calculate the sine of 0.3° using linear interpolation. However, this method results in an error between the calculated sine value and the precise value. This error varies with different angles, causing variations in the inverter's calculations and affecting normal operation.

[0032] The cosine value is calculated by looking up the sine table for 90° - 0.3° = 89.7°, but this angle is not within the stored range. Therefore, the two nearest angles to 89.7° are looked up, namely 89° and 90°. Then, the sine values ​​for 89° (Sin89) and 90° (Sin90) are looked up to calculate the sine value for 89.7°. This calculation uses linear interpolation, which also introduces errors and affects normal operation.

[0033] Therefore, under the existing accuracy requirement of 1° angular resolution, the calculation of tangent value is amplified as sine and cosine errors exist and increase.

[0034] Reducing the angular resolution is also difficult to achieve in current technology. This is because the sine table needs to be stored in an MCU processor array, and the sine value corresponding to each angle is typically a 16-bit or 32-bit value, requiring the storage space of 360 16-bit or 32-bit MCU processors. If sine and cosine values ​​at other precisions are needed, the length of the sine table needs to be further increased, increasing the MCU processor storage space, which consumes MCU processor resources and further affects the overall efficiency of the frequency converter. Therefore, it is difficult to improve the accuracy of tangent calculation by reducing angular resolution.

[0035] To address the shortcomings of existing technologies, this invention proposes a method for calculating the tangent value of a frequency converter, which improves the efficiency and accuracy of tangent value calculation without excessively occupying MCU processor storage space. Figure 1 This is a flowchart illustrating the inverter tangent calculation method in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:

[0036] Step 101: Integrate the motor speed signal to obtain the angle value;

[0037] Step 102: Use the angle value to look up the sine table to obtain the two integer angle ranges in which the angle value lies and the sine value determined based on the rounding method; the sine table includes the sine values ​​of multiple integer angles;

[0038] Step 103: Determine the error value using the angle value, the two integer angle ranges, and the pre-established error calculation model; the error value is the error between the sine value determined by rounding and the actual sine value of the angle value; the error calculation model is used to calculate the error between the sine value obtained from the lookup sine table for any angle within different integer angle ranges and the actual sine value based on the parabolic function;

[0039] Step 104: Determine the tangent of the angle value using the error value and the sine value determined based on the rounding method.

[0040] The following is a detailed explanation of the method for calculating the tangent value of the frequency converter in the embodiments of the present invention.

[0041] In this embodiment of the invention, the method for calculating the tangent of the frequency converter is applied to the microcontroller unit (MCU) processor of the frequency converter. In the prior art, when the sine table is divided into n equal parts with a fixed radius of r, n×32 bits of storage space are required.

[0042] In this embodiment of the invention, considering that the sine value is symmetrical between 0 and 180° and between 180° and 360°, it is possible to save and calculate only the sine value within the range of 0 to 180°, thereby reducing the storage space of the sine table to 50% of the original space, i.e., n / 2 × 32 bits of storage space.

[0043] Furthermore, since the sine table is symmetrical about the left and right sides of the 0~90° range and the 90~180° range, storing and calculating only the sine values ​​in the 0~90° range can further reduce the storage space by 50%, that is, n / 4×32 bits of storage space.

[0044] The principle of storing sine values ​​at equal intervals within the range of 0 to 90° is a fundamental aspect of this invention. Specifically, the sine table in this invention includes sine values ​​for multiple integer angles between 0 degrees and a specified angle of 90°. These multiple integer angles are the endpoint angles of each equal interval obtained by dividing the 0-degree to specified angle range into n equal parts, for example, by dividing the angles in steps of 1°, 5°, 10°, etc.

[0045] When performing tangent calculation lookup based on the sine table in the embodiments of the present invention, considering that the sine value obtained by the lookup table method has an error with the actual sine value at different angles, and that the maximum and minimum errors fluctuate within a large range, the embodiments of the present invention establish an error calculation model. The error calculation model is used to calculate the error between the sine value obtained by the lookup sine table and the actual sine value at any angle within different integer angle ranges based on the parabolic function.

[0046] In one embodiment, the error calculation model includes an error curve function based on a parabolic function and a sine error table;

[0047] The error curve function describes the parabolic relationship between the input angle value and the output error. The fixed parameters of this error curve function include the two integer angle ranges within which the input angle value lies, and the maximum sinusoidal error value within those two integer angle ranges. The maximum sinusoidal error value within the two integer angle ranges is the maximum error between the sine value determined by rounding for all angles within those two integer angle ranges and the actual sine value of the angle value.

[0048] The sine error table stores multiple sets of maximum sine error values ​​within two integer angle ranges.

[0049] Figure 2 This is a schematic diagram illustrating the error in the sine value retrieved from the sine table in an embodiment of the present invention. Figure 2 As shown, within the range of 0~90°, on an arc with radius r, at the angle Below, the sine value is ; at the angle Below, the sine value is ;and and The angle difference is The current sine table is based on... It preserves accurate sine values ​​at intervals.

[0050] refer to Figure 2 The following relationship exists:

[0051] (1)

[0052] (2)

[0053] (3)

[0054] exist and any angle within the range When looking up the sine value using a lookup table, based on the rounding method, the sine value is calculated using sin( ) and sin ( Determine sin( All of these have errors, and these errors increase with the angle from... Change to It rises from 0 to the maximum, and then shrinks back to 0 from the maximum.

[0055] Figure 3 This is a schematic diagram of the error curve function in an embodiment of the present invention, for reference. Figure 3 The horizontal axis represents angle, and the vertical axis represents error. and The sinusoidal error is largest when the average angle is constant. The error varies with the angle. Between two angles, the error curve exhibits a parabolic shape; recording the maximum error forms the error curve function f.

[0056] According to the equation of the parabola:

[0057] (4)

[0058] in, These represent the two endpoints of each division after dividing the range from 0 degrees to 90 degrees into a specified number of equal parts. for and The maximum error between them, i.e., the vertex of the parabola, These are the parameters to be solved.

[0059] when ,have:

[0060] (5)

[0061] It can be deduced that:

[0062] (6)

[0063] After derivation and simplification, the error curve function in different angle ranges in the embodiment is expressed as follows:

[0064] (7)

[0065] Where y represents the error between the sine value determined by rounding and the actual sine value of the angle value x, and x represents... Any angle value between, express The maximum error between These are two adjacent integer angles in the sine table.

[0066] A sine error table is formed based on the error curve function. The sine error table includes multiple sets of integer angle ranges from 0 degrees to 90 degrees: sine values ​​and maximum sine error values, as shown in Table 1 below.

[0067] Table 1

[0068]

[0069] The angle range in Table 1 is not limited, and can also be divided into 5-degree increments, such as 0-5, 5-10, 10-15, etc.

[0070] In practice, the motor speed signal is integrated to obtain the angle value. The angle value is then used to look up the sine table to obtain the two integer angle ranges in which the angle value falls and the sine value determined based on the rounding method. Then, the angle value, the two integer angle ranges, and the pre-established error calculation model are used to determine the error value.

[0071] This invention achieves the goal of selecting angle values ​​for the sine table within the range of 0 to 90°, given a maximum error, so as to minimize the storage space required for the sine table. In other words, it obtains an equivalent sine error using the minimum storage space.

[0072] In one embodiment, determining the error value using the angle value, the two integer angle ranges, and a pre-established error calculation model may include:

[0073] By looking up the sine error table using the angle value, the maximum sine error value corresponding to the angle value can be obtained;

[0074] The error value is calculated by substituting the angle value and the corresponding maximum sinusoidal error value into the error curve function.

[0075] After calculating the error value, the tangent value of the angle value is determined using the error value and the sine value determined based on the rounding method.

[0076] In one embodiment, after obtaining the two integer angle ranges of the angle value and the sine value determined based on rounding by looking up the angle value in a sine table, the method may further include:

[0077] Based on the trigonometric function reduction formulas, we determine cos(angle value) = sin( / 2-angle value), using / 2- The angle value is looked up in the sine table to obtain the cosine value determined by rounding; using / 2- Angle value lookup table for sine error, obtain / 2 - the maximum sinusoidal error value corresponding to the angle value; / 2-Angle value and Substituting the maximum sinusoidal error value corresponding to the / 2-angle value into the error curve function, we can calculate... / 2 - Error value corresponding to the angle value .

[0078] For example, the angle value is 2.3 degrees. The sine table includes sine values ​​of integer angles such as 0-1, 1-2, 2-3, etc., and the sine error table includes the maximum sine error values ​​of integer angles such as 0-1, 1-2, 2-3, etc. Looking up the sine table for 2.3 degrees, we get sin(2.3°) = sin(2°) and cos(2.3°) = cos(2°). Looking up the sine error table for 2.3 degrees, we get the maximum sine error value Xerr1 for integer angles of 2-3. Looking up the sine error table for 90°-2.3°, we get the maximum sine error value Xerr2 for integer angles of 87-88. Substituting Xerr1 and Xerr2 into formula (7) respectively, we calculate... , Then, the tangent value is calculated using the queried and calculated data.

[0079] Using the error value and the sine value determined based on rounding, the tangent value of the angle is determined, including:

[0080] The following formula is used to calculate the first tangent error introduced by the error value when calculating the tangent using the sine value determined based on rounding. :

[0081] (8)

[0082] in, To calculate the error value, the angle value and its corresponding maximum sinusoidal error value are substituted into the error curve function. It is the angle value. It uses angle values When looking up the sine table, round the corresponding integer angle.

[0083] The cosine value is determined using the following formula, based on a rounding method. The second tangent error introduced by the error value when calculating the tangent value :

[0084] (9)

[0085] Compare the error of the first tangent value Second tangent error ;

[0086] If the first tangent value error Less than the second tangent error The tangent of the angle value is then calculated using the sine value determined by rounding.

[0087] If the first tangent value error Greater than the second tangent error The tangent of the angle is then calculated using the cosine value determined by rounding.

[0088] For example, for solving The tangent value can be obtained using the following formula:

[0089] (10)

[0090] in The sine value can be obtained by looking up a sine table, but the lookup method introduces errors. We can obtain the following formula (11):

[0091] (11)

[0092] The equivalent formula for calculating the tangent using the sine value is as follows:

[0093] (12)

[0094] The formula for calculating the tangent error introduced by the error is shown in formula (8).

[0095] For solving The tangent value can also be solved using the following formula (13):

[0096] (13)

[0097] The equivalent formula for calculating the tangent using the cosine value is as follows:

[0098] (14)

[0099] The formula for calculating the tangent error introduced by the error is shown in formula (9).

[0100] The two solution formulas are theoretically equivalent, but the error of the final tangent value is different when using formula (10) and formula (13) at the same angle. At different angles, the tangent value calculation accuracy of the two calculation methods is different, so one of them needs to be selected.

[0101] The above is the theoretical derivation process for calculating the tangent value of any angle, based on the sine lookup table method.

[0102] Figure 4 This is a flowchart illustrating a specific example of the inverter tangent calculation method in this invention, as shown below. Figure 4 As shown, for any input angle, first look up the sine table to get the sine value of the angle, then look up the cosine value of the angle, and finally look up the maximum error value of the angle according to the sine error table.

[0103] Calculate the error of the angle based on the error curve function f.

[0104] The tangent error of the angle is calculated using formulas (8) and (9) respectively. The calculation method with the smaller error is selected to determine whether to use the sine value calculation equivalent formula (12) or the cosine value calculation equivalent formula (14) to calculate the tangent value.

[0105] Based on the sine value lookup table method, this embodiment of the invention establishes a sine error parabolic function, calculates the tangent value using sine and cosine values ​​respectively, and provides two tangent value error calculation formulas. The calculation method with smaller error is selected to finally determine the tangent value, avoiding the use of floating-point coprocessors, reducing the tangent value calculation method and reducing the tangent value calculation error.

[0106] This invention also provides a frequency converter tangent calculation device, as described in the following embodiments. Since the principle by which this device solves the problem is similar to the frequency converter tangent calculation method, the implementation of this device can refer to the implementation of the frequency converter tangent calculation method; repeated details will not be elaborated further.

[0107] Figure 5 This is a schematic diagram of the inverter tangent calculation device in an embodiment of the present invention, as shown below. Figure 5 As shown, the device 500 includes:

[0108] Angle value determination module 501 is used to perform integral processing on the motor speed signal to obtain the angle value;

[0109] The sine table lookup module 502 is used to look up the angle value in the sine table to obtain the two integer angle ranges in which the angle value is located and the sine value determined based on the rounding method; the sine table includes sine values ​​of multiple integer angles;

[0110] The error determination module 503 is used to determine the error value using the angle value, the two integer angle ranges, and a pre-established error calculation model; the error value is the error between the sine value determined by rounding and the actual sine value of the angle value; the error calculation model is used to calculate the error between the sine value obtained from the lookup sine table for any angle within different integer angle ranges and the actual sine value based on the parabolic function;

[0111] The tangent calculation module 504 is used to determine the tangent of the angle value using the error value and the sine value determined based on the rounding method.

[0112] In one embodiment, the error calculation model includes an error curve function based on a parabolic function and a sine error table;

[0113] The error curve function describes the parabolic relationship between the input angle value and the output error. The fixed parameters of this error curve function include the two integer angle ranges within which the input angle value lies, and the maximum sinusoidal error value within those two integer angle ranges. The maximum sinusoidal error value within the two integer angle ranges is the maximum error between the sine value determined by rounding for all angles within those two integer angle ranges and the actual sine value of the angle value.

[0114] The sine error table stores multiple sets of maximum sine error values ​​within two integer angle ranges.

[0115] In one embodiment, the error curve function is represented as follows:

[0116] ;

[0117] Where y represents the error between the sine value determined by rounding and the actual sine value of the angle value x, and x represents... Any angle value between, express The maximum error between These are two adjacent integer angles in the sine table.

[0118] In one embodiment, the error determination module 503 is specifically used for:

[0119] By looking up the sine error table using the angle value, the maximum sine error value corresponding to the angle value can be obtained;

[0120] The error value is calculated by substituting the angle value and the corresponding maximum sinusoidal error value into the error curve function.

[0121] In one embodiment, the device 500 further includes:

[0122] The cosine value lookup module is used by the sine table lookup module 502 to obtain the two integer angle ranges of the angle value and the sine value determined by rounding from the sine table using the angle value lookup module 502. Then, based on the trigonometric function induction formula, it determines cos(angle value) = sin( / 2-angle value), using / 2- The angle value is looked up in the sine table to obtain the cosine value determined by rounding; using / 2- Angle value lookup table for sine error, obtain / 2 - the maximum sinusoidal error value corresponding to the angle value; / 2-Angle value and Substituting the maximum sinusoidal error value corresponding to the / 2-angle value into the error curve function, we can calculate... / 2 - Error value corresponding to the angle value ;

[0123] The tangent calculation module 504 is specifically used for:

[0124] The following formula is used to calculate the first tangent error introduced by the error value when calculating the tangent using the sine value determined based on rounding. :

[0125] ;

[0126] in, To calculate the error value, the angle value and the corresponding maximum sinusoidal error value are substituted into the error curve function. It is an angle value. It uses angle values When looking up the sine table, round the corresponding integer angle.

[0127] The cosine value is determined using the following formula, based on a rounding method. The second tangent error introduced by the error value when calculating the tangent value :

[0128] ;

[0129] Compare the errors of the first tangent and the second tangent;

[0130] If the error of the first tangent is less than the error of the second tangent, then the tangent of the angle value is calculated using the sine value determined by rounding.

[0131] If the error of the first tangent is greater than the error of the second tangent, then the tangent of the angle value is calculated using the cosine value determined by rounding.

[0132] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described inverter tangent calculation method.

[0133] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described inverter tangent calculation method.

[0134] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described inverter tangent calculation method.

[0135] In this embodiment of the invention, the motor speed signal is integrated to obtain an angle value; the angle value is then used to look up a sine table to obtain two integer angle ranges within which the angle value falls and a sine value determined based on rounding; the sine table includes sine values ​​for multiple integer angles; an error value is determined using the angle value, the two integer angle ranges, and a pre-established error calculation model; the error value is the difference between the sine value determined based on rounding and the actual sine value of the angle value; the error calculation model is used to calculate the error between the sine value obtained from the sine table for any angle within different integer angle ranges and the actual sine value based on a parabolic function; the tangent value of the angle value is determined using the error value and the sine value determined based on rounding. In this embodiment of the invention, an error calculation model is established. The error calculation model is used to calculate the error between the sine value obtained by looking up the sine table for any angle within different integer angle range and the actual sine value based on the parabolic function. The error caused by looking up the sine table is introduced. The tangent value of the angle value is determined by combining the error value and the sine value determined by the rounding method, thereby improving the accuracy and efficiency of the inverter tangent value calculation.

[0136] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0137] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0138] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0139] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0140] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for calculating the tangent value of a frequency converter, characterized in that, include: The angle value is obtained by integrating the motor speed signal; The angle value is used to look up the sine table to obtain the two integer angle ranges in which the angle value falls and the sine value determined based on the rounding method; the sine table includes the sine values ​​of multiple integer angles; The error value is determined using the angle value, the two integer angle ranges, and a pre-established error calculation model. The error value is the error between the sine value determined by rounding and the actual sine value of the angle value. The error calculation model is used to calculate the error between the sine value obtained from the lookup sine table for any angle within different integer angle ranges and the actual sine value, based on the parabolic function. The tangent of the angle is determined using the error value and the sine value determined based on the rounding method.

2. The method as described in claim 1, characterized in that, The error calculation model includes an error curve function based on a parabolic function and a sine error table; The error curve function describes the parabolic relationship between the input angle value and the output error. The fixed parameters of the error curve function are the two integer angle ranges in which the input angle value is located and the maximum sine error value of the two integer angle ranges. The maximum sine error value of the two integer angle ranges is the maximum value of the error between the sine value of all angles in the two integer angle ranges determined by rounding and the actual sine value of the angle value. The sine error table stores multiple sets of maximum sine error values ​​within two integer angle ranges.

3. The method as described in claim 2, characterized in that, The error curve function is represented as follows: ; Where y represents the error between the sine value determined by rounding and the actual sine value of the angle value x, and x represents... Any angle value between, express The maximum error between These are two adjacent integer angles in the sine table.

4. The method as described in claim 3, characterized in that, Using the angle value, the two integer angle ranges, and a pre-established error calculation model, the error value is determined, including: By looking up the sine error table using the angle value, the maximum sine error value corresponding to the angle value can be obtained; The error value is calculated by substituting the angle value and the corresponding maximum sinusoidal error value into the error curve function.

5. The method as described in claim 1, characterized in that, After obtaining the two integer angle ranges of the angle value and the sine value determined by rounding from the sine table using the angle value lookup table, the process also includes: Based on the trigonometric function reduction formulas, we determine cos(angle value) = sin( / 2-angle value), using / 2- The angle value is looked up in the sine table to obtain the cosine value determined by rounding; using / 2- Angle value lookup table for sine error, obtain / 2 - the maximum sinusoidal error value corresponding to the angle value; / 2-Angle value and Substituting the maximum sinusoidal error value corresponding to the / 2-angle value into the error curve function, we can calculate... / 2 - Error value corresponding to the angle value ; Using the error value and the sine value determined based on rounding, the tangent value of the angle is determined, including: The following formula is used to calculate the first tangent error introduced by the error value when calculating the tangent using the sine value determined based on rounding. : ; in, To calculate the error value, the angle value and the corresponding maximum sinusoidal error value are substituted into the error curve function. It is an angle value. It uses angle values When looking up the sine table, round the corresponding integer angle. The cosine value is determined using the following formula, based on a rounding method. The second tangent error introduced by the error value when calculating the tangent value : ; Compare the errors of the first tangent and the second tangent; If the error of the first tangent is less than the error of the second tangent, then the tangent of the angle value is calculated using the sine value determined by rounding. If the error of the first tangent is greater than the error of the second tangent, then the tangent of the angle value is calculated using the cosine value determined by rounding.

6. A device for calculating the tangent value of a frequency converter, characterized in that, include: Angle value determination module is used to integrate the motor speed signal to obtain the angle value; The sine table lookup module is used to look up the sine table using the angle value to obtain the two integer angle ranges in which the angle value falls and the sine value determined based on the rounding method; the sine table includes sine values ​​of multiple integer angles; The error determination module is used to determine the error value using the angle value, the two integer angle ranges, and a pre-established error calculation model; the error value is the error between the sine value determined by rounding and the actual sine value of the angle value; the error calculation model is used to calculate the error between the sine value obtained from the lookup sine table for any angle within different integer angle ranges and the actual sine value based on the parabolic function; The tangent calculation module is used to determine the tangent of an angle value using the error value and the sine value determined based on rounding.

7. The apparatus as claimed in claim 6, characterized in that, The error calculation model includes an error curve function based on a parabolic function and a sine error table; The error curve function describes the parabolic relationship between the input angle value and the output error. The fixed parameters of the error curve function are the two integer angle ranges in which the input angle value is located and the maximum sine error value of the two integer angle ranges. The maximum sine error value of the two integer angle ranges is the maximum value of the error between the sine value of all angles in the two integer angle ranges determined by rounding and the actual sine value of the angle value. The sine error table stores multiple sets of maximum sine error values ​​within two integer angle ranges.

8. The apparatus as claimed in claim 7, characterized in that, The error curve function is represented as follows: ; Where y represents the error between the sine value determined by rounding and the actual sine value of the angle value x, and x represents... Any angle value between, express The maximum error between These are two adjacent integer angles in the sine table.

9. The apparatus as claimed in claim 8, characterized in that, The error determination module is specifically used for: By looking up the sine error table using the angle value, the maximum sine error value corresponding to the angle value can be obtained; The error value is calculated by substituting the angle value and the corresponding maximum sinusoidal error value into the error curve function.

10. The apparatus as claimed in claim 6, characterized in that, Also includes: The cosine value lookup module, after the sine table lookup module obtains the two integer angle ranges of the angle value from the sine table using the angle value lookup, and the sine value determined by rounding, uses the trigonometric function reduction formula to determine cos(angle value) = sin( / 2-angle value), using / 2- The angle value is looked up in the sine table to obtain the cosine value determined by rounding; using / 2- Angle value lookup table for sine error, obtain / 2 - the maximum sinusoidal error value corresponding to the angle value; / 2-Angle value and Substituting the maximum sinusoidal error value corresponding to the / 2-angle value into the error curve function, we can calculate... / 2 - Error value corresponding to the angle value ; The tangent calculation module is specifically used for: The following formula is used to calculate the first tangent error introduced by the error value when calculating the tangent using the sine value determined based on rounding. : ; in, To calculate the error value, the angle value and the corresponding maximum sinusoidal error value are substituted into the error curve function. It is an angle value. It uses angle values When looking up the sine table, round the corresponding integer angle. The cosine value is determined using the following formula, based on a rounding method. The second tangent error introduced by the error value when calculating the tangent value : ; Compare the errors of the first tangent and the second tangent; If the error of the first tangent is less than the error of the second tangent, then the tangent of the angle value is calculated using the sine value determined by rounding. If the error of the first tangent is greater than the error of the second tangent, then the tangent of the angle value is calculated using the cosine value determined by rounding.

11. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 5.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 5.

13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 5.