Methods, systems, devices, and media for svpwm computation and dead-time compensation for motor drives

CN122993537APending Publication Date: 2026-10-27GENERAL TECH GRP MASCH TOOL ENG RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611255205.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-10-27

AI Technical Summary

Benefits of technology

[0017]通过上述技术方案,通过将SVPWM波形生成与死区补偿逻辑剥离至FPGA中由硬件逻辑并行执行,克服了传统MCU/DSP依赖串行中断处理所固有的采样延迟和计算滞后问题,降低了电流环传输延迟,能够应对高频开关频率下的实时补偿需求,抑制了输出电流波形畸变,提升了电流环带宽与系统动态响应性能;同时,由于MCU/DSP卸除了繁重的SVPWM和死区补偿计算任务,其释放的算力可用于更复杂的前馈、辨识或振动抑制算法,实现系统整体性能的协同优化。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122993537A_ABST
    Figure CN122993537A_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a kind of for motor drive SVPWM calculation and dead time compensation method, system, equipment and medium, belong to motor drive control field.It includes: receiving microcontroller issued d-axis, q-axis equivalent control voltage instruction, bus voltage measurement value and rotor angle;With bus voltage and PWM cycle time, calculate the first and second voltage vector action time in each control cycle;According to the difference of first and second voltage vector action time, calculate the first and second voltage vector action time base compensation, according to dead time, compensation and dead time compensation coefficient, carry out dead zone feedforward compensation calculation respectively;According to the first and second voltage vector action time after compensation, obtain the duty cycle output time of U-phase, V-phase, W-phase power switch tube driving signal.Through FPGA hardware parallel execution feedforward dead zone compensation, low delay, high-precision voltage loss compensation is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of motor drive control technology, and more specifically to a method, system, device, and medium for SVPWM calculation and dead time compensation for motor drives. Background Technology

[0002] When a voltage-source inverter (such as a three-phase full-bridge inverter) drives a motor, in order to prevent the two power switches (such as IGBTs or MOSFETs) on the same bridge arm from shooting short-circuiting due to switching delay, a dead time period must be set in the drive signal to turn both switches off. However, the introduction of dead time will cause a loss in the voltage vector of the SVPWM output, resulting in a deviation between the actual output voltage and the ideal voltage command, which in turn leads to distortion of the output current waveform.

[0003] Existing dead-time compensation techniques primarily involve directly increasing or decreasing the effective pulse width based on the current direction within each PWM cycle. This method is typically implemented by a microcontroller (MCU / DSP) through interrupt processing. However, due to its serial processing architecture, it suffers from significant current sampling and calculation delays, resulting in poor real-time performance. Furthermore, it exhibits inaccurate current polarity determination near the current zero-crossing point, leading to poor compensation effects, distortion of the output current waveform, and difficulty in handling high frequencies, such as above 20kHz and high switching frequencies. Summary of the Invention

[0004] The purpose of this invention is to provide a method, system, device, and medium for SVPWM calculation and dead time compensation for motor drive. By performing feedforward dead time compensation in parallel through FPGA hardware, the current sampling delay and zero-crossing direction misjudgment are reduced, achieving low-latency and high-precision voltage loss compensation, thereby improving the sinusoidal nature of the output current waveform and enhancing the dynamic response performance of the system.

[0005] To achieve the above objectives, embodiments of the present invention provide a method for SVPWM calculation and dead-time compensation for motor driving, applied to a programmable gate array, comprising: Receive the d-axis equivalent control voltage command, q-axis equivalent control voltage command, and rotor angle issued by the microcontroller; Based on the d-axis equivalent control voltage command, q-axis equivalent control voltage command, bus voltage, and PWM cycle time, the first voltage vector action time and the second voltage vector action time within each control cycle are calculated using the space vector pulse width modulation algorithm. Based on the difference between the action time of the first voltage vector and the action time of the second voltage vector, calculate the basic compensation amount for the action time of the first voltage vector and the basic compensation amount for the action time of the second voltage vector. Configure the dead time according to the power level of the target motor and configure the dead time compensation coefficient according to the operating conditions of the target motor. Based on the basic compensation amount of the first voltage vector action time, the basic compensation amount of the second voltage vector action time, the dead time and the dead time compensation coefficient, dead time feedforward compensation calculations are performed on the first voltage vector action time and the second voltage vector action time respectively to obtain the compensated first voltage vector action time and the compensated second voltage vector action time. Based on the compensated first voltage vector action time and the compensated second voltage vector action time, the duty cycle output time of the drive signals for the U-phase, V-phase, and W-phase power switches is obtained to drive the power switches of the three-phase full-bridge inverter.

