CN101800528B - Method and device for extending controller PWM resolution - Google Patents
Method and device for extending controller PWM resolution Download PDFInfo
- Publication number
- CN101800528B CN101800528B CN 201010103425 CN201010103425A CN101800528B CN 101800528 B CN101800528 B CN 101800528B CN 201010103425 CN201010103425 CN 201010103425 CN 201010103425 A CN201010103425 A CN 201010103425A CN 101800528 B CN101800528 B CN 101800528B
- Authority
- CN
- China
- Prior art keywords
- pwm
- analog quantity
- software extensions
- value
- resolution
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000001914 filtration Methods 0.000 claims description 8
- 230000000052 comparative effect Effects 0.000 claims description 7
- 230000003247 decreasing effect Effects 0.000 abstract 2
- 230000008569 process Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000004088 simulation Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M1/00—Analogue/digital conversion; Digital/analogue conversion
- H03M1/66—Digital/analogue converters
- H03M1/82—Digital/analogue converters with intermediate conversion to time interval
- H03M1/822—Digital/analogue converters with intermediate conversion to time interval using pulse width modulation
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K7/00—Modulating pulses with a continuously-variable modulating signal
- H03K7/08—Duration or width modulation ; Duty cycle modulation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Dc-Dc Converters (AREA)
- Circuit Arrangement For Electric Light Sources In General (AREA)
Abstract
The invention is suitable for the field of PWM control and discloses a method and a device for extending controller PWM resolution. The method has the following steps: reading the actual value of a current analog quantity; acquiring the value of a preset analog quantity; comparing the actual value of the current analog quantity with the value of the preset analog quantity; and adjusting the extended PWM duty ratio of the software along the direction of increased analog quantity if the actual value of the current analog quantity is smaller than the value of the preset analog quantity, otherwise adjusting the extended PWM duty ratio of the software along the direction of decreased analog quantity. The invention can effectively extend PWM resolution on the basis of not decreasing PWM frequency so as to satisfy the requirements of fine control application field; and a high main-frequency controller is avoided, thus system power consumption and cost are effectively lowered.
Description
Technical field
The invention belongs to the PWM control field, relate in particular to the method and system of a kind of controller expansion PWM frequency and resolution.
Background technology
Pulse width modulation (Pulse Width Modulation, PWM) be to utilize the numeral of microprocessor to export a kind of very effective technology that analog circuit is controlled, be widely used in from many fields of measure, communicate by letter power control and conversion.
PWM is by with digital form control simulation circuit, cost and power consumption that can the decrease system.In addition, many microcontrollers and DSP have comprised the PWM controller at chip.
Base because CPU frequency is all lower, all is lower than 20M with the PWM control system of single-chip microcomputer usually, and take the single-chip microcomputer of a 8M and 16M dominant frequency as example, the relation of PWM resolution and frequency sees also Fig. 1:
In Fig. 1, can find out, one based in the single-chip microcomputer regulator control system of 16M high primary frequency when PWM resolution is 12Bit, the PWM frequency only has 3.9K, this can not meet the demands in AC/DC or DC/DC conversion fully, could satisfy in the DC/DC transformation system requirement to frequency when PWM resolution is 6Bit or 7Bit.But this moment is because PWM resolution is low, no matter adopt which kind of digital filtering technique, also no matter how high the ADC resolution of single-chip microcomputer is, the digital ripple of PWM regulator control system is quite significantly (seeing also Fig. 2).
Therefore, how effectively expanding the resolution of PWM on the basis that does not reduce the PWM frequency, is one of direction of digital processing technology area research.
Summary of the invention
The purpose of the embodiment of the invention is to provide a kind of method of extending controller PWM resolution, is intended to not reduce on the basis of PWM frequency the effectively resolution of expansion PWM.
The embodiment of the invention is achieved in that a kind of method of extending controller PWM resolution, said method comprising the steps of:
Read the actual value of current analog quantity;
Obtain the value of predefined analog quantity;
The actual value of current analog quantity and the value of predefined analog quantity are compared;
If the actual value of current analog quantity less than predefined analog value, is then adjusted the PWM duty ratio of software extensions to the direction that increases current analog quantity;
If the actual value of current analog quantity greater than the value of predefined analog quantity, is then adjusted the duty ratio of the PWM of software extensions to the direction that reduces current analog quantity.
The purpose of the embodiment of the invention also is to provide a kind of device of extending controller PWM resolution, comprising:
Current analog quantity acquiring unit is for the actual value that reads current analog quantity;
Default analog quantity acquiring unit is for the value of obtaining predefined analog quantity;
Comparing unit is used for the actual value of current analog quantity and the value of predefined analog quantity are compared;
Adjustment unit is used for the comparative result according to described comparing unit, adjusts the PWM duty ratio of software extensions to the direction that increases current analog quantity by the PWM control register, perhaps adjusts the duty ratio of the PWM of software extensions to the direction that reduces current analog quantity.
The embodiment of the invention is based on the software extensions on the basis of controller hardware PWM resolution, carry out the comparison of size by more current simulation numberical value of quantity and predefined simulation numberical value of quantity, according to the duty ratio of the PWM after the comparative result adjustment software extensions, to reach accurate control.The present invention has expanded the resolution of PWM very effectively on the basis that does not reduce the PWM frequency, can use the cheaply expensive meticulous software control of dsp chip realization of controller replacement high primary frequency of low dominant frequency, is beneficial to and reduces system power dissipation and cost.
Description of drawings
Fig. 1 be in the prior art PWM resolution and frequency concern schematic diagram;
Fig. 2 is the digital ripple figure of PWM regulator control system in the prior art;
Fig. 3 is the structure of the device software of the extending controller PWM resolution that provides of the embodiment of the invention;
Fig. 4 is the structure of the device hardware of the extending controller PWM resolution that provides of the embodiment of the invention
Fig. 5 A to 5F is the oscillogram of the software extensions PWM 2Bit resolution that provides of the embodiment of the invention;
Fig. 6 A to 6B is the schematic diagram that concerns of the PWM resolution that provides of the embodiment of the invention and frequency;
Fig. 7 A to 7B is the digital ripple figure of the PWM regulator control system that provides of the embodiment of the invention;
Fig. 8 is the flow chart of the method for the extending controller PWM resolution that provides of the embodiment of the invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, is not intended to limit the present invention.
The embodiment of the invention by the size of more current electric current and predefined electric current, is adjusted the duty ratio of PWM, to reach the purpose of high precision electro current control based on the software extensions on the basis of controller hardware PWM resolution according to comparative result.
Fig. 3 shows the structure of the device of the expansion controller PWM resolution that the embodiment of the invention provides.
Wherein, current analog quantity acquiring unit 31 is for the actual value that reads current analog quantity.
Preferably, described analog quantity comprises electric current, voltage, motor speed, temperature and LED brightness, certainly also is not limited to above-mentioned severally, does not enumerate one by one herein.
Default analog quantity acquiring unit 32 is for the value of obtaining predefined analog quantity.
Comparing unit 33, compare for the actual value of the current analog quantity that described current analog quantity acquiring unit 31 is obtained and the value of the predefined analog quantity that described default analog quantity acquiring unit 32 obtains, comparative result comprises following two parts: the actual value of current analog quantity is less than predefined analog value, and the actual value of current analog quantity is greater than the value of predefined analog quantity.
If the actual value of current analog quantity is less than predefined analog value, 34 directions to the current analog quantity of increase of adjustment unit are adjusted the PWM duty ratios of software extensions;
If the actual value of current analog quantity is greater than the value of predefined analog quantity, 34 duty ratios from the PWM of software extensions to the direction that reduces current analog quantity that adjust of adjustment unit.
The embodiment of the invention is by adjusting described duty ratio, so that the actual value of current analog quantity is near set point.
Described device also includes digital filtering unit 35, and in the process that adjustment unit 34 is adjusted, digital filtering unit 35 is used for according to controller digital filtering being carried out in deviation of reading and the interference of current operating supply voltage introducing ripple of described ADC.
In specific implementation process, described controller includes the ADC port that connects ADC and the PWM port (scheming not shown) that connects PWM.
See also Fig. 4, this figure is actual hardware adjustment structure chart, includes PWM input clock, PWM counter, PWM data register, PWM comparator, PWM controller and PWM output pin.
Wherein, the frequency of PWM is come by the figure place of counter and the incoming frequency of PWM input clock determines: be 8M such as incoming frequency, counter is 8Bit, and the PWM frequency is 8000/2^8=31.25K, and the PWM frequency was 8000/2^7=62.5K when counter was 7Bit.
The oscillogram of the software extensions 2Bit PWM resolution that Fig. 5 A to Fig. 5 D provides for the embodiment of the invention:
For example, normal PWM waveform such as Fig. 5 A;
When the software extensions position adds 1, add 1 take 4 impulse trains as first pulse duration of one group, all the other pulse durations are constant, such as Fig. 5 B;
When the software extensions position adds 2, add 1 take 4 impulse trains as one group first and the second pulse duration, all the other pulse durations are constant, such as Fig. 5 C;
When the software extensions position adds 3, add 1 take 4 impulse trains as one group the 1st, 2,3 pulse durations, all the other pulse durations are constant, such as Fig. 5 D;
When the software extensions position added 4, the zero clearing of software extensions position, hardware PWM Duty cycle added 1, such as Fig. 5 E.
Fig. 6 A be software extensions PWM 2Bit resolution with the schematic diagram that concerns frequency, Fig. 6 B be software extensions PWM 4Bit resolution with the schematic diagram that concerns frequency.
The digital ripple figure of the software extensions 4Bit PWM resolution that the digital ripple figure of the PWM 2Bit that Fig. 7 A provides for the embodiment of the invention, Fig. 7 B provide for the embodiment of the invention.
In specific implementation process, the PWM frequency control system of the embodiment of the invention has the interruption of overflowing, when the PWM frequency is higher such as 250K, the controller dominant frequency is had relatively high expectations, at this moment, controller is with the counter pwm pulse number that adds up, zero clearing is counted again when pulse number equals extension bits, and pulse number is during greater than the duty cycle of software extensions position, and hardware PWM duty cycle remains unchanged, when pulse number during less than the Duty cycle of software extensions position, hardware PWM duty cycle adds 1.
The controller that Fig. 8 shows the embodiment of the invention to be provided is controlled the flow process of the method for PWM.
In step S801, read the actual value of current analog quantity;
Preferably, described analog quantity comprises electric current, voltage, motor speed, temperature and LED brightness, certainly also is not limited to above-mentioned severally, does not enumerate one by one herein.
In step S802, obtain the value of predefined analog quantity;
In step S803, the actual value of current analog quantity and the value of predefined analog quantity are compared;
If the actual value of current analog quantity is then carried out step S604 less than predefined analog value; If the actual value of current analog quantity greater than the value of predefined analog quantity, is then carried out step S605;
In step S804, adjust the duty ratio of the PWM of software extensions to the direction that increases current analog quantity;
In step S805, adjust the duty ratio of the PWM of software extensions to the direction that reduces current analog quantity;
In step S806, by adjusting described duty ratio, the actual value of current analog quantity is near set point.
In specific implementation process, described controller includes the ADC port that connects ADC and the PWM port that connects PWM, when adjusting, introduce the ripple interference according to deviation of reading and the operating supply voltage of described ADC, rationally adopt arithmetic mean method to carry out digital filtering.
The embodiment of the invention is by the size of more current electric current and predefined electric current, adjust the duty ratio of the PWM of software extensions according to comparative result, do not using in the expensive DSP situation of high primary frequency, on the basis that does not reduce the PWM frequency, very effectively expanded the resolution of PWM, be beneficial to and reduce system power dissipation and cost.
The above only is preferred embodiment of the present invention, not in order to limiting the present invention, all any modifications of doing within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.
Claims (6)
1. the method for an extending controller PWM resolution is characterized in that, said method comprising the steps of:
Read the actual value of current analog quantity; Described analog quantity comprises electric current, voltage, motor speed, temperature and LED brightness;
Obtain the value of predefined analog quantity;
The actual value of current analog quantity and the value of predefined analog quantity are compared;
If the actual value of current analog quantity less than predefined analog value, is then adjusted the PWM duty ratio of software extensions to the direction that increases current analog quantity;
If the actual value of current analog quantity greater than the value of predefined analog quantity, is then adjusted the duty ratio of the PWM of software extensions to the direction that reduces current analog quantity;
Wherein, when the PWM frequency is 256K, controller is with the counter pwm pulse number that adds up, zero clearing is counted again when pulse number equals extension bits, pulse number is during greater than the duty cycle of software extensions position, hardware PWM duty cycle remains unchanged, and when pulse number during less than the Duty cycle of software extensions position, hardware PWM duty cycle adds 1;
Particularly, when software extensions 2Bit PWM resolution,
When the software extensions position adds 1, add 1 take 4 impulse trains as first pulse duration of one group, all the other pulse durations are constant;
When the software extensions position adds 2, add 1 take 4 impulse trains as one group first and the second pulse duration, all the other pulse durations are constant;
When the software extensions position adds 3, add 1 take 4 impulse trains as one group the 1st, 2,3 pulse durations, all the other pulse durations are constant;
When the software extensions position added 4, the zero clearing of software extensions position, hardware PWM Duty cycle added 1.
2. the method for extending controller PWM resolution as claimed in claim 1 is characterized in that, described controller includes ADC port and PWM port.
3. the method for extending controller PWM resolution as claimed in claim 1 is characterized in that, when adjusting the duty ratio of PWM according to comparative result, described method also comprises:
According to controller digital filtering is carried out in deviation of reading and the interference of current operating supply voltage introducing ripple of ADC.
4. the device of an extending controller PWM resolution is characterized in that, comprising:
Current analog quantity acquiring unit is for the actual value that reads current analog quantity; Described analog quantity comprises electric current, voltage, temperature, motor speed and LED brightness;
Default analog quantity acquiring unit is for the value of obtaining predefined analog quantity;
Comparing unit is used for the actual value of current analog quantity and the value of predefined analog quantity are compared;
Adjustment unit is used for the comparative result according to described comparing unit, adjusts the PWM duty ratio of software extensions to the direction that increases current analog quantity by the PWM control register, perhaps adjusts the duty ratio of the PWM of software extensions to the direction that reduces current analog quantity;
Wherein, when the PWM frequency is 256K, controller is with the counter pwm pulse number that adds up, zero clearing is counted again when pulse number equals extension bits, pulse number is during greater than the duty cycle of software extensions position, hardware PWM duty cycle remains unchanged, and when pulse number during less than the Duty cycle of software extensions position, hardware PWM duty cycle adds 1;
Particularly, when software extensions 2Bit PWM resolution,
When the software extensions position adds 1, add 1 take 4 impulse trains as first pulse duration of one group, all the other pulse durations are constant;
When the software extensions position adds 2, add 1 take 4 impulse trains as one group first and the second pulse duration, all the other pulse durations are constant;
When the software extensions position adds 3, add 1 take 4 impulse trains as one group the 1st, 2,3 pulse durations, all the other pulse durations are constant;
When the software extensions position added 4, the zero clearing of software extensions position, hardware PWM Duty cycle added 1.
5. the device of extending controller PWM resolution as claimed in claim 4 is characterized in that, described controller includes ADC port and PWM port.
6. the device of extending controller PWM resolution as claimed in claim 4 is characterized in that, described device also comprises:
The digital filtering unit is used for according to controller digital filtering being carried out in deviation of reading and the interference of current operating supply voltage introducing ripple of ADC.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010103425 CN101800528B (en) | 2010-01-26 | 2010-01-26 | Method and device for extending controller PWM resolution |
PCT/CN2011/070525 WO2011091741A1 (en) | 2010-01-26 | 2011-01-24 | Method and device for extending controller pulse width modulation (pwm) resolution |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010103425 CN101800528B (en) | 2010-01-26 | 2010-01-26 | Method and device for extending controller PWM resolution |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101800528A CN101800528A (en) | 2010-08-11 |
CN101800528B true CN101800528B (en) | 2013-01-16 |
Family
ID=42596056
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201010103425 Active CN101800528B (en) | 2010-01-26 | 2010-01-26 | Method and device for extending controller PWM resolution |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN101800528B (en) |
WO (1) | WO2011091741A1 (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101800528B (en) * | 2010-01-26 | 2013-01-16 | 深圳市京泉华电子有限公司 | Method and device for extending controller PWM resolution |
CN102402953B (en) * | 2011-12-08 | 2014-07-16 | 深圳市华星光电技术有限公司 | Driving circuit and method of light-emitting diode and display device applying same |
CN104254974B (en) | 2012-03-20 | 2017-05-17 | 德克萨斯仪器股份有限公司 | Pwm duty cycle synthesizer and method with adjustable corner frequency |
CN103888006B (en) * | 2014-03-07 | 2016-11-23 | 杭州电子科技大学 | A kind of driving pulse numeral implementation method of Single-chip Controlling inverter work |
CN108519522A (en) * | 2018-03-27 | 2018-09-11 | 系新电子技术(苏州)有限公司 | One kind instantaneously accounting for/sky ratio measuring method |
CN110572141B (en) * | 2019-08-16 | 2024-02-13 | 赛特威尔电子股份有限公司 | Method and device for improving precision of PWM controller |
CN113759288B (en) * | 2021-11-08 | 2022-03-11 | 深圳市德兰明海科技有限公司 | Leakage current detection circuit and method and leakage current detector |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1717855A (en) * | 2003-01-22 | 2006-01-04 | 美蓓亚株式会社 | Pulse-width modular circuit and method for controlling a pulse-width modular circuit |
CN1802791A (en) * | 2003-06-11 | 2006-07-12 | 皇家飞利浦电子股份有限公司 | High resolution PWM generator or digitally controlled oscillator |
CN101133553A (en) * | 2005-09-13 | 2008-02-27 | 丰田自动车株式会社 | PWM signal generating circuit |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN201285505Y (en) * | 2008-10-30 | 2009-08-05 | Bcd半导体制造有限公司 | PWM control circuit with minimum duty ratio adjustable |
CN101800528B (en) * | 2010-01-26 | 2013-01-16 | 深圳市京泉华电子有限公司 | Method and device for extending controller PWM resolution |
-
2010
- 2010-01-26 CN CN 201010103425 patent/CN101800528B/en active Active
-
2011
- 2011-01-24 WO PCT/CN2011/070525 patent/WO2011091741A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1717855A (en) * | 2003-01-22 | 2006-01-04 | 美蓓亚株式会社 | Pulse-width modular circuit and method for controlling a pulse-width modular circuit |
CN1802791A (en) * | 2003-06-11 | 2006-07-12 | 皇家飞利浦电子股份有限公司 | High resolution PWM generator or digitally controlled oscillator |
CN101133553A (en) * | 2005-09-13 | 2008-02-27 | 丰田自动车株式会社 | PWM signal generating circuit |
Also Published As
Publication number | Publication date |
---|---|
WO2011091741A1 (en) | 2011-08-04 |
CN101800528A (en) | 2010-08-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101800528B (en) | Method and device for extending controller PWM resolution | |
CN103532373B (en) | Switching regulator output capacitor current estimates | |
US8502481B2 (en) | Phase shift controller | |
CN103187875A (en) | Switching regulator and control circuit and control method thereof | |
US20120112719A1 (en) | Rectifier circuit | |
CN103916004A (en) | Power factor correction circuit and control method thereof | |
CN102097924B (en) | Drive control circuit for shunt-wound synchronous rectification tubes and switching power supply | |
CN101754541A (en) | DC bus voltage following control circuit suitable for multi-path parallel LEDs | |
CN105992436B (en) | LED drive device and its control method | |
CN101985946B (en) | Fan speed-regulation control circuit as well as control method and electronic device thereof | |
CN104640330A (en) | Light emitting diode driver and control method thereof | |
CN103516203B (en) | DC-DC controller and operation method thereof | |
CN102215616A (en) | PWM (pulse width modulation)-based LED (light emitting diode) linear dimming circuit | |
CN203775025U (en) | Power factor correction circuit and control circuit thereof | |
US9912229B2 (en) | Multiple output integrated power factor correction | |
CN106533154A (en) | Load transient and jitter of improved dc-dc converter | |
CN203801118U (en) | High-efficiency linear LED driver based on adaptive control | |
CN102684495B (en) | Digital power supply control circuit, control method and digital power supply using circuit and method | |
CN105141043B (en) | Wireless charging control method and device | |
CN103580508B (en) | Ac/dc converter circuit | |
US8947062B2 (en) | Power supply circuit | |
CN102412713A (en) | Switching power supply as well as control circuit and control method thereof | |
CN204578355U (en) | A kind of quadratic form Buck power factor correcting converter | |
CN103809719B (en) | Circuit board and the power-supply management system for circuit board | |
TW201249093A (en) | Ventilation apparatus with feedback compensation control and method for operating the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
C56 | Change in the name or address of the patentee |
Owner name: SHENZHEN JINGQUANHUA TECHNOLOGY CO., LTD. Free format text: FORMER NAME: SHENZHEN JINGQUANHUA ELECTRONICS CO., LTD. |
|
CP01 | Change in the name or title of a patent holder |
Address after: 518000 Guangdong province Shenzhen City Guanlan town library pit Jingquan Industrial Park Patentee after: Shenzhen JingQuanHua Electronics Co., Ltd. Address before: 518000 Guangdong province Shenzhen City Guanlan town library pit Jingquan Industrial Park Patentee before: Shenzhen Jingquanhua Electronics Co., Ltd. |