Angle compensation method and device, electronic equipment and storage medium

By synchronizing the current loop calculation counter and the PWM carrier counter in the quasi-continuous current loop and dynamically updating the electrical angle compensation, the problem of the inapplicability of traditional methods is solved, and the accuracy of current loop control and system stability are improved.

CN122052640APending Publication Date: 2026-05-15SHANGHAI INVT INDUSTRY TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI INVT INDUSTRY TECHNOLOGY CO LTD
Filing Date
2026-02-05
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Traditional electrical angle compensation methods are not suitable for quasi-continuous current loops, which affects current tracking accuracy and motor output performance.

Method used

By synchronizing the count values ​​of the current loop calculation counter and the PWM carrier counter during carrier frequency switching, the offset is determined and electrical angle compensation is performed, including the first offset and the second offset. The compensation electrical angle is dynamically updated to adapt to the characteristics of the quasi-continuous current loop.

Benefits of technology

Ensuring the accuracy of the electrical angle compensation value improves the stability and responsiveness of the quasi-continuous current loop control system, and enhances the accuracy and response speed of the current loop control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122052640A_ABST
    Figure CN122052640A_ABST
Patent Text Reader

Abstract

The invention discloses an angle compensation method and device, electronic equipment and a storage medium, and relates to the field of motor control. Aiming at the problem that a traditional electrical angle compensation method is not suitable for a quasi-continuous current loop, the invention provides an angle compensation method, which comprises the following steps of: synchronizing count values of a current loop calculation counter and a PWM (Pulse Width Modulation) carrier wave counter during carrier wave frequency switching; for any current loop calculation period, determining the offset between the current moment and the position updating moment as a first offset; determining the offset between the position updating moment and the position request moment as a second offset; and determining a compensation electrical angle according to the first offset and the second offset, and performing electrical angle compensation on Park transformation and anti-Park transformation through the compensation electrical angle. The method can adapt to the characteristics of the quasi-continuous current loop, and an accurate and reliable electrical angle compensation scheme is provided for the quasi-continuous current loop, so that the stability and the response capability of a quasi-continuous current loop control system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of motor control, and in particular to an angle compensation method, device, electronic device, and storage medium. Background Technology

[0002] In vector control systems, decoupling control of the DQ axes (D-axis - direct axis, Q-axis - quadrature axis, two coordinate axes of a synchronous rotating coordinate system) relies on accurate Park and IPark electrical angles. The actual feedback current of the motor tracks the command current in the DQ coordinate system under the Park-transformed electrical angle. Errors in the Park transformation electrical angle will cause decoupling errors, resulting in cross-coupling and affecting current tracking accuracy and motor output performance. Errors in the IPark transformation electrical angle will prevent the calculated DQ axis voltage from being accurately applied to the next pulse-width modulation (PWM) cycle, thus causing voltage vector errors and affecting current control performance and parameter identification algorithm accuracy. Therefore, electrical angle compensation is required for the Park and IPark transformations.

[0003] However, in a quasi-continuous current loop, the current sampling time and voltage activation time are no longer fixed within half a carrier cycle, rendering traditional electrical angle compensation methods ineffective. In this scenario, the compensation amount needs to be updated in real time as the quasi-continuous current loop is calculated to ensure that the current loop algorithm can obtain accurate compensation electrical angles at different carrier timing points and when the carrier cycle changes, thereby completing the electrical angle compensation.

[0004] Therefore, those skilled in the art urgently need an angle compensation method to solve the problem that traditional electrical angle compensation methods are not applicable to quasi-continuous current loops. Summary of the Invention

[0005] The purpose of this application is to provide an angle compensation method, device, electronic device, and storage medium to solve the problem that traditional electrical angle compensation methods are not applicable to quasi-continuous current loops.

[0006] To address the aforementioned technical problems, this application provides an angle compensation method applied to a quasi-continuous current loop control system, comprising: When switching carrier frequencies, the count values ​​of the current loop calculation counter and the PWM carrier counter are synchronized; wherein, the PWM carrier counter is a counter used to determine the carrier period; the current loop calculation counter is a counter used to determine the current loop calculation period; the edges of the current loop calculation counter and the PWM carrier counter are aligned. For any current loop calculation cycle, the offset between the current time and the position update time is determined as the first offset; the offset between the position update time and the position request time is determined as the second offset. The compensation electrical angle is determined based on the first offset and the second offset, and the Parker transform and the inverse Parker transform are compensated for electrical angle using the compensation electrical angle.

[0007] In an optional embodiment, determining the offset between the current time and the position update time as the first offset includes: The first offset is determined by the product of the number of current loop calculation cycles elapsed after the position update time and the duration of the current loop calculation cycle. Determining the offset between the location update time and the location request time as the second offset includes: The second offset is determined based on the encoder communication duration.

[0008] In one optional embodiment, the compensation electrical angle includes: a first electrical angle and a second electrical angle; wherein the first electrical angle is used to compensate the Parker transform for electrical angle, and the second electrical angle is used to compensate the inverse Parker transform for electrical angle. The step of determining the compensation electrical angle based on the first offset and the second offset includes: Use the current sampling delay time as the third offset; The first electrical angle is determined based on the first offset, the second offset, and the third offset; Determine the loading delay time and the activation delay time required for the voltage to take effect, and determine the fourth offset based on the sum of the loading delay time and the activation delay time; The second electrical angle is determined based on the first offset, the second offset, and the fourth offset.

[0009] In an optional embodiment, determining the first electrical angle based on the first offset, the second offset, and the third offset includes: The first electrical angle is determined by the first formula; The first formula is: ; Δ θ park1 Indicates the first electrical angle; T 5 represents the second offset; T 4 represents the third offset; N cur1p T2 represents the first offset; where, N cur1p This indicates the number of current loop calculation cycles elapsed since the position update time; T 2 indicates the duration of the current loop calculation period; ω e Indicates the electrical angular frequency of the rotor rotation; Determining the second electrical angle based on the first offset, the second offset, and the fourth offset includes: The second electrical angle is determined by the second formula; The second formula is: ; Δ θ ipark Indicates the second electrical angle; T 6 +T 7 represents the fourth offset; where, T 6 indicates the loading delay duration; T 7 indicates the effective delay time.

[0010] In one optional embodiment, the quasi-continuous current loop control system includes: a dual feedback current loop and a current controller; the method further includes: A continuous current signal is sampled through the first current sampling stage in the dual feedback current loop; the continuous current signal is used as the feedback input of the proportional stage in the current controller. The center point current is sampled through the second current sampling stage in the dual feedback current loop; the center point current is used as the feedback input for the integral stage in the current controller. The sampling rate of the first current sampling stage is less than that of the second current sampling stage.

[0011] In an optional embodiment, for any current loop calculation period, the method further includes: The third electrical angle is determined based on the time required from the position request time to the next PWM overflow point, the duration of the current half-carrier cycle, the number of current samples taken in the second current sampling stage from the position update time to the current time, and the duration of the first half-carrier cycle of the current carrier cycle. The Parker transform corresponding to the second current sampling stage is compensated by the third electrical angle.

[0012] In an optional embodiment, determining the third electrical angle based on the time required from the position request time to the next PWM overflow point, the duration of the current half-carrier cycle, the number of current samples taken in the second current sampling stage from the position update time to the current time, and the duration of the first half-carrier cycle of the current carrier cycle includes: The difference between the time required from the location request time to the next PWM overflow point and the duration of the current half-carrier period is used as the first intermediate quantity; If the timing of the current latching moment of the second current sampling stage is before the position request moment within the current half-carrier period, then the product of the number of current samplings of the second current sampling stage from the position update moment to the current moment and the duration of the first half-carrier period of the current carrier period is used as the second intermediate quantity; and the intermediate result is determined based on the sum of the first intermediate quantity and the second intermediate quantity. If the timing of the current latching moment of the second current sampling stage is after the position request moment within the current half-carrier period, then the difference between the number of current samples of the second current sampling stage from the position update moment to the current moment and 1 is used as the third intermediate quantity; the product of the third intermediate quantity and the duration of the first half-carrier period of the current carrier period is used as the fourth intermediate quantity; and the intermediate result is determined based on the sum of the first intermediate quantity and the fourth intermediate quantity. The third electrical angle is determined by the product of the intermediate result and the rotor's rotational electrical angular frequency.

[0013] To address the aforementioned technical problems, this application also provides an angle compensation device applied to a quasi-continuous current loop control system, comprising: A timing control module is used to synchronize the count values ​​of the current loop calculation counter and the PWM carrier counter when the carrier frequency is switched; wherein, the PWM carrier counter is a counter used to determine the carrier period; the current loop calculation counter is a counter used to determine the current loop calculation period; the edges of the current loop calculation counter and the PWM carrier counter are aligned. The offset determination module is used to determine, for any current loop calculation cycle, the offset between the current time and the position update time as the first offset; and to determine the offset between the position update time and the position request time as the second offset. The electrical angle compensation module is used to determine the compensation electrical angle based on the first offset and the second offset, and to perform electrical angle compensation on the Parker transform and the inverse Parker transform using the compensation electrical angle.

[0014] To address the aforementioned technical problems, this application also provides an electronic device, comprising: Memory, used to store computer programs; A processor is configured to implement the angle compensation method described above when executing the computer program.

[0015] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the angle compensation method described above.

