Pulse-Width-Modulation Digital-To-Analog Converter Phoenix AZ

What benefits are associated with each, which is most appropriate?

Local Companies

KRC Electric Inc.
602-242-0313
Central/West Phoenix
Phoenix, AZ
Y R S Electrical Services
562-290-3446
3540 w cypress
phoenix, AZ
Karstetter's Electric
602-686-1622
4545 E. Montecito
Phoenix, AZ
RDS Electric, Inc.
(623) 937-0003
6618 N. 58th Drive
Glendale, AZ
Aaron Electric
623-937-7400
7623 N. 67th Avenue, #301
Glendale, AZ
Westgate Enterprises,LLC
623-266-9706
P.O. Box 2378
Glendale, AZ
Kimbrell Electric, Inc.
(602) 265-2111
7593 N. 73rd Drive
Glendale, AZ
Artistic Lighting Installs
480-703-7088
4034 E Bloomfield Rd
Phoenix, AZ
FuZe Electrical
480-748-3141
4400 n scottsdale rd 9-230
scottsdale, AZ
McCloskey Electrical, Inc.
(623) 842-4530
PO Box 6090
Glendale, AZ

provided by: Design News

In today?s highly competitive electronics environment, designers are constantly looking for ways to reduce overall system costs. One of the most commonly asked questions analog specialists at digital microcontroller (MCU) companies hear from customers is, is the almost cost-free Pulse-Width-Modulation (PWM) Digital-to-Analog Converter (DAC) good enough for my application or do I need a higher-performance, stand-alone DAC, instead??

The generation of an analog voltage using a digital Pulse-Width-Modulated signal is known as a PWM DAC. As most designers? PCB boards have a microcontroller with a built-in PWM-output feature onboard, a simple digital-to-analog data conversion can be easily realized by adding a few passive components at the MCU?s PWM-output pin, as an alternative to using a stand-alone DAC.

However, in the MCU application environment, system designers can have DAC functionality nearly free of charge. PWM DACs are widely used in very low-cost applications, where accuracy is not a primary concern. Stand-alone DACs, however, are used for applications requiring higher accuracy.

Although the PWM DAC can be realized with the simple addition of a few passive components, implementing a PWM DAC for system applications is not a simple task. There are many limitations associated with this. Understanding the complexities of using the PWM DAC and its effects can save significant development time and effort.

This article presents a technique for converting a PWM pulse to an analog voltage using a simple RC low-pass filter. It also reviews the PWM DAC?s limitations and its key design constraints with regard to resolution, frequency, ripple, settling time and current consumption, which are very important design parameters that are largely affected by the resistor (R) and capacitor (C) values, as well as the PWM duty cycle and frequency.

Stand-alone DACs

Figure 1, above, right, shows an example of a stand-alone DAC. Its analog output voltage is given by:

Where Dn is the digital code. For example, with a 12-bit DAC, the user can get Vout = 2.5V with Vref= 5V and Dn = 1,000-0000-0000. Typical stand-alone DACs provide good linearity and a short settling time, which is the time required to update each output voltage.

How PWM DACs Work

Figure 2, below, shows a basic configuration of the PWM DAC. The MCU outputs a PWM signal to an RC low pass-filter. The PWM pulse train?s digital value becomes an analog voltage, when it passes through the RC filter. At a given period of time, the analog output is proportional to the PWM pulse?s high durations.

A PWM signal is defined as a digital signal with a fixed frequency, but a varying duty cycle. Figure 3, page S19, illustrates a PWM signal. The PWM period (T) is the time interval required to complete one full PWM cycle. The duty cycle is the ratio of the high duration (t) to the total period (T).

The PWM signal and RC-filter circuit parameters affect the analog output?s resolution, amplitude, settling time and ripple. The PWM DAC?s limitations are clearly demonstrated by analyzing the interaction of the PWM parameters and the RC filter. A better understanding of the relationship between these parameters enables designers to optimize the PWM to best suit their application?s requirements, while minimizing design time.

PWM DAC Bit Resolution

The PWM counter length (L) and the smallest duty-cycle change in the PWM counter (C) determine the PWM DAC?s bit resolution. The following equation expresses the maximum bit resolution of the PWM DAC:

Where: R = Resolution in Bits

L = Length of Counter in Bits

C = Smallest Duty-Cycle Change

For example, if the system generates an analog output voltage from a PWM DAC with a counter of 4,096 (L) and a minimum count step of one (C), the PWM DAC?s bit resolution is 12 bits.

When the PWM resolution is determined, it is possible to calculate the Least Significant Bit (LSB) size. The LSB size is dependant upon the PWM resolution and the PWM?s output-high level voltage (VOH) and can be calculated using the following equation:

For example, a 12-bit PWM DAC with a VOH of 5V has an LSB size of 1.2 mV.

RC-Filter Design Considerations for PWM DACs

One key design consideration when determining the PWM?s resolution is output-voltage ripple. Ripple occurs due to overshoot and undershoot as the PWM charges and discharges the RC circuit. One way to approximate the charge characteristics is to modify the equations to charge and discharge an RC-filter circuit. As the effects of this are cumulative, the following equations can be used as approximations:

VLH is the voltage increase for a specific PWM period and VHL is the voltage decrease for a specific PWM period. The values of VLH and VHL are dependant upon not only the RC-filter values, but also upon the PWM frequency and duty cycle. The PWM frequency and duty cycle determine the time available for the PWM to charge (tcharge) and discharge (tdischarge) the capacitor. Vripple is the difference between VLH and VHL for the same PWM period.

Figure 4, top, right, illustrates the magnitude of the voltage ripple across the output capacitor versus time. The vertical axis displays the magnitude of the ripple voltage, while the horizontal axis provides the corresponding time. The plot shows how the ripple voltage settles at approximately 125 mV in a time interval of approximately 40 ms for R = 10K? and 250 mV at 20 ms for R = 1 K?. In the previous example, an LSB size of less than 1.2 mV for a 12-bit system was needed. This ripple is greater than 100 LSB for a 12-bit DAC with a 5V reference, meaning the resulting PWM DAC solution has an effective resolution of less than 6 bits due to the ripples.

The ripple can be reduced by increasing the capacitor and resistor values or by increasing the PWM frequency.

As shown in Figure 4, above, the ripple decreases as the resistance value increases. However, nothing comes without a price ? settling time doubles as the ripple decreases by 50 percent.

For applications that require faster settling time (increased bandwidth) and higher resolution, a second RC filter can be added. Obvious trade-offs include the cost of additional components and the increased board space occupied. Figure 5, above, shows a model for a two-pole RC low-pass filter. Figure 6, page S20, shows the analog-output voltage of this model.

There are a couple of things to keep in mind when designing the filter. First, make sure the RC pole is set at a much greater frequency than that of the signal being generated. Secondly, if you are designing a two-pole filter, make sure that R2 > R1.

The 3dB corner frequency of the RC filter is given by:

There are a couple of additional things to consider. Increasing the PWM frequency will also decrease the ripple, but the trade-off is increased settling time. Figure 7, below, shows this case for 10 MHz and 5 kHz.

The worst-case ripple occurs at a 50 percent duty cycle. The ripple will decrease as the duty cycle moves closer to 0 or 100 percent. Figure 8, top, right, shows the peak-to-peak magnitude of ripples on the PWM DAC output. The ripple decreases almost two times as the duty cycle changes from 50 to 85 percent.

VOH = 5V, C = 10 ?F, R = 1 k?, PWM Frequency = 1 kHz, Duty Cycle = 50 percent (Solid Curve) and 85 percent (Dotted Curve).

PWM DACs and Power Consumption

Many electronic products today are portable or handheld devices. These devices are battery-powered and many have strict constraints with regard to power consumption. Therefore, it is a good idea to minimize the PWM DAC?s power consumption. The current consumed in the PWM solution is simple to approximate, using the following equation:

Figure 9, above, shows the current and voltage plots. As shown in the plot, the PWM DAC with a lower resistor draws a significant amount of current (in the range of a few mA). This high level of current consumption is unacceptable for many battery-powered applications. Current can be decreased by increasing the resistor value.

In Figure 10, page S21, the resistor value has been increased by a factor of 10, which has likewise decreased the current consumption by a factor of 10.

As the resistor limits the current available to charge/discharge the capacitor, decreasing the amount of current available (increasing resistance) to the circuit will increase the settling time.

Another factor to consider is the filter?s pole. As the resistor value increases, the 3 dB frequency decreases by the same magnitude. This can be compensated for by reducing the capacitor value by the same magnitude, which offsets the increased settling time and maintains the original pole of the filter. Figure 11, page S21, demonstrates this. Note that, as the capacitor value reduces, the circuit becomes more susceptible to loading. This is another important design consideration.

Conclusions

Although the PWM DAC is simple and low-cost, using it to generate a stable analog voltage output is not a simple, straightforward task. Various design constraints must be considered and understood before realizing the circuit. In some cases, the design steps become very time-consuming and tedious work for busy system designers.

The limitations associated with PWM DACs are low bit resolution, slow settling time, poor power efficiency and time-consuming design steps, when compared to stand-alone DACs.

PWM DACs can be used for low-cost, low resolution (less than 10-bits) and very low frequency applications (less than 1 kHz) where power consumption is not a critical parameter. On the other hand, a stand-alone DAC should be considered when high accuracy, short settling time, low power consumption and short design cycles are needed.

Youbok Lee, technical staff engineer with Microchip Technology?s Analog & Interface Products Div., has more than 20 years of industry experience in RF, embeded circuits and remote-sensing applications.

John Austin is the senior products marketing manager with MicrochipTechnology?s Analog & Interface Products Div.



author: By John Austin and Youbok Lee, Ph.D., Contributing Writers

Design News. Copyright © 2008 Reed Business Information, a division of Reed Elsevier Inc. All rights reserved.

Featured Local Company

KRC Electric Inc.

602-242-0313
Central/West Phoenix
Phoenix, AZ
www.krcelectricinc.com

Related Local Event
Commercial Construction Show
Dates: 6/2/2009 - 6/4/2009
Location: Phoenix Convention Center
Phoenix, AZ
View Details