Skip to content
Digital Control

Sampled-data systems: the process as seen by the computer

The digital control loop, the transfer function with a zero-order hold proved, first order, integrator and double integrator, sampling zeros, inter-sample behaviour.

Today almost every controller is a program: a microcontroller reads the measurements with an analogue-to-digital converter, computes the command and sends it to the actuator with a digital-to-analogue converter. The process, however, remains continuous. A system in which continuous signals and sequences of samples coexist is called sampled-data, and designing it requires a model that brings them together. In this lesson we look at the digital control loop, the discrete transfer function of the process as seen by the computer with its proof and three examples, the zeros introduced by sampling and what happens between one sample and the next.

The digital control loop

Digital control loop
In the computer (dashed frame) the reference r(k) is compared with the measurement y(k) and the controller C(z) computes the command u(k). The D/A converter holds it constant for one period and applies it to the process G(s); the continuous output y(t) is sampled with period T and converted by the A/D.

Every T seconds the A/D converter samples the output, the program computes u(k) and the D/A converter holds it constant until the next update: this is the zero-order hold (ZOH), already seen in the Process Control lesson on digital control, where it was shown that at low frequencies it is equivalent to a delay of T/2 and how T is chosen.

The computer sees only sequences: u(k) going out and y(k) = y(kT) coming in. The natural tools are therefore the z-transform and difference equations (Signal Theory and Systems Theory lessons on discrete-time systems). The controller is a transfer function C(z); what is needed is the discrete equivalent of the process, i.e. the function relating the sequence u(k) to the sequence y(k).

The transfer function with the hold

Theorem. If the process has transfer function G(s) and is preceded by a zero-order hold, the discrete transfer function from u(k) to y(k) is

    \[ G(z) = (1 - z^{-1})\,\mathcal{Z}\left\{\frac{G(s)}{s}\right\} \]

where \mathcal{Z}\{G(s)/s\} is the z-transform of the samples h_1(kT) of the process step response h_1(t).

Proof. The system from u(k) to y(k) is linear and time-invariant in discrete time, so its transfer function is the z-transform of the response to the unit impulse u(0) = 1, u(k) = 0 for k \ne 0. With this input the hold produces a rectangle of height 1 and width T, i.e. a step at time 0 minus a step at time T. By linearity the process responds with h_1(t) - h_1(t - T), and the samples are h_1(kT) - h_1((k-1)T). The second term is the first one delayed by one step, and a one-step delay in the z-transform is a multiplication by z^{-1}. So the transform of the samples is (1 - z^{-1}) times the transform of h_1(kT), and the Laplace transform of h_1 is G(s)/s. ∎

The model is exact at the sampling instants: there is no approximation, unlike the methods that approximate derivatives.

Three examples

First order. With G(s) = a/(s + a) we have G(s)/s = 1/s - 1/(s + a), hence h_1(kT) = 1 - e^{-akT} and

    \[ \mathcal{Z}\{h_1\} = \frac{z}{z - 1} - \frac{z}{z - e^{-aT}} \]

Multiplying by (z - 1)/z:

    \[ G(z) = 1 - \frac{z - 1}{z - e^{-aT}} = \frac{1 - e^{-aT}}{z - e^{-aT}} \]

The continuous pole -a has become the discrete pole e^{-aT}, and the static gain G(1) = 1 is unchanged, as in exact state-space discretisation (Systems Theory lesson on discrete-time systems).

Integrator. With G(s) = 1/s the step response is the ramp h_1(kT) = kT, with transform Tz/(z - 1)^2. So G(z) = T/(z - 1): the command accumulates, multiplied by the period.

Double integrator. With G(s) = 1/s^2 (a mass pushed by a force, a rotating satellite) we have h_1(kT) = (kT)^2/2, with transform T^2z(z + 1)/(2(z - 1)^3), and

    \[ G(z) = \frac{T^2}{2}\cdot\frac{z + 1}{(z - 1)^2} \]

Sampling zeros

The last example shows an important fact: the continuous process 1/s^2 has no zeros, but its discrete equivalent has a zero at z = -1. Sampling creates zeros that the continuous process does not have. A process with n poles and no zeros generally becomes a discrete system with n - 1 zeros. For small periods these zeros tend to values that depend only on the relative degree, and from relative degree 3 upwards at least one lies outside the unit circle: the discrete model is non-minimum-phase even if the continuous process is not. So not all the zeros of the model can be cancelled by the controller’s poles, as we will see in the lesson on deadbeat control.

What happens between samples

The z-domain model describes the output only at the instants kT. Between one sample and the next the output can do things the computer does not see:

  • hidden oscillation (inter-sample ripple), typical of very aggressive controllers: the samples sit on the reference, but the continuous output oscillates;
  • pathological sampling: if an oscillating mode of the process has frequency \omega with \omega T a multiple of \pi, its samples make it look constant or alternating, and the sampled system can lose the reachability or observability that the continuous system had.

For this reason the design is always checked with a continuous simulation of the process too, and the period is chosen with a generous margin: from 10 to 30 samples per closed-loop rise time.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x