Parsing PWM (DAC) efficiency: Half 3—PWM Analog Filters


Editor’s Be aware: It is a four-part sequence of DIs proposing enhancements within the efficiency of a “conventional” PWM—one whose output is an obligation cycle-variable rectangular pulse which requires filtering by a low-pass analog filter to provide a DAC. The primary half suggests mitigations and eliminations of widespread PWM error varieties. The second discloses circuits pushed from varied Vsupply voltages to energy rail-rail op amps and allow their output swings to incorporate floor and Vsupply. This third half pursues the optimization of post-PWM analog filters.

 Half 1 might be discovered right here.

 Half 2 might be discovered right here.

Lately, there was a spate of design concepts (DIs) revealed (see Associated Content material) which offers with microprocessor-generated pulse width modulators driving low-pass filters to provide DACs. Approaches have been launched which deal with ripple attenuation, settling time minimization, limitations in accuracy, and allow outputs to achieve and embody floor and provide rails. That is the third in a sequence of DIs proposing enhancements in general PWM-based DAC efficiency. Every of the sequence’ suggestions are implementable independently of the others. This DI addresses low go analog filters.

Radar Systems Manufacturer Hits the Mark with MRP Software 


Design-Stage Analysis, Verification, and Optimization for Every Designer


ABLIC Sets Its Sights on Europe for Further Growth


Wow the engineering world along with your distinctive design: Design Concepts Submission Information

The PWM output

Spectrally, the PWM output consists of a fascinating DC (common) portion and the rest—undesirable AC indicators. With a interval of T, these indicators encompass vitality at frequencies n/T, the place n = 1, 2, 3, and so on., that’s, harmonics of 1/T. If the PWM switches between 0 and 1, for each harmonic n there exists an obligation cycle equivalent to a peak sign degree of (2/π)/n. This reveals the futility of an attenuation scheme which focuses on a notch or band reject sort of filter—there’ll at all times be a big quantity of vitality that isn’t attenuated by such. The best amplitude harmonic is the primary, n = 1. On the very least, this harmonic should be attenuated to an appropriate degree, α. Any low go filter that accomplishes this can apply much more attenuation to the remaining harmonics that are already decrease in degree than the primary. In abstract, the seek for the most effective filter will concentrate on what are known as all-pole low go filters, which is one other manner of claiming low go filters which lack notch and band-reject options.

The thin on low go all-pole filters

Analog filters might be outlined as a ratio of two polynomials within the complicated (actual plus imaginary) variable s:

The place I ≤ Ok. The phrases zi and pi are referred to respectively because the zeroes and the poles of the filter. Ok is the order (first, second, and so on.) of the filter in addition to the variety of its poles. All-pole filters of unity acquire at DC might be specified merely as:

Filter varieties embody Butterworth, Bessel, Chebyshev, and others. These make completely different trade-offs between the aggressiveness of attenuation with rising stop-band frequency and the rapidity of settling in response to a time area impulse, step, or different disturbance. Enhancing considered one of these typically denigrates the opposite. Tables of poles for varied orders and kinds of these filters might be discovered within the reference [1]. Values given are for filters which at roughly 1 radian per second (2π Hz) exhibit 3 dB of attenuation with respect to the extent at DC. This level is taken into account to be the transition between the low frequency go and excessive frequency cease bands. Multiplying all poles by a frequency scaling issue (FSF) will trigger the filter to attenuate 3 dB at 2π·FSF Hz. The frequency response of a filter might be calculated by substituting j·2π·f for s in H(s) and taking the magnitude of the sum of the true and imaginary components. Right here, j = √-1 and f is the frequency in Hz.

The time area response of a filter to a change in PWM responsibility cycle reveals how rapidly it’s going to settle to the brand new responsibility cycle common. For a filter of unity acquire at DC, this includes subtracting from 1 the inverse Laplace remodel of H(s)/s. A dialogue of Laplace transforms, their inverses, and sensible makes use of is past the scope of this DI. These inverse transforms can, nevertheless, be readily decided by utilizing a web-based device [2].

