Motor current sampling method and device and electronic equipment

By configuring the number of channels of the analog-to-digital converter in the motor control system and adopting a vector phase shift strategy, the problem of failure of the second current sampling due to the short acting time of the effective voltage vector is solved, and the reliability and accuracy of the current sampling are improved.

CN119945234AInactive Publication Date: 2025-05-06ZHEJIANG UNIV

Patent Information

Application Number
CN202510421968.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2025-05-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the field of low-cost electrical transmission, when a microcontroller is used in a motor control system, the second current sampling is likely to fail due to the short acting time of the second effective voltage vector, resulting in limited reliability and accuracy of the motor control system.

Method used

By configuring the number of channels of the analog-to-digital converter, the number of channels used by the analog-to-digital converter is increased, thus canceling the interrupt after the first sampling, shortening the interval between the first sampling and the second sampling, and adopting a vector phase shift strategy to increase the effect time of the effective voltage vector in the first half of the cycle.

Benefits of technology

It improves the reliability and accuracy of current sampling, avoids the problem of failure of the second sampling due to the short effective voltage vector action time, and enhances the stability of the motor control system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119945234A_ABST
    Figure CN119945234A_ABST
Patent Text Reader

Abstract

The invention discloses a motor current sampling method and device and electronic equipment, and the method comprises the steps: providing a sampling resistor, and enabling the sampling resistor to be connected with a DC bus of a three-phase inverter in series; providing an operational amplifier, performing first phase current sampling on the sampling resistor at a first moment, and performing second phase current sampling on the sampling resistor at a second moment; the analog-to-digital converter at least comprises two analog-to-digital conversion channels and two independent sampling data storage registers, and the sampling result of the first phase current is stored in the first sampling data storage register through the first analog-to-digital conversion channel; storing a second phase current sampling result to a second sampling data storage register through a second analog-to-digital conversion channel; and performing single interruption in a control period of the three-phase inverter, and obtaining the value of the third phase current based on the sampling results of the first phase current and the second phase current. The accuracy of current sampling can be improved, and the reliability of a motor control system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motor control, and in particular to a motor current sampling method, device and electronic equipment. Background Art

[0002] In the field of low-cost electric transmission, in order to reduce costs, a single-chip microcomputer with only one built-in analog-to-digital converter is used in the motor control system. When sampling current, two interrupts are used to obtain the three-phase current value of the current control cycle. The system needs to enter two interrupts for data processing, so there is a minimum time interval between the two sampling processes. When the second effective voltage vector has a short action time, the second sampling is very likely to fail, resulting in the inability to reconstruct the three-phase current value of the motor, the motor cannot reach the control target, and the reliability of the motor control system cannot be guaranteed. Summary of the invention

[0003] In order to solve the deficiencies of the prior art, this application adopts the following technical solutions: In a first aspect, the present application provides a motor current sampling method, wherein the motor is driven by a three-phase inverter, and the method comprises: Providing a sampling resistor, wherein the sampling resistor is connected in series with a DC bus of the three-phase inverter; An operational amplifier is provided, wherein the operational amplifier is configured to: perform a first phase current sampling on the sampling resistor at a first moment, and perform a second phase current sampling on the sampling resistor at a second moment; An analog-to-digital converter is provided, the analog-to-digital converter comprising at least two analog-to-digital conversion channels and two independent sampling data storage registers, wherein the result of first phase current sampling is stored in the first sampling data storage register through the first analog-to-digital conversion channel, and the result of second phase current sampling is stored in the second sampling data storage register through the second analog-to-digital conversion channel; A single interruption is performed in one control cycle of the three-phase inverter, and a value of the third-phase current is obtained based on the sampling results of the first-phase current and the second-phase current.

[0004] In summary, the motor current sampling method provided by the present application, without increasing the hardware cost, increases the number of channels of the analog-to-digital converter by configuring the number of channels of the analog-to-digital converter, thereby canceling the interruption after the first sampling, shortening the interval time between the first sampling and the second sampling, solving the defect that the second sampling is prone to sampling failure when the second effective voltage vector action time is short, and improving the reliability and accuracy of current sampling.

[0005] Furthermore, the method further comprises: The first moment and the second moment are both determined by the sector where the reference voltage vector of the three-phase power synthesis is located and the duty cycle of the PWM modulation signal of each phase bridge arm; In response to the reference voltage vector being in sector 1 or sector 2, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 3 or sector 4, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 5 or sector 6, the first moment and the second moment are respectively expressed by the following formulas: ; In the formula, parameter T1 represents the conduction time of the lower switch tube of the first phase bridge arm in the first half cycle of a sector; parameter T2 represents the conduction time of the lower switch tube of the second phase bridge arm in the first half cycle of a sector; parameter T3 represents the conduction time of the lower switch tube of the third phase bridge arm in the first half cycle of a sector.