[0016] This application provides an angle compensation method that ensures the accuracy of the electrical angle compensation value during carrier frequency switching by synchronizing the count values ​​between the edge-aligned current loop calculation counter and the PWM carrier counter. Through this precise timing control, the method guarantees the synchronous execution of current loop calculation, angle compensation, and the PWM signal. This ensures accurate electrical angle compensation even during carrier period adjustments. Furthermore, this method provides a dynamically updated electrical angle compensation scheme for quasi-continuous current loop control systems. On one hand, the determination of the electrical angle compensation value is specified for each current loop calculation cycle, ensuring real-time compensation to adapt to the characteristic that the current sampling time and voltage activation time are no longer fixed within half a carrier cycle of the quasi-continuous current loop. On the other hand, this method also provides a compensation electrical angle determination scheme that can be implemented in any current loop calculation cycle, ensuring successful electrical angle compensation. Therefore, this method can adapt to the characteristics of quasi-continuous current loops, providing an accurate and reliable electrical angle compensation scheme, thereby improving the stability and responsiveness of the quasi-continuous current loop control system.

[0017] The angle compensation device, electronic device, and computer-readable storage medium provided in this application correspond to the above-described method and have the same effect. Attached Figure Description

[0018] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a block diagram of the current loop control of a motor vector control system; Figure 2 This is a typical timing diagram of a dual feedback current loop; Figure 3 A flowchart of an angle compensation method provided by the present invention; Figure 4 A timing diagram of a timing control scheme provided by the present invention; Figure 5This invention provides a timing diagram for a dual-feedback quasi-continuous current loop. Figure 6 This invention provides another timing diagram for a dual-feedback quasi-continuous current loop; Figure 7 A current loop control block diagram of a quasi-continuous current loop control system provided by the present invention; Figure 8 A structural diagram of an angle compensation device provided by the present invention; Figure 9 This is a structural diagram of an electronic device provided by the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0021] The core of this application is to provide an angle compensation method, device, electronic device, and storage medium.

[0022] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0023] In related technologies, a common current loop control block diagram in a field-oriented control (FOC) system for motors is shown below. Figure 1 As shown, the three-phase stator current of the motor is first transformed from the three-phase stationary coordinate system (ABC) to the synchronous rotating coordinate system (DQ) through Clark and Park coordinate transformation. The D-axis current corresponds to the flux linkage component, and the Q-axis current corresponds to the torque component; both are regulated separately by independent current controllers. The DQ-axis voltage command after current regulation is used to generate six pulse-width modulation (PWM) waves to drive the inverter through inverse Park transformation and space vector pulse width modulation (SVPWM). This decoupling method ensures that torque control and excitation control do not interfere with each other and can be adjusted independently, thereby achieving precise control of the motor torque and magnetic field.

[0024] In vector control systems, DQ-axis decoupling control relies on accurate Park transform and inverse Park transform electrical angles. The actual feedback current of the motor tracks the command current in the DQ coordinate system under the Park transform electrical angle. Errors in the Park transform electrical angle will cause decoupling errors, resulting in cross-coupling and affecting current tracking accuracy and motor output performance. Errors in the IPark transform electrical angle will prevent the calculated DQ-axis voltage from being accurately applied to the next PWM cycle, thus causing voltage vector errors and affecting current control performance and parameter identification algorithm accuracy. Therefore, electrical angle compensation is required for both the Park transform and IPark transform.

[0025] like Figure 2 As shown, Figure 2 This is a typical timing diagram of a dual-feedback current loop, in which the current loop calculation and carrier comparison value update are performed twice within one PWM cycle. Figure 2 Point X in the diagram represents the position request moment. After receiving the position request signal, the encoder latches the position and feeds it back to the controller, which is equivalent to the position latching moment. Point Y represents the current loop calculation moment. The current loop calculation is performed before the overflow point of the PWM carrier, avoiding the effective delay. O represents the effective moment of the carrier comparison value and the equivalent latching moment of the feedback current. T 1 represents the duration between the location request time and the effective time of the carrier comparison value; T 2 represents the duration between the current loop calculation time and the effective time of the carrier comparison value; T s This is the duration of a half-carrier period. From Figure 2 As can be seen, the electrical angle error of the Park transform originates from the difference between the latching time O of the feedback current and the latching time X of the position. Similarly, the electrical angle error of the IPark transform originates from the difference between the latching time X of the position and the equivalent effective time of the voltage vector. Therefore, the Park transform electrical angle compensation method compensates for the electrical angle from the latching time of the feedback current, and similarly, the IPark transform electrical angle compensation method compensates for the electrical angle from the equivalent effective time of the voltage vector. The compensation formulas are as follows: ; ; In the formula, Δ θ park This represents the electrical angle compensation value for the Park transform; Δ θ Ipark This represents the electrical angle compensation value for the IPark transform; ω e This represents the electric angular frequency of the rotor rotation.

[0026] In dual-feedback current loop control strategies, both current sampling and voltage activation suffer from significant timing delays. This introduces noticeable phase lag in high-bandwidth current loops, limiting their control performance. In contrast, quasi-continuous current loop control strategies perform multiple current samplings, control calculations, and PWM comparison value updates within a single carrier cycle, allowing voltage commands to take effect almost instantly. Compared to dual-feedback, the quasi-continuous approach increases the current sampling frequency and brings the latch point closer to the actual current change, reducing current feedback delay. Furthermore, voltage commands take effect immediately within the same cycle, significantly reducing voltage activation delay. Therefore, quasi-continuous current loops offer advantages such as high bandwidth, high response speed, and low phase lag. These advantages have made quasi-continuous current loops an important control method in high-performance servo drives.

