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
As 1/sTs is a continuous integrator in s, 1/wTs 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, Ts.
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
is found by recalling the defining relationship between s
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 fw values before applying frequency-response analysis by substituting the fw pole-zero values into the s-domain transfer function. The following table gives some prewarp values.
where fw =
w is the w-domain approximation to ω
of s = jω. As the sampling ratio fs/f increases, f in s approaches fw in w. As fs/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, fs 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 = nTs :
For yD(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 kth previous sample point of x from the x(n) of the nth 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 Ts intervals.
If the fs /f ratio is high enough - often ≥ 10 - then
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.
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 Ts)) to discrete-time equations and computer code.
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.