[0006] Furthermore, the method further comprises: Determine whether the deviation between any two parameters among parameters T1, T2, and T3 is less than a preset threshold; In response to the deviation between any two parameters among parameters T1, T2, and T3 being less than the preset threshold, a phase shift strategy is adopted to postpone the PWM pulse signal of the bridge arm of the phase with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm of the phase with the largest duty cycle by the preset time; The first moment and the second moment are calculated using the parameters T1, T2, and T3 after the phase shift strategy is executed.

[0007] Furthermore, the method further comprises: Inserting a dead zone during a PWM control cycle of the three-phase inverter; The preset time is positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching.

[0008] In a second aspect, the present application further provides a motor current sampling device, wherein the motor is driven by a three-phase inverter, and the motor current sampling device comprises: A sampling resistor, the sampling resistor is connected in series with a DC bus of the three-phase inverter; An operational amplifier, wherein the operational amplifier is configured to: perform a first phase current sampling on the sampling resistor at a first moment, and perform a second phase current sampling on the sampling resistor at a second moment; An analog-to-digital converter, the analog-to-digital converter comprising at least two analog-to-digital conversion channels and two independent sampling data storage registers, wherein the result of first phase current sampling is stored in the first sampling data storage register through the first analog-to-digital conversion channel, and the result of second phase current sampling is stored in the second sampling data storage register through the second analog-to-digital conversion channel; The interruption service module performs a single interruption in one control cycle of the three-phase inverter, and obtains the value of the third phase current based on the sampling results of the first phase current and the second phase current.

[0009] Furthermore, the motor current sampling device further includes a timer module, and the timer module is configured as follows: Receiving parameters T1, T2, T3, and determining the first moment and the second moment based on the parameters T1, T2, T3 and the sector where the reference voltage vector of the three-phase power synthesis is located; In response to the reference voltage vector being in sector 1 or sector 2, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 3 or sector 4, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 5 or sector 6, the first moment and the second moment are respectively expressed by the following formulas: ; In the formula, parameter T1 represents the conduction time of the lower switch tube of the first phase bridge arm in the first half cycle of a sector; parameter T2 represents the conduction time of the lower switch tube of the second phase bridge arm in the first half cycle of a sector; parameter T3 represents the conduction time of the lower switch tube of the third phase bridge arm in the first half cycle of a sector.

[0010] Further, the interrupt service module is further configured to: generate signal modulation parameters based on the values ​​of the three-phase currents by using the SVPWM modulation method, and generate PWM modulation signals of each phase bridge arm of the three-phase inverter by using the signal modulation parameters, wherein the signal modulation parameters include: the parameters T1, T2 and T3; The timer module is further configured to: determine whether the deviation between any two parameters among parameters T1, T2, and T3 is less than a preset threshold; In response to the deviation between any two parameters among parameters T1, T2, and T3 being less than the preset threshold, a phase shift strategy is adopted to postpone the PWM pulse signal of the bridge arm of the phase with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm of the phase with the largest duty cycle by the preset time; The first moment and the second moment are calculated using the parameters T1, T2, and T3 after the phase shift strategy is executed.

[0011] Further, the timer module includes a comparison value register; The comparison value register is configured to receive the parameters T1, T2, T3; In response to the timer module counting to Tn, the PWM pulse signal of the corresponding phase bridge arm outputs a high level; In response to the timer module counting to T-Tn, the PWM pulse signal of the corresponding phase bridge arm outputs a low level; If the deviation between any two parameters among the judgment parameters T1, T2, and T3 is less than the preset threshold, a phase shift strategy is adopted to postpone the PWM pulse signal of the bridge arm with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm with the largest duty cycle by the preset time; The leading and trailing edge times of the PWM pulse signal of the bridge arm with the smallest duty cycle are expressed by the following formula: Tfrontier = Tn + Tmin; T trailing edge = T-(Tn-Tmin); The leading and trailing edge times of the PWM pulse signal of the bridge arm with the largest duty cycle are expressed by the following formula: T frontier = Tn - Tmin; T trailing edge = T-(Tn+Tmin); In the formula, Tmin represents the preset time, T represents the cycle time, Tn represents the conduction time of the lower switch tube of the n-th phase bridge arm in the first half cycle of a sector, and n=1, 2, 3.

[0012] Further, the timer module further comprises a dead zone detector for inserting a dead zone during a PWM control cycle of the three-phase inverter; The preset time is positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching.

