**Discrete-Time Control in ***w*

There is a way (yet another transform) which avoids the complication of doing control analysis in *z*. Then *z* is used only as a quick way to get from discrete *t* to *s**. Control design of feedback loops can be worked out as though the feedback system were continuous, then convert to the discrete domains using the *bilinear transform*, *w* (*z*), to account for sampling effects. We now have four domains: *t*, *s*, *z*, and *w*. The *w*-transform maps the left half-plane of *s* onto the unit circle of *z* so that whatever is stable in *s* is stable in *z* (within the unit circle) and *t* and whatever is unstable in *s* is unstable in *z* and *t*. The new quantity, *w*, has units of frequency and behaves more like *s* than *z*, which is unitless. Stability analysis in *s* applies to *w*. Indeed, *w*
≈
*s*;

As 1/*s*T_{s} is a continuous integrator in *s*, 1/*w*T_{s} is a trapezoidal integrator in the time domain. If *w*(*z*) were inverse-*Z* transformed from *z* to *t*, it would be a trapezoidal integrator, what in numerical analysis (which, by the way, is equivalent to DSP, expressed more in mathematical than engineering language) is Euler’s integration rule; the two endpoints of an interval to be integrated are averaged in value and multiplied by the time interval, *T*_{s}.

Because the pole and zero values of

*s* are only approximately the same in

*w*, to accurately transform

*s*-domain poles and zeros to the

*w*-domain, a

*prewarp transform* is applied to them. The relationship between

*s* =

*jω* and

*w* =

*jω*_{x} is found by recalling the defining relationship between

*s* and

*z*;

Then for *s* = *j
ω
*,

Substitute this into the *w*(*z*) transform;

Then the *s*-domain steady-state frequency, *ω*, is related to its corresponding frequency in *w* of *ω*_{w} by

The desired poles and zeros of a continuous function of *f* can be *prewarped* to *f*_{w} values before applying frequency-response analysis by substituting the *f*_{w} pole-zero values into the *s*-domain transfer function. The following table gives some prewarp values.

where *f*_{w} = *
ω
*_{w}/2
π
, and *
ω
*_{w} is the *w*-domain approximation to *ω*
of *s* = *jω*. As the sampling ratio *f*_{s}/*f* increases, *f* in *s* approaches *f*_{w} in w. As *f*_{s}/*f* approaches the Nyquist-frequency value of 2, the ratio of steady-state *w* to *s* decreases and the frequencies diverge. At a sampling rate 10 times the *s*-domain *f*, the error in the corresponding discrete-time frequency is about −3.3 %. At this ratio of 10, the sample frequency, *f*_{s} is often high enough that the difference between continuous- and discrete-frequency poles and zeros is negligible, and prewarping can be omitted.

**From ****z** to Discrete-Time Equations

To illustrate the use of the *w*-domain, a common motor-drive feedback-loop compensator is the PID transfer function, *y*(*z*)/*e*(*z*), from Part 1, where *e* is the feedback-loop input error, implemented here by converting to the *z*-domain the three terms of

Substituting *w*(*z*) for *s* and simplifying,

This can be solved for the outputs of *y*(*z*) by first rewriting

to express the *z* quantities as delays of one sampling cycle or computed iteration, *z*^{–1}. Then

The time-domain difference equations to be implemented in computer code follow by applying (apart from initial conditions) the time-shifting transform from *z* to discrete-time *t* = *nT*_{s} :

For *y*_{D}(*z*), conversion from the *z*-domain to the discrete time-domain of computer code is

For the remaining two terms,

where in general, *x*(*n* − *k*) is the *k*th previous sample point of *x* from the *x*(*n*) of the *n*th sample point and iteration that is presently being computed. These three difference equations can be implemented directly in software, keeping in mind that if *n* corresponds to the present iteration of the computation loop in time, then the *n* − 1 samples are from the previous iteration last time through the loop. The combined output, *y*(*z*), is the sum of the three outputs. Usually, these iterations of *y*(*n*) computations are implemented as interrupt-driven by a timer that produces regular *T*_{s} intervals.

If the *f*_{s} /*f* ratio is high enough - often ≥ 10 - then *
ω
*_{p} and *
ω
*_{z} do not need to be pre-warped. Otherwise, apply the prewarp formula of the *w*-domain to more accurately position the pole and zero in the *s*-domain.

**Summary**

The *z* discrete-sequence and *w* discrete-frequency domains add some further complication to electronics that take sampling into account. Happily, mastery of the different rules of dynamics in the *z*-domain can be largely avoided by using it as a shortcut between the discrete-time and sampled-frequency domains. If design values of poles and zeros in *s* for loop frequency compensation are to be implemented in the
μ
C, then the *w*-domain is another shortcut in that *w* is an approximate, sampling-affected *s*. Prewarping from *s* to *w* and using the bilinear formula of *
ω
*_{w} result in *z*-domain transfer functions that are then directly converted (as *z*^{–n}
→
*x*(*t* – *n T*_{s})) to discrete-time equations and computer code.

As μ
C-based systems continue to proliferate, *digital signal processing* and *discrete control* have become commonplace and an essential part of the electronics engineering body of knowledge. The concepts of this brief tutorial on discrete-time circuit analysis - of sampling by ADCs and DACs - is an increasingly important and familiar part of the working knowledge of the analog engineer of mixed-signal electronics.