PWM signal generation circuit and method, and chip
By using hardware logic circuits and jump mode to disperse harmonic energy in PWM circuits, the problem of interference in PWM circuits is solved, and the effect of reducing interference is achieved without increasing circuit losses and costs.
Patent Information
- Application Number
- CN202010054876.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-17
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-01-17
AI Technical Summary
The high-frequency signals generated by the PWM circuit when the power device is turned on or off cause interference to the surrounding circuits and electrical appliances, and existing solutions increase circuit switching losses and system costs.
A PWM signal generation circuit including registers, shifters, adders, counters and comparators was designed. PWM signal generation circuit was realized through hardware logic circuits, reducing external interference of PWM circuits, and using duty cycle and periodic jump modes to disperse. Harmonic energy, reducing interference.
It effectively reduces external interference of PWM circuit, avoids increasing circuit switching losses and system costs, and meets electromagnetic compatibility requirements.
Smart Images

Figure CN111162762B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of control technology, and in particular to a PWM signal generation circuit and method thereof, and a chip including the PWM signal generation circuit. Background Art
[0002] PWM (Pulse width modulation) technology is widely used in switching power supplies, motor drives, energy conversion and other technical fields. By changing the width, duty cycle, frequency and other parameters of the square wave pulse according to a certain rule, the switching time of the power device is changed to obtain the required current, voltage or power.
[0003] However, the square wave pulses generated by the PWM circuit are used to drive the power devices. When the power devices are turned on or off, a large number of high-frequency signals will be generated. These high-frequency signals will interfere with the surrounding circuits and electrical appliances, affecting their normal operation.
[0004] To address this problem, existing solutions to reduce external interference of PWM circuits include: reducing the slope of the rising and falling edges of pulses, adding interference absorption and filtering elements or shielding, etc. However, these solutions increase the switching loss of the circuit and the system cost. Summary of the invention
[0005] The main purpose of the present application is to propose a PWM signal generation circuit and method thereof, and a chip including the PWM signal generation circuit, in order to solve the problem of how to reduce external interference of the PWM circuit.
[0006] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a PWM signal generation circuit, the PWM signal generation circuit comprising a register, a first shifter, a first adder, a counter, a first comparator and an output circuit;
[0007] The register is used to store offset data, duty cycle shift bit number and duty cycle control signal;
[0008] The first shifter is used to shift the offset data according to the duty cycle shift bit number to obtain duty cycle offset data;
[0009] The first adder is used to add the duty cycle offset data and the duty cycle control signal to obtain an added duty cycle control signal;
[0010] The counter is used to count the clock signal and output the count value of the clock signal;
[0011] The first comparator is used to compare the added duty cycle control signal with the count value of the clock signal and output a first comparison value;
[0012] The output circuit is used to output a PWM signal according to the first comparison value.
[0013] In addition, to achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a method for generating a PWM signal, the method comprising:
[0014] Reading the stored offset data, duty cycle shift bit number and duty cycle control signal;
[0015] Shifting the offset data according to the duty cycle shift bit number to obtain duty cycle offset data;
[0016] Adding the duty cycle offset data to the duty cycle control signal to obtain an added duty cycle control signal;
[0017] Compare the added duty cycle control signal with the count value of the clock signal, and output a first comparison value;
[0018] A PWM signal is output according to the first comparison value.
[0019] Furthermore, to achieve the above-mentioned purpose, a third aspect of an embodiment of the present application provides a chip, which includes the PWM signal generation circuit.
[0020] The PWM signal generation circuit and method provided in the embodiments of the present application, as well as a chip including the PWM signal generation circuit, use hardware logic circuits to implement pulse width modulation, reduce external interference of the PWM circuit, and do not increase the switching loss of the circuit and the system cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A block diagram of a circuit for generating a PWM signal provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of a square wave pulse provided in an embodiment of the present application;
[0023] Figure 3 A schematic diagram of the spectrum of a square wave pulse provided in an embodiment of the present application;
[0024] Figure 4 A schematic diagram of the amplitude density spectrum of a square wave pulse provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of a circuit for generating a PWM signal provided in an embodiment of the present application;
[0026] Figure 6Schematic diagram of a method for generating a PWM signal according to an embodiment of the present application.
[0027] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0028] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] Now, various embodiments of the present application will be described with reference to the accompanying drawings. In the following description, suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning.
[0030] In this application, the descriptions involving "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0031] First embodiment:
[0032] like Figure 1 As shown, the first embodiment of the present application provides a PWM signal generation circuit, the PWM signal generation circuit includes a register 11, a first shifter 12, a first adder 13, a counter 14, a first comparator 15 and an output circuit 16;
[0033] The register 11 is used to store offset data, duty cycle shift bit number and duty cycle control signal;
[0034] The first shifter 12 is used to shift the offset data according to the duty cycle shift bit number to obtain duty cycle offset data;
[0035] The first adder 13 is used to add the duty cycle offset data and the duty cycle control signal to obtain an added duty cycle control signal;
[0036] The counter 14 is used to count the clock signal and output the count value of the clock signal;
[0037] The first comparator 15 is used to compare the added duty cycle control signal with the count value of the clock signal and output a first comparison value;
[0038] The output circuit 16 is used to output a PWM signal according to the first comparison value.
[0039] Furthermore, the PWM signal generating circuit further includes a second shifter, a second adder and a second comparator (not shown in the drawings);
[0040] The register 11 is also used to store the periodic shift bit number and the periodic control signal;
[0041] The second shifter is used to shift the offset data according to the periodic shift bit number to obtain periodic offset data;
[0042] The second adder is used to add the period offset data and the period control signal to obtain an added period control signal;
[0043] The second comparator is further used to compare the added period control signal with the count value of the clock signal and output a second comparison value;
[0044] The output circuit 16 is further configured to output a PWM signal according to the second comparison value.
[0045] Furthermore, the register 11 is also used to store the valid number of offset data;
[0046] The first shifter 12 is further configured to shift the offset data according to the duty cycle shift bit number to obtain duty cycle offset data when the valid number of the offset data is not zero;
[0047] The second shifter is further configured to shift the offset data according to the periodic shift bit number to obtain periodic offset data when the valid number of the offset data is not zero.
[0048] Furthermore, the register 11 is also used to store a working mode flag; the working mode flag is used to indicate that the current working mode is a default mode, a duty cycle jump mode, a frequency jump mode, or an associated jump mode;
[0049] The first shifter 12 is further configured to shift the offset data according to the duty cycle shift bit number to obtain duty cycle offset data when the current working mode is the duty cycle jump mode or the associated jump mode;
[0050] The second shifter is further used to shift the offset data according to the periodic shift bit number to obtain periodic offset data when the current working mode is the frequency hopping mode or the associated hopping mode.
[0051] In order to better illustrate this embodiment, the following Figure 2-Figure 5 To explain:
[0052] like Figure 2 As shown, the pulse width modulation circuit generates square wave pulses. Figure 2 The figure shows a square wave pulse with frequency ω0. Its Fourier series expansion is:
[0053]
[0054] It can be seen that the fundamental component of the signal is the largest, and it also contains third, fifth, ... and other odd harmonic components. The spectrum is as follows Figure 3 As shown, these harmonic components can easily interfere with peripheral circuits.
[0055] By performing harmonic analysis on the square wave signal generated by pulse width modulation, the amplitude and phase angle of each harmonic in the waveform can be obtained. In electromagnetic compatibility technology, it is most important to limit the harmonic amplitude within the specified limit. The distribution of each harmonic amplitude with frequency is called the amplitude density spectrum. At frequency f1, the harmonic amplitude with a bandwidth of Δf is F(f1)Δf, such as Figure 4 shown.
[0056] The spectrum of the periodic pulse width modulation signal is discrete, and the height of each spectrum line is the amplitude of the second harmonic, the third harmonic, etc., and the distance between the spectrum lines is an integer multiple of the fundamental frequency. After the frequency jitter technology is adopted, the amplitude of the fundamental frequency change is ±delta, the second harmonic is ±2*delta, and the nth harmonic is ±n*delta, that is, the higher the harmonic order, the greater the frequency dispersion. In this way, the dispersion of harmonic frequency reduces the energy superposition of each harmonic, so that the harmonic energy peak can be dispersed and reduced, thus ensuring the amplitude margin in the entire frequency band and meeting the requirements of electromagnetic compatibility.
[0057] Based on the above analysis, if Figure 5 A PWM signal generation circuit is provided as shown. The Mod[1:0] bits of the PWM_CONF1 register in the figure can be used to select the circuit's operating mode through software configuration. This circuit is designed with 4 operating modes, namely, the default mode, the duty cycle jump mode, the frequency jump mode, and the associated jump mode.
[0058] In default mode, the PWM circuit operates in a typical manner without additional PWM. The period and duty cycle information is written to the PERIOD_BASE and DUTY_CYCLE_BASE registers and takes effect at the beginning of the next PWM cycle.
[0059] In the duty cycle jump mode, the duty cycle jump offset is stored in the OFFSET_REGISTER_BANK register. When the circuit generates a waveform, these data are continuously read in, shifted, and added to the number in the DUTY_CYCLE_BASE register, and then used to update the DUTY_CYCLE register so that it can take effect in the next cycle. In this process, the OFFSET_LEN[4:0] bit in the PWM_CONF2 register is used to indicate the valid number of duty cycle jump data, and the PreDC[2:0] bit in the PWM_CONF1 register gives the number of shifted bits.
[0060] The frequency hopping mode works similarly to the duty cycle hopping mode, with the main difference being that the PrePeri[2:0] bits are used to indicate the number of bits to shift left, and the result of the shift addition is used to update the PERIOD register.
[0061] In the associated hopping mode, the offset data in the OFFSET_REGISTER_BANK register is used alternately to generate duty cycle and frequency hopping, thereby improving the pulse width amplitude resolution while achieving frequency hopping to reduce external interference.
[0062] In actual use, the jitter parameters are calculated and simulated in advance, and then configured into the FPGA or chip for testing.
[0063] The PWM signal generation circuit provided in the embodiment of the present application uses a hardware logic circuit to implement pulse width modulation, which reduces external interference of the PWM circuit and does not increase the switching loss of the circuit and the system cost.
[0064] Second embodiment:
[0065] like Figure 6 As shown, the second embodiment of the present application provides a method for generating a PWM signal, the method comprising:
[0066] Step S21, reading the stored offset data, duty cycle shift bit number and duty cycle control signal;
[0067] Step S22, shifting the offset data according to the duty cycle shift bit number to obtain duty cycle offset data;
[0068] Step S23, adding the duty cycle offset data to the duty cycle control signal to obtain an added duty cycle control signal;
[0069] Step S24, comparing the added duty cycle control signal with the count value of the clock signal, and outputting a first comparison value;
[0070] Step S25: output a PWM signal according to the first comparison value.
[0071] Furthermore, the method further comprises:
[0072] Read the register to store the periodic shift bit number and periodic control signal;
[0073] Shifting the offset data according to the periodic shift bit number to obtain periodic offset data;
[0074] Adding the period offset data to the period control signal to obtain an added period control signal;
[0075] Comparing the added period control signal with the count value of the clock signal, and outputting a second comparison value;
[0076] A PWM signal is output according to the second comparison value.
[0077] Furthermore, the method further comprises:
[0078] Read the valid number of registered offset data;
[0079] The step of shifting the offset data according to the duty cycle shift bit number to obtain the duty cycle offset data includes:
[0080] When the valid number of the offset data is not zero, shifting the offset data according to the duty cycle shift bit number to obtain duty cycle offset data;
[0081] The step of shifting the offset data according to the periodic shift bit number to obtain the periodic offset data includes:
[0082] When the valid number of the offset data is not zero, the offset data is shifted according to the periodic shift bit number to obtain periodic offset data.
[0083] Furthermore, the method further comprises:
[0084] Reading the stored working mode flag; the working mode flag is used to indicate that the current working mode is a duty cycle jump mode, a frequency jump mode, or an associated jump mode;
[0085] The step of shifting the offset data according to the duty cycle shift bit number to obtain the duty cycle offset data includes:
[0086] When the current working mode is the duty cycle jump mode or the associated jump mode, the offset data is shifted according to the duty cycle shift bit number to obtain the duty cycle offset data;
[0087] The step of shifting the offset data according to the periodic shift bit number to obtain the periodic offset data includes:
[0088] When the current working mode is the frequency hopping mode or the correlation hopping mode, the offset data is shifted according to the periodic shift bit number to obtain the periodic offset data.
[0089] The method for generating a PWM signal provided in the embodiment of the present application reduces external interference of the PWM circuit and does not increase the switching loss and system cost of the circuit.
[0090] Third embodiment:
[0091] A third embodiment of the present application provides a chip, wherein the chip includes the PWM signal generating circuit described in the first embodiment.
[0092] Among them, the circuit for generating the PWM signal can refer to the aforementioned content and will not be described in detail here.
[0093] In this example, the chip is an FPGA or a dedicated integrated circuit.
[0094] The chip provided in the embodiment of the present application uses a hardware logic circuit to implement pulse width modulation, which reduces external interference of the PWM circuit and does not increase the switching loss of the circuit and the system cost.
[0095] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0096] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A PWM signal generating circuit, characterized in that: The PWM signal generating circuit includes a register, a first shifter, a first adder, a counter, a first comparator and an output circuit; The register is used to store offset data, duty cycle shift bit number and duty cycle control signal; The first shifter is used to shift the offset data according to the duty cycle shift bit number to obtain duty cycle offset data; The first adder is used to add the duty cycle offset data and the duty cycle control signal to obtain an added duty cycle control signal; The counter is used to count the clock signal and output the count value of the clock signal; The first comparator is used to compare the added duty cycle control signal with the count value of the clock signal and output a first comparison value; The output circuit is used to output a PWM signal according to the first comparison value.
2. The PWM signal generating circuit according to claim 1, characterized in that: The PWM signal generating circuit further includes a second shifter, a second adder and a second comparator; The register is also used to store the periodic shift bit number and the periodic control signal; The second shifter is used to shift the offset data according to the periodic shift bit number to obtain periodic offset data; The second adder is used to add the period offset data and the period control signal to obtain an added period control signal; The second comparator is further used to compare the added period control signal with the count value of the clock signal and output a second comparison value; The output circuit is further configured to output a PWM signal according to the second comparison value.
3. The PWM signal generating circuit according to claim 2, characterized in that: The register is also used to store the valid number of offset data; The first shifter is further configured to shift the offset data according to the duty cycle shift bit number to obtain duty cycle offset data when the valid number of the offset data is not zero; The second shifter is further configured to shift the offset data according to the periodic shift bit number to obtain periodic offset data when the valid number of the offset data is not zero.
4. The PWM signal generating circuit according to claim 2, characterized in that: The register is also used to store a working mode flag; the working mode flag is used to indicate that the current working mode is a duty cycle jump mode, a frequency jump mode, or an associated jump mode; The first shifter is further configured to shift the offset data according to the duty cycle shift bit number to obtain duty cycle offset data when the current working mode is the duty cycle jump mode or the associated jump mode; The second shifter is further used to shift the offset data according to the periodic shift bit number to obtain periodic offset data when the current working mode is the frequency hopping mode or the associated hopping mode.
5. A method for generating a PWM signal, characterized in that: The method comprises: Reading the stored offset data, duty cycle shift bit number and duty cycle control signal; Shifting the offset data according to the duty cycle shift bit number to obtain duty cycle offset data; Adding the duty cycle offset data to the duty cycle control signal to obtain an added duty cycle control signal; Compare the added duty cycle control signal with the count value of the clock signal, and output a first comparison value; A PWM signal is output according to the first comparison value.
6. The method for generating a PWM signal according to claim 5, characterized in that: The method further comprises: Read the register to store the periodic shift bit number and periodic control signal; Shifting the offset data according to the periodic shift bit number to obtain periodic offset data; Adding the period offset data to the period control signal to obtain an added period control signal; Comparing the added period control signal with the count value of the clock signal, and outputting a second comparison value; A PWM signal is output according to the second comparison value.
7. The method for generating a PWM signal according to claim 6, characterized in that: The method further comprises: Read the valid number of registered offset data; The step of shifting the offset data according to the duty cycle shift bit number to obtain the duty cycle offset data includes: When the valid number of the offset data is not zero, shifting the offset data according to the duty cycle shift bit number to obtain duty cycle offset data; The step of shifting the offset data according to the periodic shift bit number to obtain the periodic offset data includes: When the valid number of the offset data is not zero, the offset data is shifted according to the periodic shift bit number to obtain periodic offset data.
8. The method for generating a PWM signal according to claim 6, characterized in that: The method further comprises: Reading the stored working mode flag; the working mode flag is used to indicate that the current working mode is a duty cycle jump mode, a frequency jump mode, or an associated jump mode; The step of shifting the offset data according to the duty cycle shift bit number to obtain the duty cycle offset data includes: When the current working mode is the duty cycle jump mode or the associated jump mode, the offset data is shifted according to the duty cycle shift bit number to obtain the duty cycle offset data; The step of shifting the offset data according to the periodic shift bit number to obtain the periodic offset data includes: When the current working mode is the frequency hopping mode or the correlation hopping mode, the offset data is shifted according to the periodic shift bit number to obtain the periodic offset data.
9. A chip, characterized in that: The chip comprises a PWM signal generating circuit as described in any one of claims 1-4.
10. The chip according to claim 9, characterized in that: The chip is a FPGA or a dedicated integrated chip.
