CMU
UM


Discrete step response

To plot a step response of a discrete system, we will use two separate Matlab functions, dstep and stairs. The dstep will be used to obtain N number of output sample points, where N is supplied by an user. The stairs plots a stairstep graph of supplied vectors, namely the time vector [t] and the amplitude vector [x].

1. Transfer function

First, we will introduce to you how to use these two functions to obtain a step response of a given discrete transfer function. Suppose you have the following transfer function

We will use the dstep to obtain a vector of sample points. Create an m-file and enter the following commands.

Running this m-file in the command window gives you 101 sample points.

Notice that the function dstep does not consider the time vector [t]; instead, it considers the number of sample points (N). In deed, if you take out the left hand side argument [x] from the dstep(numDz,denDz) command, you get the step response of the system as a function of sample (k), not as a function of time (Try this yourself).

To obtain a response as a function of time, first, we need to consider the relationship between the number of samples and the sampling time (Ts). Let's say our digital control system has the sampling time of t sec/sample. Using this digital control system, it takes t*(N-1) seconds to obtain N samples. For example, if above 101 samples were taken with the system having a sampling time of 0.05 sec/sample, the total sampling period equals to 5 seconds. If you plot this, it looks like the following.

The function stairs connects these sample points in a way that it represents the output y(k) preceded by zero-order hold. Let's use stairs to connect these sample points. Add the following commands to the above m-file and rerun it. You should get the following stairstep response.

2. State-Space

To obtain a step response from the state-space model, we will follow the same procedure as what we did for the transfer function. The only difference is that we now deals with matrices F, G, H, and J instead of num and den matrices. Suppose we have the following state-space model


Note: This state-space represents the same system as the above transfer function

The following commands will plot a stairstep response of the system represented by this state-space model. Copy these commands to an new m-file and run it.

You should see the same plot as the one shown above.


Use your browser's "Back" button to return to the previous page.

8/15/97 DK