[0027] However, in a quasi-continuous current loop, the current sampling time and voltage activation time are no longer fixed within half a carrier cycle. Therefore, the traditional dual-feedback angle compensation method is no longer applicable. The compensation amount needs to be updated in real-time with the quasi-continuous current loop calculations to ensure that the current loop algorithm can obtain accurate compensation electrical angles at different carrier timing points and when the carrier cycle changes.

[0028] To address the aforementioned problems, this application provides an angle compensation method applied to a quasi-continuous current loop control system. It should be noted that the quasi-continuous current loop control system is different from the one described above. Figure 1 The main difference between the current loop control block diagrams shown lies in the sampling method of the current signal used as feedback input; their control structures are not necessarily significantly different. Therefore, the control structure of an alternative quasi-continuous current loop control system can also be found in [reference needed]. Figure 1 Furthermore, the methodology is as follows: Figure 3 As shown, it includes: S10: When the carrier frequency is switched, synchronize the count value of the current loop calculation counter with the count value of the PWM carrier counter.

[0029] Among them, the PWM carrier counter is a counter used to determine the carrier period; the current loop calculation counter is a counter used to determine the current loop calculation period; the edges of the current loop calculation counter are aligned with those of the PWM carrier counter.

[0030] For any current loop calculation period: S21: Determine the offset between the current time and the location update time as the first offset; determine the offset between the location update time and the location request time as the second offset.

[0031] S22: Determine the compensation electrical angle based on the first offset and the second offset, and perform electrical angle compensation on the Parker transform and the inverse Parker transform using the compensation electrical angle.

[0032] It should be noted that step S10 is the timing control part of this method. It coordinates the timing of current sampling, current loop calculation, and position request. It ensures that current sampling and current loop calculation are executed in the correct timing sequence within each control cycle and controls the synchronous operation of each counter. By precisely controlling the synchronous operation of each counter, the timing control module effectively avoids angle compensation errors caused by timing inconsistencies due to carrier adjustment in the distributed clock (DC) synchronization mode of EtherCAT (Ethernet Control Automation Technology), thus improving system stability and control accuracy.

[0033] Steps S21 and S22 correspond to specific electrical angle compensation schemes. Steps S21 and S22 can occur in any current loop calculation cycle. Step S10, however, is performed in real-time, triggered when the carrier frequency switching condition is met by detecting whether a carrier frequency switch occurs in the quasi-continuous current loop control system. That is, there is no specific execution order between steps S21 and S22 and step S10. However, it is important to note that the timing synchronization achieved in step S10 is a prerequisite for accurate electrical angle compensation in steps S21 and S22.

[0034] Furthermore, regarding how to determine the carrier frequency switching time in step S10 above, it should be noted that in practical applications, the carrier frequency (the duration of the carrier period) is often implemented using a counter. This counter is the aforementioned PWM carrier counter, so the switching of the carrier frequency also means a change in the PWM carrier counter's count value. To ensure a smooth switching of the carrier frequency, the switching is triggered when the carrier frequency equals 0 (i.e., the carrier underflow point).

[0035] Similarly, the current loop calculation counter is used to determine the duration of the current loop calculation period, similar to the PWM carrier counter. Further, step S10 aims to synchronize the current loop calculation counter and the PWM carrier counter. Therefore, in the specific implementation of step S10, the aforementioned triggering conditions can be ignored, such as... Figure 4 As shown, it is only necessary to monitor the count value of the PWM carrier counter and keep the count value of the current loop calculation counter synchronized with the count value of the PWM carrier counter (hold, jump, etc.).

[0036] Next, for the electrical angle compensation portion corresponding to steps S21 and S22. For example... Figure 5 The timing diagram shown is as follows: Point B is the position request time, which is triggered before the PWM (upper and lower) overflow point, reserving time for encoder communication, position loop, and speed loop calculations; C is the PWM (upper and lower) overflow point; D is the carrier frequency switching point (occurring at the PWM lower overflow point); and E is the position update time. T 2 represents the calculation period for the quasi-continuous current loop; T4 represents the equivalent delay time for current sampling; T s1 , T s2 These are the two half-carrier cycles used before and after carrier frequency switching; T 5 represents the encoder communication duration (i.e., the second offset mentioned above).

[0037] according to Figure 5 As shown in the timing diagram, achieving electrical angle compensation is equivalent to adjusting the time of this electrical angle compensation (i.e., the current time, corresponding to any current loop calculation cycle) to the actual requested position time B. It should be noted that there is a certain delay between this position request time B, the position update time E, and the actual time used for electrical angle compensation (the current time, at any current loop calculation cycle after point E). This delay is the offset that needs to be compensated, and the compensated electrical angle is calculated based on this offset.