[0006] Optionally, based on the d-axis equivalent control voltage command, the q-axis equivalent control voltage command, the bus voltage, and the PWM cycle time, the first voltage vector action time and the second voltage vector action time within each control cycle are calculated using a space vector pulse width modulation algorithm, including: Based on the d-axis equivalent control voltage command, the q-axis equivalent control voltage command, and the rotor angle, the α-axis equivalent duty cycle output time and the β-axis equivalent duty cycle output time are calculated through coordinate transformation. Based on the numerical relationship between the equivalent duty cycle output time of the α-axis and the equivalent duty cycle output time of the β-axis, the sector in which the command vector is located in the space vector hexagon is determined. Based on the two adjacent effective voltage vectors corresponding to the sector, and using the α-axis equivalent duty cycle output time, β-axis equivalent duty cycle output time, and PWM cycle time, the action time of the first voltage vector and the action time of the second voltage vector are calculated.

[0007] Optionally, based on the difference between the first voltage vector's duration of action and the second voltage vector's duration of action, a basic compensation amount for the first voltage vector's duration of action and a basic compensation amount for the second voltage vector's duration of action are calculated, including: If the difference between the action time of the first voltage vector and the action time of the second voltage vector is greater than the preset transition difference time, it is determined whether the action time of the first voltage vector is greater than the action time of the second voltage vector. If so, dead time compensation is performed only on the action time of the first voltage vector; otherwise, dead time compensation is performed only on the action time of the second voltage vector. When the difference between the action time of the first voltage vector and the action time of the second voltage vector is not greater than the preset transition difference time, the basic compensation amount of the action time of the first voltage vector and the basic compensation amount of the action time of the second voltage vector are calculated according to the difference between the action time of the first voltage vector and the action time of the second voltage vector and the preset ratio of the preset transition difference time.

[0008] Optionally, the dead time can be configured according to the power level of the target motor and the dead time compensation coefficient can be configured according to the operating conditions of the target motor, including: When the target motor is a preset high-power level, a first dead time is configured accordingly; wherein, the first dead time serves as a reference time in the dead time compensation calculation, participating in the compensation and correction calculation of the first voltage vector action time and the second voltage vector action time, and serves as the dead time interval of the PWM modulation output, used to configure the switching delay of the upper and lower transistors of the power switch drive signal. When the target motor is a preset low power level, a second dead time that is less than the first dead time is configured accordingly; wherein, the second dead time is used as both the reference time in the compensation calculation and the dead time configuration time of the PWM output, so as to reduce the current waveform distortion and torque pulsation caused by the dead time effect while ensuring the safe commutation of the power switching tube. The total harmonic distortion rate of the current waveform is used as the setting evaluation index for the compensation coefficient. Starting with the default value used in the initial debugging, the compensation coefficient is gradually increased step by step using an online debugging tool, and several PWM cycles are maintained after each step adjustment. After the current waveform of the target motor stabilizes, the total harmonic distortion rate of the current waveform is read and recorded. When the compensation coefficient changes in an increasing direction from the default value, if the total harmonic distortion rate exhibits a U-shaped change pattern of first decreasing and then increasing, then the compensation coefficient corresponding to the lowest point of the total harmonic distortion rate is taken as the optimal compensation coefficient of the target motor under the current operating conditions.

[0009] Optionally, the duration of the first voltage vector after compensation and the duration of the second voltage vector after compensation are calculated according to the following formulas: when At that time, the duration of the first voltage vector after compensation is The second voltage vector has no compensation for its duration of action; when At that time, the first voltage vector's duration of action is uncompensated, and the compensated duration of the second voltage vector's duration of action is... ; Otherwise, the compensated durations of the first and second voltage vectors are calculated according to the following formulas:

[0010]

[0011] In the formula, The duration of the first voltage vector's action. The duration of the second voltage vector's action. The preset transition difference time, This is the dead time compensation coefficient. This refers to the dead zone time.

[0012] Optionally, the microcontroller is responsible for computational tasks in the position loop, velocity loop, and current loop, excluding space vector pulse width modulation waveform generation and dead-zone compensation, while the programmable gate array is responsible for hardware-level parallel computation of space vector pulse width modulation waveform generation and dead-zone compensation.

[0013] Secondly, the present invention also provides a system for SVPWM calculation and dead-time compensation for motor drive, comprising: The microcontroller contains: The speed loop PID control module is used to perform PID calculations based on the speed command and feedback speed, and generate and output the d-axis equivalent control voltage command, the q-axis equivalent control voltage command, and the rotor angle. The parameter configuration module is used to configure the dead time compensation coefficient and send it to the programmable gate array; Programmable gate array, which contains: The SVPWM module receives the d-axis equivalent control voltage command and the q-axis equivalent control voltage command, the rotor angle, the compensation coefficient bus voltage, the PWM cycle time, and the dead time. It transforms the d-axis and q-axis equivalent control voltage commands to obtain the α-axis equivalent duty cycle output time and the β-axis equivalent duty cycle output time. Based on the α-axis and β-axis equivalent duty cycle output times, it determines the sector where the command vector is located and calculates the first and second voltage vector action times. Based on the difference between the first and second voltage vector action times, it calculates the basic compensation amount for the first and second voltage vector action times. It configures the dead time according to the target motor's power level and the dead time compensation coefficient according to the target motor's operating conditions. Based on the basic compensation amount for the first and second voltage vector action times, the dead time, and the dead time compensation coefficient, it performs dead-time feedforward compensation calculations on the first and second voltage vector action times to obtain the compensated first and second voltage vector action times. The PWM module is used to generate six PWM control signals based on the duty cycle output time to drive the power switching transistors of the three-phase full-bridge inverter.

