Using PWM to get precise output voltage

Publisher:星际穿越Latest update time:2012-03-19 Source: 单片机与嵌入式系统应用 Keywords:PWM Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In recent years, many single-chip microcomputer manufacturers, such as Atmel, Analog Devices, Intel, Philips, Dallas, Maxim, etc., have launched new high-speed single-chip microcomputers. Their instruction execution cycle is only 1/3 to 1/10 of the original, and EEPROM, WDT, A/D converter and D/A converter are integrated in the single-chip microcomputer, which greatly improves the performance of the single-chip microcomputer and facilitates users. However, the output of the D/A converter in many single-chip microcomputers adopts the form of pulse width modulation (PWM). PWM is very suitable for the control of switching power supplies, thyristors and other devices, and can also be used in occasions such as LCD brightness control and audio output that do not require accurate voltage output. Since PWM has no reference voltage, the amplitude of its output pulse is not very constant, which limits the scope of PWM. In occasions where precise control voltage output is required, such as precise adjustable voltage sources, motor inverters, etc., PWM cannot be used.

However, only two cheap integrated circuits are needed to convert the PWM output with unstable amplitude into a precise PWM output voltage.

1 Circuit Principle

The circuit principle of using a three-terminal precision reference power supply and an analog switch to obtain a voltage-precision PWM pulse is shown in Figure 1. D1 is a TL431 three-terminal reference voltage integrated circuit, and U1 uses a single-pole double-throw analog switch MAX4544; resistors R1, R2, and R3 are determined according to specific needs. Of course, other types of integrated circuits can also be used.



When the PWM pulse is at a high level (logic 1), the COM terminal of U1 is thrown to the normally closed terminal (NC), the adjustment pin of TL431 is connected to the positive voltage pin, and the output voltage value is 2.5 V. When the PWM pulse is at a low level (logic 0), the COM terminal of U1 is thrown to the normally open terminal (NO), and the output voltage of TL431 is sent to the adjustment pin after being divided by R2 and R3. At this time, the output voltage value is equal to [(R2+R3)/R3]×2.5 V. In this example, the output voltage is equal to 8 V. In this way, when the IN pin of U1 inputs a PWM signal, the circuit outputs a PWM pulse with a high level of 8 V and a low level of 2.5 V, and its amplitude is 8 V - 2.5 V = 5.5 V. If it is necessary to output a PWM signal with a low level of zero, adding a differential amplifier can solve the problem.

In situations where the precision requirement is not very high, a simpler method can be used. Figure 2 is a circuit diagram for stabilizing and limiting PWM pulses using precision voltage regulator diodes. In Figure 2, the PWM signal is amplified by the high-speed operational amplifier U1 to become an output voltage of ±12 V. After the current limiting of R1 and the voltage stabilization of D1, a PWM pulse output of ±6.5 V is obtained.



2 Error Analysis

In Figure 1, as long as the reference power supply is properly selected, the error of the reference power supply itself can be completely ignored. In addition, the sources of error are mainly the following:

(1) Error caused by the on-resistance of the analog switch
The analog switch has a certain on-resistance when it is turned on. When the input current of the TL431 adjustment pin passes through the analog switch, a voltage drop will be formed, resulting in an error. The on-resistance of the MAX4544 is 35 Ω, while the input current of the TL431 adjustment pin is less than 4 μA. As a result, the error of the reference voltage is less than 140 μV, which is 0.000 056 of 2.5 V, equivalent to 14 bits of binary precision.

(2) Error introduced by switch delay time
The switch delay time will cause the pulse duty cycle to change, resulting in an error in the PWM output pulse. The on-time of the MAX4544 is 30 ns and the off-time is 25 ns. Calculation shows that when the PWM frequency is 10 kHz, the maximum error caused by this is 0.0003, equivalent to 12 bits of precision. If the PWM frequency is selected to be lower, the influence of the switching delay time will be reduced accordingly. For example, when 1 kHz is selected, the introduced error is 0.000 03, which is equivalent to 15-bit accuracy.

Among the above two items, the drift of these parameters with temperature and time is what really affects the accuracy of the output power supply. Since the absolute values ​​of these two parameters themselves are very small, it can be inferred that their drift is smaller.

From the above analysis, it can be seen that the error introduced by the additional circuit can fully meet the accuracy requirements of PWM.
In the circuit of Figure 2, there are three main reasons for the error:

(1) Error introduced by the dynamic resistance of the Zener diode
The dynamic resistance of the Zener diode is relatively large, generally around tens of Ω (when the working current is 5~10 mA); while the driving capability of the operational amplifier is relatively small, and the Zener diode can only work at a smaller working current. In addition, the dynamic resistance of the Zener diode is larger when working at a small current, which is more likely to cause voltage changes.

