Motor control module, carrier counter, PWM wave generation circuit and method thereof

By adopting the asymmetric carrier counting method and the dead zone overflow protection mechanism in the motor control chip, the problem of poor motor operation and failure is solved, and the smooth and efficient operation of the motor is achieved.

CN118694347APending Publication Date: 2024-09-24CRM ICBG (WUXI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310279263.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

The carrier counting circuit in the existing motor control chip adopts a symmetrical structure and cannot generate asymmetric PWM waveforms, resulting in poor motor operation. It also lacks a dead zone overflow protection mechanism, which can easily lead to motor failure.

Method used

Using the asymmetric carrier counting method, by configuring the downlink count increment and the uplink count increment, count alternately, and update the comparison value and dead time when the count value reaches the maximum or minimum value, set the dead zone overflow protection mechanism, and generate PWM signal with dead time.

Benefits of technology

It achieves smooth and stable motor operation. Through flexible counting increments and dead zone overflow protection mechanisms, motor jamming and stalling faults are avoided, and the operating efficiency of the motor is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694347A
    Figure CN118694347A
Patent Text Reader

Abstract

The invention provides a motor control module, a carrier counter, a PWM wave generation circuit and a method thereof. The motor control module comprises a downlink counting increment register, an uplink counting increment register, a downlink counting unit and an uplink counting unit, the downlink counting increment register is used for configuring downlink counting increment, the uplink counting increment register is used for configuring uplink counting increment, the downlink counting unit performs downlink counting based on the downlink counting increment, and the uplink counting unit performs uplink counting based on the uplink counting increment; wherein the downlink counting increment is not equal to the uplink counting increment. According to the method, the downlink counting increment and the uplink counting increment are flexibly set, and the required non-central-point symmetrical triangular waves can be generated, so that the subsequent sampling time and the calculation time are reasonably distributed, and the smooth operation of the motor is ensured; the dead zone time is set between the upper phase waveform and the lower phase waveform, and a dead zone overflow protection mechanism is added, so that the motor runs more stably, smoothly and efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of motor control, and in particular to a motor control module, a carrier counter, a PWM wave generating circuit and a method thereof. Background Art

[0002] With the development of the times and the advancement of science and technology, motor control chips are now needed in more and more fields, such as new energy vehicles, power tools, drones, various robots, etc. As more and more industrial or consumer electronics fields require motor control chips, the corresponding performance requirements are also getting higher and higher. In motor control chips, the most critical circuit structure is the carrier counting circuit. The quality of this circuit design determines the performance of the motor control chip.

[0003] The traditional carrier counting circuit in the motor control chip is generally designed with a symmetrical structure. This circuit structure is relatively rigid and cannot generate asymmetrical PWM waveforms on the three phases UVW of the motor. As a result, it cannot be flexibly applied, causing the motor to run poorly. In addition, there is no dead zone between the upper phase waveform and the lower phase waveform of the PWM signal. Even if a dead zone is set, there is no dead zone overflow protection mechanism, which can cause the motor to run stuck at best and stop at worst.

[0004] Therefore, how to ensure smooth operation of the motor and avoid motor failure has become one of the problems that technical personnel in this field need to solve urgently.

[0005] It should be noted that the above introduction to the technical background is only for the convenience of providing a clear and complete description of the technical solutions of the present application and for the convenience of understanding by those skilled in the art. It cannot be considered that the above technical solutions are well known to those skilled in the art simply because they are described in the background technology section of the present application. Summary of the invention

[0006] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a motor control module, a carrier counter, a PWM wave generating circuit and a method thereof, which are used to solve the problems of poor motor operation and easy failure in the prior art.

[0007] To achieve the above object and other related objects, the present invention provides a carrier counting method, which at least includes:

[0008] Configure the downlink count increment and uplink count increment;

[0009] Perform downlink counting based on the downlink count increment, and when the count reaches the minimum carrier count value, end the downlink count and start the uplink count; perform uplink counting based on the uplink count increment, and when the count reaches the maximum carrier count value, end the uplink count and start the downlink count; the uplink count and the downlink count are performed alternately until a count end instruction is received;

[0010] The downlink count increment is not equal to the uplink count increment.

[0011] Optionally, the downlink count increment is greater than the uplink count increment.

[0012] To achieve the above-mentioned object and other related objects, the present invention further provides a PWM wave generating method, the PWM wave generating method at least comprising:

[0013] Configure the downlink count comparison value and uplink count comparison value of the three phases U, V, and W respectively;

[0014] Obtain the carrier count value generated based on the above carrier count method, compare the downlink count comparison value of each phase with the corresponding downlink count value, and compare the uplink count comparison value of each phase with the corresponding uplink count value to obtain U, V, W three-phase PWM signals.

[0015] Optionally, when the maximum value of the carrier count is reached, the downlink count comparison value of each phase is updated; when the minimum value of the carrier count is reached, the uplink count comparison value of each phase is updated.

[0016] Optionally, the PWM wave generating method further includes:

[0017] Configure the downlink counting dead time, uplink counting dead time, downlink counting and downlink counting dead zone overflow protection value of the three phases U, V and W respectively;

[0018] The downlink count upper phase comparison value and the downlink count lower phase comparison value of each phase are calculated based on the downlink count comparison value of each phase and the downlink count dead time, and the uplink count upper phase comparison value and the uplink count lower phase comparison value of each phase are calculated based on the uplink count comparison value of each phase and the uplink count dead time;

[0019] The up phase comparison value and the down phase comparison value of the down count of each phase are respectively compared with the corresponding down count value, and the up phase comparison value and the up phase comparison value of the up count of each phase are respectively compared with the corresponding up count value to obtain the up phase waveform and the down phase waveform of the U, V, W three-phase PWM signal with dead time set;

[0020] If the downlink count phase comparison value is greater than or equal to the maximum carrier count value, the downlink count comparison value of the corresponding phase is adjusted to the dead zone overflow protection value of the downlink count, so that the downlink count phase comparison value is less than the maximum carrier count value; if the uplink count phase comparison value is greater than or equal to the maximum carrier count value, the corresponding uplink count comparison value is adjusted to the dead zone overflow protection value of the uplink count, so that the uplink count phase comparison value is less than the maximum carrier count value.

[0021] More optionally, the downlink count upper comparison value and the downlink count lower comparison value satisfy:

[0022] Hdncomp=CompDn;

[0023] Ldncomp=Hdncomp+DeadTimeDn;

[0024] Wherein, Hdncomp is the downlink count upper comparison value, CompDn is the downlink count comparison value, Ldncomp is the downlink count lower comparison value, and DeadTimeDn is the downlink count dead time;

[0025] The uplink count upper comparison value and the uplink count lower comparison value satisfy:

[0026] Hupcomp=CompUp;

[0027] Lupcomp=Hupcomp+DeadTimeUp;

[0028] Among them, Hupcomp is the uplink count upper comparison value, CompUp is the uplink count comparison value, Lupcomp is the uplink count lower comparison value, and DeadTimeUp is the uplink count dead time.

[0029] More optionally, when the maximum value of the carrier count is reached, the uplink count comparison value, the downlink count comparison value and the downlink count dead time of each phase are updated; when the minimum value of the carrier count is reached, the uplink count comparison value, the uplink count comparison value and the uplink count dead time of each phase are updated.

[0030] In order to achieve the above object and other related objects, the present invention provides a carrier counter for implementing the above carrier counting method, wherein the carrier counter at least comprises:

[0031] A downlink count increment register, an uplink count increment register, a downlink count unit and an uplink count unit;

[0032] The downlink count increment register is used to configure the downlink count increment, the uplink count increment register is used to configure the uplink count increment, the downlink counting unit performs downlink counting based on the downlink count increment, and the uplink counting unit performs uplink counting based on the uplink count increment;

[0033] The downlink count increment is not equal to the uplink count increment.

[0034] Optionally, the downlink count increment is greater than the uplink count increment.

[0035] In order to achieve the above-mentioned object and other related objects, the present invention further provides a PWM wave generating circuit for implementing the above-mentioned PWM wave generating method, wherein the PWM wave generating circuit at least comprises:

[0036] The carrier counter is used to count the carrier; and the first PWM wave generating module, the second PWM wave generating module, and the third PWM wave generating module are used to generate U, V, and W three-phase PWM signals respectively;

[0037] Wherein, each PWM wave generating module includes a downlink count comparison value register, an uplink count comparison value register and a comparator;

[0038] The downlink count comparison value register configures the downlink count comparison value;

[0039] The uplink count comparison value register configures the uplink count comparison value;

[0040] The comparator is connected to the downlink count comparison value register, the uplink count comparison value register and the output end of the carrier counter, compares the downlink count comparison value with the downlink count value, and compares the uplink count comparison value with the uplink count value to generate a corresponding PWM signal.

[0041] Optionally, the three corresponding downlink count comparison values ​​are equal to the uplink count comparison values; or the three corresponding downlink count comparison values ​​are not equal to the uplink count comparison values; or the same corresponding downlink count comparison value is equal to the uplink count comparison value, and different corresponding downlink count comparison values ​​are not equal to the uplink count comparison values.

[0042] More optionally, each PWM wave generating module further includes a downlink counting dead time configuration register, an uplink counting dead time configuration register and a dead zone overflow protection value register;

[0043] The downlink count dead time configuration register is used to configure the downlink count dead time to obtain a downlink count upper phase comparison value and a downlink count lower phase comparison value;

[0044] The uplink counting dead time configuration register is used to configure the uplink counting dead time to obtain an uplink counting upper phase comparison value and an uplink counting lower phase comparison value;

[0045] The comparator compares the downlink count upper phase comparison value, the downlink count lower phase comparison value and the downlink count value, respectively, and compares the uplink count upper phase comparison value, the uplink count lower phase comparison value and the uplink count value, respectively, to generate a corresponding PWM signal upper phase waveform and lower phase waveform with a dead time;

[0046] The dead zone overflow protection value register is used to configure the dead zone overflow protection value of the downlink count and the uplink count; when the downlink count comparison value is greater than or equal to the maximum value of the carrier count, the downlink count comparison value is adjusted to the dead zone overflow protection value of the downlink count; when the uplink count comparison value is greater than or equal to the maximum value of the carrier count, the uplink count comparison value is adjusted to the dead zone overflow protection value of the uplink count.

[0047] In order to achieve the above-mentioned object and other related objects, the present invention further provides a motor control module, which at least includes: the above-mentioned PWM wave generating circuit.

[0048] As described above, the motor control module, carrier counter, PWM wave generating circuit and method of the present invention have the following features:

[0049] Beneficial effects:

[0050] 1. The present invention flexibly sets the downlink count increment and the uplink count increment, which can generate the required non-center point symmetrical triangular wave, thereby facilitating the reasonable allocation of subsequent sampling time and calculation time, and ensuring smooth operation of the motor.

[0051] 2. A dead zone time is set between the upper phase waveform and the lower phase waveform of the present invention, and a dead zone overflow protection mechanism is added, so that the motor runs more stably, smoothly and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 Shown is a schematic diagram of the principle of a PWM signal generation method.

[0053] Figure 2 The waveform diagram of the three-phase PWM signal U, V, and W is shown.

[0054] Figure 3 It is a schematic diagram showing the principle of the carrier counting method of the present invention.

[0055] Figure 4 Shown is a schematic diagram of the principle of the PWM wave generating method of the present invention.

[0056] Figure 5Shown is a schematic diagram of the U-phase, V-phase, and W-phase PWM signal waveforms obtained by using the PWM wave generating method of the present invention.

[0057] Figure 6 It is a schematic diagram showing the principle of the dead zone overflow protection method of the present invention.

[0058] Figure 7 Shown is a schematic structural diagram of the carrier counter of the present invention.

[0059] Figure 8 Shown is a structural schematic diagram of the PWM wave generating circuit of the present invention.

[0060] Fig. 9 Shown is a structural schematic diagram of the PWM wave generating module of the present invention.

[0061] Component number description

[0062] 1 Carrier counter

[0063] 11 Downstream count increment register

[0064] 12 Upward count increment register

[0065] 13 Downstream counting unit

[0066] 14 Uplink counting unit

[0067] 2 The first PWM wave generation module

[0068] 3 Second PWM wave generation module

[0069] 4 The third PWM wave generation module

[0070] 51 Downstream count comparison value register

[0071] 52 Upward count comparison value register

[0072] 53 Comparator

[0073] 54 Downstream counting dead time configuration register

[0074] 55 Uplink counting dead time configuration register

[0075] 56 Dead zone overflow protection value register DETAILED DESCRIPTION

[0076] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.

[0077] See also Figures 1 to 9 It should be noted that the illustrations provided in this embodiment are only used to illustrate the basic concept of the present invention in a schematic manner, and the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0078] like Figure 1 The figure shows a method for generating a PWM signal. The upward slope of the triangular wave formed by symmetrical carrier counting is equal to the downward slope, that is, it is always an isosceles triangle. The output waveform of the carrier counter is compared with a comparison value Comp, and the comparison result forms a PWM waveform. U, V, and W are respectively set with corresponding comparison values, and then a step-shaped U, V, and W three-phase PWM signal is obtained to drive the motor to work, such as Figure 2 As shown. When the ADC resistance sampling is performed later, ADC sampling is performed in the uplink stage, and data calculation of the sampling value is performed in the downlink stage. Generally, the calculation time is longer than the sampling time. Since the uplink counting time of the carrier counter is equal to the downlink counting time, the sampling time and calculation time cannot be flexibly configured, which will cause the motor to run poorly. In addition, a dead time is set between the upper phase waveform and the lower phase waveform of the PWM signal. However, when the lower phase comparison value is greater than or equal to the maximum value of the carrier count, the dead time overflow causes the generated motor sine wave or saddle wave to have burrs, causing the motor to run stuck or even stop.

