Control system techniques for DSPbased SMPS design, including stability analysis and predicting transient behavior, will be analyzed using SPICE (IsSpice4) simulation. In addition, a novel design approach using SPICE simulation of a plant model will be unveiled, which resembles a similar technique used in the design of Kalman filters. An important advantage of the plant model is that it exposes current as a “hidden” parameter, thus eliminating the need for sensing current. The splane operations in SPICE then will be converted into a ztransform solution. Finally, the DSP difference equations will be derived, and a DSP reference design will be tested for a buck regulator.
The techniques presented here will show the advantages of using special device models with the IsSpice4 simulator to simulate the digital control algorithms for DSP and create corresponding instructions to program the DSP's CPU through a development board.
ZTRANSFORM BASICS
Design and analysis of control systems usually are performed in the frequency domain, whereby the time domain process of convolution is replaced by a simple process of multiplication of complex polynomials in the frequency domain. Sampled data systems use a similar concept using a unit delay as the basic building block. The analog splane maps into the sampled data zplane by substitution of variables where: equations
The later representation is identical to a delay line, with zn representing a delay of nT seconds. Transfer functions, including impedance and admittance functions, are described as polynomial ratios of the form G = N/D, where N = a0 + a1z1 + … anzn and D = 1 + b1z1 + … + bnzn are the numerator and denominator polynomials, respectively. Notice that b0 = 1. Then, rearranging the following equation with D' = D1:
This is the “direct” programming method (Fig. 1), which can be more rigorously derived. This equation also can be implemented in the splane using the block diagram in Fig. 1 with the unit time delay (UTD) replaced by a SPICE transmission line. This implementation allows for SPICE analysis of the timedomain difference equations, including transient and ac analysis as well as Bode plots.
BILINEAR TRANSFORM
Solving for s as a function of z yields:
The ln(z) function can be broken down into three common approximations. Let's first do this by using the first term of the series expansion, where:
Then, for ω 1/T, z + 1 ≈ 2z to further simplify to:
As ω approaches infinity, z approaches zero so that:
ln(z) = z1
Then, tl
Then, the three approximations are:
The second representation is the one commonly used on page 741 in the ztransform tables.^{1} Mathematically, it is common to let T = 1 and omit it from the tables, leaving it to the user to scale the result for other sample frequencies. If you fail to account for T, then you will get the wrong answer! Restating the previous equations to represent integration and delays yields: equations
There are three interpretations to these equations in terms of integration method. Although they were derived here from a series expansion, they also could have been derived in time domain using rectangular and trapezoidal integration methods. These representations have several interesting properties. First, Eq. 1 has a step response of z1, which is interpreted as the deadbeat response; that is, the error to a step response will be reduced to zero in one sample time. That is the holy grail of digital control system design, so the loop compensation should be designed to replicate that behavior. Unfortunately, adding 6 dB of gain makes it unstable.
The second equation gives good results for control system compensation. As shown in Fig. 2, the phase is leading near the Nyquist frequency, providing added margin.
Finally, Eq. 3 inserts a term that averages the previous sample with the current sample.
The average of two samples at onehalf the Nyquist frequency is exactly zero for any signal, at Fs/2, regardless of its phase. Fig. 3 shows this result and also shows that phase stays at 90 degrees up to Fs/2. Both figures represent current through 100 µH at Fs =100 kHz.
As frequency increases past onehalf the sampling frequency, aliasing causes the results to repeat, as shown in Fig. 4.
Ztransforms can be used to describe heterodyned signal detection by placing an analog bandpass filter about the center frequency of interest followed by a digital lowpass filter. Moreover, the samples can be separated by 90 degrees (in time), with the inphase component representing real numbers and the 90 degree delayed sample data being imaginary numbers. A Fourier transform converts the complex time data to the frequency domain where it can be filtered. Then, an inverse Fourier transform recovers the filtered time dependant data.
ZPLANE FREQUENCY WARPING
Splane poles and zeros ranging to infinity are warped into the z plane. Mathematically, the warping is described by evaluating the splane frequency for s = jω and the zplane frequency = jωz. For the bilinear transform of Eq. 5:
Multiplying numerator and denominator by
gives:
Now, the zplane argument is phase going from π/2 to π/2, as splane frequency goes from infinity to +infinity.
Fig. 5 illustrates this warping. It is important to note that the warping maps each splane frequency to a unique zplane frequency. Filters such as Chebyshev, Butterworth and Elliptical can be mapped into the zplane so that filter cutoff frequencies are the same by adjusting c. The filter then will have a somewhat sharper cutoff than its corresponding splane filter, because frequencies approaching infinity are compressed to ωs/2.
SAMPLEANDHOLD MODEL
The digital control system gets its input from an A/D converter that is basically a sampleandhold (S&H) device. Similarly, its output is a D/A that also is represented by an S&H process. In both cases, they are modeled as zero order holds.
There is a substantial penalty in the phase lag when the input to the A/D has a steady state signal at exactly the sample frequency. However, if the S&H were followed by a ztransform integrator: equations
then the net result would be a transfer function of 1/s, which is exactly right. So, there isn't much difference between the z and s plane. Moreover, the ztransform is more computationally efficient than the bilinear transform.
When performing a bilinear transform from continuous to sampled systems, the poles or zeros at infinity move to the Nyquist frequency (onehalf the sampling frequency) in the zplane. The frequency warping between zplane and splane is approximately linear for low frequencies; however, splane frequencies get compressed near the Nyquist frequency and show different behavior, depending on the approximation used for ln(z). Modeling the ztransform difference equations in the zdomain requires the insertion of zero order holds at the A/D and D/A interface. These analogtodigital interface models are part of the controller model and are not included in the DSP equations.
Although peak current control using the fast 1bit A/D converter is a good theoretical concept, in practice, it is plagued by noise. The noise is mainly electromagnetic interference (EMI). The EMI is caused by the rapid voltage and current switching of the PWM, which excites parasitic ringing at the current sense point.
This EMI at best is chaotic, but clearly it is not Gaussian. An oftenused DSP favorite, the Kalman filter, is a tempting approach, but the poor statistical match may doom its applicability. The Kalman filter uses a plant model to predict the observable state variables and then combines them with the noisy observation to get a “best” estimate. The following approach is postulated:
Apply the measured input voltage and computed duty ratio to the plant model. Add an extra control loop to the plant model, integrating the error difference between plant and measured outputs, and then apply the result to adjust the plant model load current.
REFERENCES

Kuo, B. “Digital Control Systems, 2nd Edition,” Oxford UniversityPress, 1992.

Basso, C. “SwitchMode Power Supplies,” McGraw Hill, 2008.

Middlebrook, D. “General Feedback Theorm,” Intusoft Newsletter #70, May 2003.

Oppenheim, A.; Shafer, R.; Buck, J. “DiscreteTime Signal Processing,” 2nd Edition, Prentice Hall, 1998.