[0013] In a third aspect, the present application further provides an electronic device, comprising a motor, an inverter and a motor current sampling device as described in any one of the above items. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flowchart of the steps of a motor flow sampling method provided by an embodiment of the present application; Figure 2 A schematic diagram of a circuit connection between a sampling resistor and a three-phase inverter in a motor current sampling method provided by an embodiment of the present application; Figure 3A schematic diagram of sector division of an effective voltage vector in a motor current sampling method provided by an embodiment of the present application; Figure 4 It is a sampling timing diagram of the existing motor current sampling method in the first sector; Figure 5 A sampling timing diagram of a motor current sampling method in the first sector provided by an embodiment of the present application; Figure 6 An ideal timing diagram of a motor current sampling method provided by an embodiment of the present application under a normal output voltage vector; Figure 7 A current sampling timing diagram of a motor current sampling method provided by an embodiment of the present application when the output voltage vector is located at the sector junction or the output voltage vector amplitude is relatively small; Figure 8 A timing diagram of sampling the first sector after phase shifting of a motor current sampling method provided by an embodiment of the present application; Fig. 9 A schematic diagram of the composition of a motor current sampling device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0015] The present application will be described in detail below in conjunction with the specific implementation modes shown in the accompanying drawings, but these implementation modes do not limit the present application. Structural, methodological, or functional changes made by ordinary technicians in the field based on these implementation modes are included in the protection scope of the present application.

[0016] In order to solve the deficiencies of the prior art, the present application provides a motor current sampling method, wherein the motor is driven by a three-phase inverter, such as Figure 1 As shown, the method comprises the following steps: Step S11, providing a sampling resistor, wherein the sampling resistor is connected in series with a DC bus of a three-phase inverter; Step S12, providing an operational amplifier, wherein the operational amplifier is configured to: perform first-phase current sampling on the sampling resistor at a first moment, and perform second-phase current sampling on the sampling resistor at a second moment; Step S13, providing an analog-to-digital converter, the analog-to-digital converter comprising at least two analog-to-digital conversion channels and two independent sampling data storage registers, wherein the result of first phase current sampling is stored in the first sampling data storage register through the first analog-to-digital conversion channel, and the result of second phase current sampling is stored in the second sampling data storage register through the second analog-to-digital conversion channel; Step S14, performing a single interruption in one control cycle of the three-phase inverter, and obtaining a value of the third-phase current based on the sampling results of the first-phase current and the second-phase current.

[0017] like Figure 2As shown, the sampling resistor is connected in series with the DC bus of the three-phase inverter, and the sampling resistor samples the bus current. According to the correspondence between the phase current and the bus current under different working states of the six switch tubes of the three-phase inverter, the phase current of each phase is reconstructed. The correspondence between the phase current and the DC bus current is shown in Table 1 below, where 0 represents the conduction of the lower bridge arm switch tube, 1 represents the conduction of the upper bridge arm switch tube, and the three numbers correspond to the switching conditions of the A phase, B phase, and C phase bridge arms from left to right.

[0018] For example, Table 1 is as follows:

[0019] When the motor control system is working, it outputs two valid voltage vectors in one cycle, that is, voltage vectors other than 000 and 111. Figure 3 As shown, according to the six effective voltage vectors, the space can be divided into six sectors, and the sampling resistor samples when different effective voltage vectors act to obtain different phase currents.

[0020] An operational amplifier is provided, and the operational amplifier is electrically connected to the sampling resistor. The operational amplifier is configured to: sample the first phase current of the sampling resistor at a first moment, and sample the second phase current of the sampling resistor at a second moment. The operational amplifier amplifies or reduces the sampling signal according to the input range of the analog-to-digital converter of the three-phase inverter main control chip, and then transmits the sampling signal to the analog-to-digital converter of the three-phase inverter main control chip, thereby realizing the sampling of the DC bus current.

[0021] An analog-to-digital converter is provided, the analog-to-digital converter comprising at least two analog-to-digital conversion channels and two independent sampling data storage registers, wherein the result of first phase current sampling is stored in the first sampling data storage register through the first analog-to-digital conversion channel, and the structure of second phase current sampling is stored in the second sampling data storage register through the second analog-to-digital conversion channel.

[0022] A single interruption is performed in one control cycle of the three-phase inverter, and a value of the third-phase current is obtained based on the sampling results of the first-phase current and the second-phase current.

[0023] When the system cycle triggers the first sampling, the result of the first phase current sampling is stored in the first sampling data storage register, and the system does not enter an interrupt during the sampling process; when the system cycle triggers the second sampling, the result of the second phase current sampling is stored in the second sampling data storage register. After both samplings are completed, the second sampling end flag signal is used to trigger the system to enter an interrupt, and the sampling results of the first phase current and the second phase current in the control cycle are read to obtain the value of the third phase current.