[0079] Based on the above reasons, the present invention provides a motor control module, a carrier counter, a PWM wave generating circuit and a method thereof. Through an independently designed asymmetric carrier counter and a dead zone overflow protection mechanism, flexible configuration of the uplink and downlink waveform slopes of the carrier counter is achieved, thereby achieving a reasonable allocation of ADC resistance sampling and data calculation time, making the motor operation more stable, smooth and efficient.

[0080] Embodiment 1

[0081] like Figure 3 As shown, this embodiment provides a carrier counting method, and the carrier counting method includes:

[0082] 11) Configure the downlink count increment and uplink count increment;

[0083] Specifically, the downlink count increment DnStp is used to set the slope of the downlink waveform of the carrier counter; the larger the downlink count increment DnStp, the larger the slope of the downlink waveform (i.e., the steeper the slope); conversely, the smaller the downlink count increment DnStp, the smaller the slope of the downlink waveform (i.e., the gentler the slope); the number of signal bits of the downlink count increment DnStp is determined by the bit width of the carrier counter 1 (i.e., the downlink count increment DnStp is an n-bit signal, and n is the counting bit width of the carrier counter 1). The specific value and number of bits of the downlink count increment DnStp can be set according to actual application needs, and will not be described in detail here.

[0084] Specifically, the uplink count increment UpStp is used to set the slope of the uplink waveform of the carrier counter; the larger the uplink count increment UpStp, the larger the slope of the uplink waveform (i.e., the steeper the slope); conversely, the smaller the uplink count increment UpStp, the smaller the slope of the uplink waveform (i.e., the gentler the slope); the number of signal bits of the uplink count increment UpStp is determined by the bit width of the carrier counter 1 (i.e., the uplink count increment UpStp is an n-bit signal). The specific value and number of bits of the uplink count increment UpStp can be set according to actual application needs, and will not be described in detail here.

