Appendix E
Appendix E
Appendix E
E.1 Introduction
Readers who are studying MATLAB may want to explore the convenience of
MATLAB’s LTI Viewer, the Simulink LTI Viewer, and the SISO Design Tool. SISO
is an acronym for single-input single-output. Before proceeding, the reader should
have studied Appendix B, the MATLAB Tutorial, including Section B.1, which is
applicable to this appendix.
MATLAB Version 7.9 (R2009b), MATLAB’s Control System Toolbox Ver-
sion 8, Simulink Version 7.4, and Simulink Control Design Version 3 are required in
order to use the tools described in this appendix.
The M-files in this appendix are available elsewhere on this Web site. Consult
the MATLAB Installation Guide for your platform for minimum system hardware
requirements.
1
E1BAPP05 11/08/2010 13:12:11 Page 2
TABLE E.1 Critical points available for each plot in MATLAB’s LTI Viewer
Reference. The following summarize the steps you may take to obtain plots from the
LTI Viewer.
1. Access the LTI Viewer The LTI Viewer, shown in Figure E.1, may be accessed by
typing ltiview in the MATLAB Command Window or by executing this command
in an M-file.
2. Create LTI transfer function Create LTI transfer functions for which you want to
obtain responses. The transfer functions can be created in an M-file or in the
MATLAB Command Window. Run the M-file or MATLAB Command Window
statements to place the transfer function in the MATLAB workspace. All LTI
objects in the MATLAB workspace can be exported to the LTI Viewer.
3. Select LTI transfer functions for the LTI Viewer Choose Import . . . under
the File menu in the LTI Viewer window and select all LTI objects whose responses
you wish to display in the LTI Viewer sometime during your current session.
4. Select the LTI objects for the next reponse plot Right-click anywhere in the
LTI Viewer plot area to produce a pop-up menu as shown in Figure E.1.
Under Systems, select or deselect the objects whose plots you want or do not
want to show in the LTI Viewer. More than one LTI transfer function may be
selected.
5. Select the plot type Right-click anywhere in the LTI Viewer plot area to produce
a pop-up menu as shown in Figure E.1. Under Plot Types, select the type of plot
you want to show in the LTI Viewer.
6. Select the characteristics Right-click anywhere in the LTI Viewer plot area to
produce a pop-up menu as shown in Figure E.1. Under Characteristics, select the
characteristics of the plot you want displayed. More than one characteristic may
be selected. For each characteristic chosen, a point will be placed on the plot at
the appropriate location.
7. Interact with the Plot:
Zoom in Select the Zoom In button (with the þ sign) on the tool bar. Hold the
mouse button down and drag a rectangle on the plot over the area you want to
enlarge. Let go of the mouse button. You may also click the mouse. Each click
zooms you in closer.
Zoom out Select the Zoom Out button (with the sign) on the tool bar. Click
on the plot. Each click widens your view.
Grid Select Grid in the right-click menu to toggle the grid on and off. The
right-click menu will not work if any zoom button on the tool bar is
selected.
Normalize Select Normalize in the right-click menu to normalize all curvesin view.
Full view Select Full View in the right-click menu to return to the full view of
your plot after zooming.
Characteristics Read the values of the characteristics by placing the mouse on
the characteristics point on the plot. Left-click the mouse to keep the values
displayed.
Properties Select Properties in the right-click menu to change the appearance
of the graph. You can change the title, axis labels, x and y limits, font size and
styles, colors, and response characteristics definitions.
Coordinates and curve Left-click the mouse at any point on the plot to read the
system identification and the coordinates.
Add text and graphics Under the File menu, choose Print to Figure. The tool
bar of this figure has additional tools for adding text, arrows, and lines.
Additional plot-edit capabilities The Edit menus of the LTI Viewer and the
figures created by selecting Print to Figure offer a wide variety of control over
the plot presentation.
Example E.1
Step Response
This example, taken from Example 4.8 in the text, shows the use of the LTI Viewer
to display simultaneously three step responses as well as their peak time, settling
time, rise time, and steady-state values. Let us follow the steps listed in Section E.3.
Access the LTI Viewer and create the LTI objects Follow Steps (1) and (2)
in Section E.3 to access the LTI Viewer and generate the LTI transfer functions.
Figure E.2(a) shows the M-file used to generate the three transfer functions.
Select transfer functions for viewing responses After running the M-file,
follow Steps (3) and (4) in Section E.3 and select T1, T2, and T3.
Select the plot type Follow Step (5) in Section E.3 and select Step.
Select the Characteristics Follow Step (6) in Section E.3 and select Peak
Response, Settling Time, Rise Time, and Steady State.
Interact with the plot Follow Step (7) in Section E.3 and interact with the plot.
In particular, read the peak value and peak time of T3’s step response. Figure E.2(b)
shows the LTI Viewer window with the responses and system T3’s peak amplitude,
percent overshoot, and peak time.
Example E.2
Nyquist Diagram and Gain/Phase Margins
This example, taken from Example 10.8 in the text, shows the use of the LTI Viewer
in plotting a Nyquist diagram and obtaining gain margin, phase margin, zero dB
frequency, and 180 frequency. To create this plot follow Step (1) through (4) in
Section E.3 using the M-file shown in Figure E.3(a). Then use the right-click menu
and select Nyquist under Plot Type. To find the gain and phase margins as well as
the gain and phase margin frequencies, use the right-click menu and select All
Stability Margins under Characteristics. Figure E.3(b) shows the resulting LTI
Viewer window. The system’s gain margin and 180 frequency are displayed along
with the phase margin and zero dB frequency.
Example E.3
Bode Plots and Gain/Phase Margins
This example, taken from Example 10.10 in the text, shows the use of the LTI
Viewer in making a Bode plot and obtaining gain margin, phase margin, zero dB
frequency, and 180 frequency. To create this plot, follow Steps (1) through (4) in
Section E.3 using the M-file shown in Figure E.4(a). Then use the right-click menu
and select Bode under Plot Type. To find the gain and phase margins as well as the
gain and phase margin frequencies, use the right-click menu and select All Stability
Margins under Characteristics. Use the right-click menu and select Grid. Figure E.4
(b) shows the resulting LTI Viewer window. The system’s phase margin and 0 dB
frequency are displayed along with the gain margin and 180 frequency.
Since Example 10.10 used asymptotic approximations to determine the
characteristics, such as gain and phase margin, there will be some discrepancy
between the characteristics found using the LTI Viewer, which uses the exact
frequency response, and the results of Example 10.10.
Example E.4
Nichols Chart and Gain/Phase Margins
This example, which reproduces Figure 10.47 in the text, shows the use of the LTI
Viewer in making a Nichols chart and obtaining gain margin, phase margin, zero
dB frequency, and 180 frequency. To create this plot follow Step (1) through (4) in
Section E.3 using the M-file shown in Figure E.5(a). Then use the right-click menu
and select Nichols under Plot Type.
To find the gain and phase margins as well as the gain and phase margin
frequencies, use the right-click menu and select All Stability Margins under
Characteristics. Use the right-click menu to select Grid. Finally, select Zoom In
from the toolbar and drag your mouse over a portion of the Nichols plot to create
the close-up view shown in Figure E.5(b). Figure E.5(b) also shows the points from
which gain and phase margins and frequencies can be read.
Example E.5
Step Response for Digital systems
This example shows the use of the LTI Viewer to produce step responses for digital
system. To create this plot follow Steps (1) through (4) in Section E.3 using the M-file
shown in Figure E.6(a). Then use the right-click menu and select Step under Plot
Type. Figure E.6(b) shows the LTI Viewer window with the digital step response.
FIGURE E.7 Simulink model window showing Input Point and Output Point
FIGURE E.9 Simulink LTI Viewer after selecting Linearize Model from the Control and
Estimation Tools Manager window
1. Access the SISO Design Tool The SISO Design for SISO Design Task window,
shown in Figure E.10, may be accessed by typing sisotool in the MATLAB
Command Window or by executing this command in an M-file.
2. Create LTI transfer functions Create open-loop LTI transfer functions for which
you want to analyze closed-loop characteristics or design compensators. The
transfer functions can be created in an M-file or in the MATLAB Command
Window. Run the M-file or MATLAB Command Window statements to place the
transfer functions in the MATLAB workspace. All LTI objects in the MATLAB
workspace can be exported to the SISO Design Tool. For this example we run an
M-file and generate the LTI object for GðsÞ ¼ ðs þ 8Þ=½ðs þ 3Þðs þ 6Þðs þ 10Þ.
3. Create the closed-loop model for the SISO Design Tool Choose Import . . .
under the File menu in the SISO Design for SISO Design Task window to display
the System Data window shown in Figure E.11(a).
Type the LTI transfer function in the Data column. Alternately, click the
Browse . . . button and select the function you want to analyze in the resulting
Model Import window shown in Figure E.11(b). Click Import in the Model
Import window. Click OK in the System Data window.
FIGURE E.11 a. The System Data window b. The Model Import window
E1BAPP05 11/08/2010 13:12:25 Page 14
4. Interact with the SISO Design Tool After the System Data window closes, the
SISO Design for SISO Design Task window now contains the root locus and Bode
plots for the system as shown in Figure E.12.
You can now add the window to your desktop from which you can immediately
view closed-loop responses as you make changes to the root locus or Bode plot.
Under the Analysis menu select the desired response to open the LTI Viewer for
SISO Design Task window. Be sure to right-click on the LTI Viewer for SISO Design
Task and choose Systems to display the system response you desire. See the earlier
Task sections of this appendix for information on the LTI Viewer.
Changing gain You may change the loop gain in three ways. (1) Grab a
closed-loop pole (red squares) on the root locus. When the arrow cursor changes to a
hand, hold down the left button of your mouse and drag the closed-loop pole along
the root locus. You will see immediate changes on the Bode plot and the closed-loop
response in the LTI Viewer for SISO Design Task window. The value of gain will be
displayed in the Status Bar at the bottom of the SISO Design for SISO Design Task
window. (2) The loop gain can also be changed by positioning the cursor over the
Bode magnitude plot unit it changes to a hand. Hold down the left button of your
mouse and drag the Bode magnitude plot up or down. You will see immediate
changes on the root locus and closed-loop response. (3) Finally, the gain can also be
changed by choosing Design in the SISO Design for SISO Design Task menu bar and
E1BAPP05 11/08/2010 13:12:26 Page 15
then selecting Edit Compensator . . . When the Control and Estimation Tools
Manager window appears, type the desired gain in the Compensator section and hit
enter. As you change the gain, notice that you can read the gain and phase margins
and the gain and phase margin frequencies at the bottom of the Bode magnitude and
phase plots. Also, at the bottom of the Bode magnitude plot you are told whether or
not your closed-loop system is stable.
Grids You may toggle the root locus and Bode plot grids on and off by right-
clicking in the respective plot’s window and selecting or deselecting Grid. The root
locus grids are damping ratio and natural frequency.
Zoom See the instructions for zooming in Section E.3, Using the LTI Viewer.
Design constraints You may add design boundaries on your plots. For
example, if you want the settling time to be less than 2 seconds, a vertical gray
bar immediately to the right of 2 will signify the boundary for that portion of the
root locus where the settling time does not meet the requirements. These constraints
may be selected by right-clicking a respective plot and selecting Design Require-
ments. Choose whether you want a New . . . constraint or you want to Edit . . . an
existing constraint. Constraints may also be edited on the plots. Position your cursor
at the boundary of the constraint. Left click and when it turns into a four-pointed
arrow, you can drag the boundary to a new position. The values of the constraints are
displayed in the Status Bar at the bottom of the plots.
Properties Right-clicking in a plot’s window and selecting Properties . . .
displays the Property Editor window. From this window you can control some
properties of the plot, such as axis labels and limits. There are other options
available. For instance, you may change the damping ratio grids to show percent
overshoot by right-clicking in the root locus window and selecting Properties . . .
Once the Property Editor window is displayed, click the Options tab and select
Display damping values as % peak overshoot. You may want to explore other
options available for the root locus and Bode plots.
Add poles, zeros, and compensators Poles and zeros may be added from the
SISO Design Tool window toolbar shown in Figure E.13. Use the SISO Design for
SISO Design Task toolbar and select the desired compensator. Your cursor shows that
a compensator was selected. Point your cursor arrow to the point on the root locus or
Bode plot where you want to add the compensator and click. The compensator is
shown in the Control and Estimation Tools Manager window under the Compensator
Editor tab. The effect of adding the compensator is immediately seen in the root locus,
Bode plots, and LTI Viewer for SISO Design Task window. You may change the way
the compensator is represented by going to SISO Tool Preferences . . . under the Edit
menu. Select the Options tab and choose the compensator format you want.
Editing compensators The pole and zero values of the compensators can be
edited in several ways. (1) Place your cursor over a compensator zero or pole on the
FIGURE E.13 SISO Design for SISO Design Task window toolbar
E1BAPP05 11/08/2010 13:12:26 Page 16
root locus or Bode plot. When the cursor changes to a hand, hold down the left
button of your mouse and drag the pole or zero to a new position. (2) Choose
Designs then Edit Compensator . . . on the SISO Design for SISO Task window
menu bar. In response, MATLAB produces the Control and Estimation Tools
Manager. Under the Compensator Editor tab you can type in another location
for compensator zeros and poles. (3) Poles and zeros can be erased using the eraser
on the tool bar in Figure E.13. Select the eraser with your mouse and click on the
pole or zero you wish to erase. The effect of editing the compensator is immediately
seen in the root locus, Bode plots, and LTI Viewer for SISO Design Task window.
Other options and windows There are other options and windows available
that may be important to your project. You are encouraged to explore other menu
items not discussed in this section.
Summary
This appendix described three MATLAB GUI tools: the LTI Viewer, the Simulink
LTI Viewer, and the SISO Design Tool.
We described how to use MATLAB’s LTI Viewer to obtain time and frequency
response plots, as well as critical points on those plots, for transfer functions within
the MATLAB workspace. Several examples covering step responses for continuous
and sampled systems, Nyquist diagrams, Bode plots, and Nichols charts were given.
In addition, several preferences that we did not describe are available from the
LTI Viewer Edit menu. Within that menu, choose Plot Configurations . . . to select a
response layout. Line Styles . . . allows you to change the color, marker, and line
style orders. The interested reader should consult the Control System Toolbox
reference listed in the Bibliography of this appendix for more details about options
not covered in this appendix as well as additional instruction about the LTI Viewer.
The Simulink LTI Viewer extends the unefulness of the LTI Viewer to Simulink
diagrams. Simulink models are linearized before presenting the response curves in the
Simulink LTI Viewer. You may set the input and output points at any appropriate
place on the Simulink diagram. You may make changes to the Simulink diagram and
simultaneously display the response of each mode in the Simulink LTI Viewer.
The SISO Design Tool is a convenient and intuitive way to obtain, view and
interact with a system’s root locus, Bode plot, and Nichols plot. You can move
closed-loop poles along the root locus and immediately read the values of gain,
locations of closed-loop poles, and characteristics of performance, Furthermore, you
can see the changes in the open-loop frequency response as well as the closed-loop
response if you have the LTI Viewer for SISO Design Task open. Gain also can be
adjusted on the open-loop frequency response plots, and the effect can be seen
immediately on the root locus and closed-loop responses. Finally, you can add
compensators and see the immediate effect on the root locus, open-loop frequency
response plots, and the closed-loop responses.
In conclusion, it should be pointed out that results obtained from the GUIs
might be different from the analysis presented in the chapters. For example, the
GUIs use nonasymptotic frequency response plots to obtain results, while our
analysis and design may have used asymptotic Bode plots. Another example is
settling time. In Chapter 4 we approximated the settling time so that it was measured
at the peaks. With the GUIs the actual settling time is used, that is, the time the curve
first enters and stays within the 2% boundary.
E1BAPP05 11/08/2010 13:12:26 Page 17
Bibliography 17
Bibliography
The MathWorks. Control System ToolboxTM 8 Getting Started Guide. The MathWorks. Natick,
MA. 2000–2009.
The MathWorks. MATLABj 7 Getting Started Guide. The MathWorks. Natick, MA. 1984–
2009.
The MathWorks. Simulinkj 7 User’s Guide. The MathWorks. Natick, MA. 1990–2009.
The MathWorks. Simulinkj Control DesignTM 3 Getting Started Guide. The MathWorks.
Natick, MA. 2004–2010.
E1BAPP05 11/08/2010 13:12:26 Page 18
Founded in 1807, John Wiley & Sons, Inc. has been a valued source of knowledge and understanding for more
than 200 years, helping people around the world meet their needs and fulfill their aspirations. Our company is
built on a foundation of principles that include responsibility to the communities we serve and where we live
and work. In 2008, we launched a Corporate Citizenship Initiative, a global effort to address the environmental,
social, economic, and ethical challenges we face in our business. Among the issues we are addressing are carbon
impact, paper specifications and procurement, ethical conduct within our business and among our vendors, and
community and charitable support. For more information, please visit our website: www.wiley.com/go/citizenship.
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying recording, scanning or otherwise, except as permitted under
Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the
Publisher or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center,
222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for
permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street,
Hoboken, NJ 07030-5774, (201) 748-6011, fax (201) 748-6008 or online at http://www.wiley.com/go/permissions.
Evaluation copies are provided to qualified academics and professionals for review purposes only, for use in
their courses during the next academic year. These copies are licensed and may not be sold or transferred to a
third party. Upon completion of the review period, please return the evaluation copy to Wiley. Return
instructions and a free of charge return shipping label are available at www.wiley.com/go/returnlabel. Outside
of the United States, please contact your local representative.
ISBN 13 978-0470-54756-4
10 9 8 7 6 5 4 3 2 1