[0014] Optionally, the programmable gate array implements space vector pulse width modulation waveform generation and dead-zone compensation calculation in parallel using hardware logic circuits without software interrupt processing.

[0015] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described method for SVPWM calculation and dead-time compensation for motor drive.

[0016] Fourthly, the present invention also provides a storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method for calculating SVPWM and compensating dead time for motor drive.

[0017] By using the above technical solution, the SVPWM waveform generation and dead-time compensation logic are decoupled into the FPGA and executed in parallel by hardware logic. This overcomes the sampling delay and computational lag inherent in traditional MCU / DSP relying on serial interrupt processing, reduces current loop transmission delay, can meet the real-time compensation requirements at high-frequency switching frequencies, suppresses output current waveform distortion, and improves current loop bandwidth and system dynamic response performance. At the same time, since the MCU / DSP is relieved of the heavy SVPWM and dead-time compensation calculation tasks, the freed computing power can be used for more complex feedforward, identification, or vibration suppression algorithms, achieving synergistic optimization of the overall system performance.

[0018] Other features and advantages of the embodiments of the present invention will be described in detail in the following detailed description section. Attached Figure Description

[0019] The accompanying drawings are provided to further illustrate embodiments of the present invention and form part of the specification. They are used together with the following detailed description to explain the embodiments of the present invention, but do not constitute a limitation thereof. In the drawings: Figure 1 This is a schematic diagram illustrating the loss in voltage vector application time caused by dead time, provided by an embodiment of the present invention. Figure 2 This is a flowchart of a method for calculating SVPWM and compensating dead time for motor drive provided by an embodiment of the present invention; Figure 3 This is a block diagram of SVPWM implementation for dead-time compensation provided in an embodiment of the present invention; Figure 4 This is a three-phase current waveform without dead-zone compensation provided in an embodiment of the present invention; Figure 5 This is a three-phase current waveform after dead-zone compensation provided in an embodiment of the present invention; Figure 6 This is a structural diagram of a system for SVPWM calculation and dead time compensation for motor drive provided by an embodiment of the present invention; Figure 7This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0020] Various embodiments of this disclosure will be described more fully in the following detailed description. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.

[0021] In the following, the terms “comprising” or “may include”, which may be used in various embodiments of this disclosure, indicate the presence of the disclosed functions or operations and do not limit the addition of one or more functions or operations. Furthermore, as used in various embodiments of this disclosure, the terms “comprising,” “having,” and their cognates are intended only to indicate a specific feature, number, step, operation, or combination of the foregoing and should not be construed as primarily excluding the presence of one or more other features, numbers, steps, operations, or combinations of the foregoing, or the possibility of adding one or more features, numbers, steps, operations, or combinations of the foregoing.

[0022] In various embodiments of this disclosure, the expression "or" or "at least one of A and / or B" includes any combination or all combinations of the words listed simultaneously. For example, the expression "A or B" or "at least one of A and / or B" may include A, may include B, or may include both A and B.

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

[0024] like Figure 1 As shown, when driving power switching transistors with SVPWM, a dead time needs to be added when the control signals of the upper and lower transistors change to prevent simultaneous conduction. Up, Vp, and Wp are the PWM control signals for the upper bridge arms of phases U, V, and W, respectively, and Un, Vn, and Wn are the PWM control signals for the lower bridge arms of phases U, V, and W, respectively. T d Let T1 be the theoretical duration of voltage vector V1, T2 be the theoretical duration of voltage vector V2, and T1' and T2' be the actual durations of voltage vectors V1 and V2, respectively. Due to the dead zone T... dThe reason for this is that the actual application time of the voltage vectors V1 and V2 is lost, and the actual application time of the output vector T1 / T2 is reduced to T1' / T2' due to the dead time, resulting in current deviation and poor sinusoidal performance during actual control. This application performs dead-time feedforward compensation on the application times T1 and T2 during the calculation process to compensate for the voltage vector loss caused by the dead time.

[0025] Its core includes the following technical solutions: I. Current Loop Decomposition Architecture: The traditional three-loop control chain, implemented by a single MCU / DSP, is broken down into separate loops: the position loop, speed loop, and part of the current loop are still handled by the MCU / DSP software, while the SVPWM waveform generation and dead-time compensation logic, which have the highest real-time requirements, are offloaded to the FPGA and implemented in parallel by hardware logic circuits. In each current loop cycle, the DSP only needs to process the V calculated by the speed loop. d / V q Commands and rotor angle θ are sent to the FPGA, where dead-time compensation calculations, vector time calculations, and PWM generation are performed directly. Meanwhile, the MCU / DSP, relieved of the burden of SVPWM and dead-time compensation calculations, can dedicate its computing power to more complex feedforward, identification, or vibration suppression algorithms, further improving overall system performance and achieving a complementary advantage between the complexity of MCU / DSP algorithms and the real-time processing capabilities of the FPGA.