[0085] 12) Perform downlink counting based on the downlink count increment DnStp, and when the count reaches the minimum carrier count value C0, end the downlink count and start the uplink count; perform uplink counting based on the uplink count increment UpStp, and when the count reaches the maximum carrier count value CTOP, end the uplink count and start the downlink count; the uplink count and the downlink count are performed alternately until the count end instruction is received.

[0086] Specifically, subtraction counting is performed with the downlink count increment DnStp as the change value, and a trigger signal is generated to switch from the downlink count mode to the uplink count mode when counting to the minimum carrier count value C0. In this embodiment, the number of signal bits of the minimum carrier count value C0 is determined by the bit width of the carrier counter 1 (that is, the minimum carrier count value C0 is an n-bit signal). Taking n=16 as an example, the minimum carrier count value C0 is 0000000000000000 (that is, decimal 0); in actual use, the minimum carrier count value can be set as needed.

[0087] Specifically, the uplink count increment UpStp is used as the change value for addition counting, and when counting reaches the carrier count maximum value CTOP, a trigger signal is generated to switch from the uplink counting mode to the downlink counting mode. In this embodiment, the number of signal bits of the carrier count maximum value CTOP is determined by the bit width of the carrier counter 1 (that is, the carrier count maximum value CTOP is an n-bit signal). Taking n=16 as an example, the carrier count maximum value CTOP is 11111111111111111 (that is, 65535 in decimal); in actual use, the carrier count maximum value can be set as needed.

[0088] It should be noted that the downlink count increment DnStp is not equal to the uplink count increment UpStp. The downlink count increment DnStp and the uplink count increment UpStp can be flexibly set according to actual needs to generate the required non-center point symmetrical triangular wave. In this example, in order to facilitate the reasonable allocation of subsequent sampling time and calculation time, the downlink count increment DnStp is set to be greater than the uplink count increment UpStp, that is, the downlink count time is less than the uplink count time. In other applications, the downlink count increment DnStp can also be set to be less than the uplink count increment UpStp as needed, not limited to this embodiment. The period T of the asymmetric carrier counter of the present invention PWM Satisfies the following relationship:

[0089]

[0090] Among them, f clk is the counting clock frequency of the carrier counter; n is the counting bit width of the carrier counter. For example, if the counting bit width of the carrier counter is 16 bits, then 2 n =2 16 =65536.

[0091] It should be noted that there is no clear order between uplink counting and downlink counting. Uplink counting and downlink counting are performed alternately. Downlink counting can be performed first and then uplink counting, or uplink counting can be performed first and then downlink counting. Counting is completed when the counting end instruction is received.

[0092] like Figure 4 As shown, this embodiment also provides a PWM wave generating method, the PWM wave generating method comprising:

[0093] 21) Configure the downlink count comparison value and uplink count comparison value of the U, V, and W phases respectively.

[0094] Specifically, the downlink count comparison value corresponding to U is recorded as U_CompDn, and the uplink count comparison value is recorded as U_CompUp; the downlink count comparison value corresponding to V is recorded as V_CompDn, and the uplink count comparison value is recorded as V_CompUp; the downlink count comparison value corresponding to W is recorded as W_CompDn, and the uplink count comparison value is recorded as W_CompUp. Each downlink count comparison value and uplink count comparison value are used to determine the moment when the PWM signal level is flipped, and each downlink count comparison value and uplink count comparison value can be set as needed. In this embodiment, the number of signal bits of each comparison value is determined by the bit width of the carrier counter 1 (that is, an n-bit signal).

[0095] 22) Obtain the carrier count value generated based on the above carrier count method, compare the downlink count comparison value of each phase with the corresponding downlink count value, and compare the uplink count comparison value of each phase with the corresponding uplink count value to obtain U, V, W three-phase PWM signals.

[0096] Specifically, the principle of generating a PWM signal is explained by taking the U phase as an example. The principles of the other two phases are the same and will not be described in detail here. Figure 4 As shown, when the carrier counts down, the U-phase down count comparison value U_CompDn is compared with the down count value. When the down count value drops to the U-phase down count comparison value U_CompDn, the comparison result is reversed, and the level of the U-phase PWM signal is reversed. When the carrier counts up, the U-phase up count comparison value U_CompUp is compared with the up count value. When the up count value rises to the U-phase up count comparison value U_CompUp, the comparison result is reversed again, and the level of the U-phase PWM signal is also reversed. The U-phase PWM signal includes an upper phase waveform UH and a lower phase waveform UL, and the lower phase waveform is the inverse of the upper phase waveform.

[0097] It should be noted that based on the above method, the U-phase, V-phase and W-phase PWM signals are obtained respectively, and the corresponding downlink count comparison values ​​and uplink count comparison values ​​can be configured to be the same value or different values, and the configuration method is as follows:

[0098] Configuration method 1: (U_CompDn=U_CompUp)=(V_CompDn=V_CompUp)=(W_CompDn=W_CompUp), that is, the uplink and downlink comparison values ​​of the U phase, V phase, and W phase are equal, and the three phases U, V, and W are also equal.

[0099] Configuration method 2: (U_CompDn≠U_CompUp)≠(V_CompDn≠V_CompUp)≠(W_CompDn≠W_CompUp), that is, the uplink and downlink comparison values ​​of the U phase, V phase, and W phase are not equal, and the comparison values ​​of the U, V, and W phases are also not equal.

[0100] Configuration method three: (U_CompDn=U_CompUp)≠(V_CompDn=V_CompUp)≠(W_CompDn=W_CompUp), that is, the uplink and downlink comparison values ​​of the U phase, V phase, and W phase are equal, but the three phases U, V, and W are independent of each other and are not equal.

[0101] Among them, the U-phase, V-phase, and W-phase PWM signals obtained by configuration method 1 have the same duty cycle, and configuration methods 2 and 3 can obtain U-phase, V-phase, and W-phase PWM signals with different duty cycles; Figure 5 The figure shows the U-phase, V-phase, and W-phase PWM signals obtained by using configuration method three. In the figure, only the upper phase waveform of each phase PWM signal is used to illustrate the relationship between each phase.

