[ad_1]
Editor’s Notice: 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 frequent PWM error varieties. The second discloses circuits pushed from varied Vprovide voltages to energy rail-rail op amps and allow their output swings to incorporate floor and Vprovide. The third pursues the optimization of post-PWM analog filters. This fourth half pursues the optimization of post-PWM analog filters.
Half 1 will be discovered right here.
Half 2 will be discovered right here.
Half 3 will 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 tackle ripple attenuation, settling time minimization, and limitations in accuracy. That is the fourth in a sequence of DIs proposing enhancements in total PWM-based DAC efficiency. Every of the sequence’ suggestions is implementable independently of the others. This DI addresses PWM sequence modifications which ease low move analog filtering necessities.
Wow the engineering world along with your distinctive design: Design Concepts Submission Information
The tyranny of decision vs response time
The mixture of PWM clock frequency Fclk Hz and the variety of bits b of PWM decision dictates the bottom frequency (Fclk·2-b Hz) output part of a normal PWM. Over all of the attainable responsibility cycles, this part can also be the most important and due to this fact probably the most difficult for an analog filter to suppress. For a given Fclk, the extra bits of decision, the longer the settling time will probably be of a filter which supplies ample suppression. However there’s a means round this limitation.
Suppose a normal 8-bit PWM whose output is both 0 or 1 is configured for an obligation cycle of (arbitrarily) 121/256. The primary 121 states in a 256-state cycle can be 1 and the remaining 135 can be 0’s. However what if the primary 128 states began with 60 ones and the final 128 states began with 61 ones? Let’s name this the “split-in-two” PWM. These two sequences have been offset in amplitude barely in order that they are often clearly seen on a graph proven in Determine 1.
Determine 1 Output sequences of normal and split-in-two 8-bit PWMs with the identical clock frequency, interval, and responsibility cycle (121/256).
The blue waveform represents the usual PWM and the orange one is the split-in-two PWM. Why may the latter be advantageous? Think about the spectra of the 2 PWMs seen in Determine 2.
Determine 2 Frequency content material of normal and split-in-two 8-bit PWMs with the identical clock frequency, interval, and responsibility cycle (121/256).
The power within the first harmonic of the split-in-two PWM is negligible compared with that of the usual PWM. The required attenuation for the primary harmonic has been considerably lessened, and that which was required is now utilized to the harmonic at double the frequency. A much less aggressive attenuation-with-frequency analog filter can now be employed, leading to a shorter settling time in response to a change in responsibility cycle.
One other means to take a look at that is to double the split-in-two PWM interval to 512 states to provide a 9-bit PWM. As proven in Determine 3, the spectra of the 2 PWMs are nearly similar as a result of the time area waveforms are nearly similar—they differ solely in that each different 256-bit sequence, one further one-state replaces a zero-state. The upper decision 9-bit PWM produces a small quantity of power (lower than 1%) at half the frequency of the 8-bit’s elementary. Any analog low move filter with ample suppression of the 8-bit elementary frequency will greater than sufficiently attenuate the sign at half that frequency.
Determine 3 Frequency content material of a normal 8-bit PWM of responsibility cycle 121/256 and a split-in-two 9-bit PWM of responsibility cycle (121.5/256). They share the identical clock, however the split-in-two’s interval is twice the usual PWM’s.
The super-cycle
We are able to consider the split-in-two as producing a “super-cycle” consisting of two cycles of twob states, every having no less than S one-states, with 0 ≤ S < 2b. In a single cycle, one zero-state may very well be swapped for a one-state if the whole variety of ones within the super-cycle is odd. It is a (b+1)-bit PWM with a interval of twob+1 states. However there isn’t any motive to cease at two. There generally is a super-cycle of twon cycles the place n is any integer. With every cycle able to optionally swapping one zero-state for a one-state, this results in a PWM super-cycle with a decision of twob+n bits. However not like customary, non-super-cycle PWMs whose most spectral power part is at fclk/2b+n Hz, the super-cycle’s is at a a lot larger fclk/2b Hz. As with the particular case of the split-in-two, this eases analog filtering necessities and ends in a shorter settling time.
It’s price considering of a super-cycle as consisting of the sum of two totally different sequences. One is the S-sequence through which each cycle consists of an similar sequence of S contiguous one-states. The opposite is the X-sequence the place every cycle optionally swaps the primary zero-state following the final one-state with one other one-state. The X-sequence has X one-states the place 0 ≤ X < 2n. The responsibility cycle of the super-cycle is then (2n·S + X)/2b+n.
When n = 1 for a super-cycle, there is just one cycle the place an additional one-state can reside. However when n > 1, X can also be better than one and the query turns into methods to distribute the X ones among the many 2n cycles in order to reduce the super-cycle’s power at low frequencies. The fantastic people at Microchip who manufacture the SAM D21 microcontroller not solely have figured this out for us, however they’ve additionally carried out it in {hardware} [1]! For this IC, it’s obligatory solely to write down the values of X and S to separate registers to implement a super-cycle PWM; the {hardware} does the remainder unsupervised. Fortuitously, it’s easy for nearly any microprocessor to reinforce a normal PWM to implement a super-cycle. For every PWM cycle, the responsibility cycle depend have to be modified in order that instantly after the sequence of S ones, the primary zero will get modified to a one if and provided that the next C expression is true for that cycle:
MASK & (cycleNbr * X) > MASK – X
Right here, MASK = 2n– 1, X is as earlier than, and cycleNbr is the numeric place of the cycle within the super-cycle. Determine 4 is a graph of the magnitudes of the bottom 32 harmonics of an n = 4, b = 8 super-cycle PWM. The graph supplies proof of the good thing about this strategy.
Determine 4 First 32 harmonics of an n=4, b=8 super-cycle PWM. Spectra are displayed for X=1 by way of 8. (Spectra of X=9 by way of 15 are the identical as these proven.)
The X-sequence’s power is comparatively low, having solely 0 by way of 2n-1 one-states, however it additionally presents the bottom frequency part, fclk/2n+b Hz. The S-sequence typically accommodates probably the most power by far (aside from cases of very small responsibility cycles), however its smallest frequency part is noticeably larger at Fclk/2b Hz. Among the many X sequences, X = 1 provides the most important amplitude for its first harmonic: 2-11 at fclk/2n+b Hz. The S sequence’s spectrum begins on the X sequence’s harmonic quantity 24 = 16 and produces its largest amplitude of two/π for that harmonic when S = 211. If this had been a normal PWM (an n = 0 super-cycle—no super-cycle in any respect that’s, only a regular PWM), then that amplitude of two/π would seem at frequency which is 16 instances decrease. The usual PWM presents a way more extreme filtering drawback. Its filter would take so much longer to settle in response to an obligation cycle change due to the a lot bigger quantity of low frequency attenuation required.
Evaluating the filters for (n+b)-bit customary and super-cycle PWMs
The filtered AC regular state time-domain contributions of each the usual and the super-cycle (with its X and S sequences) PWMs needs to be lower than some fraction α of the voltage of the PWMs’ one-state. An affordable worth of α is 2-(n+b+1), ½ LSB. This interprets to an attenuation issue of 1/4 on the first harmonic of the X sequence. It’s lucky that even a easy two-component R-C filter assembly this requirement will sufficiently attenuate all larger X sequence harmonics, so there aren’t any further constraints to satisfy to suppress them. The 16th X harmonic frequency is that of the primary S harmonic. Its PWM power requires an attenuation issue of (π/2)·2-(n+b+1) at a 50% responsibility cycle. Once more, any low move filter assembly this requirement will adequately attenuate the remaining S-sequence harmonics. For an Fclk = 20 MHz, Determine 5 and Determine 6are graphs of the frequency and time area step responses of threerd order filters (two op-amps, 3 resistors, and three capacitors) assembly these necessities for traditional 12-bit and super-cycle n = 4, b = 8 (12-bit) PWMs.
Determine 5 The frequency responses of filters for traditional and super-cycle n = 4 bit PWMs with 12 bits of decision. The maxima of the peaked waveforms are the utmost responses allowed for the filters on the peaked frequencies. The filters make sure that the regular state time area power at their outputs is lower than ½ LSB of Full Scale.
Determine 6 The log of absolutely the worth of time responses of filters for traditional and super-cycle n = 4 bit PWMs with 12 bits of decision. The a lot shorter settling time of the super-cycle PWM is clearly evident.
Easing low move analog filter necessities
When partnered with an acceptable analog filter, an strategy to PWM embodiment accessible in {hardware} in an current microprocessor [1] provides considerably shorter settling instances than does a normal PWM. This strategy will be carried out with assistance from a small quantity of software program in nearly any microcontroller.
Christopher Paul has labored in varied engineering positions within the communications trade for over 40 years.
Associated Content material
References
[ad_2]