[0026] II. Ultra-low latency dead-time compensation and SVPWM generation based on FPGA hardware level: FPGA receives V from MCU / DSP d / V q Following the voltage command, without any software interruption, the entire SVPWM sector determination and adjacent vector action time calculation are completed in parallel in hardware, directly outputting 6 PWM signals. Simultaneously, dead-time compensation logic is embedded in the SVPWM calculation path, eliminating the need for current detection. A feedforward approach is used to automatically adjust the dead-time insertion time of the complementary switching signals in each PWM cycle, significantly reducing the current loop transmission delay and improving current loop bandwidth and system dynamic performance.

[0027] For detailed implementation steps, please refer to [link / reference]. Figure 2 The diagram shown is a flowchart of a method for calculating SVPWM and compensating for dead time in a specific embodiment of a motor drive, including the following execution steps: Step 200: Receive the d-axis equivalent control voltage command, q-axis equivalent control voltage command, and rotor angle issued by the microcontroller.

[0028] Specifically, within each PWM cycle, the MCU / DSP calculates and outputs the q-axis current command based on the speed loop PID controller. After adjustment by the current loop PI controller, it generates the d-axis equivalent control voltage command Vd and the q-axis equivalent control voltage command Vq. The MCU / DSP acquires the rotor position through the encoder interface and calculates the rotor electrical angle θ. Vd, Vq, and θ are then sent to the FPGA via a parallel bus or SPI interface. Upon receiving this data, the FPGA directly latches it into its internal registers, and the hardware logic immediately triggers the subsequent SVPWM calculation chain without waiting for any software interrupt response. This ensures that the end-to-end delay from voltage command update to PWM output is limited only by the FPGA hardware propagation delay and the update boundary of the PWM cycle itself.

[0029] Step 201: Based on the d-axis equivalent control voltage command, q-axis equivalent control voltage command, bus voltage, and PWM cycle time, calculate the first voltage vector action time and the second voltage vector action time within each control cycle using the space vector pulse width modulation algorithm.

[0030] Specifically, when executing step 201, the following steps can be performed: S2010: Based on the d-axis equivalent control voltage command, the q-axis equivalent control voltage command, and the rotor angle, the α-axis equivalent duty cycle output time and the β-axis equivalent duty cycle output time are calculated through coordinate transformation.

[0031] Specifically, the equivalent duty cycle output time of the α-axis and the equivalent duty cycle output time of the β-axis are calculated using the following formulas through coordinate transformation:

[0032] In the formula, V d V represents the equivalent control voltage command in the d direction. q This represents the equivalent control voltage command in the q direction, θ represents the rotor angle, and V bus T represents the bus voltage. s T represents the PWM update cycle time. α T represents the equivalent duty cycle output time in the α direction. β This represents the equivalent duty cycle output time in the β direction.

[0033] S2011: Based on the numerical relationship between the equivalent duty cycle output time of the α-axis and the equivalent duty cycle output time of the β-axis, determine the sector in the space vector hexagon.

[0034] Specifically, the sector in which the instruction vector is located in the space vector hexagon is determined according to the following formula and Table 1:

[0035]

[0036] In the formula, it is determined whether each term is greater than 0. If it is greater than 0, it means true (=1); if it is not greater than 0, it means false (=0).

[0037] Table 1 Sector Correspondence

[0038] S2012: Based on the two adjacent effective voltage vectors corresponding to the sector, and based on the α-axis equivalent duty cycle output time, β-axis equivalent duty cycle output time, and PWM cycle time, calculate the action time of the first voltage vector and the action time of the second voltage vector.

[0039] Specifically, when the instruction vector is located in sector 1, i.e., N="011":

[0040] When the instruction vector is located in sector 2, i.e., N="111":

[0041] When the instruction vector is located in sector 3, i.e., N="101":

[0042] When the instruction vector is located in sector 4, i.e., N="100":

[0043] When the instruction vector is located in sector 5, i.e., N = "000":

[0044] When the instruction vector is located in sector 6, i.e., N = "010":

[0045] When N is any other value: .

[0046] Step 202: Calculate the basic compensation amount for the first voltage vector's action time and the basic compensation amount for the second voltage vector's action time based on the difference between the first voltage vector's action time and the second voltage vector's action time.

[0047] Specifically, when the difference between the action time of the first voltage vector and the action time of the second voltage vector is greater than the preset transition difference time, it is determined whether the action time of the first voltage vector is greater than the action time of the second voltage vector. If so, dead time compensation is performed only on the action time of the first voltage vector; otherwise, dead time compensation is performed only on the action time of the second voltage vector.

[0048] When the difference between the action time of the first voltage vector and the action time of the second voltage vector is not greater than the preset transition difference time, the basic compensation amount of the action time of the first voltage vector and the basic compensation amount of the action time of the second voltage vector are calculated according to the difference between the action time of the first voltage vector and the action time of the second voltage vector and the preset ratio of the preset transition difference time.

[0049] Step 203: Configure the dead time according to the power level of the target motor and configure the dead time compensation coefficient according to the operating conditions of the target motor.

[0050] Specifically, when executing step 203, the following steps can be performed: S2030: When the target motor is a preset high-power level, a first dead time is configured accordingly.

[0051] The first dead time serves as a reference time in the dead time compensation calculation, participating in the compensation and correction calculation of the first voltage vector action time and the second voltage vector action time. On the other hand, it serves as the dead time interval of the PWM modulation output, used to configure the switching delay of the power switch drive signal between the upper and lower transistors.

[0052] S2031: When the target motor is a preset low-power level, a second dead time that is less than the first dead time is configured.

[0053] The second dead time serves as both the reference time in the compensation calculation and the dead time configuration time for the PWM output, in order to reduce the current waveform distortion and torque pulsation caused by the dead time effect while ensuring the safe commutation of the power switching transistor.

[0054] S2032: The setting evaluation index uses the total harmonic distortion rate of the current waveform as the compensation coefficient.

[0055] S2033: Starting from the default value used in the initial debugging, the compensation coefficient is gradually increased by the online debugging tool according to the preset step size, and after each step size adjustment, it is maintained for several PWM cycles. After the current waveform of the target motor stabilizes, the total harmonic distortion rate of the current waveform is read and recorded.

[0056] S2034: When the compensation coefficient changes in an increasing direction from the default value, if the total harmonic distortion rate shows a U-shaped change law of first decreasing and then increasing, then the compensation coefficient corresponding to the lowest point of the total harmonic distortion rate is taken as the optimal compensation coefficient of the target motor under the current operating conditions.

[0057] Step 204: Based on the basic compensation amount of the first voltage vector action time, the basic compensation amount of the second voltage vector action time, the dead time and the dead time compensation coefficient, perform dead-time feedforward compensation calculations on the first voltage vector action time and the second voltage vector action time respectively to obtain the compensated first voltage vector action time and the compensated second voltage vector action time.

[0058] Specifically, the duration of the first voltage vector after compensation and the duration of the second voltage vector after compensation are calculated according to the following formulas: when At that time, the duration of the first voltage vector after compensation is The second voltage vector has no compensation for its duration of action; when At that time, the first voltage vector's duration of action is uncompensated, and the compensated duration of the second voltage vector's duration of action is... ; Otherwise, the compensated durations of the first and second voltage vectors are calculated according to the following formulas:

[0059]

[0060] In the formula, The duration of the first voltage vector's action. The duration of the second voltage vector's action. The preset transition difference time, This is the dead time compensation coefficient. This refers to the dead zone time.

[0061] For details, please refer to Figure 3 As shown, when executing step 204, the following steps can be performed: using the dead time and dead time compensation coefficient as feedforward inputs, the first voltage vector action time and the second voltage vector action time are directly compensated incrementally in the SVPWM calculation path.

[0062] It should be understood that the dead time compensation coefficient is configured by the microcontroller and sent to the programmable gate array.

[0063] Step 205: Based on the compensated first voltage vector action time and second voltage vector action time, the duty cycle output time of the drive signals for the U-phase, V-phase, and W-phase power switches is obtained to drive the power switches of the three-phase full-bridge inverter.

[0064] In one specific implementation, it is detected whether the calculated duration of action exceeds the configured maximum modulation time per cycle, T. max <T sIf the modulation time exceeds the maximum, it will be scaled down proportionally.

[0065] {

[0066]

[0067] } else {

[0068]

[0069] }

[0070] According to the compensated T 1c T 2c The subsequent SVPWM calculations are then completed to obtain the duty cycle times of the drive signals for the three-phase power switches U, V, and W.

[0071] Zero vector action time:

[0072] When the instruction vector is located in sector 1, i.e., N="011":

[0073] When the instruction vector is located in sector 2, i.e., N="111":

[0074] When the instruction vector is located in sector 3, i.e., N="101":

[0075] When the instruction vector is located in sector 4, i.e., N="100":

[0076] When the instruction vector is located in sector 5, i.e., N="000":

[0077] When the instruction vector is located in sector 6, i.e., N="010":

[0078] When N is any other value: .

[0079] It should be noted that the microcontroller is responsible for the computational tasks in the position loop, velocity loop, and current loop, except for space vector pulse width modulation waveform generation and dead-time compensation, while the programmable gate array is responsible for the hardware-level parallel computation of space vector pulse width modulation waveform generation and dead-time compensation.

[0080] In this embodiment, a feedforward compensation method is adopted to avoid current waveform distortion caused by inaccurate current detection, fluctuations, and high computational latency. Parallel processing of compensation and SVPWM calculation using FPGA reduces the transmission delay of the current loop, improving current loop bandwidth and system dynamic performance. By decoupling the SVPWM waveform generation and dead-time compensation logic into the FPGA, the MCU / DSP can free up computing power for more complex feedforward, identification, or vibration suppression algorithms, achieving a complementary advantage between the complexity of MCU / DSP algorithms and the real-time processing capabilities of FPGA. The compensation coefficient K can be flexibly configured by the MCU / DSP, adapting to different motor models and dead-time settings, exhibiting good versatility and portability.