[0102] It should be noted that, in this example, the comparison values ​​of each cycle of the same phase can also be flexibly configured. When the maximum value of the carrier count (the top of the triangle wave CTOP) is reached, the downlink count comparison value CompDn of each phase is updated; when the minimum value of the carrier count (the bottom of the triangle wave C0) is reached, the uplink count comparison value CompUp of each phase is updated.

[0103] As another implementation of the present invention, the PWM wave generating method further includes:

[0104] a) Configure the downlink counting dead time, uplink counting dead time, downlink counting and uplink counting dead zone overflow protection value of the three phases U, V and W respectively.

[0105] Specifically, the downlink counting dead zone time corresponding to U is recorded as U_DeadTimeDn, the uplink counting dead zone time is recorded as U_DeadTimeUp, the dead zone overflow protection value of the downlink counting is recorded as U_DeadTimeMaxDn, and the dead zone overflow protection value of the uplink counting is recorded as U_DeadTimeMaxUp; the downlink counting dead zone time corresponding to V is recorded as V_DeadTimeDn, the uplink counting dead zone time is recorded as V_DeadTimeUp, the dead zone overflow protection value of the downlink counting is recorded as V_DeadTimeMaxDn, and the dead zone overflow protection value of the uplink counting is recorded as V_DeadTimeMaxUp; the downlink counting dead zone time corresponding to W is recorded as W_DeadTimeDn, the uplink counting dead zone time is recorded as W_DeadTimeUp, the dead zone overflow protection value of the downlink counting is recorded as W_DeadTimeMaxDn, and the dead zone overflow protection value of the uplink counting is recorded as W_DeadTimeMaxUp. Each downlink count dead time and uplink count dead time are used to determine the dead time of the upper phase waveform and the lower phase waveform of the PWM signal. The dead zone overflow protection value of the downlink and uplink counts is used to implement the dead zone overflow protection mechanism. Each downlink count dead time, uplink count dead time and corresponding dead zone overflow protection value can be set as needed; in this embodiment, the same corresponding downlink count dead zone overflow protection value DeadTimeMaxDn is equal to the uplink count dead zone overflow protection value DeadTimeMaxUp, that is, only one dead zone overflow protection value needs to be configured for the same phase. In this embodiment, the number of signal bits of each downlink count dead time, uplink count dead time and dead zone overflow protection value is determined by the bit width of the carrier counter 1 (that is, an n-bit signal).

[0106] b) The downlink count upper phase comparison value and the downlink count lower phase comparison value of each phase are calculated based on the downlink count comparison value of each phase and the downlink count dead time, and the uplink count upper phase comparison value and the uplink count lower phase comparison value of each phase are calculated based on the uplink count comparison value of each phase and the uplink count dead time.

[0107] Specifically, in this embodiment, the U-phase downlink count comparison value U_CompDn is assigned to the U-phase downlink count up-phase comparison value U_Hdncomp, that is, U_Hdncomp=U_CompDn, and then based on the relationship U_Ldncomp=U_Hdncomp+U_DeadTimeDn, the U-phase downlink count down-phase comparison value U_Ldncomp is obtained by addition operation; similarly, the U-phase uplink count comparison value U_CompUp is assigned to the U-phase uplink count up-phase comparison value U_Hu pcomp, that is, U_Hupcomp=U_CompUp; then based on the relationship U_Lupcomp=U_Hupcomp+U_DeadTimeUp, the U-phase up-count down-phase comparison value U_Lupcomp is obtained by addition operation; thereby, the U-phase down-count up-phase comparison value U_Hdncomp, the U-phase down-count down-phase comparison value U_Ldncomp, the U-phase up-count up-phase comparison value U_Hupcomp and the U-phase up-count down-phase comparison value U_Lupcomp can be obtained.

[0108] It should be noted that the upper phase comparison value Hdncomp of each phase downlink count, the lower phase comparison value Ldncomp of the corresponding phase downlink count, and the corresponding phase downlink count dead time DeadTimeDn all satisfy the following relationship: Hdncomp=CompDn; Ldncomp=Hdncomp+DeadTimeDn. The upper phase comparison value Hupcomp of each phase uplink count, the lower phase comparison value Lupcomp of the corresponding phase uplink count, and the corresponding phase uplink count dead time DeadTimeUp all satisfy the following relationship: Hupcomp=CompUp; Lupcomp=Hupcomp+DeadTimeUp. This embodiment takes the U phase as an example to illustrate the method of obtaining the upper phase comparison value of the downlink count and the lower phase comparison value of the downlink count. The methods for the other two phases are the same and will not be repeated here.

[0109] c) respectively comparing the downlink count upper phase comparison value and the downlink count lower phase comparison value of each phase with the corresponding downlink count value, and respectively comparing the uplink count upper phase comparison value and the uplink count lower phase comparison value of each phase with the corresponding uplink count value, so as to obtain the upper phase waveform and the lower phase waveform of the U, V, W three-phase PWM signal with dead time.

[0110] Specifically, the principle of generating the upper phase waveform and the lower phase waveform of the PWM signal is explained by taking the U phase as an example. The principles of the other two phases are the same and will not be elaborated here.