(2) Error introduced by the temperature drift of the Zener diode
The internal structure of 2DW7 (2DW230~236) can be considered to be two Zener diodes connected in series. The forward voltage drop of one diode (with a negative temperature coefficient) compensates the temperature drift of the other Zener diode (with a positive temperature coefficient), resulting in a very low temperature coefficient. However, when 2DW7 is applied in reverse, its temperature drift cannot be properly compensated, resulting in a higher temperature coefficient of the negative pulse part.

(3) Errors introduced by the operational amplifier
The drift of the input offset voltage of the operational amplifier can directly lead to errors in the pulse amplitude; and if the conversion rate (SR) is too low, it will cause distortion of the pulse square wave waveform, which will then cause voltage errors. The price of an operational amplifier with low offset voltage temperature drift and high conversion rate will be very high.

However, for 8~10-bit PWM, this circuit can already meet the requirements. For occasions with lower requirements, two cheap Zener diodes can be connected to replace 2DW7.

3 Application Examples

Using the PWM output of the microcontroller, an RC filter circuit and a first-stage operational amplifier are added to Figure 1 to obtain a 0~10 V DC output voltage as the control signal of the inverter, which has achieved good results. Figure 3 shows an example of using PWM output to control a frequency converter.

Keywords:PWM Reference address:Using PWM to get precise output voltage

Previous article:Application of TCP/IP protocol stack with open source code in remote monitoring
Next article:USB2.0 Features and USB Microcontroller

Recommended ReadingLatest update time:2024-11-17 02:26

[Lianshengde W806 Hands-on Notes] 4. PWM Module
Windows 10 20H2 HLK-W806-V1.0-KIT WM_SDK_W806_v0.6.0        Excerpted from "W806 Chip Design Guide V1.0", "W806 MCU Chip Specification V2.0" PWM Controller        5-channel PWM signal generation function        2-channel input signal capture function (PWM0 and PWM4 two channels)        Frequency range: 3Hz~160KHz
[Microcontroller]
[Lianshengde W806 Hands-on Notes] 4. PWM Module
Xiaomi's new flagship with 2K screen revealed: supports 1920Hz PWM dimming
Yesterday, digital blogger @数码闲聊站 exposed a new Xiaomi flagship and revealed that the new phone will be equipped with a 2K resolution high-definition screen and also support 1920Hz PWM dimming. It is reported that 1920Hz PWM dimming can greatly reduce the flicker of the OLED screen, making it easier on th
[Mobile phone portable]
STM32f4 PWM output experimental code
The pwm.c source file code is as follows:   //TIM14 PWM initialization   //PWM output initialization //arr: automatic reload value psc: clock pre-division number void TIM14_PWM_Init(u32 arr,u32 psc) {                     GPIO_InitTypeDef GPIO_InitStructure;   TIM_TimeBaseInitTypeDef  TIM_TimeBaseStructure;   TIM_OCIni
[Microcontroller]
Design of DC Motor PWM Speed ​​Control System Based on 51 Single Chip Microcomputer
Design ideas The main functions of the DC motor PWM control system include: realizing the acceleration, deceleration, forward rotation, reverse rotation and emergency stop of the DC motor, and adjusting the speed of the motor, which can easily realize the intelligent control of the motor. Main circuit: DC motor PWM
[Microcontroller]
Design of DC Motor PWM Speed ​​Control System Based on 51 Single Chip Microcomputer
STM32PWM output experiment
1. Introduction to PWM To make the general-purpose timer TIMx of STM32 generate PWM output, in addition to the registers mentioned in the timer interrupt experiment, three other registers will be used. These three registers are: capture/compare mode register (TIMx_CCMR1/2), capture/compare enable register (TIMx_CCER),
[Microcontroller]
stc adjustable PWM program
The following program is a pwm program applied to stc12c2052ad, and the test is successful #include reg52.h sfr CCON =0xD8; //PCA control register sfr CMOD =0xD9; sfr CL =0xe9; sfr CH =0xF9; sfr CCAP0L=0xea; sfr CCAP1L=0xeb; sfr CCAP0H=0xfa; sfr CCAP1H=0xfb; sfr CCAPM0 = 0xda; sfr CCAPM1=0xdb; sbit CR=0xde; //bit
[Microcontroller]
Current regeneration method based on motor PWM output
In the previous article on the PWM drive principle of brushed DC motors, a current regeneration method based on short circuiting the two ends of the motor was introduced. In fact, there are other current regeneration methods in the PWM drive of brushed DC motors. Each method in the PWM drive of brushed DC motors has
[Embedded]
Current regeneration method based on motor PWM output
AVR timer fast PWM mode use
PWM is very commonly used. AVR has its own internal PWM function, which is divided into fast PWM mode and phase correction PWM mode. Here we choose method 15, OCR1A saves the upper limit value, and OCR1B saves the matching value, so the output pin OCR1A cannot input PWM, and only OCR1B can output PWM signal. If
[Microcontroller]
AVR timer fast PWM mode use
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号