[0081] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0082] In one specific implementation, such as Figure 4 The image shows the three-phase current waveform without dead-time compensation; significant distortion is evident in the waveform. Figure 5 The figure shows the three-phase current waveform after dead-zone compensation using this application. The current waveform has good sinusoidal properties and the distortion is effectively suppressed.

[0083] like Figure 6 As shown, the following are embodiments of a system for SVPWM calculation and dead time compensation for motor drive provided by this disclosure. The system belongs to the same inventive concept as the methods for SVPWM calculation and dead time compensation for motor drive in the above embodiments. For details not described in detail in the embodiments of the system for SVPWM calculation and dead time compensation for motor drive, please refer to the embodiments of the methods for SVPWM calculation and dead time compensation for motor drive described above.

[0084] A system for SVPWM calculation and dead-time compensation for motor drive includes: The microcontroller contains: The speed loop PID control module is used to perform PID calculations based on the speed command and feedback speed, and generate and output the d-axis equivalent control voltage command, the q-axis equivalent control voltage command, and the rotor angle. The parameter configuration module is used to configure the dead time compensation coefficient and send it to the programmable gate array; Programmable gate array, which contains: The SVPWM module receives the d-axis equivalent control voltage command and the q-axis equivalent control voltage command, the rotor angle, the compensation coefficient bus voltage, the PWM period time, and the dead time. It transforms the d-axis and q-axis equivalent control voltage commands, combines them with the bus voltage and PWM period, to obtain the α-axis equivalent duty cycle output time and the β-axis equivalent duty cycle output time. Based on the α-axis and β-axis equivalent duty cycle output times, it determines the sector where the command vector is located and calculates the first voltage vector's action time and the second voltage vector's action time. Based on the first voltage vector... Calculate the basic compensation amount for the first voltage vector's action time and the basic compensation amount for the second voltage vector's action time using the difference between the time and the second voltage vector's action time; configure the dead time according to the target motor's power level and the dead time compensation coefficient according to the target motor's operating conditions; based on the basic compensation amount for the first voltage vector's action time, the basic compensation amount for the second voltage vector's action time, the dead time, and the dead time compensation coefficient, perform dead time feedforward compensation calculations on the first voltage vector's action time and the second voltage vector's action time respectively to obtain the compensated first voltage vector's action time and the compensated second voltage vector's action time. The PWM module is used to generate six PWM control signals based on the duty cycle output time to drive the power switching transistors of the three-phase full-bridge inverter.

[0085] The MCU / DSP is responsible for the speed loop PID calculation and parameter configuration, and will convert V... d V q The voltage command and rotor angle θ are sent to the FPGA. After receiving the above commands, the FPGA combines them with the bus voltage V. bus PWM cycle time T s Dead time T d (Including compensation coefficient K) and current feedback, SVPWM calculation and dead-time compensation are completed, and finally six PWM control signals Up / Un / Vp / Vn / Wp / Wn are output to drive the three-phase full-bridge inverter.

[0086] Figure 7 This is a schematic diagram of the hardware structure of an electronic device that implements various embodiments of the present invention.

[0087] The SVPWM calculation and dead-time compensation method for motor drives provided in this application can be applied to electronic devices. Those skilled in the art will understand that the electronic device structure involved in the embodiments of this invention does not constitute a limitation on the electronic device. An electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. In the embodiments of this invention, the electronic device includes, but is not limited to, laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of this application described and / or claimed herein.

[0088] Electronic devices may include processors, external memory interfaces, internal memory, universal serial bus (USB) interfaces, charging management modules, power management modules, batteries, wireless communication modules, audio modules, speakers, microphones, sensor modules, buttons, cameras, displays, and SIM card interfaces, etc.

[0089] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0090] A processor may include one or more processing units, such as: a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). Different processing units may be independent devices or integrated into one or more processors.

[0091] The processor can serve as the nerve center and command center of an electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to control the fetching and execution of instructions.

[0092] The processor may also include memory for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. This memory can store instructions or data that the processor has just used or that are used repeatedly. If the processor needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces processor latency, and thus improves system efficiency.

[0093] An external storage interface (ESI) can be used to connect external memory cards, such as microSD cards, to expand the storage capacity of electronic devices. The external memory card communicates with the processor through the ESI to perform data storage functions, such as saving music and video files on the external memory card.

[0094] Internal memory can be used to store computer executable program code, which includes instructions. The processor executes various functional applications and data processing of electronic devices by running the instructions stored in internal memory. Internal memory can include a program storage area and a data storage area. Internal memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0095] Wireless communication functionality in electronic devices can be achieved through antennas, wireless communication modules, modem processors, and baseband processors.