[0111] Specifically, Figure 6As shown, when the carrier is counting down, the U-phase down-counting lower phase comparison value U_Ldncomp and the U-phase down-counting upper phase comparison value U_Hdncomp are compared with the down-counting value. Since the lower phase comparison value is greater than the upper phase comparison value, the down-counting value first drops to the U-phase down-counting lower phase comparison value U_Ldncomp during down-counting, and triggers the lower phase waveform UL of the U-phase PWM signal to flip from a high level to a low level; after the U-phase down-counting dead time U_DeadTimeDn, the down-counting value drops to the U-phase down-counting upper phase comparison value U_Hdncomp, and triggers the upper phase waveform UH of the U-phase PWM signal to flip from a low level to a high level.

[0112] Specifically, Figure 6 As shown, when the carrier is counting up, the U-phase up-count lower phase comparison value U_Lupcomp and the U-phase up-count upper phase comparison value U_Hupcomp are compared with the up-count value. Since the lower phase comparison value is greater than the upper phase comparison value, the up-count value first rises to the U-phase up-count upper phase comparison value U_Hupcomp during up-counting, and triggers the upper phase waveform UH of the U-phase PWM signal to flip from a high level to a low level; after the U-phase up-count dead time U_DeadTimeUp, the up-count value rises to the U-phase up-count lower phase comparison value U_Lupcomp, and triggers the lower phase waveform UL of the U-phase PWM signal to flip from a low level to a high level.

[0113] By analogy, the comparison of the up-count and the down-count is continuously performed to obtain the PWM signals of each phase. It should be noted that in this example, the comparison value of each cycle can be flexibly configured. When the maximum value of the carrier count (the top of the triangle wave) is reached, the up-count comparison value Hdncomp, the down-count comparison value Ldncomp and the down-count dead time DeadTimeDn of each phase are updated; when the minimum value of the carrier count (the bottom of the triangle wave) is reached, the up-count comparison value Hupcomp, the down-count comparison value Lupcomp and the up-count dead time DeadTimeUp of each phase are updated.

[0114] d) During the comparison process, if the comparison value Ldncomp under the downlink count is greater than or equal to the maximum value of the carrier count, the downlink count comparison value CompDn of the corresponding phase is adjusted to the dead zone overflow protection value DeadTimeMaxDn of the downlink count, so that the comparison value Ldncomp under the downlink count is less than the maximum value of the carrier count; if the comparison value Lupcomp under the uplink count is greater than or equal to the maximum value of the carrier count, the corresponding uplink count comparison value CompUp is adjusted to the dead zone overflow protection value DeadTimeMaxUp of the uplink count, so that the comparison value Lupcomp under the uplink count is less than the maximum value of the carrier count.

[0115] Specifically, in actual use, it is necessary to ensure that the downlink count comparison value Ldncomp and the uplink count comparison value Lupcomp of each phase are less than the maximum carrier count. If the downlink count comparison value Ldncomp obtained by adding the downlink dead time DeadTimeDn to the downlink count comparison value Hdncomp is greater than or equal to the maximum carrier count, it means that under the current dead time configuration mode (that is, the dead time is configured as a fixed value), the downlink count comparison value Hdncomp is too large, and the downlink count comparison value CompDn is adjusted to the dead zone overflow protection value DeadTimeMaxDn of the downlink count to ensure that DeadTimeMaxDn+DeadTimeDn is less than the maximum carrier count. The use principle of the uplink dead zone overflow protection value is the same, which will not be repeated here.

[0116] The carrier counting of the present invention adopts an asymmetric structure, has great flexibility, and satisfies the time allocation of subsequent ADC sampling by making the downlink counting time shorter than the uplink counting time, thereby ensuring smooth operation of the motor. At the same time, when a dead zone overflow fault occurs, the downlink counting comparison value or the uplink counting comparison value is automatically updated to the dead zone overflow protection value, thereby achieving the dead zone overflow protection effect and ensuring the safe and stable operation of the motor.

[0117] Embodiment 2

[0118] Figure 7 As shown, this embodiment provides a carrier counter 1, and the carrier counter 1 includes:

[0119] A downlink count increment register 11, an uplink count increment register 12, a downlink count unit 13 and an uplink count unit 14.

[0120] like Figure 7 As shown, the downlink count increment register 11 is used to configure the downlink count increment DnStp., and the uplink count increment register 12 is used to configure the uplink count increment UpStp.

[0121] like Figure 7 As shown, the downlink counting unit 13 performs downlink counting based on the downlink counting increment DnStp, and the uplink counting unit 14 performs uplink counting based on the uplink counting increment UpStp.

[0122] Specifically, in this embodiment, the downlink counting unit 13 is a down counter, and the uplink counting unit 14 is an up counter.

[0123] Specifically, the downlink count increment DnStp is not equal to the uplink count increment UpStp, and the slopes of the downlink count and the uplink count can be flexibly set based on the downlink count increment DnStp and the uplink count increment UpStp. As an example, if the downlink count increment DnStp is greater than the uplink count increment UpStp, the downlink count time is shorter than the uplink count time. The working principle of the carrier counter 1 refers to Embodiment 1, which is not described in detail here.

[0124] Figure 8 As shown, this embodiment also provides a PWM wave generating circuit, and the PWM wave generating circuit includes:

[0125] The carrier counter 1 , the first PWM wave generating module 2 , the second PWM wave generating module 3 and the third PWM wave generating module 4 .

[0126] Specifically, the carrier counter 1 is used to count the carriers, and its structure and principle are as mentioned above, which will not be described in detail here.