[0038] To address this, step S21 of this method determines the offset between the current time and the position update time (between the current time and point E) as the first offset, and determines the offset between the position update time and the position request time (between points E and B) as the second offset, thus obtaining the offset to be compensated. Based on this, the dynamic calculation of the compensated electrical angle can be completed to achieve electrical angle compensation for Park transform and IPark transform.

[0039] Furthermore, this embodiment also provides a suitable alternative solution for determining the offset between the current time and the location update time for determining the first offset, and the offset between the location update time and the location request time for determining the second offset.

[0040] Step S21 above: Determine the offset between the current time and the position update time as the first offset, specifically including: S211: Determine the first offset by multiplying the number of current loop calculation cycles elapsed after the position update time by the duration of the current loop calculation cycle.

[0041] like Figure 5 As shown, the first offset equals the number of current loop calculation cycles elapsed after the position update time. N cur1p × Duration of the current loop calculation period T 2.

[0042] Step S21 above: Determine the offset between the location update time and the location request time as the second offset, specifically including: S212: Determine the second offset based on the encoder communication duration.

[0043] like Figure 5 As shown, the second offset equals the encoder communication time. T 5.

[0044] Therefore, this embodiment does not require actually determining the start and end times of the first and second offsets. Instead, it can conveniently, efficiently, and accurately determine the first and second offsets by utilizing known parameters in the quasi-continuous current loop control system. The implementation logic of this embodiment is simple and efficient, which can further improve the accuracy and efficiency of electrical angle compensation, and is beneficial for improving the control accuracy and response speed of the quasi-continuous current loop.

[0045] On the other hand, the Park transform and the IPark transform are designed for different signals. For example... Figure 1 As shown, the Park transform is applied to the sampled current signal. The IPark transform is applied to the current controller (such as...). Figure 1 The voltage signal output by the proportional-integral controller (PI controller) in the circuit. Therefore, to achieve more accurate electrical angle compensation, the characteristics of the target signal mentioned above can be considered, and further offset determination schemes can be given. For example, the Park transform is for the sampled current signal, and the offset caused by current sampling can be further considered. In addition, the IPark transform is for the voltage signal obtained after processing the current signal, and the time required for this processing can be further considered.

[0046] Based on the above, this embodiment also provides a further implementation scheme: the compensation electrical angle includes a first electrical angle and a second electrical angle. The first electrical angle is used for electrical angle compensation of the Park transform, and the second electrical angle is used for electrical angle compensation of the inverse Park transform.

[0047] Step S22: Determine the compensation electrical angle based on the first offset and the second offset, specifically including: S221: Use the current sampling delay time as the third offset.

[0048] S222: Determine the first electrical angle based on the first offset, the second offset, and the third offset.

[0049] Furthermore, the process of determining the first electrical angle can be expressed by the following first formula: ; In the formula, Δ θ park1 Indicates the first electrical angle; T 4 represents the equivalent delay time of current sampling, which is also the third offset mentioned above; N cur1p T 2 represents the first offset; where,N cur1p This indicates the number of current loop calculation cycles elapsed since the position update time; T 2 indicates the duration of the current loop calculation period.

[0050] S223: Determine the loading delay duration and the activation delay duration required for the voltage to take effect, and determine the fourth offset based on the sum of the loading delay duration and the activation delay duration.

[0051] S224: Determine the second electrical angle based on the first offset, the second offset, and the fourth offset.

[0052] Furthermore, the process of determining the second electrical angle can be expressed by the following second formula: ; In the formula, Δ θ ipark Indicates the second electrical angle; T 6 +T 7 represents the fourth offset mentioned above; where, T 6 indicates the loading delay time; T 7 indicates the effective delay duration. In an optional embodiment, the loading delay duration is... T 6= T 2. Effective delay time T 7 = 0.5 T 2. Therefore, the second formula above can also be expressed as: ; It is readily apparent that steps S221 and S222 correspond to electrical angle compensation for the Park transform, while steps S223 and S224 correspond to electrical angle compensation for the IPark transform. There is no requirement for the order of these steps; they can be executed in parallel, and this embodiment does not impose any restrictions on this.

[0053] Furthermore, as described above, this embodiment, based on the first and second offsets, further incorporates the characteristics of different targets targeted by the Park transform and IPark transform, and introduces more comprehensive offset calculations. For the sampled current signal targeted by the Park transform, this embodiment incorporates the offset (third offset) between the occurrence of current sampling and the actual effective moment of the sampled value into the determination process of the compensation electrical angle; for the voltage signal obtained from current signal processing targeted by the IPark transform, this embodiment incorporates the offsets required for the two stages of voltage signal loading and effectiveness (fourth offset) into the determination process of the compensation electrical angle; thereby further improving the accuracy of determining the compensation electrical angle, which is beneficial to further improving the control accuracy of the current loop.

[0054] It should also be noted that,Figure 5 The timing shown is only for one possible scenario. The angle compensation method provided in this application can be applied to situations where the position update frequency is lower than, equal to, or higher than the PWM frequency, and the corresponding timing is as follows: Figure 6 As shown.