[0096] Wireless communication modules can provide solutions for wireless communication applications in electronic devices, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies.

[0097] Electronic devices can implement audio functions through audio modules, speakers, receivers, microphones, headphone jacks, and application processors.

[0098] Electronic devices can achieve shooting functions through ISPs, cameras, video codecs, GPUs, displays, and application processors.

[0099] Electronic devices can achieve display functions through GPUs, displays, and application processors.

[0100] A GPU is a microprocessor for image processing, connected to the display screen and application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. A processor may include one or more GPUs, which execute program instructions to generate or modify display information.

[0101] A display screen is used to display images, videos, etc. A display screen includes a display panel.

[0102] The storage medium provided in this application stores a program product capable of implementing SVPWM calculation and dead time compensation methods for motor drives.

[0103] The method for SVPWM calculation and dead time compensation for motor drive includes: receiving d-axis equivalent control voltage commands, q-axis equivalent control voltage commands, and rotor angles issued by the microcontroller; calculating the first voltage vector action time and the second voltage vector action time within each control cycle using a space vector pulse width modulation algorithm based on the d-axis equivalent control voltage commands, q-axis equivalent control voltage commands, bus voltage, and PWM cycle time; calculating the basic compensation amount for the first voltage vector action time and the second voltage vector action time based on the difference between the first voltage vector action time and the second voltage vector action time; and calculating the basic compensation amount for the first voltage vector action time based on the power level of the target motor. Configure the dead time and the dead time compensation coefficient according to the operating conditions of the target motor; based on the basic compensation amount of the first voltage vector action time, the basic compensation amount of the second voltage vector action time, the dead time and the dead time compensation coefficient, perform dead time feedforward compensation calculations on the first voltage vector action time and the second voltage vector action time respectively to obtain the compensated first voltage vector action time and the compensated second voltage vector action time; based on the compensated first voltage vector action time and the second voltage vector action time, obtain the duty cycle output time of the drive signals of the U-phase, V-phase and W-phase power switches to drive the power switches of the three-phase full-bridge inverter.

[0104] In some possible implementations, the subject matter of this disclosure, namely, the method and system for SVPWM calculation and dead-time compensation for motor drive, can be implemented as a program product comprising program code that, when run on a terminal device, causes the terminal device to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of this disclosure.

[0105] The storage medium disclosed herein may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.

[0106] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for SVPWM calculation and dead-time compensation for motor drives, characterized in that, Applications include: Receive the d-axis equivalent control voltage command, q-axis equivalent control voltage command, and rotor angle issued by the microcontroller; Based on the d-axis equivalent control voltage command, q-axis equivalent control voltage command, bus voltage, and PWM cycle time, the first voltage vector action time and the second voltage vector action time within each control cycle are calculated using the space vector pulse width modulation algorithm. Based on the difference between the action time of the first voltage vector and the action time of the second voltage vector, calculate the basic compensation amount for the action time of the first voltage vector and the basic compensation amount for the action time of the second voltage vector. Configure the dead time according to the power level of the target motor and configure the dead time compensation coefficient according to the operating conditions of the target motor. Based on the basic compensation amount of the first voltage vector action time, the basic compensation amount of the second voltage vector action time, the dead time and the dead time compensation coefficient, dead time feedforward compensation calculations are performed on the first voltage vector action time and the second voltage vector action time respectively to obtain the compensated first voltage vector action time and the compensated second voltage vector action time. Based on the compensated first voltage vector action time and second voltage vector action time, the duty cycle output time of the drive signals for the U-phase, V-phase, and W-phase power switches is obtained to drive the power switches of the three-phase full-bridge inverter.

2. The method for SVPWM calculation and dead-time compensation for motor drive according to claim 1, characterized in that, Based on the d-axis equivalent control voltage command, q-axis equivalent control voltage command, bus voltage, and PWM cycle time, the first voltage vector action time and the second voltage vector action time within each control cycle are calculated using a space vector pulse width modulation algorithm, including: Based on the d-axis equivalent control voltage command, the q-axis equivalent control voltage command, and the rotor angle, the α-axis equivalent duty cycle output time and the β-axis equivalent duty cycle output time are calculated through coordinate transformation. Based on the numerical relationship between the equivalent duty cycle output time of the α-axis and the equivalent duty cycle output time of the β-axis, the sector in which the command vector is located in the space vector hexagon is determined. Based on the two adjacent effective voltage vectors corresponding to the sector, and using the α-axis equivalent duty cycle output time, β-axis equivalent duty cycle output time, and PWM cycle time, the action time of the first voltage vector and the action time of the second voltage vector are calculated.

