Getting Started | ![]() ![]() |
Constructing SISO Models
Once you have a set of differential equations that describe your plant, you can construct SISO models using simple commands in the Control System Toolbox. The following sections discuss:
Constructing a State-Space Model of the DC Motor
Listed below are nominal values for the various parameters of a DC motor.
R= 2.0 % Ohms L= 0.5 % Henrys Km = .015 % Torque constant Kb = .015 % emf constant Kf = 0.2 % Nms J= 0.02 % kg.m^2/s^2
Given these values, you can construct the numerical state-space representation using the ss
function.
This is the output of the last command.
Converting Between Model Representations
Now that you have a state-space representation of the DC motor, you can convert to other model representations, including transfer function (TF) and zero/pole/gain (ZPK) models.
Transfer Function Representation. You can use tf
to convert from the state-space representation to the transfer function. For example, use this code to convert to the transfer function representation of the DC motor.
Zero/Pole/Gain Representation. Similarly, the zpk
function converts from state-space or transfer function representations to the zero/pole/gain format. Use this code to convert from the state-space representation to the zero/pole/gain form for the DC motor.
Note The state-space representation is best suited for numerical computations. For highest accuracy, convert to state space prior to combining models and avoid the transfer function and zero/pole/gain representations, except for model specification and inspection. See Reliable Computations in the online Control System Toolbox documentation for more information on numerical issues. |
Constructing Transfer Function and Zero/Pole/Gain Models
In the DC motor example, the state-space approach produced a set of matrices that represents the model. If you choose a different approach, you can construct the corresponding models using tf
, zpk
, ss
, or frd
.
sys = tf(num,den) % Transfer function sys = zpk(z,p,k) % Zero/pole/gain sys = ss(a,b,c,d) % State-space sys = frd(response,frequencies) % Frequency response data
For example, if you want to create the transfer function of the DC motor directly, use these commands.
The Control System Toolbox builds this transfer function.
Alternatively, you can create the transfer function by specifying the numerator and denominator with this code.
To build the zero/pole/gain model, use this command.
This is the resulting zero/pole/gain representation.
![]() | SISO Example: the DC Motor | Discrete Time Systems | ![]() |