[0024] Taking the output voltage vector amplitude of sector 1 as an example, the sampling timing diagram of the existing motor current sampling method is as follows: Figure 4 As shown, the sampling timing diagram of the motor current sampling method provided by the present application is as follows Figure 5 shown. Figure 4 and Figure 5 In the figure, the horizontal axis of the upper part is time, and the vertical axis represents the timer count value; the horizontal axis of the lower part is time, and the vertical axis is the three-phase switch signal of A, B, and C.

[0025] pass Figure 3 It can be seen that after the first sampling is completed, the existing motor current sampling method triggers the second sampling to enter the interrupt. At this time, the effective voltage vector 110 is completed when the first interrupt is processing data. At this time, the output voltage vector of the three-phase inverter is 111. According to Table 1, the DC bus current is zero at this time, resulting in the inability to sample the actual second phase current. Therefore, only one phase current is collected in this control cycle, and the three-phase current value of the motor cannot be completely reconstructed, and the motor cannot achieve the control purpose.

[0026] pass Figure 4 It can be seen that the motor current sampling method provided by the present application does not enter an interrupt after the first sampling. When the second sampling is triggered, the three-phase inverter is outputting the second effective voltage vector. Even if the second effective voltage vector 110 has a shorter action time, the second sampling can still be performed within its action time. When the second sampling is completed, the system interrupts and reads the current values ​​of the two samples at the same time, and obtains the value of the third phase current based on the sampling results of the first phase current and the second phase current.

[0027] According to the above description, a motor current sampling method provided by the present application increases the number of channels of the analog-to-digital converter by configuring the number of channels of the analog-to-digital converter without increasing the hardware cost, thereby canceling the interruption after the first sampling and shortening the interval time between the first sampling and the second sampling, solving the defect that the second sampling is prone to sampling failure when the second effective voltage vector action time is short, and improving the reliability and accuracy of current sampling.

[0028] As an implementation method, the motor current sampling method provided in the present application also includes: the first moment and the second moment are both determined by the sector where the reference voltage vector of the three-phase electricity synthesis is located and the duty cycle of the PWM modulation signal of each phase bridge arm.

[0029] In response to the reference voltage vector being in sector 1 or sector 2, the first moment and the second moment are respectively expressed by the following formulas: (1); In response to the reference voltage vector being in sector 3 or sector 4, the first moment and the second moment are respectively expressed by the following formulas: (2); In response to the reference voltage vector being in sector 5 or sector 6, the first moment and the second moment are respectively expressed by the following formulas: (3); In the formula, parameter T1 represents the conduction time of the lower switch tube of the first phase bridge arm in the first half cycle of a sector; parameter T2 represents the conduction time of the lower switch tube of the second phase bridge arm in the first half cycle of a sector; parameter T3 represents the conduction time of the lower switch tube of the third phase bridge arm in the first half cycle of a sector.

[0030] Through the above calculation formula, the motor current sampling method provided in the present application does not trigger the system to enter interruption for data processing after the first sampling is completed, and the result values ​​of the two samplings are read simultaneously after the two samplings are not completed, thereby reducing the sampling interval time and avoiding sampling failure in the second sampling, thereby improving the reliability of current sampling.

[0031] As an implementation method, the method also includes: in response to the deviation between any two parameters of parameters T1, T2, and T3 being less than a preset threshold, a phase shift strategy is adopted to delay the PWM pulse signal of the bridge arm of the phase with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm of the phase with the largest duty cycle by a preset time; and the first moment and the second moment are calculated using the parameters T1, T2, and T3 after executing the phase shift strategy.

[0032] Specifically, if the deviation between any two parameters of parameters T1, T2, and T3 is less than the preset threshold, it means that the action time of a certain voltage vector is short. At this time, the PWM pulse signal of the bridge arm with the smallest duty cycle is added with a correction value Tmin in the first half cycle, and subtracted with a correction value Tmin in the second half cycle. In addition, the PWM pulse signal of the bridge arm with the largest duty cycle is subtracted with a correction value Tmin in the first half cycle, and added with a correction value Tmin in the second half cycle. The first moment and the second moment are calculated with the parameters T1, T2, and T3 after the phase shift strategy is executed. By increasing the action time of the effective voltage vector in the first half cycle, current sampling is realized when the current of the three-phase inverter is stable, thereby improving the accuracy of current sampling.

[0033] As an implementation method, the method also includes: inserting a dead zone during the PWM control cycle of the three-phase inverter; the preset time is positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching.

[0034] Specifically, Figure 6 and Figure 7As shown in the figure, each time the power electronic device is turned on and off, due to the presence of inductance and capacitance in the circuit, the current and voltage will not stabilize immediately, but will reach a stable state after a period of vibration. By inserting a dead zone during the PWM control cycle of the three-phase inverter, the power electronic devices of the upper and lower bridge arms are turned off before being turned on again, avoiding the power short circuit caused by the power electronic devices on the upper and lower bridge arms being turned on at the same time.