[0055] In summary, the angle compensation method provided in this application ensures the accuracy of the electrical angle compensation value during carrier frequency switching by controlling the quasi-continuous current loop calculation to synchronize with the carrier. Through precise timing control, this module guarantees the synchronous execution of current loop calculation, angle compensation, and PWM signals, ensuring accurate electrical angle compensation even during carrier adjustment. Furthermore, this method provides a scheme for dynamically updating the electrical angle compensation value. The electrical angle compensation value can be dynamically adjusted based on the operational characteristics of the quasi-continuous current loop. The scheme considers the different timing sequences of continuous sampling and center point sampling, calculating the compensation value separately to ensure that the feedback signal from current sampling can accurately compensate for electrical angle errors. The real-time calculation mechanism enables the electrical angle compensation to continuously provide accurate angle compensation values, improving the stability and responsiveness of the quasi-continuous current loop control system.

[0056] On the other hand, in quasi-continuous current loop control systems, while continuous sampling strategies can significantly improve the system's response speed and dynamic performance, the large current ripple in the current feedback signal caused by continuous sampling affects the stability and accuracy of the current loop. To address the problem of large feedback current ripple, this application also provides an optional embodiment. For example... Figure 7 As shown, the quasi-continuous current loop control system includes a dual feedback current loop and a current controller. The above method also includes: S31: Sample the continuous current signal through the first current sampling link in the dual feedback current loop.

[0057] Among them, such as Figure 7 As shown, the first current sampling stage in the dual feedback current loop (corresponding to...) Figure 7 The continuous current signal obtained by sampling in the current sampling is used as the feedback input of the proportional element in the current controller.

[0058] S32: The center point current is sampled through the second current sampling loop in the dual feedback current loop; the center point current is used as the feedback input for the integral loop in the current controller.

[0059] Among them, such as Figure 7 As shown, the second current sampling stage in the dual feedback current loop (corresponding to...) Figure 7 The center point current sampled in current sampling 2) is used as the feedback input for the integral element in the current controller of the quasi-continuous current loop control system. Furthermore, the decimation rate of the first current sampling element is less than that of the second current sampling element.

[0060] This embodiment employs dual-channel current sampling. One current sampling channel is responsible for continuously and in real-time acquiring the current signal, serving as the first current sampling stage. The decimation rate of the first current sampling stage is set relatively low to reduce sampling delay. For example... Figure 7 As shown, the feedback current, after Clark and Park transformations, yields DQ-axis current feedback 1, used for the proportional loop calculation of the current controller to meet the system's requirements for high bandwidth and fast response. The sampled value of the other current sample is latched after the center point and used as the feedback input for the integral loop. Integration is performed using the center point current, forming the second current sampling loop. The decimation rate of the second current sampling loop can be set relatively high to effectively reduce current fluctuations and deviations in steady state.

[0061] Furthermore, this embodiment employs a dual-feedback current loop control structure with separate proportional and integral feedback, which can avoid current steady-state errors when driving high-power, low-inductance motors using a quasi-continuous current loop. However, it should be noted that in this embodiment, the current controller (D-axis, Q-axis) only needs to have proportional and integral components; it does not necessarily have to be a PI controller, but can also be a PIR (R: resonant control) controller or other controllers that include a PI component.

[0062] Furthermore, when the quasi-continuous current loop control system adopts a dual feedback current loop as described in the above embodiments, the first current sampling stage, which is also the current sampling stage using a continuous sampling strategy, corresponds to the Park transform and can achieve electrical angle compensation through the scheme given in the above embodiments. For the second current sampling stage in the previous embodiment, a center-point sampling scheme is used. Although the principle for determining the compensation electrical angle is the same as in the above embodiments, there may be some differences in the specific implementation. Therefore, for determining the compensation electrical angle of the second current sampling stage, this embodiment also provides an optional scheme. For any current loop calculation period, the above method further includes: S231: Determine the third electrical angle based on the time required from the position request time to the next PWM overflow point, the duration of the current half-carrier cycle, the number of current samplings in the second current sampling stage from the position update time to the current time, and the duration of the first half-carrier cycle of the current carrier cycle.

[0063] S232: Perform electrical angle compensation on the Parker transform corresponding to the second current sampling stage using the third electrical angle.

[0064] Further reference Figure 5 A represents the current sampling latching time of the second current sampling stage. The latching is triggered after the PWM (upper and lower) overflow point to obtain the fundamental frequency information of the current. T 1 represents the time from the position request moment to the PWM (upper or lower) overflow point;T 2 represents the duration from the PWM (upward and downward) overflow point to the current sampling latch time. Additionally, it should be noted that... Figure 5 The three sampling periods of the first current sampling stage shown are equal to the equivalent delay time of two current samples. T 4 is only one possible example and does not represent the sampling period of the first current sampling stage and the equivalent delay time of current sampling. T There is a specific multiple relationship between 4 and 4.

[0065] In addition, combined Figure 5 This embodiment also provides a further embodiment regarding the determination of the third electrical angle in step S231 above. Step S231 specifically includes: S2311: The difference between the time required from the position request time to the next PWM overflow point and the duration of the current half-carrier period is used as the first intermediate quantity.

[0066] S2312: If the timing of the current latching moment of the second current sampling link is before the position request moment within the current half-carrier period, then the product of the number of current samplings of the second current sampling link from the position update moment to the current moment and the duration of the first half-carrier period of the current carrier period is used as the second intermediate quantity; and the intermediate result is determined based on the sum of the first intermediate quantity and the second intermediate quantity.

[0067] S2313: If the timing of the current latching moment of the second current sampling link is after the position request moment within the current half-carrier period, the difference between the number of current samplings of the second current sampling link from the position update moment to the current moment and 1 is used as the third intermediate quantity; the product of the third intermediate quantity and the duration of the first half-carrier period of the current carrier period is used as the fourth intermediate quantity; and the intermediate result is determined based on the sum of the first intermediate quantity and the fourth intermediate quantity.

[0068] S2314: Determine the third electrical angle based on the product of the intermediate result and the rotor's rotational electrical angular frequency.

[0069] The above steps can also be expressed by the following third formula: ; In the formula, Δ θ park2 Indicates the third electrical angle; T s Indicates the duration of the current half-carrier period; N cur2up This indicates the number of current samples taken in the second current sampling stage from the position update time to the current time. T s_prevThis indicates the duration of the first half of the current carrier cycle; flag represents the timing flag; within the current half-carrier cycle, if the timing of the current latching moment of the second current sampling stage is before the position request moment, then flag=1; if the timing of the current latching moment of the second current sampling stage is after the position request moment, then flag=0.

[0070] Therefore, this embodiment also provides a dynamic compensation electrical angle determination scheme for the second current sampling stage mentioned above. This ensures that the feedback signals from both current sampling paths can accurately compensate for electrical angle errors. The real-time calculation mechanism enables the electrical angle compensation to continuously provide accurate angle compensation values, improving the stability and responsiveness of the quasi-continuous current loop control system.

[0071] In the above embodiments, an angle compensation method has been described in detail. This application also provides an embodiment corresponding to an angle compensation device. It should be noted that this application describes the embodiment of the device from two perspectives: one is based on the functional module, and the other is based on the hardware.

[0072] From the perspective of functional modules, such as Figure 8 As shown, this embodiment provides an angle compensation device, including: The timing control module 11 is used to synchronize the count values ​​of the current loop calculation counter and the PWM carrier counter when the carrier frequency is switched; wherein, the PWM carrier counter is a counter used to determine the carrier period; the current loop calculation counter is a counter used to determine the current loop calculation period; the edges of the current loop calculation counter and the PWM carrier counter are aligned.

[0073] The offset determination module 12 is used to calculate the offset between the current time and the position update time as the first offset for any current loop calculation cycle; and to determine the offset between the position update time and the position request time as the second offset.

[0074] The electrical angle compensation module 13 is used to determine the compensation electrical angle based on the first offset and the second offset, and to perform electrical angle compensation on the Parker transform and the inverse Parker transform through the compensation electrical angle.

[0075] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0076] Figure 9 A structural diagram of an electronic device provided in another embodiment of this application, such as... Figure 9As shown, an electronic device includes: a memory 20 for storing a computer program; and a processor 21 for executing the computer program to implement the steps of an angle compensation method as described in the above embodiment. The electronic device provided in this embodiment may include, but is not limited to, a mobile terminal, a personal computer, a workstation, etc.

[0077] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0078] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, is capable of implementing the relevant steps of an angle compensation method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, an angle compensation method.

[0079] In some embodiments, an electronic device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0080] Those skilled in the art will understand thatFigure 9 The structure shown does not constitute a limitation on an electronic device and may include more or fewer components than shown.

[0081] An electronic device provided in this application includes a memory and a processor. When the processor executes a program stored in the memory, it can implement the following method: an angle compensation method.

[0082] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0083] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0084] The foregoing has provided a detailed description of an angle compensation method, apparatus, electronic device, and storage medium provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

[0085] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. An angle compensation method, characterized in that, Applications include quasi-continuous current loop control systems, including: When the carrier frequency is switched, the count values ​​of the current loop calculation counter and the PWM carrier counter are synchronized; wherein, the PWM carrier counter is a counter used to determine the carrier period; and the current loop calculation counter is a counter used to determine the current loop calculation period. For any current loop calculation cycle, the offset between the current time and the position update time is determined as the first offset; the offset between the position update time and the position request time is determined as the second offset. The compensation electrical angle is determined based on the first offset and the second offset, and the Parker transform and the inverse Parker transform are compensated for electrical angle using the compensation electrical angle.

