Efficient determination method and device of angle parameter, vertical take-off and landing aircraft
By obtaining the electrical angle of the motor rotor in the hardware circuit, determining the quadrant and converting it into the first angle, and using a two-port structure to query the sine and cosine values in parallel and adjust the sign, the problem of slow sine and cosine value calculation speed in the hardware circuit is solved, and fast and accurate sine and cosine value output is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIFEI ZHIHANG TECHNOLOGY (DEQING) CO LTD
- Filing Date
- 2026-06-16
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, the calculation of the sine and cosine values of angles in hardware circuits is slow, resulting in high delays in the control system.
By obtaining the electrical angle of the motor rotor, determining its quadrant, and converting the electrical angle into a first angle less than or equal to 90°, the sine and cosine values in the memory are queried separately using the two-port structure of the hardware circuit. The sign is adjusted by utilizing the symmetry of trigonometric functions, achieving parallel reading and sign correction, and storing only the value of a quarter cycle.
It improves the reading speed of sine and cosine values, reduces storage resources, ensures output accuracy, and meets the rapid update requirements of high-frequency closed-loop control.
Smart Images

Figure CN122456941A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of motor control, and more specifically, to an efficient method, apparatus, and vertical take-off and landing aircraft for determining angle parameters. Background Technology
[0002] In real-time control systems based on hardware circuits in fields such as motor control, digital communication, and image processing, the real-time calculation of sine and cosine functions is a fundamental step in realizing key algorithms such as vector control, signal modulation, and coordinate transformation.
[0003] In related technologies, the Coordinate Rotation Digital Computer (CORDIC) algorithm is commonly used, which employs addition and shift operations to perform multiple iterative approximations to calculate sine and cosine.
[0004] However, the calculation methods in related technologies suffer from slow calculation speed of sine and cosine values, resulting in high latency in the control system. Summary of the Invention
[0005] This application provides an efficient method, apparatus, and vertical takeoff and landing aircraft for determining angle parameters, so as to at least solve the problem of high delay in calculating the sine and cosine values of angles in hardware circuits in related technologies.
[0006] According to one embodiment of this application, an efficient method for determining angle parameters is provided, comprising: obtaining the electrical angle of a motor rotor; determining the quadrant in which the electrical angle is located and converting the electrical angle into a first angle; the first angle is less than or equal to 90°, and the sine values of the first angle and the electrical angle are equal, and the cosine values of the two are equal; based on the first angle, querying the sine value in a corresponding first memory through a first port of the hardware circuit, and querying the cosine value in a corresponding second memory through a second port of the hardware circuit; the first memory stores sine values for a quarter-cycle, the second memory stores cosine values for a quarter-cycle, and the quarter-cycles corresponding to the first memory and the second memory are the same; adjusting the sign portion of the queried sine and cosine values according to the quadrant to obtain the complete sine and complete cosine values corresponding to the electrical angle.
[0007] In an exemplary embodiment, the step of querying a sine value in a corresponding first memory through a first port of the hardware circuit and querying a cosine value in a corresponding second memory through a second port of the hardware circuit, based on the first angle, includes: determining a sine address and a cosine address based on the first angle; querying a sine value in the corresponding first memory through the first port based on the sine address; and querying a cosine value in the corresponding second memory through the second port based on the cosine address.
[0008] In an exemplary embodiment, the clock module based on the hardware circuit performs the following steps in a first clock cycle: acquiring the electrical angle of the motor rotor; determining the quadrant in which the electrical angle is located; and converting the electrical angle into a first angle; in a second clock cycle, determining the sine address and cosine address based on the first angle; in a third clock cycle, querying the sine value in the corresponding first memory through the first port based on the sine address; and querying the cosine value in the corresponding second memory through the second port based on the cosine address; and in a fourth clock cycle, adjusting the sign portion of the queried sine and cosine values according to the quadrant to obtain the complete sine and cosine values corresponding to the electrical angle.
[0009] In an exemplary embodiment, determining the sine address and cosine address based on the first angle includes: determining mapping rules corresponding to the sine address and cosine address respectively based on the angle range covered by the quarter-cycle; and mapping the first angle according to the mapping rules and the quadrant to obtain the sine address and the cosine address.
[0010] In an exemplary embodiment, mapping the first angle according to the mapping rule and the quadrant to obtain the sine address and the cosine address includes: when the angle range of the quarter-cycle corresponding to the first memory and the second memory is 0° to 90° or 180° to 270°: when the quadrant is the first quadrant or the third quadrant, mapping the first angle according to the mapping rule and the quadrant to obtain the sine address as the first angle and the cosine address as the difference between 90° and the first angle; when the quadrant is the second quadrant or the fourth quadrant, mapping the first angle according to the mapping rule and the quadrant to obtain the sine address as 90°. The difference between 0° and the first angle, and the cosine address, constitute the first angle; or, when the angle range of the quarter-cycle corresponding to the first memory and the second memory is 90° to 180° or 270° to 360°: when the quadrant is the first quadrant or the third quadrant, the first angle is mapped according to the mapping rule and the quadrant to obtain the sine address as the difference between 90° and the first angle, and the cosine address as the first angle; when the quadrant is the second quadrant or the fourth quadrant, the first angle is mapped according to the mapping rule and the quadrant to obtain the sine address as the first angle, and the cosine address as the difference between 90° and the first angle.
[0011] In an exemplary embodiment, the electrical angle is a bit sequence, and the maximum angle that the bit sequence can represent is 360°. Determining the quadrant in which the electrical angle is located and converting the electrical angle into a first angle includes: extracting the two most significant bits in the bit sequence and determining the quadrant based on the two most significant bits; and determining the first angle based on the remaining bit sequence in the bit sequence excluding the two most significant bits.
[0012] In an exemplary embodiment, adjusting the sign portions of the queried sine and cosine values according to the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle includes: determining a sign adjustment rule based on the angle range of one-quarter cycles corresponding to the first memory and the second memory; and adjusting the sign portions of the queried sine and cosine values according to the sign adjustment rule and the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle.
[0013] In an exemplary embodiment, adjusting the sign portions of the queried sine and cosine values according to the sign adjustment rules and the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle includes: when the angle range of the quarter-cycle corresponding to the first memory and the second memory is 0° to 90° or 90° to 180°: when the quadrant is the first quadrant, determining that the sign of the sine value is positive and the sign of the cosine value is positive; when the quadrant is the second quadrant, determining that the sign of the sine value is positive and the sign of the cosine value is negative; when the quadrant is the third quadrant, determining that the sign of the sine value is negative and the sign of the cosine value is negative; in the... When the quadrant is the fourth quadrant, the sign of the sine value is determined to be negative and the sign of the cosine value is determined to be positive; or, when the angle range of the quarter-cycle corresponding to the first memory and the second memory is 180° to 270° or 270° to 360°: when the quadrant is the first quadrant, the sign of the sine value is determined to be negative and the sign of the cosine value is determined to be negative; when the quadrant is the second quadrant, the sign of the sine value is determined to be negative and the sign of the cosine value is determined to be positive; when the quadrant is the third quadrant, the sign of the sine value is determined to be positive and the sign of the cosine value is determined to be positive; when the quadrant is the fourth quadrant, the sign of the sine value is determined to be positive and the sign of the cosine value is determined to be negative.
[0014] According to one embodiment of the present application, an efficient device for determining angle parameters is provided, comprising:
[0015] Angle receiving module, used to acquire the electrical angle of the motor rotor;
[0016] A conversion module is used to determine the quadrant in which the electrical angle is located and to convert the electrical angle into a first angle; the first angle is less than or equal to 90°, and the sine values of the first angle and the electrical angle are equal, and the cosine values of the two are equal;
[0017] The query module is used to query a sine value in a corresponding first memory through a first port of the hardware circuit based on the first angle, and to query a cosine value in a corresponding second memory through a second port of the hardware circuit; the first memory stores a sine value for a quarter period, the second memory stores a cosine value for a quarter period, and the quarter period corresponding to the first memory and the second memory is the same.
[0018] The parameter determination module is used to adjust the sign part of the queried sine and cosine values according to the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle.
[0019] According to another aspect of the embodiments of this application, a vertical take-off and landing aircraft is also provided, including a motor and hardware circuitry, the hardware circuitry being used to execute the above-described method for efficiently determining angle parameters.
[0020] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-mentioned efficient method for determining angle parameters at runtime.
[0021] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-mentioned efficient method for determining angle parameters through the computer program.
[0022] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0023] In this embodiment, an electrical angle is obtained to provide a precise input source for the hardware circuit. The quadrant of the electrical angle is determined, and the electrical angle is converted into a first angle within the range of 0°–90°. Based on the first angle, the sine value is queried in the corresponding first memory through the first port of the hardware circuit, and the cosine value is queried in the corresponding second memory through the second port. Since the hardware circuit can query the sine and cosine values through the first and second ports respectively, parallel and conflict-free reading of the sine and cosine values is achieved, allowing the two function values to be obtained simultaneously, improving the reading speed of the sine and cosine values. Moreover, the first and second memories only store the sine and cosine values for a quarter of the cycle, respectively. After the sine and cosine values are retrieved, the signs of the sine and cosine values are adjusted using the symmetry of trigonometric functions in the four quadrants. Thus, storing only the sine and cosine values for a quarter of the cycle is sufficient to meet the calculation requirements of the entire 360° cycle, reducing the storage size of the memory to one-quarter of the traditional direct lookup table method. In summary, querying sine and cosine values using a dual-port structure improves calculation speed, storing only a quarter of the cycle of sine and cosine values saves storage resources, and quadrant-based sign adjustment of sine and cosine values ensures accurate restoration of the signs of the sine and cosine values, guaranteeing the accuracy of the output sine and cosine values. Attached Figure Description
[0024] Figure 1 This is a hardware structure block diagram of a computer terminal for an optional method of efficiently determining angle parameters according to an embodiment of this application.
[0025] Figure 2This is one of the flowcharts of an efficient method for determining angle parameters according to an embodiment of this application;
[0026] Figure 3 This is a second flowchart of an efficient method for determining angle parameters according to an embodiment of this application;
[0027] Figure 4 This is a schematic diagram of the clock cycle executed according to an embodiment of the present application of an efficient method for determining angle parameters;
[0028] Figure 5 This is the third flowchart of an efficient method for determining angle parameters according to an embodiment of this application;
[0029] Figure 6 This is the fourth flowchart of an efficient method for determining angle parameters according to an embodiment of this application;
[0030] Figure 7 This is a schematic diagram illustrating an address lookup according to an embodiment of this application;
[0031] Figure 8 This is the fifth flowchart of an efficient method for determining angle parameters according to an embodiment of this application;
[0032] Figure 9 This is a structural block diagram of an efficient angle parameter determination device according to an embodiment of this application. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] The methods and embodiments provided in this application can be executed on a computer terminal or similar computing system. Taking running on a computer terminal as an example, Figure 1 This is a hardware structure block diagram of a computer terminal for an efficient method of determining angle parameters according to an embodiment of this application. For example... Figure 1 As shown, a computer terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. In one exemplary embodiment, the computer terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the computer terminal described above. For example, the computer terminal may also include components that are more complex than those described above. Figure 1 The more or fewer components shown, or having the same Figure 1 Equivalent functions or ratios shown Figure 1 The functions shown have more different configurations.
[0036] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the efficient angle parameter determination method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage systems, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to a computer terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0037] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider for the computer terminal. In one example, the transmission device 106 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet.
[0038] This embodiment provides an efficient method for determining angle parameters, applied to the aforementioned computer terminal. The method is described in detail below, along with its execution flow. For example... Figure 2As shown, the method includes the following steps S200-230:
[0039] Step S200: Obtain the electrical angle of the motor rotor.
[0040] Specifically, the electrical angle of the motor rotor can be acquired by sensors, or it can be estimated in real time by hardware circuits (such as field programmable gate arrays, FPGAs).
[0041] Among them, the electrical angle refers to the real-time rotational position of the motor rotor relative to the stator magnetic field during the electrical cycle. The electrical angle can be output by a rotary encoder, rotary transformer or sensorless observation algorithm, and its value can be represented in discrete digital form, such as a 15-bit unsigned integer, ranging from 0 to 32767, corresponding to a complete electrical cycle from 0° to 360°.
[0042] The electrical angle signal serves as the core input to the Field-Oriented Control (FOC) algorithm, directly influencing the decoupling calculation of the d-axis and q-axis currents in the current loop and the generation of the voltage space vector. In the hardware circuit, this electrical angle signal can be directly input to the input port of the sine / cosine calculation device via an external sensor interface circuit or a digital signal processor as an initial trigger signal. This signal is transmitted directly as an integer before entering the calculation module, eliminating the need for software interpolation or floating-point operations, ensuring the determinism and real-time nature of the data path. By directly obtaining the electrical angle digital value natively output by the hardware, the latency and jitter introduced by angle conversion or floating-point operations at the software layer are avoided, providing a stable, low-latency, and high-precision raw input for subsequent hardware parallel computing.
[0043] Step S210: Determine the quadrant in which the electrical angle is located and convert the electrical angle into a first angle.
[0044] Wherein, the first angle is less than or equal to 90°, and the sine values of the first angle and the electrical angle are equal, and the cosine values of the two are equal.
[0045] The quadrants refer to the four 90° intervals within the electrical angle's range of 0° to 360° in the electrical cycle: the first quadrant (0°–90°), the second quadrant (90°–180°), the third quadrant (180°–270°), and the fourth quadrant (270°–360°). The first angle is the equivalent angle obtained by mapping the electrical angle to the periodicity of trigonometric functions and the quadrant symmetry. Its numerical range is limited to 0° to 90°, and its sine value is equal to the absolute value of the electrical angle's sine value; the cosine value is similar, but the sign may differ.
[0046] Step S220: Based on the first angle, query the sine value in the corresponding first memory through the first port of the hardware circuit, and query the cosine value in the corresponding second memory through the second port of the hardware circuit.
[0047] The first memory stores sine values for a quarter-cycle, and the second memory stores cosine values for a quarter-cycle. The quarter-cycles corresponding to the first memory and the second memory are the same.
[0048] For example, the first and second memories can be read-only memories (ROMs) with a depth of 8192 and a bit width of 17 bits. They adopt the Q16 fixed-point format and store the precise sine and cosine values of 8192 equally divided points in the 0° to 90° range. The angular resolution of each point is 360° / 32768=0.011°, which matches the electrical angle input resolution. When the input angle resolution is 15 bits, 15 bits correspond to 32768 electrical cycle sampling points. By performing full-cycle symmetrical expansion on the 8192 sine amplitude data stored in the 0°~90° range, 4×8192=32768 equivalent output points can be generated, which perfectly matches the resolution of the input angle, thereby achieving the calculation accuracy that is completely consistent with the full-cycle lookup table. Since the first memory only needs to store 8192 sine amplitude data in the range of 0° to 90° and the second memory only needs to store 8192 cosine amplitude data in the range of 0° to 90°, the ROM capacity is only 1 / 4 of the traditional direct lookup table scheme for the entire 0° to 360° cycle (requiring 32768 sampling points), which significantly reduces the on-chip storage resource overhead of the FPGA and effectively frees up more hardware resources.
[0049] The first port and the second port are independently connected to the first memory and the second memory, respectively, allowing parallel reading of values corresponding to two different addresses within the same clock cycle. During reading, the first port uses the first angle as the address to read the sine value corresponding to the first angle from the first memory; the second port can use either the first angle or 8191 – the first angle as the address to read the cosine value corresponding to the first angle from the second memory. This dual-port parallel reading mechanism ensures complete synchronization of sine and cosine value acquisition, eliminating the need for serial access or time-division multiplexing. It enables the simultaneous output of two function values within a single cycle, avoiding the increased latency and decreased throughput caused by single-port ROM or time-division multiplexing architectures, thereby improving computational throughput and meeting the rapid sine and cosine update requirements in high-frequency closed-loop control.
[0050] Step S230: Adjust the sign of the sine and cosine values retrieved according to the quadrant to obtain the complete sine and cosine values corresponding to the electrical angle.
[0051] The sign adjustment refers to correcting the sign of the values read from the first and second memories based on the quadrant in which the electrical angle is located, restoring them to the true trigonometric function values in the corresponding quadrant. For example, if the electrical angle is 330°, it is converted to the first angle 360°-330°=30°. Since 30° is in the first quadrant and 330° is in the fourth quadrant, the sign of the sine value needs to be inverted, while the sign of the cosine value remains unchanged.
[0052] It should be specifically noted that the description in this invention of "the first angle is less than or equal to 90°" and "the first memory stores sine values for a quarter-cycle, the second memory stores cosine values for a quarter-cycle, and the quarter-cycles corresponding to the first and second memories are the same" does not specifically mean that the first angle can only be less than or equal to 90°, or that the first and second memories can only store cosine and sine values for a quarter-cycle. For this invention, as long as the absolute values of the trigonometric function values stored in the first and second memories cover the range from 0 to 1, simple changes to the aforementioned angles and cycles are also within the scope of protection of this invention. For example, the first memory can store sine values for half a cycle (e.g., 0°–180°), and the second memory can store cosine values for half a cycle; or, the first memory can store sine values within the angle range of 60°–240°, and the second memory can store cosine values within the angle range of 60°–240°. In this case, the first angle is not necessarily less than or equal to 90°, but needs to be determined based on the periodic symmetry of the trigonometric functions and the angle range corresponding to the stored trigonometric function values. This allows it to be compatible with various trigonometric function symmetry rules, such as half-period symmetry, full-period symmetry, and arbitrary interval symmetry. The calculation logic is universal and does not depend on a single angle interval, enabling it to flexibly adapt to different digital signal processing scenarios.
[0053] In this embodiment, an electrical angle is acquired to provide a precise input source for the hardware circuit. The quadrant of the electrical angle is determined, and the electrical angle is converted into a first angle within the range of 0°–90°. Based on the first angle, the sine value is queried in the corresponding first memory through the first port of the hardware circuit, and the cosine value is queried in the corresponding second memory through the second port. Since the hardware circuit can query the sine and cosine values through the first and second ports respectively, parallel and conflict-free reading of the sine and cosine values is achieved, allowing the two function values to be acquired simultaneously, thus improving the reading speed of the sine and cosine values. Moreover, the first and second memories only store the sine and cosine values for a quarter of the cycle, respectively. After the sine and cosine values are retrieved, the signs of the sine and cosine values are adjusted using the symmetry of trigonometric functions in the four quadrants. Therefore, only the sine and cosine values for a quarter of the cycle need to be stored to meet the calculation requirements of the entire 360° cycle, reducing the storage size of the memory to a quarter of that of the traditional direct lookup table method. In summary, querying sine and cosine values using a dual-port structure improves calculation speed, storing only a quarter of the cycle of sine and cosine values saves storage resources, and quadrant-based sign adjustment of sine and cosine values ensures accurate restoration of the signs of the sine and cosine values, guaranteeing the accuracy of the output sine and cosine values.
[0054] In one embodiment, such as Figure 3 As shown, step S220 involves querying the sine value in the corresponding first memory through the first port of the hardware circuit, and querying the cosine value in the corresponding second memory through the second port of the hardware circuit, based on the first angle. This includes steps S300-S320:
[0055] Step S300: Determine the sine address and cosine address based on the first angle.
[0056] Here, the sine address refers to the read address used to locate the sine value corresponding to the first angle in the first memory, and the cosine address refers to the read address used to locate the cosine value corresponding to the first angle in the second memory. Since the sine and cosine functions have complementary symmetry in the 0°–90° interval, and can be restored in other quadrants through mirroring and sign adjustment, the sine address and cosine address are not directly equal to the first angle, but are dynamically generated according to preset logical rules based on the quadrant in which the electrical angle is located.
[0057] Step S310: Query the sine value in the corresponding first memory through the first port according to the sine address.
[0058] The first port is an independent read port for the first memory, which stores sine function values at 8192 equally divided points within the 0° to 90° range. The sine address serves as the input address signal for this port, used to determine which sampling point's sine value to read from the first memory.
[0059] And, in step S320, the cosine value is queried in the corresponding second memory through the second port according to the cosine address.
[0060] The second port is an independent read port for the second memory, which stores the cosine function values of 8192 sample points that are identical to those in the first memory, within the 0° to 90° range. The cosine address serves as the input address signal for the second port, used to determine which sample point's cosine value to read from the second memory.
[0061] In this embodiment, based on the quadrants where the first angle and the electrical angle are located, the sine address and cosine address are dynamically generated through combinational logic, realizing a precise mapping from the full-cycle angle to the quarter-cycle storage space. Then, the sine value and cosine value are queried from the corresponding first memory and second memory using independent first and second ports respectively, ensuring that the acquisition of the two function values does not interfere with each other and is read synchronously.
[0062] In one embodiment, the clock module based on the hardware circuit performs step S200 in the first clock cycle to obtain the electrical angle of the motor rotor, and performs step S210 to determine the quadrant in which the electrical angle is located and convert the electrical angle into a first angle.
[0063] The clock module of the hardware circuit provides a unified synchronous clock signal for the system, which is used to coordinate the timing operations of the functional modules. Within the first clock cycle, the electrical angle signal is acquired, the quadrant in which the electrical angle is located is determined, and the electrical angle is converted into a first angle.
[0064] In the second clock cycle, step S300 is executed to determine the sine address and cosine address based on the first angle.
[0065] It should be specifically noted that the description of "executing steps S200 and S210 in the first clock cycle" and "executing step S300 in the second clock cycle" in this invention does not specifically mean that steps S200 and S210 and step S300 need to be executed in two separate clock cycles. Rather, it is sufficient that steps S200 and S210 are executed before step S300. For this invention, steps S200 and S210 and step S300 being executed in the same clock cycle are also within the scope of protection of this invention. For example, steps S200 and S210 and step S300 can be executed in the same clock cycle, but steps S200 and S210 can be executed first, followed by step S300.
[0066] In the third clock cycle, step S310 involves querying the sine value in the corresponding first memory using the first port based on the sine address. And step S320 involves querying the cosine value in the corresponding second memory using the second port based on the cosine address.
[0067] In the fourth clock cycle, step S230 is executed, and the sign part of the queried sine and cosine values is adjusted according to the quadrant to obtain the complete sine and cosine values corresponding to the electrical angle.
[0068] For example, such as Figure 4 As shown, in the first clock cycle: a 15-bit electrical angle bit sequence from external input is received. The highest 2 bits of the 15-bit sequence are extracted to directly determine the quadrant to which the input angle belongs (00 / 01 / 10 / 11 correspond to the first to fourth quadrants, respectively); the lowest 13 bits of the 15-bit sequence are extracted to determine the first angle in the 0°~90° range.
[0069] Second clock cycle: Determine the sine address and cosine address based on the quadrant and the first angle.
[0070] Third clock cycle: Query the sine value in the first memory based on the sine address. Query the cosine value in the second memory based on the cosine address.
[0071] Fourth clock cycle: The sine value is sign-adjusted and then output to the corresponding register. The cosine value is sign-adjusted and then output to the corresponding register.
[0072] In this embodiment, with the reference of the clock module, the above steps are configured into a four-stage fixed pipeline structure. Each stage completes a specific functional unit within an independent clock cycle: the first stage completes angle input and quadrant / first angle extraction; the second stage completes address mapping generation; the third stage completes parallel reading of sine and cosine values; and the fourth stage completes sign correction and output. For example, the aforementioned four-stage pipeline can be implemented using a pipelined control state machine in hardware circuitry. Since each stage uses synchronous registers to isolate input and output, and there is no data dependency delay between stages, the system allows a new electrical angle to be input in each clock cycle, and the corresponding complete sine and cosine values to be output in the fourth cycle, forming a continuous pipelined processing mode of input and output per cycle. The electrical angle is fixedly delayed by four clock cycles to output sine and cosine values. Only four clock cycles are required from input to output, resulting in low and fixed latency, which facilitates system timing convergence and shortens the time interval from electrical angle sampling to calculation result output, achieving fast and orderly output of sine and cosine values.
[0073] In one embodiment, such as Figure 5 As shown, step S300 involves determining the sine and cosine addresses based on the first angle. This includes steps S400-S410:
[0074] Step S400: Determine the mapping rules corresponding to the sine address and cosine address respectively based on the angle range covered by the quarter-cycle.
[0075] The quarter-cycle covers any one of the following angle ranges: 0° to 90°, 90° to 180°, 180° to 270°, and 270° to 360°. The trigonometric function values within this range are unique and monotonic, forming the basis for constructing full-cycle sine and cosine calculations. Taking the 0-90° angle range as an example, since the sine function monotonically increases within the 0°–90° interval, and the cosine function monotonically decreases within this interval, and satisfies symmetric relationships such as sin(θ)=cos(90°–θ), sin(180°–θ)=sin(θ), cos(180°–θ)=–cos(θ), sin(180°+θ)=–sin(θ), and cos(180°+θ)=–cos(θ), it is only necessary to store the sine and cosine values at the equally divided points within this interval to reconstruct the corresponding values in the other quadrants through address mapping. The sine address mapping rule is defined as follows: when the electrical angle is in the first or third quadrant, the absolute value of the sine is equal to the sine corresponding to the first angle, therefore the sine address is equal to the first angle; when the electrical angle is in the second or fourth quadrant, the absolute value of the sine is equal to the sine corresponding to (90° – the first angle), therefore the sine address is equal to (90° – the first angle). The cosine address mapping rule is defined as follows: when the electrical angle is in the first or third quadrant, the cosine address is (the difference between 90° and the first angle); when the electrical angle is in the second or fourth quadrant, the cosine address is the first angle. Through mathematical mapping rules, the problem of calculating trigonometric function values for the entire 360° period is transformed into the reuse of a single dataset within the 0°–90° interval, reducing memory capacity to one-quarter of the traditional full-cycle lookup table, while maintaining the match between the number of output points and the input resolution, thus improving storage resource utilization efficiency.
[0076] Step S410: Map the first angle according to the mapping rules and quadrants to obtain the sine address and cosine address.
[0077] In this embodiment, firstly, based on the mathematical properties of trigonometric functions in the 0°–90° interval, a precise mapping rule for sine and cosine addresses is established. This rule is derived from trigonometric identities, ensuring the mathematical correctness of the address mapping. Then, according to the determined mapping rule and quadrant, the first angle is mapped to obtain the sine and cosine addresses.
[0078] In one embodiment, step S410 involves mapping the first angle according to mapping rules and quadrants to obtain the sine address and cosine address. This includes:
[0079] When the angle range of the quarter-cycle corresponding to the first memory and the second memory is 0° to 90° or 180° to 270°:
[0080] When the quadrant is the first quadrant or the third quadrant, the first angle is mapped according to the mapping rules and the quadrant, so that the sine address is the first angle and the cosine address is the difference between 90° and the first angle.
[0081] When the quadrant is the second or fourth quadrant, the first angle is mapped according to the mapping rules and the quadrant to obtain the difference between the sine address (90°) and the first angle, and the cosine address (the first angle).
[0082] Specifically, in the 0°–90° interval, the sine value monotonically increases from 0 to 1, and the cosine value monotonically decreases from 1 to 0. In the 180°–270° interval, the sine value monotonically decreases from 0 to -1, and the cosine value monotonically increases from -1 to 0. Since the sine and cosine have mirror symmetry in the 180°–270° interval and the 0°–90° interval (i.e., sin(180°+θ)=–sin(θ), cos(180°+θ)=–cos(θ)), the same mapping rule can be reused.
[0083] Alternatively, if the angle range of the quarter-cycle corresponding to the first memory and the second memory is 90° to 180° or 270° to 360°:
[0084] When the quadrant is the first quadrant or the third quadrant, the first angle is mapped according to the mapping rules and the quadrant to obtain the difference between the sine address 90° and the first angle, and the cosine address is the first angle.
[0085] When the quadrant is the second or fourth quadrant, the first angle is mapped according to the mapping rules and the quadrant to obtain the sine address as the first angle and the cosine address as the difference between 90° and the first angle.
[0086] In this embodiment, when the system stores different quarter-cycle sine and cosine values, it can generate sine and cosine addresses according to the corresponding mapping rules.
[0087] In one embodiment, such as Figure 6 As shown, step S210 involves determining the quadrant of the electrical angle and converting the electrical angle into a first angle. This includes steps S500-S510:
[0088] Step S500: Extract the two highest bits from the bit sequence and determine the quadrant based on the two highest bits.
[0089] The electrical angle is a bit sequence, and the maximum angle that the bit sequence can represent is 360°.
[0090] For example, the bit sequence is a 15-bit unsigned binary digital signal with a value range of 0 to 32767, corresponding to a complete electrical cycle from 0° to 360°. The two highest bits refer to the two highest-weighted bits in this 15-bit sequence, namely the 14th and 13th bits (numbered starting from 0). The combination of these two bits uniquely identifies the quadrant of the electrical angle: when the two highest bits are "00", it corresponds to the first quadrant (0°–90°); when they are "01", it corresponds to the second quadrant (90°–180°); when they are "10", it corresponds to the third quadrant (180°–270°); and when they are "11", it corresponds to the fourth quadrant (270°–360°). The above is only an example, and this disclosure does not specifically limit the number of bits in the bit sequence.
[0091] Step S510: Determine the first angle based on the remaining bit sequence excluding the two highest bits in the bit sequence.
[0092] For example, the remaining bit sequence refers to the lower 13 bits (bits 12 to 0) of the 15-bit input bit sequence after removing the two most significant bits. Its value ranges from 0 to 8191, precisely covering all sampling points within the 0°–90° range. In the hardware circuit, this 13-bit sequence is directly used as the value of the first angle.
[0093] For example, such as Figure 7 As shown, the input is 15 bits of unsigned electrical angle data (bit14~bit0), linearly corresponding to an electrical cycle of 0°~360°. This data is split in parallel to obtain two signals: the high 2 bits (bit14, bit13): quadrant flags, indicating the quadrant to which the current angle belongs (00=quadrant 1, 01=quadrant 2, 10=quadrant 3, 11=quadrant 4). The low 13 bits (bit12~bit0): represent the first angle A_base, ranging from 0 to 8191 (corresponding to 2^13=8192 sampling points), linearly corresponding to 0°~90°.
[0094] Using the high 2 bits of the quadrant flag and the low 13 bits of A_base as input, the sine address sin_addr and the cosine address cos_addr are obtained by looking up a table (which pre-defines the correspondence between the quadrant and the first angle and the sine and cosine addresses).
[0095] For example, since this solution uses a lookup table to obtain the sine and cosine addresses, and both sine and cosine data are pre-calculated with high precision by Matlab and then quantized and stored in Q16 fixed-point format, the error of the data obtained by the lookup table only comes from the data quantization stage. The theoretical accuracy can reach 2^-16. The actual test results show that the maximum error of the data obtained by the lookup table is less than 0.008%. Compared with the typical error level of about 0.02% of the Xilinx 16-bit output CORDICIP core, the accuracy of the data obtained by the lookup table in this solution is higher. This can effectively reduce the calculation error of the coordinate transformation stage in the FOC vector control of permanent magnet synchronous motors, reduce motor torque fluctuation and speed control deviation, and improve the stability of the power system operation. It is especially suitable for application scenarios with strict requirements for the accuracy of trigonometric function calculations, such as eVTOL multi-rotor power control and high-precision servo drive.
[0096] For example, the hardware circuit of this solution is implemented using FPGA, with a simple interface design that is fully compatible with the control and data interfaces of the general-purpose CORDICIP core. It can directly replace the CORDICIP core in the existing FPGA project without additional adaptation logic, greatly reducing the complexity of engineering modification and porting. At the same time, this sine and cosine calculation device is highly versatile. In addition to the core application scenario of permanent magnet synchronous motor FOC vector control, it can also be widely adapted to various digital signal processing scenarios such as coordinate transformation, digital mixing, and attitude calculation. Whether it is eVTOL airborne power control, industrial servo drive, or general power electronic conversion system, it can be quickly integrated and deployed, effectively shortening the development cycle and reducing development costs. It has extremely high engineering practical value and platform adaptability.
[0097] In this embodiment, after acquiring the 15-bit electrical angle signal, the hardware circuit separates two independent information channels through hardware bit field truncation: the highest two bits are used to uniquely determine the quadrant where the electrical angle is located, and the lower 13 bits are directly used as the equivalent angle value in the 0°–90° range.
[0098] In one embodiment, such as Figure 8 As shown, step S230 involves adjusting the sign of the retrieved sine and cosine values according to the quadrant to obtain the complete sine and cosine values corresponding to the electrical angle. This includes steps S600-S610:
[0099] Step S600: Determine the sign adjustment rule based on the angle range of the quarter-cycle corresponding to the first memory and the second memory.
[0100] The first and second memories store the sine and cosine function values for a quarter-cycle period (any consecutive 90° interval from 0°–90°, 90°–180°, 180°–270°, or 270°–360°). Since trigonometric functions have fixed sign patterns in different quadrants, a matching sign correction rule needs to be established based on the angle intervals covered by the memories to ensure that the non-negative base values read from the memories can be correctly restored to the true sign values of the corresponding electrical angles throughout the entire period.
[0101] Step S610: According to the sign adjustment rules and quadrants, adjust the sign part of the queried sine and cosine values respectively to obtain the complete sine and cosine values corresponding to the electrical angle.
[0102] The sine and cosine values are base values read from the first and second memories. Based on the sign adjustment rules and the quadrant in which the current electrical angle is located, the sign bits of these two base values are corrected to obtain the complete sine and cosine values corresponding to the electrical angle.
[0103] In this embodiment, a sign adjustment rule is first established based on the quarter-cycle angle range covered by the first and second memories. Then, after reading the base value, the system performs sign flipping on the sine and cosine base values using pure combinational logic based on the rule and the current quadrant, achieving accurate mapping and restoration from non-negative base values to the true values of the entire cycle.
[0104] In one embodiment, step S610 involves adjusting the sign portions of the retrieved sine and cosine values according to the sign adjustment rules and quadrants to obtain the complete sine and cosine values corresponding to the electrical angle. This includes:
[0105] When the angle range of the quarter-cycle corresponding to the first memory and the second memory is 0° to 90° or 90° to 180°:
[0106] When the quadrant is the first quadrant, the sign of the sine value is determined to be positive, and the sign of the cosine value is also positive.
[0107] When the quadrant is the second quadrant, the sign of the sine value is determined to be positive and the sign of the cosine value to be negative.
[0108] When the quadrant is the third quadrant, the sign of the sine value is determined to be negative, and the sign of the cosine value is also negative.
[0109] When the quadrant is the fourth quadrant, the sign of the sine value is determined to be negative and the sign of the cosine value to be positive.
[0110] Alternatively, if the angle range of the quarter-cycle corresponding to the first memory and the second memory is 180° to 270° or 270° to 360°:
[0111] When the quadrant is the first quadrant, the sign of the sine value is determined to be negative, and the sign of the cosine value is determined to be negative.
[0112] When the quadrant is the second quadrant, the sign of the sine value is determined to be negative and the sign of the cosine value to be positive.
[0113] When the quadrant is the third quadrant, the sign of the sine value is determined to be positive, and the sign of the cosine value is also positive.
[0114] When the quadrant is the fourth quadrant, the sign of the sine value is determined to be positive and the sign of the cosine value to be negative.
[0115] In this embodiment, for different quarter-cycle storage cases (0°–90° / 90°–180° and 180°–270° / 270°–360°), matching sign adjustment rules are established respectively, which can realize the sign adjustment of sine and cosine values, thereby mapping and restoring the queried sine and cosine values to complete sine and cosine values.
[0116] In one embodiment, the hardware circuitry can be designed based on a 15-bit angle code for quadrant splitting, address mapping, ROM lookup, and sign adjustment, with a defined effective input range of 0~32767. This numerical range linearly corresponds to the complete electrical cycle of the motor from 0° to 360°. However, in the vector control of a permanent magnet synchronous motor, if the input angle comes from an accumulator (such as speed integral), it may exceed 32767. Therefore, a modulo 32768 arithmetic unit (i.e., modulo 360°) is added to the front end of the hardware circuitry to normalize the angle to the range of 0~32767. The normalization operation can be implemented using hardware comparison and subtraction circuitry.
[0117] In one embodiment, through parameterized design, the ROM depth can be configured to 4096, 8192, or 16384. As the depth increases, the number of bits for the first angle increases accordingly, resulting in a linear increase in ROM resource usage, but an improvement in angle resolution. Simultaneously, the input angle bit width needs adjustment (e.g., a depth of 8192 corresponds to 15 bits of input, and a depth of 16384 corresponds to 16 bits of input). Users can choose a suitable ROM depth and angle input resolution based on a balance between accuracy and resources. When the ROM depth is configured to 8192, the input angle uses a 15-bit width, with the high 2 bits used as quadrant flags and the low 13 bits used as base angle addressing bits; when the ROM depth is configured to 16384, the input angle is extended to a 16-bit width, with the high 2 bits used as quadrant flags and the low 14 bits used as base angle addressing bits; when the ROM depth is configured to 4096, the input angle uses a 14-bit width, with the high 2 bits used as quadrant flags and the low 12 bits used as base angle addressing bits.
[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0119] Figure 9 This is a structural block diagram of an efficient angle parameter determination device according to an embodiment of this application. Figure 9 As shown, it includes:
[0120] Angle receiving module 901 is used to acquire the electrical angle of the motor rotor.
[0121] The conversion module 902 is used to determine the quadrant in which the electrical angle is located and to convert the electrical angle into a first angle. The first angle is less than or equal to 90°, and the sine values of the first angle and the electrical angle are equal, as are the cosine values of the two.
[0122] The query module 903 is used to query the sine value in the corresponding first memory through the first port of the hardware circuit according to the first angle, and to query the cosine value in the corresponding second memory through the second port of the hardware circuit. The first memory stores the sine value for one-quarter period, and the second memory stores the cosine value for one-quarter period. The one-quarter period corresponding to the first memory and the second memory is the same.
[0123] The parameter determination module 904 is used to adjust the sign part of the queried sine and cosine values according to the quadrant to obtain the complete sine and cosine values corresponding to the electrical angle.
[0124] In an exemplary embodiment, the query module 903 is specifically configured to: determine the sine address and the cosine address based on the first angle; query the sine value in the corresponding first memory via the first port based on the sine address; and query the cosine value in the corresponding second memory via the second port based on the cosine address.
[0125] In an exemplary embodiment, the above-described apparatus is further configured to: In a first clock cycle, a hardware circuit-based clock module performs the following steps: acquiring the electrical angle of the motor rotor; determining the quadrant of the electrical angle; and converting the electrical angle into a first angle. In a second clock cycle, the module performs the following steps: determining a sine address and a cosine address based on the first angle. In a third clock cycle, the module performs the following steps: querying a sine value in a corresponding first memory via a first port based on the sine address; and querying a cosine value in a corresponding second memory via a second port based on the cosine address. In a fourth clock cycle, the module performs the following steps: adjusting the sign portions of the queried sine and cosine values according to the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle.
[0126] In an exemplary embodiment, determining the sine address and cosine address based on the first angle includes: determining mapping rules corresponding to the sine address and cosine address respectively based on the angle range covered by a quarter-cycle; and mapping the first angle according to the mapping rules and quadrants to obtain the sine address and cosine address.
[0127] In an exemplary embodiment, mapping the first angle according to the mapping rule and the quadrant to obtain the sine address and the cosine address includes: When the angle range of the quarter-cycle corresponding to the first memory and the second memory is 0° to 90° or 180° to 270°: when the quadrant is the first quadrant or the third quadrant, mapping the first angle according to the mapping rule and the quadrant to obtain the sine address as the first angle and the cosine address as the difference between 90° and the first angle. When the quadrant is the second quadrant or the fourth quadrant, mapping the first angle according to the mapping rule and the quadrant to obtain the sine address as the difference between 90° and the first angle and the cosine address as the first angle. Alternatively, when the angle range of the quarter-cycle corresponding to the first memory and the second memory is 90° to 180° or 270° to 360°: when the quadrant is the first quadrant or the third quadrant, mapping the first angle according to the mapping rule and the quadrant to obtain the sine address as the difference between 90° and the first angle and the cosine address as the first angle. When the quadrant is the second or fourth quadrant, the first angle is mapped according to the mapping rules and the quadrant to obtain the sine address as the first angle and the cosine address as the difference between 90° and the first angle.
[0128] In an exemplary embodiment, the electrical angle is a bit sequence, and the maximum angle that the bit sequence can represent is 360°. The conversion module 902 is specifically used to: extract the two highest bits from the bit sequence and determine the quadrant based on the two highest bits; and determine the first angle based on the remaining bit sequence excluding the two highest bits.
[0129] In an exemplary embodiment, the parameter determination module 904 is specifically used to: determine a sign adjustment rule based on the angle range of one-quarter cycles corresponding to the first memory and the second memory; and adjust the sign portion of the queried sine and cosine values according to the sign adjustment rule and quadrants to obtain the complete sine and cosine values corresponding to the electrical angle.
[0130] In an exemplary embodiment, adjusting the sign portions of the queried sine and cosine values according to the sign adjustment rules and the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle includes: when the angle range of the quarter-cycle corresponding to the first and second memories is 0° to 90° or 90° to 180°: when the quadrant is the first quadrant, determining that the sign of the sine value is positive and the sign of the cosine value is positive; when the quadrant is the second quadrant, determining that the sign of the sine value is positive and the sign of the cosine value is negative; when the quadrant is the third quadrant, determining that the sign of the sine value is negative and the sign of the cosine value is negative; when the quadrant is the fourth quadrant, determining that the sign of the sine value is negative and the sign of the cosine value is positive. Alternatively, when the angle range of the quarter-cycle corresponding to the first and second memories is 180° to 270° or 270° to 360°: when the quadrant is the first quadrant, determining that the sign of the sine value is negative and the sign of the cosine value is negative. When the quadrant is the second quadrant, the sign of the sine value is negative and the sign of the cosine value is positive. When the quadrant is the third quadrant, the sign of the sine value is positive and the sign of the cosine value is positive. When the quadrant is the fourth quadrant, the sign of the sine value is positive and the sign of the cosine value is negative.
[0131] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0132] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0133] Embodiments of this application also provide a vertical takeoff and landing aircraft, including a motor and hardware circuitry, the hardware circuitry being used to perform the steps in any of the above method embodiments.
[0134] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.
[0135] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0136] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0137] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0138] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0139] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0140] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above method embodiments.
[0141] The embodiments described herein also provide a computer program product, including a computer program comprising computer instructions stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the steps in any of the above method embodiments.
[0142] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing systems. They can be centralized on a single computing system or distributed across a network of multiple computing systems. Optionally, they can be implemented using program code executable by a computing system, thereby storing them in a storage system for execution by the computing system. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0143] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.
Claims
1. A method for efficiently determining angle parameters, characterized in that, Applied to hardware circuits, the method includes: Obtain the electrical angle of the motor rotor; Determine the quadrant in which the electrical angle is located and convert the electrical angle into a first angle; the first angle is less than or equal to 90°, and the sine values of the first angle and the electrical angle are equal, and the cosine values of the two are equal; According to the first angle, the sine value is queried in the corresponding first memory through the first port of the hardware circuit, and the cosine value is queried in the corresponding second memory through the second port of the hardware circuit; the first memory stores a quarter-cycle sine value, the second memory stores a quarter-cycle cosine value, and the quarter-cycle corresponding to the first memory and the second memory is the same. The sign portions of the queried sine and cosine values are adjusted according to the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle.
2. The efficient method for determining angle parameters according to claim 1, characterized in that, The step of querying the sine value in the corresponding first memory through the first port of the hardware circuit according to the first angle, and querying the cosine value in the corresponding second memory through the second port of the hardware circuit, includes: Based on the first angle, determine the sine address and the cosine address; The sine value is queried in the corresponding first memory according to the sine address through the first port; Additionally, the cosine value is queried in the corresponding second memory via the second port based on the cosine address.
3. The efficient method for determining angle parameters according to claim 2, characterized in that, Based on the clock module of the hardware circuit, in the first clock cycle, the steps of acquiring the electrical angle of the motor rotor, determining the quadrant in which the electrical angle is located, and converting the electrical angle into a first angle are performed. In the second clock cycle, the step of determining the sine address and cosine address based on the first angle is performed; In the third clock cycle, the steps of querying the sine value in the corresponding first memory through the first port according to the sine address and querying the cosine value in the corresponding second memory through the second port are performed. In the fourth clock cycle, the step of adjusting the sign portion of the queried sine and cosine values according to the quadrants is performed to obtain the complete sine and cosine values corresponding to the electrical angle.
4. The efficient method for determining angle parameters according to claim 2, characterized in that, The step of determining the sine address and cosine address based on the first angle includes: Based on the angle range covered by the quarter-cycle, determine the mapping rules corresponding to the sine address and cosine address respectively; Based on the mapping rules and the quadrants, the first angle is mapped to obtain the sine address and the cosine address.
5. The efficient method for determining angle parameters according to claim 4, characterized in that, The step of mapping the first angle according to the mapping rule and the quadrant to obtain the sine address and the cosine address includes: When the angle range of the quarter-cycle corresponding to the first memory and the second memory is 0° to 90° or 180° to 270°: When the quadrant is the first quadrant or the third quadrant, the first angle is mapped according to the mapping rule and the quadrant to obtain the sine address as the first angle and the cosine address as the difference between 90° and the first angle. When the quadrant is the second quadrant or the fourth quadrant, the first angle is mapped according to the mapping rule and the quadrant to obtain the difference between the sine address 90° and the first angle, and the cosine address is the first angle. Alternatively, when the angle range of the quarter-cycle corresponding to the first memory and the second memory is 90° to 180° or 270° to 360°: When the quadrant is the first quadrant or the third quadrant, the first angle is mapped according to the mapping rule and the quadrant to obtain the difference between the sine address 90° and the first angle, and the cosine address is the first angle. When the quadrant is the second quadrant or the fourth quadrant, the first angle is mapped according to the mapping rule and the quadrant to obtain the sine address as the first angle and the cosine address as the difference between 90° and the first angle.
6. The efficient method for determining angle parameters according to any one of claims 1-5, characterized in that, The electrical angle is a bit sequence, and the maximum angle that the bit sequence can represent is 360°. Determining the quadrant in which the electrical angle is located and converting the electrical angle into a first angle includes: Extract the two highest bits from the bit sequence, and determine the quadrant based on the two highest bits; The first angle is determined based on the remaining bit sequence excluding the two highest bits in the bit sequence.
7. The efficient method for determining angle parameters according to any one of claims 1-5, characterized in that, The step of adjusting the sign portion of the retrieved sine and cosine values according to the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle includes: The sign adjustment rule is determined based on the angle range of one-quarter cycles corresponding to the first memory and the second memory; Based on the sign adjustment rules and the quadrants, the sign portions of the queried sine and cosine values are adjusted respectively to obtain the complete sine and cosine values corresponding to the electrical angle.
8. The efficient method for determining angle parameters according to claim 7, characterized in that, The step of adjusting the sign portion of the queried sine and cosine values according to the sign adjustment rules and the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle includes: When the angle range of the quarter-cycle corresponding to the first memory and the second memory is 0° to 90° or 90° to 180°: When the quadrant is the first quadrant, the sign of the sine value is determined to be positive, and the sign of the cosine value is determined to be positive. When the quadrant is the second quadrant, the sign of the sine value is determined to be positive and the sign of the cosine value to be negative; When the quadrant is the third quadrant, the sign of the sine value is determined to be negative, and the sign of the cosine value is determined to be negative; When the quadrant is the fourth quadrant, the sign of the sine value is determined to be negative and the sign of the cosine value to be positive. Alternatively, if the angle range of the quarter-cycle corresponding to the first memory and the second memory is 180° to 270° or 270° to 360°: When the quadrant is the first quadrant, the sign of the sine value is determined to be negative, and the sign of the cosine value is determined to be negative; When the quadrant is the second quadrant, the sign of the sine value is determined to be negative and the sign of the cosine value to be positive. When the quadrant is the third quadrant, the sign of the sine value is determined to be positive, and the sign of the cosine value is determined to be positive. When the quadrant is the fourth quadrant, the sign of the sine value is determined to be positive and the sign of the cosine value to be negative.
9. A highly efficient device for determining angle parameters, characterized in that, The device includes: Angle receiving module, used to acquire the electrical angle of the motor rotor; A conversion module is used to determine the quadrant in which the electrical angle is located and to convert the electrical angle into a first angle; the first angle is less than or equal to 90°, and the sine values of the first angle and the electrical angle are equal, and the cosine values of the two are equal; The query module is used to query a sine value in a corresponding first memory through a first port of the hardware circuit based on the first angle, and to query a cosine value in a corresponding second memory through a second port of the hardware circuit; the first memory stores a sine value for a quarter period, the second memory stores a cosine value for a quarter period, and the quarter period corresponding to the first memory and the second memory is the same. The parameter determination module is used to adjust the sign part of the queried sine and cosine values according to the quadrants to obtain the complete sine and cosine values corresponding to the electrical angle.
10. A vertical takeoff and landing aircraft, characterized in that, It includes a motor and hardware circuitry, the hardware circuitry being used to perform the steps of the method described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the steps of the method described in any one of claims 1 to 8.
12. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to perform the steps of the method described in any one of claims 1 to 8 through the computer program.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 8.