Necessities of an optimum filter

A filter should attenuate the utmost worth over all responsibility cycles (2/π) of the PWM first harmonic by an element of α. A b-bit PWM has a decision of Full-Scale·2-b. So, for the primary harmonic peak to be no better than ½ LSB, α must be set to (π/2)·2-(b+1). Asking for extra attenuation would sluggish the filter response to a step change in responsibility cycle. From the time area perspective, the time ts must be minimized for the filter to settle to +/- α · Full Scale in response to an obligation cycle change from Full Scale to zero.

In direction of an optimum filter

Contemplate a 12-bit PWM clocked from a 20 MHz supply. The frequency of its first harmonic is F0 = 4883 Hz, and its α is 1.917·10-4. third, fifth, and seventh order filters of varieties Bessel, Linear Part .05° and .5° Equiripple error, Gaussian 6 dB and 12 dB, Butterworth, and .01 dB Chebyshev are thought-about. These are roughly so as of more and more aggressive attenuation with frequency coupled with rising settling instances. Acceptable FSFs are wanted to multiply the poles (listed in reference [1]) of every filter to realize attenuation α at F0 Hz. Excel’s Solver [3] was used to seek out these components. The scaled values had been divided by 2π to transform them to Hertz and utilized to LTspice’s [4] 2ndOrderLowpass filter objects in its Particular Capabilities folder to assemble full filters. The graph in Determine 1 reveals the frequency responses of 24 scaled filters. These embody third, fifth, and seventh order variations of the filter varieties listed above. These filters had been named after the mathematicians who developed the maths describing them (I’ve for some motive failed to seek out any details about Mr. or Ms. Equiripple). Moreover, there are the identical three orders of yet one more filter sort that was developed by the writer and will likely be described later. Though the writer makes no claims of being a mathematician, for need of an alternate, these have been named Paul filters. (An appalling alternative, I’m positive you’ll agree.)

Determine 1 The frequency response of 24 scaled filters together with embody third, fifth, and seventh order variations of the 7 filter varieties listed above (Bessel, Linear Part, Equiripple, Gaussian, Butterworth, Chebyshev and the Paul filter developed by the writer) the place the worth of α is depicted by the horizontal crimson line.

In Determine 1, the worth of α is depicted by the horizontal line. It and all of the filter responses intersect at a frequency of F0 (the PWM’s first harmonic) satisfying the frequency response attenuation requirement. Determine 2 is the Bessel filter portion of the LTspice file which generates the above graph. The irregular pentagons are LTspice’s 2ndOrderLowPass objects. The resistors and capacitors implement first order sections. H = 1 is the filter’s acquire at DC.

Determine 2 The Bessel filter portion of the LTspice file which generates the response in Determine 1, U1-U6 are LTspice’s 2ndOrderLowPass objects, resistors and capacitors implement first order sections, and H = 1 is the filter’s acquire at DC.

By altering the “.ac dec 100 100 10000” command within the file to “.tran 0 .01 0”, changing the “SINE (0 1) AC 1” voltage supply with a pulsed supply “PULSE(1 0 0 1u 1u .0099 .01)” and working the simulation, the response of those filters to an obligation cycle step from 1 V to 0 V is obtained as proven in Determine 3.

Determine 3 Changing the AC voltage supply with a pulsed supply to alter the responsibility cycle step of the filter response from 1 V to 0 V.

Oh, what a stunning mess! The vertical scale is the widespread log of absolutely the worth of the response—absolute worth as a result of the response oscillates round zero, and log due to the massive dynamic vary between 1 and α, the latter of which is once more proven as a horizontal line.