2. The angle compensation method according to claim 1, characterized in that, Determining the offset between the current time and the location update time as the first offset includes: The first offset is determined by the product of the number of current loop calculation cycles elapsed after the position update time and the duration of the current loop calculation cycle. Determining the offset between the location update time and the location request time as the second offset includes: The second offset is determined based on the encoder communication duration.

3. The angle compensation method according to claim 1, characterized in that, The compensation electrical angle includes: a first electrical angle and a second electrical angle; wherein, the first electrical angle is used to compensate the Parker transform for electrical angle, and the second electrical angle is used to compensate the inverse Parker transform for electrical angle. The step of determining the compensation electrical angle based on the first offset and the second offset includes: Use the current sampling delay time as the third offset; The first electrical angle is determined based on the first offset, the second offset, and the third offset; Determine the loading delay time and the activation delay time required for the voltage to take effect, and determine the fourth offset based on the sum of the loading delay time and the activation delay time; The second electrical angle is determined based on the first offset, the second offset, and the fourth offset.

4. The angle compensation method according to claim 3, characterized in that, Determining the first electrical angle based on the first offset, the second offset, and the third offset includes: The first electrical angle is determined by the first formula; The first formula is: ; Δ θ park1 Indicates the first electrical angle; T 5 represents the second offset; T 4 represents the third offset; N cur1p T 2 represents the first offset; where, N cur1p This indicates the number of current loop calculation cycles elapsed since the position update time; T 2 indicates the duration of the current loop calculation period; ω e Indicates the electrical angular frequency of the rotor rotation; Determining the second electrical angle based on the first offset, the second offset, and the fourth offset includes: The second electrical angle is determined by the second formula; The second formula is: ; Δ θ ipark Indicates the second electrical angle; T 6 +T 7 represents the fourth offset; where, T 6 indicates the loading delay duration; T 7 indicates the effective delay time.

5. The angle compensation method according to any one of claims 1 to 4, characterized in that, The quasi-continuous current loop control system includes: a dual feedback current loop and a current controller; the method further includes: A continuous current signal is sampled through the first current sampling stage in the dual feedback current loop; the continuous current signal is used as the feedback input of the proportional stage in the current controller. The center point current is sampled through the second current sampling stage in the dual feedback current loop; the center point current is used as the feedback input for the integral stage in the current controller. The sampling rate of the first current sampling stage is less than that of the second current sampling stage.

6. The angle compensation method according to claim 5, characterized in that, For calculating the period of any current loop, the method also includes: The third electrical angle is determined based on the time required from the position request time to the next PWM overflow point, the duration of the current half-carrier cycle, the number of current samples taken in the second current sampling stage from the position update time to the current time, and the duration of the first half-carrier cycle of the current carrier cycle. The Parker transform corresponding to the second current sampling stage is compensated by the third electrical angle.

7. The angle compensation method according to claim 6, characterized in that, The step of determining the third electrical angle based on the time required from the position request time to the next PWM overflow point, the duration of the current half-carrier period, the number of current samples taken in the second current sampling stage from the position update time to the current time, and the duration of the first half-carrier period of the current carrier period includes: The difference between the time required from the location request time to the next PWM overflow point and the duration of the current half-carrier period is used as the first intermediate quantity; If the timing of the current latching moment of the second current sampling stage is before the position request moment within the current half-carrier period, then the product of the number of current samplings of the second current sampling stage from the position update moment to the current moment and the duration of the first half-carrier period of the current carrier period is used as the second intermediate quantity; and the intermediate result is determined based on the sum of the first intermediate quantity and the second intermediate quantity. If the timing of the current latching moment of the second current sampling stage is after the position request moment within the current half-carrier period, then the difference between the number of current samples of the second current sampling stage from the position update moment to the current moment and 1 is used as the third intermediate quantity; the product of the third intermediate quantity and the duration of the first half-carrier period of the current carrier period is used as the fourth intermediate quantity; and the intermediate result is determined based on the sum of the first intermediate quantity and the fourth intermediate quantity. The third electrical angle is determined by the product of the intermediate result and the rotor's rotational electrical angular frequency.

8. An angle compensation device, characterized in that, Applications include quasi-continuous current loop control systems, including: A timing control module is used to synchronize the count values ​​of the current loop calculation counter and the PWM carrier counter when the carrier frequency is switched; wherein, the PWM carrier counter is a counter used to determine the carrier period; the current loop calculation counter is a counter used to determine the current loop calculation period; the edges of the current loop calculation counter and the PWM carrier counter are aligned. The offset determination module is used to determine, for any current loop calculation cycle, the offset between the current time and the position update time as the first offset; and to determine the offset between the position update time and the position request time as the second offset. The electrical angle compensation module is used to determine the compensation electrical angle based on the first offset and the second offset, and to perform electrical angle compensation on the Parker transform and the inverse Parker transform using the compensation electrical angle.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the angle compensation method as described in any one of claims 1 to 7 when executing the computer program.

10. 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 steps of the angle compensation method as described in any one of claims 1 to 7.