3. The method for SVPWM calculation and dead-time compensation for motor drive according to claim 2, characterized in that, Based on the difference between the first voltage vector's duration of action and the second voltage vector's duration of action, calculate the basic compensation amount for the first voltage vector's duration of action and the basic compensation amount for the second voltage vector's duration of action, including: If the difference between the action time of the first voltage vector and the action time of the second voltage vector is greater than the preset transition difference time, it is determined whether the action time of the first voltage vector is greater than the action time of the second voltage vector. If so, dead time compensation is performed only on the action time of the first voltage vector; otherwise, dead time compensation is performed only on the action time of the second voltage vector. When the difference between the action time of the first voltage vector and the action time of the second voltage vector is not greater than the preset transition difference time, the basic compensation amount of the action time of the first voltage vector and the basic compensation amount of the action time of the second voltage vector are calculated according to the difference between the action time of the first voltage vector and the action time of the second voltage vector and the preset ratio of the preset transition difference time.

4. The method for SVPWM calculation and dead-time compensation for motor drive according to claim 1, characterized in that, Configure the dead time according to the power level of the target motor and the dead time compensation coefficient according to the operating conditions of the target motor, including: When the target motor is a preset high-power level, a first dead time is configured accordingly; wherein, the first dead time serves as a reference time in the dead time compensation calculation, participating in the compensation and correction calculation of the first voltage vector action time and the second voltage vector action time, and serves as the dead time interval of the PWM modulation output, used to configure the switching delay of the upper and lower transistors of the power switch drive signal. When the target motor is a preset low power level, a second dead time that is less than the first dead time is configured accordingly; wherein, the second dead time is used as both the reference time in the compensation calculation and the dead time configuration time of the PWM output, so as to reduce the current waveform distortion and torque pulsation caused by the dead time effect while ensuring the safe commutation of the power switching tube. The total harmonic distortion rate of the current waveform is used as the setting evaluation index for the compensation coefficient. Starting with the default value used in the initial debugging, the compensation coefficient is gradually increased step by step using an online debugging tool, and several PWM cycles are maintained after each step adjustment. After the current waveform of the target motor stabilizes, the total harmonic distortion rate of the current waveform is read and recorded. When the compensation coefficient changes in an increasing direction from the default value, if the total harmonic distortion rate exhibits a U-shaped change pattern of first decreasing and then increasing, then the compensation coefficient corresponding to the lowest point of the total harmonic distortion rate is taken as the optimal compensation coefficient of the target motor under the current operating conditions.

5. The method for SVPWM calculation and dead-time compensation for motor drive according to claim 4, characterized in that, The duration of the first voltage vector after compensation and the duration of the second voltage vector after compensation are calculated using the following formulas: when At that time, the duration of the first voltage vector after compensation is The second voltage vector has no compensation for its duration of action; when At that time, the first voltage vector's duration of action is uncompensated, and the compensated duration of the second voltage vector's duration of action is... ; Otherwise, the compensated durations of the first and second voltage vectors are calculated according to the following formulas: In the formula, The duration of the first voltage vector's action. The duration of the second voltage vector's action. The preset transition difference time, This is the dead time compensation coefficient. This refers to the dead zone time.

6. The method for SVPWM calculation and dead-time compensation for motor drive according to claim 1, characterized in that, The microcontroller is responsible for computational tasks in the position loop, velocity loop, and current loop, excluding space vector pulse width modulation waveform generation and dead-zone compensation. The programmable gate array is responsible for hardware-level parallel computation of space vector pulse width modulation waveform generation and dead-zone compensation.

7. A system for SVPWM calculation and dead-time compensation for motor drive, characterized in that, include: The microcontroller contains: The speed loop PID control module is used to perform PID calculations based on the speed command and feedback speed, and generate and output the d-axis equivalent control voltage command, the q-axis equivalent control voltage command, and the rotor angle. The parameter configuration module is used to configure the dead time compensation coefficient and send it to the programmable gate array; Programmable gate array, which contains: The SVPWM module receives the d-axis equivalent control voltage command and the q-axis equivalent control voltage command, rotor angle, compensation coefficient, bus voltage, PWM cycle time, and dead time. It transforms the d-axis and q-axis equivalent control voltage commands to obtain the α-axis equivalent duty cycle output time and the β-axis equivalent duty cycle output time. Based on the α-axis and β-axis equivalent duty cycle output times, it determines the sector where the command vector is located and calculates the first and second voltage vector action times. Based on the difference between the first and second voltage vector action times, it calculates the basic compensation amount for the first and second voltage vector action times. It configures the dead time according to the target motor's power level and the dead time compensation coefficient according to the target motor's operating conditions. Based on the basic compensation amount for the first and second voltage vector action times, the dead time, and the dead time compensation coefficient, it performs dead-time feedforward compensation calculations on the first and second voltage vector action times to obtain the compensated first and second voltage vector action times. The PWM module is used to generate six PWM control signals based on the duty cycle output time to drive the power switching transistors of the three-phase full-bridge inverter.

8. The system for SVPWM calculation and dead-time compensation for motor drive according to claim 7, characterized in that, The programmable gate array implements space vector pulse width modulation waveform generation and dead zone compensation calculation in parallel using hardware logic circuits without software interrupt processing.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method for SVPWM calculation and dead time compensation for motor drive as described in any one of claims 1 to 6.

10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method for SVPWM calculation and dead time compensation for motor drive as described in any one of claims 1 to 6.