Embedded Control Systems in C/C++: An Introduction for Software Developers Using MATLAB

Continuous-time model discretization is performed in MATLAB by the c2d() command provided in the Control System Toolbox. The c2d() command takes three arguments: a continuous linear time-invariant model, the sampling period for the discrete-time model, and the name of the discretization method to use for the conversion.
<span style="background-color:d9d9d9">>> sysd = c2d(sysc, Ts, method)</span>
In the statement above, sysc is the continuous-time system, Ts is the sampling period (usually in units of seconds), and method is a character string giving the name of the discretization method to be used. The discrete-time system sysd is the result of the discretization process.
The discretization methods available in MATLAB are described below. For each discretization method, comparison results are displayed in the time domain (as the unit step response) and in the frequency domain (as Bode diagrams). In these examples, the continuous-time model to be discretized is Y/ X = 1/( s 2 + 2 s + 1) and the sampling period is 1.0 second. The sampling period has been intentionally set to a large value to emphasize the differences among the discretization methods.
method = 'zoh' Zero-order hold. This method assumes the input is held constant between sampling instants. The output of the discrete-time model matches that of the continuous system at the sampling instants. The zero-order hold introduces a one-half sample time delay into the model. Figure 8.1 shows the time response and frequency response of the...