[0035] Furthermore, when the output voltage vector is located near the junction of two sectors or the output voltage vector amplitude is small, sampling in the above two time periods will lead to inaccurate current sampling. By configuring the preset time to be positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching, the action time of the smaller voltage vector in the first half cycle is increased by phase shifting, thereby improving the current sampling accuracy. Taking the first sector as an example, the sampling timing diagram after phase shifting is as follows: Figure 8 As shown, the effective voltage vector action time in the first half cycle is significantly increased, and sampling is performed when the current is stable, thereby improving the sampling accuracy.

[0036] According to the above description, a motor current sampling method provided by the present application increases the number of channels of the analog-to-digital converter by configuring the number of channels of the analog-to-digital converter without increasing the hardware cost, thereby canceling the interruption after the first sampling, shortening the interval time between the first sampling and the second sampling, and solving the defect that the second sampling is prone to sampling failure when the action time of the second effective voltage vector is short, thereby improving the reliability and accuracy of current sampling; and, by adopting a vector phase shifting strategy, when the output voltage vector is located near the junction of two sectors or the output voltage vector amplitude is small, the action time of the voltage vector is increased, thereby further improving the current sampling accuracy and ensuring the reliability of current sampling.

[0037] In a second aspect, the present application also provides a motor current sampling device, wherein the motor is driven by a three-phase inverter, such as Fig. 9 As shown, the motor sampling device includes: a sampling resistor R, an operational amplifier A, a timer module M1, an analog-to-digital converter M2 and an interrupt service module M3.

[0038] The sampling resistor R is connected in series with the DC bus of the three-phase inverter; The operational amplifier A is configured to: perform first-phase current sampling on the sampling resistor at a first moment, and perform second-phase current sampling on the sampling resistor at a second moment; The analog-to-digital converter M2 includes at least two analog-to-digital conversion channels and two independent sampling data storage registers, wherein the result of the first phase current sampling is stored in the first sampling data storage register DAT0 through the first analog-to-digital conversion channel, and the result of the second phase current sampling is stored in the second sampling data storage register DAT1 through the second analog-to-digital conversion channel; The interruption service module M3 performs a single interruption in one control cycle of the three-phase inverter, and obtains the value of the third-phase current based on the sampling results of the first-phase current and the second-phase current.

[0039] According to the above description, a motor current sampling device provided by the present application, without increasing the hardware cost and program complexity, cancels the interruption after the first sampling by configuring the number of channels of the analog-to-digital converter and increasing the number of channels of the existing analog-to-digital converter, thereby reducing the sampling interval time, solving the defect that the second sampling is prone to sampling failure when the second effective voltage vector action time is short, and improving the reliability and accuracy of current sampling.

[0040] As an implementation, the timer module M1 is configured to receive parameters T1, T2, T3, and determine the first moment and the second moment based on the parameters T1, T2, T3 and the sector where the reference voltage vector of the three-phase power synthesis is located.

[0041] like Fig. 9 As shown, the interrupt service module M3 further includes a three-phase current calculation unit M31, a Clarke coordinate transformation unit M32, a Park coordinate transformation unit M33, a PID control unit M34, an inverse Park transformation unit M35 and a sampling timing unit M36.

[0042] When the control cycle starts, wait for the fourth channel CH4 of the timer module M1 to count to the comparison value filled in the register CCR4, and the fourth channel CH4 generates a trigger signal output to the register TIG to trigger the first sampling of the analog-to-digital converter M2, and the first sampling result is stored in the first sampling data storage register DAT0. The system does not enter an interrupt during the sampling process. Wait for the fourth channel CH4 of the timer module to count to the comparison value filled in the register CCR5, and wait for the fourth channel CH4 of the timer module to generate a trigger signal input to the TIG register to trigger the second sampling of the analog-to-digital converter M2, and store the sampling result in the second sampling data storage register DAT1. After the two samplings are completed, the flag signal of the end of the second sampling is used to trigger the system to enter an interrupt, and the sampling value of this cycle is read out.

[0043] After entering the interrupt, the three-phase current calculation unit M31 converts the sampling results stored in the first sampling data storage register DAT0 and the second sampling data storage register DAT1 in the analog-to-digital converter M2 into three-phase currents through conversion according to Table 1, and stores the three-phase currents in i a , i b , i c register and store it in i a , i b , i c The three-phase current in the register is used as the input of the Clarke coordinate transformation unit M32, which converts the three-phase current into the value in the stationary coordinate system and stores it in i α , i β The value is then converted into the synchronous rotating coordinate system as the input of the Park transformation unit M33 and stored in i d , i q register.