Which filter’s absolute response settles (reaches and stays lower than α) within the shortest time frame? To seek out the reply to that query, use is fabricated from LTspice’s “Export information as textual content” characteristic underneath the “File” possibility made obtainable by right-clicking contained in the plot. This information is then imported into Excel. Every filter’s information is parsed backwards in time ranging from 10 ms. The primary instants when the responses exceed α are recorded. These are the instances that the filters require to settle to α. (As might be seen, there have been some that require greater than 10 ms to take action.) For every filter order, it was decided which sort had the shortest settling time. Desk 1 reveals the settling instances to ½ LSB for 8-bit by 16-bit PWMs of third, fifth, and seventh orders of filters of assorted varieties.

Desk 1 Settling instances to ½ LSB for 8-bit by 16-bit PWMs of third, fifth, and seventh orders for varied kinds of filters. The quickest settling instances are proven in daring crimson whereas those who did not settle inside 10 ms are gray and listed as “> 10 ms”.

The entries in every desk row with the quickest settling time is proven in daring crimson. These which did not settle inside 10 ms are listed as > 10 ms and are greyed-out. Typically, the seventh orders settled quicker than the fifth orders, which had been noticeably quicker than the third’s. Additionally, these with the decrease Q sections settled quicker than the upper Q alternate options (once more, see the tables in reference [1]). The Chebyshev filters with ripples better than .01 dB (not depicted) for example, had larger Q’s than all those listed above and had hopelessly lengthy settling instances.

As a bunch, the Paul filters settled the quickest, however that doesn’t preclude the number of one other filter in an occasion when it settles quicker. Nonetheless, it’s value discussing how the Pauls had been developed. Beginning with the third, fifth, and seventh order frequency-scaled Bessel poles, the Excel Solver evaluated the inverse Laplace transforms of the filters’ capabilities H(s). It was instructed to differ the pole values whereas minimizing the utmost worth of the filter response after a given time ts. This was made topic to the constraint that the amplitude response of |H(2πj·F0)| be α, the place F0 = 20MHz / 212 and α = (π/2)·2-(12+1). If the utmost response exceeded α for a given ts, ts was elevated. In any other case ts was lowered. A number of runs of Solver led to the ultimate set of filter poles. It’s fascinating that though the optimization was run for a 12-bit PWM solely, settling instances at different bit lengths between 8 and 16 continues to be fairly good and usually superior to these of the opposite well-known filters. The Paul filter poles and Qs are listed in Desk 2.

Desk 2 The poles and Qs for third, fifth, and seventh order Paul filter.

Desk 3 contains FSFs for the poles of the well-known filters. The unscaled poles are given within the tables of reference [1]. The scaled poles are attribute of filters which additionally attenuate a frequency of F0 by an element of α.

Desk 3 The FSFs for the poles of the well-known filters within the tables of reference [1] for the values of α and F0.

 Implementing a filter

A place to begin for the implementation of a filter whose poles are taken from a reference desk is to use to these poles an applicable FSF.  These components are given for well-known filters in Desk 3 for an attenuation, α, at a frequency of F0 Hz. In Desk 2, the Paul filter poles have already been scaled as such. For any of those filters, to alter the α from a frequency F0 to F1 Hz, the poles must be multiplied by an FSF of F1/F0.

In settling rapidly to the small worth of α, a few of the greatest errors in filter efficiency are attributable to part tolerances. To restrict these errors, resistors must be metallic movie, 1% at worst with 0.1% most well-liked.  Capacitors must be NPO or C0G for temperature and DC voltage stability, 2% at worst and 1% most well-liked. Smaller worth resistors end in a quieter design and result in smaller offset voltages attributable to op amp enter bias and offset currents. Nevertheless, these additionally require larger-valued, greater, and dearer capacitors. Preserve these restrictions in thoughts when continuing with the next steps.

For a primary order part with pole ω:

Begin by guessing values of R and C such that RC = 1/ω.
Select a normal worth NPO or COG capacitor near that worth of C.
Calculate R’ = 1/(ω·C) the place C is that commonplace worth capacitor.
Select for R the following smaller commonplace worth of R’ and make up the distinction with one other smaller resistor in sequence. Though this is not going to compensate for the elements’ 1% and a couple of% tolerances, it’s going to yield a outcome which is perfect on common.
Join one terminal of R to the PWM output and the opposite to the capacitor C (floor its different aspect) and to the enter of a unity acquire op amp. If acquire is required within the mixture filter, it’s this op amp which ought to provide it fairly than one which implements a second order part; not like second order sections, acquire on this op amp has no impact on the R-C part’s AC traits as a result of there is no such thing as a suggestions to the passive elements. The output of this op amp ought to drive the cascade of remaining second order sections (Determine 4).

Determine 4 Advisable configuration the place one terminal of R is related to the PWM output, and the opposite is related to the capacitor C (floor its different aspect) and to the enter of a unity acquire op amp.

For second order sections with pole ω and high quality issue Q, error sources are once more part values. Errors might be exacerbated by the selection of a filter topology. A second order Sallen Key [5] part with the least sensitivity employs an op amp configured for unity acquire as proven in Determine 5.

Determine 5 A second order Sallen Key part with the least sensitivity employs an op amp configured for unity acquire.

To pick part values:

Begin by selecting values of R and C such that RC = 1/ω.
Select commonplace values of C1 and C2 much like C such that C1 / C2 is as giant as attainable, however no bigger than 4Q2. Making a desk of all attainable capacitor ratios is useful in deciding on the optimum ratio.
Calculate D = (1 – 4Q2·C2/C1)0.5 and W = 2·Q·C2·ω
For R1a, choose a normal resistor worth barely lower than (1 + D)/W and add R1b in sequence to make up the distinction.
For R2a, choose a normal resistor worth barely lower than (1 – D)/W and add R2b in sequence to make up the distinction.
If there are a couple of second order part, the sections must be related so as of lowering values of Q to reduce noise.

A PWM filter instance

Contemplate a fifth order Paul filter with an attenuation of α at a frequency F1 = F0/2. Every of the ω values within the Paul filter desk can be multiplied by an FSF of F1/F0 = ½, however the Q’s can be unchanged. The next schematic proven in Determine 6 satisfies these constraints.

Determine 6 A fifth order Paul filter scaled to function at F0/2 Hertz.

 Designing PWM analog filters

A set of tables itemizing settling instances to inside ½ LSB of 8 by 16-bit PWMs of interval 204.8 µs (1/4883 = 1/F0 Hz) has been generated for third, fifth, and seventh order variations of eight completely different filter varieties. These filters attenuate the height worth of regular state PWM-induced ripple to ½ LSB. From these listings, the filter with the quickest settling time is instantly chosen. These filters might be tailored to a brand new PWM interval by multiplying their poles by a scaling issue equal the ratio of the outdated to new durations. New settling instances are obtained by dividing those within the tables by that very same ratio.

Pole scaling components for the operation of well-known filters at F0 are provided in a separate desk. The poles of those filters can be found in reference [1] and must be multiplied by the related issue to perform this. A brand new “Paul” filter (already scaled for F0 operation) has been developed which usually has quicker settling instances than the well-known ones whereas offering the required PWM ripple attenuation. As with the others, it too might be scaled for operation at completely different frequencies.

It must be famous that part tolerances will result in filters with attenuations and settling instances which differ considerably from the calculations introduced. Nonetheless, it is smart to make use of filters with the smallest calculated settling time values.

Christopher Paul has labored in varied engineering positions within the communications trade for over 40 years.

Associated Content material

 References (particularly Figures 8.26 by 8.36. This reference does an incredible job of describing the variations between the filter response varieties and filter realization normally.)*bpercent5E2percent2Fpercent28percent28spercent5E2percent2Bbpercent5E2percent29*%28spercent2Bppercent29percent29


Supply hyperlink

Main leak reveals which chips Apple will use on upcoming iPad and iPhone fashions

The Finest Drone-spots in Strasbourg, France !