[0127] Specifically, the first PWM wave generating module 2, the second PWM wave generating module 3 and the third PWM wave generating module 4 are used to generate U, V, W three-phase PWM signals respectively. Fig. 9 As shown, each PWM wave generating module includes a downlink count comparison value register 51, an uplink count comparison value register 52 and a comparator 53. The downlink count comparison value register 51 configures the downlink count comparison value CompDn; the uplink count comparison value register 52 configures the uplink count comparison value CompUp; the comparator 53 is connected to the downlink count comparison value register 51, the uplink count comparison value register 52 and the output end of the carrier counter 1, compares the downlink count comparison value CompDn with the downlink count value, and compares the uplink count comparison value CompUp with the uplink count value to generate a corresponding PWM signal.

[0128] It should be noted that the corresponding downlink count comparison value and uplink count comparison value can be set as needed, including but not limited to the three corresponding downlink count comparison values ​​and the uplink count comparison value are not equal; or the same corresponding downlink count comparison value is equal to the uplink count comparison value, and different corresponding downlink count comparison values ​​are not equal to the uplink count comparison values.

[0129] As another implementation of the present invention, each PWM wave generating module further includes a downlink counting dead time configuration register 54, an uplink counting dead time configuration register 55 and a dead zone overflow protection value register 56. The downlink counting dead time configuration register 54 is used to configure the downlink counting dead time DeadTimeDn to obtain the downlink counting upper phase comparison value Hdncomp and the downlink counting lower phase comparison value Ldncomp. The uplink counting dead time configuration register 55 is used to configure the uplink counting dead time DeadTimeUp to obtain the uplink counting upper phase comparison value Hupcomp and the uplink counting lower phase comparison value Lupcomp. The comparator 53 compares the downlink counting upper phase comparison value Hdncomp and the downlink counting lower phase comparison value Ldncomp with the downlink counting value, and compares the uplink counting upper phase comparison value Hupcomp and the uplink counting lower phase comparison value Lupcomp with the uplink counting value, to generate the corresponding PWM signal upper phase waveform and lower phase waveform with dead time. The dead zone overflow protection value register 56 is used to configure the dead zone overflow protection value of the downlink count and the uplink count; when the downlink count comparison value Ldncomp is greater than or equal to the maximum value of the carrier count, the downlink count comparison value CompDn is adjusted to the dead zone overflow protection value DeadTimeMaxDn of the downlink count. When the uplink count comparison value Lupcomp is greater than or equal to the maximum value of the carrier count, the uplink count comparison value CompUp is adjusted to the dead zone overflow protection value DeadTimeMaxUp of the uplink count. When the dead zone overflow protection value of the downlink count and the dead zone overflow protection value of the uplink count are equal, the dead zone overflow protection value register 56 outputs a dead zone overflow protection value.

[0130] It should be noted that each register is used to provide configured data, and the comparator 53 performs simple operations based on each data, including but not limited to addition and subtraction, and then compares. The corresponding downlink counting dead time, uplink counting dead time and dead zone overflow protection value can be set as needed. The working principle of the PWM wave generating circuit is shown in Example 1, which is not described here one by one.

[0131] This embodiment also provides a motor control module, which at least includes: the PWM wave generating circuit, which can realize flexible configuration of the up and down waveform slopes of the carrier counter, and reasonably allocate ADC resistance sampling and data calculation time, so that the motor operation is more stable, smooth and efficient.

[0132] In summary, the present invention provides a motor control module, a carrier counter, a PWM wave generating circuit and a method thereof, including: a downlink count increment register, an uplink count increment register, a downlink counting unit and an uplink counting unit; the downlink count increment register is used to configure the downlink count increment, the uplink count increment register is used to configure the uplink count increment, the downlink counting unit performs downlink counting based on the downlink count increment, and the uplink counting unit performs uplink counting based on the uplink count increment; wherein the downlink count increment is not equal to the uplink count increment. The present invention flexibly sets the downlink count increment and the uplink count increment, and can generate the required non-center point symmetrical triangular wave, thereby facilitating the reasonable allocation of subsequent sampling time and calculation time, and ensuring smooth operation of the motor; the present invention sets a dead time between the upper phase waveform and the lower phase waveform, and adds a dead zone overflow protection mechanism, so that the motor runs more stably, smoothly and efficiently. Therefore, the present invention effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0133] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A carrier counting method, characterized in that: The carrier counting method at least comprises: Configure the downlink count increment and uplink count increment; Perform downlink counting based on the downlink count increment, and when the count reaches the minimum carrier count value, end the downlink count and start the uplink count; perform uplink counting based on the uplink count increment, and when the count reaches the maximum carrier count value, end the uplink count and start the downlink count; the uplink count and the downlink count are performed alternately until a count end instruction is received; The downlink count increment is not equal to the uplink count increment.

2. The carrier counting method according to claim 1, characterized in that: The downlink count increment is greater than the uplink count increment.

3. A PWM wave generating method, characterized in that: The PWM wave generating method at least comprises: Configure the downlink count comparison value and uplink count comparison value of the three phases U, V, and W respectively; Obtain the carrier count value generated based on the carrier count method as described in claim 1 or 2, compare the downlink count comparison value of each phase with the corresponding downlink count value, and compare the uplink count comparison value of each phase with the corresponding uplink count value to obtain U, V, and W three-phase PWM signals.

4. The PWM wave generating method according to claim 3, characterized in that: When the maximum value of the carrier count is reached, the downlink count comparison value of each phase is updated; when the minimum value of the carrier count is reached, the uplink count comparison value of each phase is updated.