[0044] Further, the i d , i q The value in the register is used as the input of the PID control unit M34, and is converted into AC and DC axis voltage data after processing, and the AC and DC axis voltage data is stored in u d , u q register, will be stored in u d , u q The value in the register is used as the input of the inverse Park transformation unit M35, which converts the voltage data to the value in the stationary coordinate system and stores the value in u α , u β register, will be stored in u α , u βThe value in the register is used as the PWM signal output and the input of the sampling timing unit M36. The SVPWM modulation method generates the fill values ​​T1, T2, and T3 of the comparison value registers CCR1, CCR2, and CCR3 that determine the PWM output duty cycle, and the fill values ​​of the timer module registers CCR4 and CCR5 that trigger the analog-to-digital converter to start conversion are calculated according to the following formula: and .

[0045] In response to the reference voltage vector being in sector 1 or sector 2, the first moment and the second moment are respectively expressed by the following formulas: (4); In response to the reference voltage vector being in sector 3 or sector 4, the first moment and the second moment are respectively expressed by the following formulas: (5); In response to the reference voltage vector being in sector 5 or sector 6, the first moment and the second moment are respectively expressed by the following formulas: (6); In the formula, parameter T1 represents the conduction time of the lower switch tube of the first phase bridge arm in the first half cycle of a sector; parameter T2 represents the conduction time of the lower switch tube of the second phase bridge arm in the first half cycle of a sector; parameter T3 represents the conduction time of the lower switch tube of the third phase bridge arm in the first half cycle of a sector.

[0046] Through the above calculation formula, the motor current sampling device provided in the present application does not trigger the system to enter interruption for data processing after the first sampling is completed, and reads the result values ​​of the two samplings at the same time after the two samplings are not completed, thereby reducing the sampling interval time and avoiding sampling failure in the second sampling, thereby improving the reliability of current sampling.

[0047] As an implementation method, the interrupt service module is further configured to: generate signal modulation parameters based on the value of the three-phase current using the SVPWM modulation method, and generate the PWM modulation signal of each phase bridge arm of the three-phase inverter by the signal modulation parameters, wherein the signal modulation parameters include: parameters T1, T2 and T3; the timer module is further configured to: determine whether the deviation between any two parameters of parameters T1, T2 and T3 is less than a preset threshold; In response to the deviation between any two parameters of parameters T1, T2, and T3 being less than a preset threshold, a phase shift strategy is adopted to delay the PWM pulse signal of the bridge arm of the phase with the smallest duty cycle by a preset time, and to advance the PWM pulse signal of the bridge arm of the phase with the largest duty cycle by a preset time; the first moment and the second moment are calculated using the parameters T1, T2, and T3 after executing the phase shift strategy.

[0048] By adopting the phase shift strategy, the action time of the smaller voltage vector in the first half cycle is increased, and sampling is performed when the current of the three-phase inverter is stable, thereby improving the accuracy of current sampling.

[0049] As an implementation method, the timer module includes a comparison value register; the comparison value register is configured to receive parameters T1, T2, and T3; in response to the timer module counting to Tn, the PWM pulse signal of the corresponding phase bridge arm outputs a high level; in response to the timer module counting to T-Tn, the PWM pulse signal of the corresponding phase bridge arm outputs a low level; If the deviation between any two parameters among the judgment parameters T1, T2, and T3 is less than the preset threshold, a phase shift strategy is adopted to postpone the PWM pulse signal of the bridge arm with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm with the largest duty cycle by a preset time. The leading and trailing edge times of the PWM pulse signal of the bridge arm with the smallest duty cycle are expressed by the following formula: Tfrontier = Tn + Tmin (7); T trailing edge = T - (Tn - Tmin) (8); The leading and trailing edge times of the PWM pulse signal of the bridge arm with the largest duty cycle are expressed by the following formula: Tfront = Tn-Tmin (9); T trailing edge = T-(Tn+Tmin)(10); Wherein, Tmin represents the preset time, T represents the cycle time, Tn represents the conduction time of the lower switch tube of the nth phase bridge arm in the first half cycle of a sector, and n=1, 2, 3.

[0050] Based on the above phase shift strategy, by increasing the action time of the effective voltage vector in the first half cycle, current sampling is performed when the current of the three-phase inverter is stable, thereby improving the accuracy of current sampling.

[0051] As an implementation method, the timer module also includes a dead zone detector D, which is used to insert a dead zone during the PWM control cycle of the three-phase inverter; the preset time is positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching.

[0052] Specifically, each time the power electronic device is turned on and off, due to the presence of inductance and capacitance in the circuit, the current and voltage will not stabilize immediately, but will vibrate for a period of time before reaching a stable state. By inserting a dead zone during the PWM control cycle of the three-phase inverter, the power electronic devices of the upper and lower bridge arms are guaranteed to be turned off before being turned on again, avoiding the power short circuit caused by the power electronic devices on the upper and lower bridge arms being turned on at the same time.

