8 System Identification

Following is an example of using the identification methods discussed in the Chapter 8. Update the design values using the controls in the example or the duplicates here

As an example, consider the third order continuous system with transfer function

$$G(s)=\frac{2000}{(2+10)(s^2+20s+200)} \optbreak{}=\frac{2000}{(s+10)(s+10\pm j10)}$$

The complex poles have natural frequency $\omega_n \approx$ 14 rad/sec, or about 2.25 Hz, so pick sampling frequency of 20 Hz, or $T$ = 0.05 sec. Preceding this $G(s)$ by a sampler and following it by a ZOH (our standard discretization procedure) yields its discrete form,

$$\begin{aligned}G(z) &=\frac{0.0284z^{−1} + 0.0775z^{−2} + 0.0134z^{−3}}{1 − 1.6711z^{−1} + 1.0136z^{−2} − 0.2231z^{−3} } \optbreak{} \\ \\ &= \frac{0.0284(z + 0.1857)(z + 2.54)}{(z − 0.6065)(z − 0.5323 \pm j0.2908)}\end{aligned}$$

Excitation.
Excite this $G(z)$ with $N$ samples of a random binary signal of amplitude ±1 as shown in Chapter 8, Figure 8.2. Assume that the output is quantized by an A/D with 8-bit resolution and range. Where

The quantized response of this system is shown in Figure 1

normal distributed points
Figure 1: Quantized output of $G(z)$ driven by a random binary signal.
Refresh to run the simulation with a new random data set.

Least-Squares Fit.
The input data $u(k)$ and output data $y(k)$ must be arranged according to equations (8.9) and (8.10) $$\tag{8.9}\bold{Y}\triangleq \underbrace{\begin{bmatrix} y(n)\\y(n+1)\\ \vdots \\ y(N) \end{bmatrix}}_{(N-n+1)\times 1}$$ $$\tag{8.10}\bold{\Psi}\triangleq \underbrace{\begin{bmatrix} y(n-1) & y(n-2) & \dots & y(0) & u(n-1) & u(n-2) & \dots & u(0) \\ y(n) & y(n-1) & \dots & y(1) & u(n) & u(n-1) & \dots & u(1) \\ \vdots & \vdots & & \vdots & \vdots & \vdots & & \vdots \\ y(N-1) & y(N-2) & \dots & y(N-n) & u(N-1) & u(N-2) & \dots & u(N-n) \end{bmatrix}}_{(N-n+1)\times 2n} $$ $$\bold{\Psi}\triangleq \begin{matrix} \big\lceil & y(n-1) & y(n-2) & \dots & y(0) \\ \Big\vert & y(n) & y(n-1) & \dots & y(1) \\ \Big\vert & \vdots & \vdots & & \vdots \\ \big\lfloor & y(N-1) & y(N-2) & \dots & y(N-n) \end{matrix} $$ $$\tag{8.10} \hspace{4em}\underbrace{\hspace{2em} \begin{matrix} u(n-1) & \dots & u(0) &\big \rceil \\ u(n) & \dots & u(1) & \Big\vert \\ \vdots & & \vdots & \Big\vert \\ u(N-1) & \dots & u(N-n) &\big \rfloor \end{matrix}}_{(N-n+1)\times 2n} $$ . to form the $\bold{Y}$ and $\bold{\Psi}$ matrices, then the least-squares solution for model parameter vector $\bold{\Theta}$ is given by equation(8.13) $$\tag{8.13} \bold{\Theta} = [\bold{\Psi}^T\bold{\Psi}]^{-1}\bold{\Psi}^T\bold{Y}$$ . Here $N$ = 50 and $n$ = 3, and $\bold{Y}$ and $\bold{\Psi}$ are constructed accordingly

Executing this yields model parameter vector

$\bold{\Theta}= [$  $]^T$

and corresponding estimated transfer function

Step Response.
How does the step response of the model compare with the actual system? Both unit step responses are shown in Figure 2. While the steady-state value is somewhat inaccurate, the transient portion of the response exhibits excellent agreement.

step response
Figure 2: Comparison of actual and model step response Solid lines are drawn for clarity. They do not represent the intersample response.. Model generated with a ±5V ADC range and $N$= 50 
Refresh to run the simulation with a new random data set.

Comments.
In this example, we did not make good use of the range of the A/D converter, using only about ±1V range of the ±5V converter. This contributed to the inaccuracy. Even so, the $\hat{G}(z)$ we obtained would serve pretty well for controller design


Use the controls in the previous example to change the number of data points, $N$, or rerun the simulation with a new random data set.

Update the design values using the controls in the example or duplicates here

  1. Change the number of data points, $N$, used to generate the model. How does that affect the step response of the model?
  2. What is the advantage and disadvantage of using a larger $N$
  3. Run the simulation using $N=50$ and a ±5V ADC range. Do this several times with different data sets by refreshing the data set in Figure 2. Why does the output simulation change?
  4. Run the simulation using $N=50$ and a ±1V ADC range. Do this several times with different data sets by refreshing the data set in Figure 2. How do the results differ from those in question #3 and why?
Controls
$N$ = 

A/D =