5. The PWM wave generating method according to claim 3, characterized in that: The PWM wave generating method further comprises: Configure the downlink counting dead time, uplink counting dead time, downlink counting and downlink counting dead zone overflow protection value of the three phases U, V and W respectively; The downlink count upper phase comparison value and the downlink count lower phase comparison value of each phase are calculated based on the downlink count comparison value of each phase and the downlink count dead time, and the uplink count upper phase comparison value and the uplink count lower phase comparison value of each phase are calculated based on the uplink count comparison value of each phase and the uplink count dead time; The up phase comparison value and the down phase comparison value of the down count of each phase are respectively compared with the corresponding down count value, and the up phase comparison value and the up phase comparison value of the up count of each phase are respectively compared with the corresponding up count value to obtain the up phase waveform and the down phase waveform of the U, V, W three-phase PWM signal with dead time set; If the downlink count phase comparison value is greater than or equal to the maximum carrier count value, the downlink count comparison value of the corresponding phase is adjusted to the dead zone overflow protection value of the downlink count, so that the downlink count phase comparison value is less than the maximum carrier count value; if the uplink count phase comparison value is greater than or equal to the maximum carrier count value, the corresponding uplink count comparison value is adjusted to the dead zone overflow protection value of the uplink count, so that the uplink count phase comparison value is less than the maximum carrier count value.

6. The PWM wave generating method according to claim 5, characterized in that: The downlink count upper comparison value and the downlink count lower comparison value satisfy: Hdncomp=CompDn; Ldncomp=Hdncomp+DeadTimeDn; Wherein, Hdncomp is the up-phase comparison value of the downlink count, CompDn is the downlink count comparison value, Ldncomp is the downlink count down comparison value, DeadTimeDn is the downlink count dead time; The uplink count upper comparison value and the uplink count lower comparison value satisfy: Hupcomp=CompUp; Lupcomp=Hupcomp+DeadTimeUp; Wherein, Hupcomp is the uplink count up comparison value, CompUp is the uplink count comparison value, Lupcomp is the uplink counting down comparison value, and DeadTimeUp is the uplink counting dead time.

7. The PWM wave generating method according to claim 5, characterized in that: When the maximum value of the carrier count is reached, the uplink count comparison value, the downlink count comparison value and the downlink count dead time of each phase are updated; when the minimum value of the carrier count is reached, the uplink count comparison value, the uplink count comparison value and the uplink count dead time of each phase are updated.

8. A carrier counter, implementing the carrier counting method according to claim 1 or 2, characterized in that: The carrier counter at least comprises: A downlink count increment register, an uplink count increment register, a downlink count unit and an uplink count unit; The downlink count increment register is used to configure the downlink count increment, the uplink count increment register is used to configure the uplink count increment, the downlink counting unit performs downlink counting based on the downlink count increment, and the uplink counting unit performs uplink counting based on the uplink count increment; The downlink count increment is not equal to the uplink count increment.

9. A PWM wave generating circuit, used to implement the PWM wave generating method according to any one of claims 3 to 7, characterized in that: The PWM wave generating circuit at least comprises: The carrier counter as claimed in claim 8, used to count the carrier; and the first PWM wave generating module, the second PWM wave generating module, and the third PWM wave generating module are used to generate U, V, and W three-phase PWM signals respectively; Wherein, each PWM wave generating module includes a downlink count comparison value register, an uplink count comparison value register and a comparator; The downlink count comparison value register configures the downlink count comparison value; The uplink count comparison value register configures the uplink count comparison value; The comparator is connected to the downlink count comparison value register, the uplink count comparison value register and the output end of the carrier counter, compares the downlink count comparison value with the downlink count value, and compares the uplink count comparison value with the uplink count value to generate a corresponding PWM signal.

10. The PWM wave generating circuit according to claim 9, characterized in that: The three corresponding downlink count comparison values ​​are equal to the uplink count comparison values; or the three corresponding downlink count comparison values ​​are not equal to the uplink count comparison values; or the same corresponding downlink count comparison value is equal to the uplink count comparison value, and different corresponding downlink count comparison values ​​are not equal to the uplink count comparison values.

11. The PWM wave generating circuit according to claim 9 or 10, characterized in that: Each PWM wave generation module also includes a downlink counting dead time configuration register, an uplink counting dead time configuration register and a dead zone overflow protection value register; The downlink count dead time configuration register is used to configure the downlink count dead time to obtain a downlink count upper phase comparison value and a downlink count lower phase comparison value; The uplink counting dead time configuration register is used to configure the uplink counting dead time to obtain an uplink counting upper phase comparison value and an uplink counting lower phase comparison value; The comparator compares the downlink count upper phase comparison value, the downlink count lower phase comparison value and the downlink count value, respectively, and compares the uplink count upper phase comparison value, the uplink count lower phase comparison value and the uplink count value, respectively, to generate a corresponding PWM signal upper phase waveform and lower phase waveform with a dead time; The dead zone overflow protection value register is used to configure the dead zone overflow protection value of the downlink count and the uplink count; when the downlink count comparison value is greater than or equal to the maximum value of the carrier count, the downlink count comparison value is adjusted to the dead zone overflow protection value of the downlink count; when the uplink count comparison value is greater than or equal to the maximum value of the carrier count, the uplink count comparison value is adjusted to the dead zone overflow protection value of the uplink count.

12. A motor control module, characterized in that: The motor control module at least includes: a PWM wave generating circuit as described in any one of claims 9-11.