[0053] Furthermore, when the output voltage vector is located near the junction of two sectors or the output voltage vector amplitude is small, sampling in the above two time periods will lead to inaccurate current sampling. By configuring the preset time to be positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching, the action time of the smaller voltage vector in the first half cycle is increased by phase shifting, thereby improving the current sampling accuracy.

[0054] According to the above description, a motor current sampling device provided by the present application, on the basis of not increasing the hardware cost, by configuring the number of channels of the analog-to-digital converter, increasing the number of channels of the existing analog-to-digital converter to cancel the interruption after the first sampling, thereby shortening the interval time between the first sampling and the second sampling, and solving the defect that the second sampling is prone to sampling failure when the action time of the second effective voltage vector is short, thereby improving the reliability and accuracy of current sampling; and, by adopting a vector phase shifting strategy, when the output voltage vector is located near the junction of two sectors or the output voltage vector amplitude is small, the action time of the voltage vector is increased, thereby further improving the current sampling accuracy and ensuring the reliability of current sampling.

[0055] In a third aspect, the present application also provides an electronic device, including a motor, an inverter and a motor current sampling device as described above, which is used to improve the accuracy of current sampling and increase the reliability of the motor control system.

[0056] It will be appreciated that the word "exemplary" as used herein means "serving as an example, instance, or illustration". Any embodiment described as "exemplary" is not necessarily preferred or superior to other embodiments and / or does not exclude the combination of features of other embodiments. It will be appreciated that certain features of the present application described in the context of separate embodiments for the sake of clarity may also be provided in a single embodiment by combination. Conversely, various features of the present application described in the context of a single embodiment for the sake of clarity may also be provided individually or in any suitable combination or as any other described embodiment of the present application.

[0057] The above disclosure is only the preferred embodiment of the present application, but it is not intended to limit the scope of rights of the present application. A person of ordinary skill in the art can understand that without departing from the spirit and scope of the present application and the appended claims, changes, modifications, substitutions, combinations, and simplifications should all be equivalent replacement methods and still fall within the scope of the invention.

Claims

1. A motor current sampling method, wherein the motor is driven by a three-phase inverter, characterized in that: The method comprises: Providing a sampling resistor, wherein the sampling resistor is connected in series with a DC bus of the three-phase inverter; An operational amplifier is provided, wherein the operational amplifier is configured to: perform first-phase current sampling on the sampling resistor at a first moment, and perform second-phase current sampling on the sampling resistor at a second moment; An analog-to-digital converter is provided, the analog-to-digital converter comprising at least two analog-to-digital conversion channels and two independent sampling data storage registers, wherein the result of first phase current sampling is stored in the first sampling data storage register through the first analog-to-digital conversion channel, and the result of second phase current sampling is stored in the second sampling data storage register through the second analog-to-digital conversion channel; A single interruption is performed in one control cycle of the three-phase inverter, and a value of the third-phase current is obtained based on the sampling results of the first-phase current and the second-phase current.

2. The motor current sampling method according to claim 1, characterized in that: The method further comprises: The first moment and the second moment are both determined by the sector where the reference voltage vector of the three-phase power synthesis is located and the duty cycle of the PWM modulation signal of each phase bridge arm; In response to the reference voltage vector being in sector 1 or sector 2, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 3 or sector 4, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 5 or sector 6, the first moment and the second moment are respectively expressed by the following formulas: ; In the formula, parameter T1 represents the conduction time of the lower switch tube of the first phase bridge arm in the first half cycle of a sector; parameter T2 represents the conduction time of the lower switch tube of the second phase bridge arm in the first half cycle of a sector; parameter T3 represents the conduction time of the lower switch tube of the third phase bridge arm in the first half cycle of a sector.

3. The motor current sampling method according to claim 2, characterized in that: The method further comprises: Determine whether the deviation between any two parameters among parameters T1, T2, and T3 is less than a preset threshold; In response to the deviation between any two parameters among parameters T1, T2, and T3 being less than the preset threshold, a phase shift strategy is adopted to postpone the PWM pulse signal of the bridge arm of the phase with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm of the phase with the largest duty cycle by the preset time; The first moment and the second moment are calculated using the parameters T1, T2, and T3 after the phase shift strategy is executed.

4. The motor current sampling method according to claim 3, characterized in that: The method further comprises: Inserting a dead zone during a PWM control cycle of the three-phase inverter; The preset time is positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching.

