# Digital Control Systems

![Figure 13: Digital Control System](https://3896527066-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MQYqMkpf2WPiP6MKWRe%2Fuploads%2Fgit-blob-1b537f5762fd05d0c5655d6ac71f13f301930e00%2F7d6516d032a47dac031adf41bcb7d9095f8db6ae.png?alt=media)

When using a digital system to control a CT system, the inputs $$u(t)$$ must be held constant for a particular amount of time. This is equivalent to using a zero-order hold for sampling period $$T$$. At an multiple of the sampling period $$kT$$

$$\mathbf{x}(kT) = e^{AkT}\mathbf{x}(0) + \int\_{0}^{kT}e^{A(kT-\tau)}B\mathbf{u}(\tau)d\tau.$$

If we look only at the output at times which are multiples of $$kT$$ (i.e what our CPU would see if we sampled the output), then we can find a relationship between the current sample and the next sample.

$$\begin{aligned} -e^{At}\mathbf{x}(kT) + \mathbf{x}((k+1)T) &= -e^{A(k+1)\tau}\mathbf{x}(0) - \int\_{0}^{kT} e^{A((k+1)T-\tau)}B\mathbf{u}(\tau) d\tau \ &+ e^{A(k+1)\tau}\mathbf{x}(0) + \int\_{0}^{(k+1)T} e^{A((k+1)T-\tau)}B\mathbf{u}(\tau) d\tau\ &= \int\_{kT}^{(k+1)T} e^{A((k+1)T-\tau)}B\mathbf{u}(\tau)d\tau = e^{A(k+1)T}B\mathbf{u}(kT)\int\_{kT}^{(k+1)T}e^{-A\tau}d\tau\ &= B\mathbf{u}(kT)\int\_0^{T}e^{A\lambda}d\lambda \qquad (\lambda = (k+1)T-\tau)\ \therefore \mathbf{x}((k+1)T) &= e^{At}\mathbf{x}(kT) + \mathbf{u}(kT)\int\_{0}^{T}Be^{A\lambda}d\lambda.\end{aligned}$$

Looking only at the samples, the discrete system is

$$\mathbf{x}\[k+1] = G\mathbf{x}\[k]+H\mathbf{u}\[k] \qquad G = e^{AT} \quad H = \int\_0^Te^{A\lambda}Bd\lambda. \qquad (17)$$

If we solve this recursive equation for a particular $$\mathbf{x}\[0]$$, then we get

$$\mathbf{x}\[n] = G^n\mathbf{x}\[0] + \sum\_{i=0}^{n-1}G^iH\mathbf{u}\[i]. \qquad (18)$$

Notice that the stability of this system depends on the eigenvales of $$G$$ and that $$|\lambda\_G|<1$$ in order for it to be stable. If we want to find a transfer function of the system, then we can use the unilateral Z-transform.

$$\begin{aligned} zX(z) - zx\[0] = GX(z) + HU(z)\ X(Z) = (zI-G)^{-1}(HU(z)+x\[0]z) \qquad (19)\end{aligned}$$

Notice that the poles of the system are still the eigenvalues of the $$G$$ matrix. Thus any techniques for placing the poles of the $$G$$ matrix are still valid, except we need to make sure the poles stay within the unit circle for stability instead of the left half plane. If we want to figure out how a system will respond to an input, we can use the final value theorem like we do in CT.

{% hint style="info" %}

## Theorem 15

For a transfer function $$G(z)$$ which has all poles in the unit circle, the final value of $$g\[n]$$ is given by

$$\lim\_{n=\to\infty}g\[n] = \lim\_{z\to1}(z-1)G(z).$$
{% endhint %}

The other primary difference from CT is that in DT, a pole which is closer to the origin means a faster transient response.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://aparande.gitbook.io/berkeley-notes/ee128-0/ee128-7.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
