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
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,
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
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.
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
Change the number of data points, $N$, used to generate the model. How does that affect the step
response of the model?
What is the advantage and disadvantage of using a larger $N$
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?
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?