5. A motor current sampling device, wherein the motor is driven by a three-phase inverter, characterized in that: The motor current sampling device comprises: A sampling resistor, the sampling resistor is connected in series with a DC bus of the three-phase inverter; An operational amplifier, wherein the operational amplifier is configured to: perform a first phase current sampling on the sampling resistor at a first moment, and perform a second phase current sampling on the sampling resistor at a second moment; An analog-to-digital converter, the analog-to-digital converter comprising at least two analog-to-digital conversion channels and two independent sampling data storage registers, wherein the result of first phase current sampling is stored in the first sampling data storage register through the first analog-to-digital conversion channel, and the result of second phase current sampling is stored in the second sampling data storage register through the second analog-to-digital conversion channel; The interruption service module performs a single interruption in one control cycle of the three-phase inverter, and obtains the value of the third phase current based on the sampling results of the first phase current and the second phase current.

6. The motor current sampling device according to claim 5, characterized in that: The motor current sampling device further includes a timer module, and the timer module is configured as follows: Receiving parameters T1, T2, T3, and determining the first moment and the second moment based on the parameters T1, T2, T3 and the sector where the reference voltage vector of the three-phase power synthesis is located; In response to the reference voltage vector being in sector 1 or sector 2, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 3 or sector 4, the first moment and the second moment are respectively expressed by the following formulas: ; In response to the reference voltage vector being in sector 5 or sector 6, the first moment and the second moment are respectively expressed by the following formulas: ; In the formula, parameter T1 represents the conduction time of the lower switch tube of the first phase bridge arm in the first half cycle of a sector; parameter T2 represents the conduction time of the lower switch tube of the second phase bridge arm in the first half cycle of a sector; parameter T3 represents the conduction time of the lower switch tube of the third phase bridge arm in the first half cycle of a sector.

7. The motor current sampling device according to claim 6, characterized in that: The interrupt service module is further configured to: generate signal modulation parameters using the SVPWM modulation method based on the values ​​of the three-phase currents, and generate PWM modulation signals of each phase bridge arm of the three-phase inverter using the signal modulation parameters, wherein the signal modulation parameters include: the parameters T1, T2 and T3; The timer module is further configured to: determine whether the deviation between any two parameters among parameters T1, T2, and T3 is less than a preset threshold; In response to the deviation between any two parameters among parameters T1, T2, and T3 being less than the preset threshold, a phase shift strategy is adopted to postpone the PWM pulse signal of the bridge arm of the phase with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm of the phase with the largest duty cycle by the preset time; The first moment and the second moment are calculated using the parameters T1, T2, and T3 after the phase shift strategy is executed.

8. The motor current sampling device according to claim 7, characterized in that: The timer module includes a comparison value register; The comparison value register is configured to receive the parameters T1, T2, T3; In response to the timer module counting to Tn, the PWM pulse signal of the corresponding phase bridge arm outputs a high level; In response to the timer module counting to T-Tn, the PWM pulse signal of the corresponding phase bridge arm outputs a low level; If the deviation between any two parameters among the judgment parameters T1, T2, and T3 is less than the preset threshold, a phase shift strategy is adopted to postpone the PWM pulse signal of the bridge arm with the smallest duty cycle by a preset time, and advance the PWM pulse signal of the bridge arm with the largest duty cycle by the preset time; The leading and trailing edge times of the PWM pulse signal of the bridge arm with the smallest duty cycle are expressed by the following formula: Tfrontier = Tn + Tmin; T trailing edge = T-(Tn-Tmin); The leading and trailing edge times of the PWM pulse signal of the bridge arm with the largest duty cycle are expressed by the following formula: T frontier = Tn - Tmin; T trailing edge = T-(Tn+Tmin); In the formula, Tmin represents the preset time, T represents the cycle time, Tn represents the conduction time of the lower switch tube of the n-th phase bridge arm in the first half cycle of a sector, and n=1, 2, 3.

9. The motor current sampling device according to claim 7, characterized in that: The timer module further comprises a dead zone detector for inserting a dead zone during a PWM control cycle of the three-phase inverter; The preset time is positively correlated with the duration of the dead zone, the turn-on time of the switch tube in the three-phase inverter, and the oscillation time during the switch switching.

10. An electronic device, characterized in that: It comprises a motor, an inverter and a motor current sampling device as described in any one of claims 5 to 9.

Citation Information

Patent Citations

  • Control method of electric bicycle

    CN102320252A

  • Low-cost quick reconstruction method for phase current of permanent magnet motor of fan

    CN103023414A

  • Three-phase current reconstruction method using single sampling resistance

    CN103199791A

  • Phase shift compensation method for single resistance current sampling

    CN106872766A

  • Motor three-phase current sampling circuit and method, chip and computer equipment

    CN113489389A

Cited By

  • Method for acquiring inductive current of three-phase inverter circuit, electronic equipment and medium

    CN120668991A