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

In the preceding chapters, I performed modeling and control design procedures in the continuous-time domain and implemented those designs in MATLAB with floatingpoint mathematics. It is now time to make the transition from continuous-time to discrete-time controller implementations. This step is necessary because software-based controllers are generally implemented as discrete-time systems. In addition, because of requirements to use low-cost, low-power microprocessors in many applications, it is often necessary to use fixed-point, rather than floating-point, mathematics.
A discrete-time control system samples its inputs and updates its outputs at equally spaced points in time. The values of the input signals between sampling instants are unknown to the controller. The output signals are normally held constant following each update until the next update. As an example, a SISO controller might sample its input signal with an ADC at 100Hz and update its output through a DAC at the same rate.
The time between input samples (and between output updates) is called the sampling period, T s. The sampling frequency, f s, is the reciprocal of T s. The selection of a sampling period is a critical step in the conversion of a continuous-time controller to a discrete-time implementation. The smaller the value of T s, the more closely the behavior of the discrete-time controller approximates that of the continuous-time system from which it was derived. However, as the value of T s becomes smaller, additional computing power is required to perform the more frequent controller...