10.1: State Variable Models of Sampled-Data Systems
- Page ID
- 24433
Discretizing the State Variable Model
System models described with state variables can be converted to their discrete-time equivalents by considering a zero-order hold (ZOH) at the input of the model. The ZOH device converts the output of a digital controller (a number sequence) into a piece-wise constant continuous-time signal by holding its output constant over successive time periods.
To develop this approach, let the continuous-time state variable model be given as:
\[\dot{x}(t)=Ax(t)+Bu(t) \nonumber \]
\[y(t)=Cx(t) \nonumber \]
where \(A\) is the system matrix, \(B\) is the input matrix, and \(C\) is the output matrix.
In order to discretize the continuous-time state equations, we consider the time-domain solution to the state equation (Chapter 8) given in terms of a convolution integral:
\[x(t)=e^{A(t-t_{0} )} x_{0} +\int _{t_{0} }^{\tau } e^{A(t-\tau )} B\,u(\tau )\,\rm d\tau \nonumber \]
It is assumed that the system state is available at \(t_{0} =(k-1)T\); then, assuming a constant input, \(u_k\), the state at \(t=kT\) is given as:
\[x_{k} =e^{At} x_{k-1} +\int _{(k-1)T}^{kT} e^{AT} B\,u_{k} \,\rm d\tau \nonumber \]
A simple change of variables results in the following expression:
\[x_{k} =e^{At} x_{k-1} \; +\int _{0}^{T} e^{AT} d\tau \, B\, u_{k} \nonumber \]
Let the system and input matrices appearing in the discrete-time model be defined as:
\[A_{\rm d} =e^{AT} ,\; \; B_{\rm d} =\int _{0}^{T} e^{A\tau } d\tau B \nonumber \]
Then, after a time shift, the discrete-time state variable model is expressed as:
\[x_{k+1} =A_{\rm d} x_{k} +B_{\rm d} u_{k} ,\; \; \; y_{k} =C_{\rm d} x_{k} . \nonumber \]
where \(C_{\rm d} =C.\)
Assuming that system matrix \(A\) is invertible, the expression for \(B_{\rm d}\) can be simplified as:
\[B_{\rm d} =\left[\int _{0}^{T} \left(I+A\tau +\frac{A^{2} \tau ^{2} }{2!} +\ldots \right)d\tau \right]=\left(IT+\frac{AT^{2} }{2!} +\ldots \right)B=A^{-1} (e^{AT} -I)B \nonumber \]
The system and input matrices \(\left(A_{\rm d} ,B_{\rm d} \right)\) appearing in the discrete-time model are parameterized by the sample time, \(T\). Hence, changing \(T\) will change the discrete-time model.
In the MATLAB Control Systems Toolbox, ‘c2d’ command is used for the discretizing a state variable model; the presence of a ZOH at the input is assumed, but other options are available.
The state variable model of a DC motor is given as:
\[\frac{\rm d}{\rm dt} \left[\begin{array}{c} {i_{a} } \\ {\omega } \end{array}\right]=\left[\begin{array}{cc} {-100} & {-5} \\ {5} & {-10} \end{array}\right]\left[\begin{array}{c} {i_{a} } \\ {\omega } \end{array}\right]+\left[\begin{array}{c} {100} \\ {0} \end{array}\right]V_{a} , \;\;\omega =\left[\begin{array}{cc} {0} & {1} \end{array}\right]\left[\begin{array}{c} {i_{a} } \\ {\omega } \end{array}\right] \nonumber \]
Let \(T=0.02\; \rm s\), a value five times faster than the dominant motor time constant: \(\tau _\rm m \cong 0.1\; \rm s.\); then, the system and input matrices for the discrete model are computed as:
\[A_{\rm d} =e^{At} =\left[\begin{array}{cc} {0.134} & {-0.038} \\ {0.038} & {0.816} \end{array}\right], B_{\rm d} =A^{-1} \left(e^{At} -I\right)B=\left[\begin{array}{c} {0.863} \\ {0.053} \end{array}\right] \nonumber \]
The resulting discrete state variable model is given as:
\[\left[\begin{array}{c} {i_{k+1} } \\ {\omega _{k+1} } \end{array}\right]=\left[\begin{array}{cc} {0.134} & {-0.038} \\ {0.038} & {0.816} \end{array}\right]\left[\begin{array}{c} {i_{k} } \\ {\omega _{k} } \end{array}\right]+\left[\begin{array}{c} {0.863} \\ {0.053} \end{array}\right]V_{k} , \;\; y_{k} =\left[\begin{array}{cc} {0} & {1} \end{array}\right]\left[\begin{array}{c} {i_{k} } \\ {\omega _{k} } \end{array}\right] \nonumber \]
An alternate state variable model of the DC motor is obtained by using the ‘ss’ command in the MATLAB Control Systems Toolbox to realize the motor transfer function; the model is given as:
\[\left[ \begin{array}{c} {\dot{x}}_1 \\ {\dot{x}}_2 \end{array} \right]=\left[ \begin{array}{cc} -110 & -32.03 \\ 32 & 0 \end{array} \right]\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right]+\left[ \begin{array}{c} 4 \\ 0 \end{array} \right]V_a,\ \ \omega =\left[ \begin{array}{cc} 0 & 3.906 \end{array} \right]\left[ \begin{array}{c} x_1 \\ x_2 \end{array} \right] \nonumber \]
By using the MATLAB ‘c2d’ command, the corresponding discrete-time model is obtained as:
\[\left[\begin{array}{c} {x_{1,\,k+1} } \\ {x_{2,\,k+1} } \end{array}\right]=\left[\begin{array}{cc} {0.058} & {-0.243} \\ {0.243} & {0.892} \end{array}\right]\left[\begin{array}{c} {x_{1,\,k} } \\ {x_{2,\,k} } \end{array}\right]+\left[\begin{array}{c} {0.030} \\ {0.013} \end{array}\right]\, u_{k} , \;\;y_{k} =\left[\begin{array}{cc} {0} & {3.91} \end{array}\right]\left[\begin{array}{c} {x_{1,\,k} } \\ {x_{2,\,k} } \end{array}\right] \nonumber \]
The two discrete-time state variables of the DC motor are equivalent, i.e., they both share the same \(z\)-plane eigenvalues:\(\ z_{1,2}=0.814,\ 0.136\); these values are related to the analog system eigenvalues: \(s_{1,2}=-99.7,\ -10.28\) by the relation: \(z=e^{Ts}\).
Iterative Solution to Discrete State Equations
The discrete-time state equations constitute a set of first-order difference equations that can be easily solved by iteration. Toward this end, let the discrete state equation be given as:
\[x_{k+1} =A_{\rm d} x_{k} +B_{\rm d} u_{k} , \;\;y_{k} =C_{\rm d} x_{k} \nonumber \]
Starting from an initial vector, \(x_0\), and given an input sequence \(u\left\{k\right\}\), an iterative solution to the discrete state equation is developed as follows:
\[x_{1} =A_{\rm d} x_{0} +B_{\rm d} u_{0} \nonumber \]
\[x_{2} =A_{\rm d} ^{2} x_{0} +A_{\rm d} B_{\rm d} u_{0} +B_{\rm d} u_{1} \nonumber \]
\[\vdots \nonumber \]
\[x_{n} =A_{\rm d}^{n} x_{0} +\sum _{k=0}^{n-1} A_{\rm d}^{n-1-k} B_{\rm d} u_{k} \nonumber \]
Let \(\Phi (k)=A_{\rm d}^{k}\) define the discrete state-transition matrix; then, the solution is given as:
\[x_{n} =\Phi (n)x_{0} +\sum _{k=0}^{n-1} \Phi (n-1-k)B_{\rm d} u_{k} \nonumber \]
The discrete state variable model of a dc motor (\(T=0.02s\)) is given as:
\[A_{\rm d} =\left[\begin{array}{cc} {0.134} & {-0.038} \\ {0.038} & {0.816} \end{array}\right],\; \; B_{\rm d} =\left[\begin{array}{c} {0.863} \\ {0.053} \end{array}\right],\; \; C_{\rm d} =\left[\begin{array}{cc} {0} & {1} \end{array}\right] \nonumber \]
Assuming zero initial conditions and a unit-input sequence: \(u_{k} =\{ 1,\; 1,\ldots \} ;\) the output sequence is iteratively computed as:
\[y\left\{k\right\}=\{0,\ 0.053,\ 0.128,\ 0.194,\ 0.249,\ 0.293,\ 0.329,\ 0.359,\ 0.383,\ 0.402,\ 0.418,\dots \} \nonumber \]
The Pulse Transfer Function
The pulse transfer function, \(G(z)\), of a sampled-data system can be obtained from discrete state equations by the application of \(z\)-transform:
\[zx(z)-zx_{0} =A_{\rm d} x(z)+B_{\rm d} u(z) \nonumber \]
The above equation is solved assuming zero initial conditions to obtain:
\[x(z)=(zI-A_{\rm d} )^{-1} B_{\rm d} u(z) \nonumber \]
The output equation is defined as:
\[y(z)=C_{\rm d} (zI-A_{\rm d} )^{-1} B_{\rm d} u(z)=G(z)u(z) \nonumber \]
Given the discrete state equations, the pulse transfer function is obtained as:
\[G(z)=C_{\rm d} (zI-A_{\rm d} )^{-1} B_{\rm d} \nonumber \]
The discrete state-transition matrix is obtained by taking the inverse \(z\)-transform of \((zI-A_{\rm d} )^{-1}\) as:
\[\phi (k)=z^{-1} \left\{(zI-A_{\rm d} )^{-1} \right\}=A_{\rm d}^{k} \nonumber \]
In terms of the state transition matrix, the unit-pulse response the sampled-data system is obtained as:
\[g_{k} =C_{\rm d} A_{\rm d}^{k-1} B,\; \; k\ge 0 \nonumber \]
In the MATLAB Control System Toolbox, the pulse transfer function for a given discrete state variable model can be obtained by invoking the ‘tf’ command.
The discrete state variable model of a dc motor (\(T=0.02s\)) is given as:
\[A_{\rm d} =\left[\begin{array}{cc} {0.134} & {-0.038} \\ {0.038} & {0.816} \end{array}\right],\; \; B_{\rm d} =\left[\begin{array}{c} {0.863} \\ {0.053} \end{array}\right],\; \; C_{\rm d} =\left[\begin{array}{cc} {0} & {1} \end{array}\right] \nonumber \]
By using the 'tf' command in MATLAB, the motor pulse transfer function is obtained as:
\[G\left(z\right)=\frac{0.053z+0.0257}{z^2-0.95z+0.111}. \nonumber \]