CN108390664B - Method for generating high-precision voltage based on double-pulse width modulation - Google Patents
Method for generating high-precision voltage based on double-pulse width modulation Download PDFInfo
- Publication number
- CN108390664B CN108390664B CN201810087099.1A CN201810087099A CN108390664B CN 108390664 B CN108390664 B CN 108390664B CN 201810087099 A CN201810087099 A CN 201810087099A CN 108390664 B CN108390664 B CN 108390664B
- Authority
- CN
- China
- Prior art keywords
- voltage
- output
- pwm
- precision
- resistor
- 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 15
- 238000006243 chemical reaction Methods 0.000 claims abstract description 8
- 238000004364 calculation method Methods 0.000 claims description 7
- 230000009977 dual effect Effects 0.000 claims description 3
- 230000007547 defect Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 239000003990 capacitor Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
Images
Classifications
-
- 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
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K3/00—Circuits for generating electric pulses; Monostable, bistable or multistable circuits
- H03K3/01—Details
- H03K3/011—Modifications of generator to compensate for variations in physical values, e.g. voltage, temperature
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03K—PULSE TECHNIQUE
- H03K3/00—Circuits for generating electric pulses; Monostable, bistable or multistable circuits
- H03K3/01—Details
- H03K3/017—Adjustment of width or dutycycle of pulses
Landscapes
- Dc-Dc Converters (AREA)
Abstract
The invention relates to a method for generating high-precision voltage based on double pulse width modulation, which comprises the steps of firstly, calculating two PWM register values M and N to be preset in a microcontroller according to the voltage to be output on the premise of improving the precision of output voltage without adding an external D/A conversion chip, and outputting PWM waves at a duty ratio corresponding to M, N after the PWM register is initialized; and the two paths of output PWM waves are rectified by a PWM rectifying circuit, the direct-current voltage obtained by rectification is connected into an adder circuit to be added according to the proportion, and the direct-current voltage with higher precision is obtained after addition. The invention adopts the PWM waveform generator in the microcontroller to directly improve the precision of the output voltage, makes up for the defect of insufficient output precision of the 8-bit PWM microcontroller and reduces the cost caused by using other D/A conversions.
Description
Technical Field
The invention relates to a method for generating high-precision voltage based on double-pulse width modulation, and belongs to the technical field of electronics.
Background
Pulse Width Modulation (PWM), is to change the duty ratio of the output PWM wave by changing the PWM register, thereby precisely controlling the magnitude of the voltage. The PWM output of the commercially available microcontrollers is mostly 8 bits, which means that the output voltage is adjusted to 28256, calculated at a voltage of 5V with maximum output, 5/256 ≈ 0.0195, so that the incremental gap of the output voltage is 0.0195V.
In practical engineering applications, such precision is often insufficient, and generally the precision of the control voltage is required to be 0.01V or even higher, which needs to be improved from other aspects, for example, the D/a conversion chip is used to accurately control the output voltage, or a microcontroller with higher precision of output PWM is used instead, and the control difficulty is increased by using the D/a conversion chip; replacing a higher precision microcontroller increases costs. The method realizes high-precision control of the output voltage of the microcontroller by using two paths of PWM registers in the microcontroller and adding a simple rectifying and filtering circuit and an adder circuit, and has the advantages of simple circuit and easy realization.
Disclosure of Invention
The invention provides a method for generating high-precision voltage based on double-pulse width modulation, which is used for improving the precision of output voltage by using the resources of a microcontroller and adding an adder circuit on the premise of improving the precision of the output voltage without adding an external D/A conversion chip.
The technical scheme of the invention is as follows: a method for generating high-precision voltage based on double-pulse width modulation includes using voltage V to be output to raise accuracy of output voltage without adding external D/A conversion chipoutCalculating two PWM register values M and N to be preset in a microcontroller, and outputting PWM waves at a duty ratio corresponding to M, N after the PWM registers are initialized; the two output PWM waves are rectified by a PWM rectifying circuit, and the rectified direct-current voltage V is1、V2The direct current voltage V with higher precision is obtained after the addition of the direct current voltage V and the proportion of the direct current voltage Vout'。
PWM register value M, N and rectified DC voltage V1、V2The calculation method comprises the following steps:
where V is the microprocessor output voltage, l is the number of bits of the output PWM wave, VoutIs the voltage to be output;
According to V1Calculating the rectified voltage V to be output from another path2'=2n×(Vout-V1) (ii) a Where n is the number of bits to be increased in precision;
The adder circuit comprises a resistor RM、RN、Rf、Rx、RyAnd two operational amplifiers; wherein the direct current voltageV1Connecting resistor RMOne terminal of (1), DC voltage V2Connecting resistor RNOne terminal of (1), resistance RM、RNThe other end of the resistor R is connected with the inverting input end of one operational amplifierfA resistor R connected to the inverting input and output of one of the operational amplifiersxOne end of the resistor R is connected with the output end of one operational amplifierxThe other end is connected with the inverting input end of another operational amplifier, and a resistor RyThe inverting input end and the output end of the other operational amplifier are connected, and the homodromous input ends of the two operational amplifiers are grounded.
The above-mentionedWherein R isM、RN、Rf、Rx、RyRespectively represent corresponding resistances RM、RN、Rf、Rx、RyThe resistance value of (c).
The invention has the beneficial effects that: the invention adopts the PWM waveform generator in the microcontroller to directly improve the precision of the output voltage, makes up for the defect of insufficient output precision of the 8-bit PWM microcontroller and reduces the cost caused by using other D/A conversions.
Drawings
FIG. 1 is a process diagram of an implementation of the present invention;
FIG. 2 is a PWM rectifier circuit diagram of the present invention;
FIG. 3 is a circuit diagram of an adder according to the present invention.
Detailed Description
Example 1: as shown in fig. 1-3, a method for generating high precision voltage based on dual pulse width modulation comprises the following steps: in this embodiment, the voltage V to be output is setoutFor 2.57V, l is now set to 8 bits and n is set to 8 bits, which allows the controller to increase to 16 bits based on the original 8 bit precision, which allows the voltage resolution to be 5/216) About 0.0000763V; v is set to be 5V; the adder circuit comprises a resistor RM、RN、Rf、Rx、RyAndtwo operational amplifiers; wherein the direct current voltage V1Connecting resistor RMOne terminal of (1), DC voltage V2Connecting resistor RNOne terminal of (1), resistance RM、RNThe other end of the resistor R is connected with the inverting input end of one operational amplifierfA resistor R connected to the inverting input and output of one of the operational amplifiersxOne end of the resistor R is connected with the output end of one operational amplifierxThe other end is connected with the inverting input end of another operational amplifier, and a resistor RyConnecting the inverting input terminal and the output terminal of another operational amplifier, connecting the inverting input terminals of the two operational amplifiers to ground, the first stage acting as an inverting addition, and the second stage acting as an inverting addition, so that R is setM=1kΩ、RN=256kΩ、Rf=1kΩ、Rx=1kΩ、R y1k Ω; the process of the microcontroller calculating the PWM register value M, N is now simulated:
V2'=2n×(Vout-V1)=256×(2.57-2.55859375)=2.92;
then setting the obtained values M, N into PWM registers respectively;
in this embodiment, two PWM waves generated by the microcontroller pass through the PWM rectifier circuit, which is composed of two identical low-pass filters, wherein the low-pass filter is composed of a 10k resistor and a 1uF electrolytic capacitor, as shown in fig. 2;
rectified two-way voltage V1、V2Connected to an adder circuit for addition in a proportional relationship, as shown in FIG. 3, wherein the proportional relationship of the addition isThe calculation in the embodiment shows that:
V1=2.55859375;
error Δ Vout=Vout'-Vout=0.000037841796875;
Instead, if only 8-bit single pulse PWM is used as the output, the formula for calculating M can be rounded down, i.e., the formula is rounded down
ΔVout'=V1-Vout=0.008125;
It is easy to see Δ Vout' much greater than Δ VoutThe method can effectively improve the precision of the output voltage of the microcontroller.
The high-precision direct-current voltage obtained after the addition is connected to other modules needing high-precision voltage control, so that the precision of the output voltage is improved
While the present invention has been described in detail with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, and various changes can be made without departing from the spirit of the present invention within the knowledge of those skilled in the art.
Claims (3)
1. A method for generating high-precision voltage based on double pulse width modulation is characterized in that: firstly, without adding external partsOn the premise of improving the accuracy of the output voltage by the D/A conversion chip, the voltage V to be output is usedoutCalculating two PWM register values M and N to be preset in a microcontroller, and outputting PWM waves at a duty ratio corresponding to M, N after the PWM registers are initialized; the two output PWM waves are rectified by a PWM rectifying circuit, and the rectified direct-current voltage V is1、V2The direct current voltage V with higher precision is obtained after the addition of the direct current voltage V and the proportion of the direct current voltage Vout';
PWM register value M, N and rectified DC voltage V1、V2The calculation method comprises the following steps:
where V is the microprocessor output voltage, l is the number of bits of the output PWM wave, VoutIs the voltage to be output;
According to V1Calculating the rectified voltage V to be output from another path2'=2n×(Vout-V1) (ii) a Where n is the number of bits to be increased in precision;
2. The method for generating high precision voltages based on dual pulse width modulation of claim 1, wherein: the adder circuit comprises a resistor RM、RN、Rf、Rx、RyAnd two operational amplifiers(ii) a Wherein the direct current voltage V1Connecting resistor RMOne terminal of (1), DC voltage V2Connecting resistor RNOne terminal of (1), resistance RM、RNThe other end of the resistor R is connected with the inverting input end of one operational amplifierfA resistor R connected to the inverting input and output of one of the operational amplifiersxOne end of the resistor R is connected with the output end of one operational amplifierxThe other end is connected with the inverting input end of another operational amplifier, and a resistor RyThe inverting input end and the output end of the other operational amplifier are connected, and the homodromous input ends of the two operational amplifiers are grounded.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810087099.1A CN108390664B (en) | 2018-01-30 | 2018-01-30 | Method for generating high-precision voltage based on double-pulse width modulation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810087099.1A CN108390664B (en) | 2018-01-30 | 2018-01-30 | Method for generating high-precision voltage based on double-pulse width modulation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108390664A CN108390664A (en) | 2018-08-10 |
CN108390664B true CN108390664B (en) | 2020-09-25 |
Family
ID=63074092
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810087099.1A Active CN108390664B (en) | 2018-01-30 | 2018-01-30 | Method for generating high-precision voltage based on double-pulse width modulation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108390664B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1134100C (en) * | 2000-07-28 | 2004-01-07 | 上海新源变频电器有限公司 | Zero-voltage switch double-PWM frequency converter |
US8814327B2 (en) * | 2011-07-01 | 2014-08-26 | Canon Kabushiki Kaisha | Power supply apparatus and printing apparatus |
JP6186726B2 (en) * | 2013-01-07 | 2017-08-30 | 株式会社リコー | PWM signal generation circuit, printer, and PWM signal generation method |
CN107342147B (en) * | 2017-08-10 | 2018-09-18 | 温州大学 | A kind of low-power consumption high-speed electro-magnet driving circuit of two voltage signal pulsewidth modulation |
-
2018
- 2018-01-30 CN CN201810087099.1A patent/CN108390664B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108390664A (en) | 2018-08-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI622260B (en) | Buck-boost converter with ramp compensation and controller and control method thereof | |
CN106370912B (en) | Method and system for improving current sampling precision of MOSFET (metal oxide semiconductor field effect transistor) tube and motor driving system | |
TWI408882B (en) | Control device for buck-boost converter | |
CN103916004A (en) | Power factor correction circuit and control method thereof | |
CN105027406B (en) | Impulse density D/A converter with slope-compensation function | |
CN104135151B (en) | DC-DC switching controller | |
CN105978337A (en) | COT control mode based offset voltage canceling circuit | |
CN110943612A (en) | Load current detection circuit and method for switching power supply converter | |
US8624567B2 (en) | Controllers for DC/DC converters | |
CN104617830A (en) | Counter electromotive force zero-cross detection method and method of brushless DC motor, and phase-changing signal output method and circuit | |
CN109039070B (en) | BUCK type DCDC output constant current detection control circuit and method | |
CN104702136B (en) | Correct the controlling circuit of voltage regulation and control method of ripple vehicle-mounted inverter output voltage | |
CN106249792A (en) | Voltage regulator circuit and the operational approach of voltage regulator circuit | |
CN104022772A (en) | Close-loop analog quantity output method and circuit capable of zero setting automatically | |
CN103312198A (en) | Conducting time compensation for switch power converter | |
CN110504826B (en) | LED driving system, ripple removing circuit and method | |
CN108390664B (en) | Method for generating high-precision voltage based on double-pulse width modulation | |
CN106357107A (en) | Voltage regulating circuit and programmable power supply | |
CN103731150B (en) | A kind of analogue quantity output circuit and control method | |
CN102636684A (en) | Alternating voltage peak moment detection circuit | |
CN205921567U (en) | Sawtooth wave produces circuit | |
CN205176712U (en) | Pressure regulating control circuit among AC voltage stabilizer | |
CN103930844A (en) | Control method and system for correcting the voltages to be applied to an electrical load | |
CN103259518A (en) | Magnetic control type memory resistor and control method thereof | |
CN108539972B (en) | Boost converter circuit with memristive load |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |