For Use with MATLAB®ComputationVisualizationProgrammingControl SystemToolboxUser’s GuideVersion 4.2
viii ContentsSpecifying the Simulink Model Portion for Analysis . . . . . . . . 6-53Adding Input Point or Output Point Blocks t o the Diagram 6-53Remo
2 LTI Models2-56typepade(H,[],[],[1 1;2 1])where H is the TF representation of defined in the “Distillation ColumnExample” on page 2-47. This command
Simulink Block for LTI Systems2-57Simulink Block for LTI SystemsYou can incorporate LTI objects into Simulink diagrams using the LTI Systemblock shown
2 LTI Models2-58transfer functions or zero-pole-gain models, as it depends on the choice of statecoordinates used by the realization algorithm. As a r
References2-59References[1] Dorf, R.C. and R.H. Bi shop, Modern Control Systems, Addison-Wesley,Menlo Park, CA, 1998.[2] Wood, R.K. and M.W. Berry, “T
2 LTI Models2-60
3Operations on LTI ModelsIntroduction ...3-2Precedence and Property Inheritance ...3-3Extracting and Modifying Subsystems ...
3 Operations on LTI Models3-2IntroductionYou can perform basic matrix operations such as addition, multiplication, orconcatenation on LTI models. Such
Precedence and Property Inheritance3-3Precedence and Property InheritanceYou can apply operations to LTI models of different types. The resulting type
3 Operations on LTI Models3-4• In general, when two LTI models sys1 and sys2 are combined usingoperations such as+, *, [,], [;], append,andfeedback, t
Extracting and Modifying Subsystems3-5Extracting and Modifying SubsystemsSubsystems relate subsets of the inputs and outputs of a system. The transfer
ix8The Root Locus Design GUIIntroduction ... 8-2A Servomechanism Example ... 8-4Control
3 Operations on LTI Models3-6Note: •sys, the LTI model that has had a portion reassigned, retains its originalmodel type (TF, ZPK, SS, or FRD) regar
Extracting and Modifying Subsystems3-7To extract the transfer function from the first input to the first output,typeT(1,1)Transfer function: 1------
3 Operations on LTI Models3-8I/O channel or g roup names) as a keyword. There are two ways you can specifyFRD models using frequencies:• Using integer
Extracting and Modifying Subsystems3-9is equivalent tosys(1,[2 4 5]Similarly, if pressure isthenameassignedtoanoutputchanneloftheLTImodelsys,thensys(&
3 Operations on LTI Models3-10For state-space models, both concatenation and subsystem assignmentincrease the model order because they assume t hatsys
Arithmetic Operations3-11Arithmetic OperationsYou can apply almost all arithmetic operations to LTI models, including thoseshown below.To understand h
3 Operations on LTI Models3-12represents the parallel interconnection shown below.Ifsys1 and sys2 are two state-space models with data and, the state-
Arithmetic Operations3-13MultiplicationMultiplication of two LTI models connects them in series. Specifically,sys = sys1 * sys2returns an LTI model sy
3 Operations on LTI Models3-14The resulting inverse model is of the same type as sys. Related operationsinclude:• Left divisionsys1\sys2, which is equ
Arithmetic Operations3-15You can use pertransposition to obtain the Hermitian (conjugate) transpose ofthe frequency response of a given system. The fr
x ContentsClearingData... 8-46References ... 8-489Design Case StudiesYaw Da
3 Operations on LTI Models3-16Model Interconnection FunctionsThe Control System Toolbox provides a number of functions to help with themodel building
Model Interconnection Functions3-17Concatenation of LTI ModelsLTI model concatenation is done in a manner similar to the way youconcatenate matrices i
3 Operations on LTI Models3-18Useappend(sys1,sys2)to specify the block-decoupled LTI model interconnection.Seeappend on page 11-12 for more informatio
Model Interconnection Functions3-19For example, if sys1 has m inputs and p outputs, while sys2 has p inputs andm outputs, then the negative feedback c
3 Operations on LTI Models3-20Continuous/Discrete Conversions of LTI ModelsThe function c2d discretizes continuous-time TF, SS, or ZPK models.Converse
Continuous/Discrete Conversions of LTI Models3-21The signal is then fed to the continuous system , and the resultingoutput is sampled every seconds to
3 Operations on LTI Models3-22and you get back the original discrete-time system (up to canceling thepole/zero pair at z=–0.5):Zero/pole/gain: (z+0.5)
Continuous/Discrete Conversions of LTI Models3-23Similarly, the d2c conversion relies on the inverse correspondenceTustin with Frequency PrewarpingThi
3 Operations on LTI Models3-24Discretization of Systems with DelaysYou can also use c2d to discretize SISO or MIMO continuous-time models withtime del
Continuous/Discrete Conversions of LTI Models3-25The step responses of the continuous and discretized models are compared inthe figure below. This plo
xi10Reliable ComputationsConditioning and Numerical Stability ... 10-4Conditioning... 10-4Numerical
3 Operations on LTI Models3-26vectors when it is p ossible to reduce the total number of I/O delays. Theresulting model has a minimum number of such d
Resampling of Discrete-Time Models3-27Resampling of Discrete-Time ModelsYou can resample a discrete-time TF, SS, or ZPK model sys1 by typingsys2 = d2d
3 Operations on LTI Models3-28References[1] Åström, K.J. and B. Wittenmark, Computer-Controlled Systems: Theoryand Design, Prentice-Hall, 1990, pp. 48
4Arrays of LTI ModelsIntroduction ...4-2When to Collect a Set of Models in an LTI Array . . . . . . 4-2Restrictions for LTI Models Co
4 Arrays of LTI Models4-2IntroductionYou can use LTI arrays to collect a set of LTI models into a single MATLABvariable. You then use this variable to
Introduction4-3Where to Find Information on LTI ArraysThenext twosections giveexamples thatillustratetheconcept ofanLTI array,its dimensions, and size
4 Arrays of LTI Models4-4The Concept of an LTI ArrayTo visualize the concept of an LTI array, consider the set of five transferfunction models shown b
The Concept of an LTI Array4-5Just as you might collect a set of two-by-two matrices in a multidimensionalarray, you can collect this set of five tran
4 Arrays of LTI Models4-6Higher Dimensional Arrays of LTI ModelsYou can also collect a set of models in a two-dimensional array. The followingdiagram
Dimensions, Size, and Shape of an LTI Array4-7Dimensions, Size, and Shape of an LTI ArrayThe dimensions and size of a single LTI model are determined
xii ContentsConversiontoTransferFunction ... 11-226Example1... 11-226Example2...
4 Arrays of LTI Models4-8Thenext figure illustrates the concepts of dimension and sizefor the LTI arraym2d, a 2-by-3 array of one-input, two-output tr
Dimensions, Size, and Shape of an LTI Array4-9Five related quantities are pertinent to understanding the array dimensions:• N, the number of models in
4 Arrays of LTI Models4-10Note: • By convention, a single LTI model is treated as a 1-by-1 array of models.For s ingle LTI models, size returns only
Dimensions, Size, and Shape of an LTI Array4-11Notice that size returns a vector whose entries correspond to the length ofeach of the four dimensions
4 Arrays of LTI Models4-12Building LTI ArraysThere are several ways to b uild LTI arrays:• Using afor loop to assign each model in the array• Usingsta
Building LTI Arrays4-13Suppose, based on measured input and output data, you estimate confidenceintervals , and for each of the pa rameters, and . All
4 Arrays of LTI Models4-14The first two colon indices ( ) select all I/O channels from the I/O dimensionsofH. Thet hird indexof H refers to the first
Building LTI Arrays4-15For the purposes of efficient computation, you can initialize an LTI array tozero, and then reassign the entire array to the va
4 Arrays of LTI Models4-16When you concatenate several models or LTI arrays along the jth arraydimension, such as instack(j,sys1,sys2,...,sysn)• The l
Building LTI Arrays4-17% Set up the LTI array using stack.COL1 = stack(1,H11,H21); % The first column of the 2-by-2 arrayCOL2 = stack(1,H12,H22); % Th
PrefaceInstallation ...3Getting Started ...4Typographic Conventions ...5
4 Arrays of LTI Models4-18where• Both zeros and poles are multidimensional cell arrays whose cell entriescontain the v ectors of zeros and poles for e
Building LTI Arrays4-19where• is the maximum of the number of states in each model in the array.• is the number of inputs in each model.• is the numbe
4 Arrays of LTI Models4-20Indexing Into LTI ArraysYou can index into LTI arrays in much the same way as y ou would formultidimensional arrays to:• Acc
Indexing Into LTI Arrays4-21For example, if sys is a 5-by-2 a rray of state-space models defined bysys = rss(4,3,2,5,2);youcan access(and display)the
4 Arrays of LTI Models4-22selects the first two input channels, and the first output channel in each modelof the LTI arrayA, and returns the resulting
Indexing Into LTI Arrays4-23Similarly, the commandssys(:,:,3,2) = sys(:,:,4,1);sys(1,2,3,2) = 0;reassign the entire model in the (3,2) position ofthe
4 Arrays of LTI Models4-24Similarly,sys(:,:,[3 4],:) = []deletes the third and fourth rows of this two-dimensional array of models.
Operations on LTI Arrays4-25Operations on LTI ArraysUsing LTI arrays, you can apply almost all of the basic model operations thatwork on single LTI mo
4 Arrays of LTI Models4-26Example: Addition of Two LTI ArraysThe following diagram illustrates the addition of two 3-by-1 LTI arrayssys1+sys2.Figure 4
Operations on LTI Arrays4-27Note that:• Each model in sys1 and sys2 must have the same number of inputs andoutputs. This is required for the addition
Preface2MATLAB®has a rich collection of functions immediately useful to the controlengineer or system theorist. Complex arithmetic, eigenvalues, root
4 Arrays of LTI Models4-28where sys, the result of the operation, is an L TI array with the same arraydimensions assys1. You can use shortcuts for cod
Operations on LTI Arrays4-29You can do this efficiently by first setting up an LTI array h containing theSISO models and then using concatenation to f
4 Arrays of LTI Models4-30adds a single SISO transfer function model to each entry in each model of theLTIarrayofMIMOmodels[h,h].Finally,G = rand(1,1,
5 Model Analysis ToolsGeneral Model Characteristics ...5-2Model Dynamics ...5-4State-Space Realizations ...5-7Time a
5 Model Analysis Tools5-2General Model CharacteristicsGeneral model characteristics include t he model type, I/O dimensions, andcontinuous or discret
General Model Characteristics5-3This example ill ustrates the use of some of these commands. See the relatedreference pages for more details.H = tf({1
5 Model Analysis Tools5-4Model DynamicsThe Control System Toolbox offers commands to determine the system poles,zeros,DCgain,norms,etc.Youcanapply the
Model Dynamics5-5Here is an example of model analysis using some of these commands.h = tf([4 8.4 30.8 60],[1 4.12 17.4 30.8 60])Transfer function:
5 Model Analysis Tools5-6Thesefunctionsalsoo perateonLTIarraysandreturnarrays.F or example,thepoles of a three dimensional LTI arraysysarray are obtai
State-Space Realizations5-7State-Space RealizationsThe following functions are useful t o analyze, perform state coordinatetransformations on, and der
Installation3InstallationInstructions for installing the Control System Toolbox can be found in theMATLAB Installation Guide for your platform. We rec
5 Model Analysis Tools5-8state-spacecomputations.Consequently,itiswisetousethemonly foranalysispurposes and not in control design algorithms.
Time and Frequency Response5-9Time and Frequency ResponseThe Control System Toolbox contains a set of commands that provide the basictime and frequenc
5 Model Analysis Tools5-10where sys is any continuous or discrete LTI model or LTI array. For MIMOmodels, these commands produce an array of plots wit
Time and Frequency Response5-11Note: When specifying a time vector t = [0:dt:tf],rememberthefollowing constraints on the spacingdt between time samp
5 Model Analysis Tools5-12In addition, the function margin determines the gain and phase margins for agiven SISO open-loop model. These functions can
Time and Frequency Response5-13For example,bode(sys,{0.1 , 100})draws the Bode plot between 0.1 and 100 radians/second. You can also specifya particul
5 Model Analysis Tools5-14several LTI models on a single plot. To do so, invoke the correspondingcommand line function using the listsys1,..., sysN of
Time and Frequency Response5-15The following example compares a continuous model with its zero-order-holddiscretization.sysc = tf(1000,[1 10 1000])sys
5 Model Analysis Tools5-16bode(sysc,'--',sysd,'-') % compare Bode responsesA comparison of the continuous and discretized response
Time and Frequency Response5-17Customizing the Plot DisplayYou can plo t da ta g e nerated by several response a na ly sis functions app lied toone or
Preface4Getting StartedIf you are a new user, begin with Chapters 2 through 5 to learn:• How to specify and manipula te linear time-invariant models•
5 Model Analysis Tools5-18For example, the following sequence of commands displays the Bode plot, s tepresponse, p ole/zero map, and some additional d
Time and Frequency Response5-19Another example issubplot(221)bode(h)subplot(222)step(h)subplot(223)pzmap(h)subplot(224)plot(rand(1, 100)) % any data c
5 Model Analysis Tools5-20Model Order ReductionYou can derive reduced-order models with the following commands.Useminreal to delete uncontrollable or
6The LTI ViewerIntroduction ...6-2Getting Started U sing the LTI Viewer: An Example ..6-4The LTI Viewer Menus ...6-15The
6 The LTI Viewer6-2IntroductionThe LTI Viewer is a graphical user interface for viewing and manipulating theresponse plots of LTI models.You can displ
Introduction6-3• Zoom in on or out from the individual displayed plots• Toggle the grid on or off on a plot• Select which I/O channels the LTI Viewer
6 The LTI Viewer6-4Getting Started Using the LTI Viewer: An ExampleThis section contains a brief introduction to the LTI Viewer through anexample that
Getting Started Using the LTI Viewer: An Example6-5Transfer function: 2 s^3 + 1.2 s^2 + 15.1 s + 7.5----------------------------------------s^4 +
6 The LTI Viewer6-6Note: When you initia lize the LTI Viewer with lsim or initial,theseplottypes require some extra arguments. For more information o
Getting Started Using the LTI Viewer: An Example6-7Right-Click Menus: Setting Response CharacteristicsTo a ccess the individual response plot controls
Typographic Conventions5Typographic ConventionsTo Indicate This Guide Uses ExampleExample code Monospace type To assign the value 5 to A,enterA = 5Fun
6 The LTI Viewer6-81 Right -click anywherein theplotregionof thestepresponseplots.This opensthe following menu list in the plot region.Figure 6-1: Th
Getting Started Using the LTI Viewer: An Example6-9Your LTI Viewer should now look like this.Notice that there is one settling time or peak magnitude
6 The LTI Viewer6-10Note that you can:• Use either the right or the left mouse button when you select a marker on aplot.• Left-click anywhere on a par
Getting Started Using the LTI Viewer: An Example6-11Importing ModelsIf the closed-loop models Gcl1 and Gcl2 donotmeetyourspecifications,youmay want to
6 The LTI Viewer6-12Note: A given LT I Viewer c an only be used to analyze m odels with the samenumber of inputs and outputs. If you want to a nalyze
Getting Started Using the LTI Viewer: An Example6-13a Point your mouse to any corner of the rectangle of the region you want tozoom in on.b Left-Click
6 The LTI Viewer6-14After releasing the mouse on the zoom region, the LTI Viewer looks like this.Noticethatyou’veonlyzoomedonthe stepresponse plot;the
The LTI Viewer Menus6-15The LTI Viewer MenusThe LTI Viewer has three main menus:•File• Tools• HelpThe File menu provides features pertinent to bringin
6 The LTI Viewer6-16For directions for loading LTI models into the LTI Viewer workspace when youopen it, see “Initializing the LTI Viewer with Multipl
The LTI Viewer Menus6-17The first submenu, Overview, opens the help text describing how to use theLTI Viewer menus and right-click menus that control
How to Contact The MathWorks:508-647-7000 Phone508-647-7001 FaxThe MathWorks, Inc. Mail24 Prime Park WayNatick, MA 01760-1500http://www.mathworks.com
Preface6
6 The LTI Viewer6-18The Right-Click MenusYou can access most of the controls for the individual response plots displayedby the LTI Viewer through the
The Right-Click Menus6-19This isthe right-clickmenu forSISOmodels. These menu items control the LTIViewer plots for all models:•Plot Type—Youcan choos
6 The LTI Viewer6-20are in the LTI Viewer workspace, but their responses are not displayed onthe plot associated with the open menu.- You can select a
The Right-Click Menus6-21Note: To multiselect submenu items (such as in the Characteristics or theSystems menus), re-open the right-click menu for ea
6 The LTI Viewer6-22Your LTI Viewer looks like this.Figure 6-8: Nyquist Plots of the Four I/O Responses in ssF8Notice th at the I/O names for this mo
The Right-Click Menus6-23Right-click on any part of the plot region (anywhere on the grid of plots). Thisopens the following menu.Figure 6-9: The Rig
6 The LTI Viewer6-24You can use the Axes Grouping submenu to reconfigure the grouping of theseI/O response curves with the following submenu items.•In
The Right-Click Menus6-25• Outputs: The response curves from a g iven input to all of the outputs areplottedinthesameportionoftheplotregion.Thereareas
6 The LTI Viewer6-26• All: All of the I/O response curves are displayed (grouped) in a single plotregion.Figure 6-12: Axes Grouping: AllThe Select I/
The Right-Click Menus6-27When you select Select I/Os from the right-click menu, the following windowopens.ThisI/O Selector window allows you to custom
1 Quick StartLTI Models ...1-3MIMOSystems ...1-4ModelConversion ...1-5LTIArrays...1
6 The LTI Viewer6-28With the Axes Grouping set to None, the display looks like this.Note: To reset the Ax es Grouping to None, open the right-click
The Right-Click Menus6-29For a given LTI array in the LTI Viewer workspace, you can use this interfaceto display the plots of a subset of models in th
6 The LTI Viewer6-30To display the responses of only some of the models in the LTI array, you mustfirst complete the following two steps:1 Right-click
The Right-Click Menus6-31This opens the Model Selector for LTI Arrays window in the (default) Indexinto Dimensionssetup .Figure 6-14: LTI Array Model
6 The LTI Viewer6-32OnceyouhaveselectedthenameofanLTIarrayintheModel Selector forLTI Arrayswindow, you can select models in the LTI array whose respon
The Right-Click Menus6-33For example to display only the first row of models in the 2-by-3 LTI array m2d,either:• Select the first index in the first
6 The LTI Viewer6-34Figure 6-16: Step Response of the First Row of Models in m2dThere are a variety of ways you can index into the dimensions of an L
The Right-Click Menus6-35Indexing into the LTI Array Using Design Specification CriteriaYou can also use several plot-specific design criteria to sele
6 The LTI Viewer6-364 Position your mouse pointer in the textbox next to the design specificationcharacteristic.5 Type a MATLAB relational expression
The Right-Click Menus6-37Figure 6-19: Step Response of the Model with the Maximum Rise TimeYou can also use any logical expression in variables defin
1 Quick Start1-2Thischapter providesa quick overviewof somefeatures ofthe ControlSystemsToolbox.
6 The LTI Viewer6-38at the MATLAB command line, and$ > any(any(Q))in the Model Selector for LTI Arrays window. This displays o nly the plots ofthos
The LTI Viewer Tools Menu6-39The LTI Viewer Tools MenuThree preferences windows provide additional options for customizingthe LTIViewer display. You c
6 The LTI Viewer6-40load this model). With the Available LTI Viewer Configurations windowopen:1 Select the radio button for the two-plot configuration
The LTI Viewer Tools Menu6-41Figure 6-21: Response Preferences WindowYou can use the Response Preferences window to:• Specify the time duration for t
6 The LTI Viewer6-42value. You can use the Time vector (sec.) portionoftheTime Domain fieldshown below to do this.TheTime vector (sec.) field accepts
The LTI Viewer Tools Menu6-43The Frequency vector (rad/sec.) field also provides you with the option torecalculateanew frequencyvectorforeach frequenc
6 The LTI Viewer6-44rise time. For example, you can change the value for the settling time to 5% asshown below.Figure 6-22: Changing the Settling Tim
The LTI Viewer Tools Menu6-45After selecting Linestyle Preferences from the Tools menu, t he followingLinestyle Preferences window opens.Figure 6-23:
6 The LTI Viewer6-46You can designate that the chosen preference (color, marker, or linestyle)distinguish the plotted response curves by any (or all)
The LTI Viewer Tools Menu6-472 Select either:-Apply to keep the Linestyle Preferences window open when you applythese changes-OK to apply the changes
LTI Models1-3LTI ModelsYou can specify linear time-invariant (LTI) systems a s transfer function (TF)models, zero/pole/gain (ZPK) models, state-space
6 The LTI Viewer6-48Simulink LTI ViewerIf you have Simulink, you can use the Simulink LTI Viewer,aversionoftheLTI Viewer that performs linear a nalysi
Simulink LTI Viewer6-49Notice that the title of this Simulink model is vdp, and that it contains staticnonlinearities.A Sample Analysis TaskSuppose yo
6 The LTI Viewer6-50The basic procedure for carrying out this type of analysis is outlined below:1 Open the Simulink LTI Viewer.2 Specify your analysi
Simulink LTI Viewer6-51When you select Linear Analysis, t wo new windows open: an LTI Viewerwindow and a Simuli n k diagram calledModel_Inputs_and_Out
6 The LTI Viewer6-52The Simulink LTI Viewer differs from the regular LTI Viewer, in that: The Simulink LTI Viewer includes an additional menu for acqu
Simulink LTI Viewer6-53• The title bar shows the name of the Simulink model to which it is linked.• The menu bar contains an additional menu calledSim
6 The LTI Viewer6-54To set up the analysis model for the vdp Simulink model:1 Insert an Input Point block on the line labeled x2 going into the Produc
Simulink LTI Viewer6-55. Grab an Input Point block, drag it, and release it on the Simulink model here.
6 The LTI Viewer6-56Keep the following in mind when using the Input Point a nd Output Pointblocks to specify analysis models:• You must p lace at leas
Simulink LTI Viewer6-57Consider the following simple diagram.Based on the location of the Input Point and Output Point blocks, you mightthink that the
1 Quick Start1-4To create discrete-time models, append the sample time Ts to the previouscalling sequences.sys = tf(num,den,Ts)sys = zpk(z,p,k,Ts)sys
6 The LTI Viewer6-581 Select Set Operating Point in the Simulink menu. This opens theOperating Point window.Figure 6-24: The Operating Point Window f
Simulink LTI Viewer6-594 Select OK. A dialog box opens.a Selecting Yes closes the Operating Point window and linearizes themodel automatically. The ne
6 The LTI Viewer6-60For this e xample, we use the Zero initial states setting, shown in the figurebelow.Note the following:• The inputs listed on theO
Simulink LTI Viewer6-61• While the Operating Point window is in the Initial state in Simulinkdiagrammode, the linearization values used by the Simulin
6 The LTI Viewer6-62Importing a Linearized Analysis Model to the LTI ViewerTo linearize and load your firstanalysis model for the van der Pol example
Simulink LTI Viewer6-63You can viewthe linearizedmodels in the LTIViewerworkspaceor chang etheplot type using the right-click menus. See “The Right-Cl
6 The LTI Viewer6-64As is shown below, the linearized model for the new value of Mu appearsasthelast item in theSystems submenu, and the Bode plots fo
Simulink LTI Viewer6-65Notice the foll o wing about the models lis ted in the Systems list on theright-click menu:• The names reflect the title of the
6 The LTI Viewer6-66To export analysis models from the LTI Viewer workspace:1 Highlight the models you want to save in the Export List.(Youcanmultisel
7 Control Design ToolsRoot Locus Design ...7-3Pole Placement ...7-5State-FeedbackGainSelection...7-5StateEstim
LTI Models1-5where each SISO entry is characterized by its n umerator and denominator.Cell arrays provide an ide al means to specify the resulting arr
7 Control Design Tools7-2We use the term control system design to refer to the process of selectingfeed ba ck gains in a closed-loop control system. M
Root Locus Design7-3Root Locus DesignThe root locus method is used to describe the trajectories of the closed-looppoles of a feedback system as one pa
7 Control Design Tools7-4If you are interested in just the root locus plot, use the command rlocus.Thiscommand takes one argument: a SISO model of the
Pole Placement7-5Pole PlacementThe closed-loop pole locations have a direct impact on time responsecharacteristics such as rise time, settling time, a
7 Control Design Tools7-6The estimator poles are the eigenvalues of , which can be arbitrarilyassigned by proper selection of the estimator gain matri
Pole Placement7-7The function acker is limited to SISO systems and should only be used forsystems with a small number of states. The functionplace is
7 Control Design Tools7-8LQG DesignLinear-Quadratic-Gaussian (LQG) control is a modern state-space techniquefordesigning optimal dynamic regulators. I
LQG Design7-9Optimal State-Feedback GainIn LQG control, the regulation performance is measured by a quadraticperformance criterion of the formThe weig
7 Control Design Tools7-10LQG RegulatorTo form the LQG regulator, simply connect the Kalman filter and LQ-optimalgain as shown below:This regulator ha
LQG Design7-11discrete problems as well as the design of d iscrete LQG regulators forcontinuous plants.Seethecasestudyonpage9-31foranexampleofLQGdesig
1 Quick Start1-6MATLAB derives the zero/pole/gain representation of the transfer function hZero/pole/gain: 1-------(s+1)^2LTI ArraysYou can now crea
7 Control Design Tools7-12
8The Root Locus DesignGUIIntroduction ...8-2A Servomechanism Example ...8-4Controller Design Using the Root Locus Design GUI
8 The Root Locus Design GUI8-2IntroductionThe root locus method is used to descri be the trajectories in the complex planeof the closed-loop poles of
Introduction8-3- Editing the compensator pole and zero locations- Opening the LTI Viewer• Saving the compensator and models to the workspace or the di
8 The Root Locus Design GUI8-4A Servomechanism ExampleA simple version of an electrohydraulic servomechanism model consists of:• A push-pull amplifier
A Servomechanism Example8-5Aclosed-l oopmodelfortheelectrohydraul i cvalvepositioncontrolcan besetupas follows.Figure 8-1: Feedback Control for an El
8 The Root Locus Design GUI8-6Controller Design Using the Root Locus Design GUIIn t h is section, we use the servomechanism example to describe some o
Controller Design Using the Root Locus Design GUI8-7This brings up the following GUI.Importing Models into the Root Locus Design GUIThe Root Locus Des
8 The Root Locus Design GUI8-8There are four ways to import SISO LTI models into the R oot Locus DesignGUI:• Load a model from the MATLAB workspace.•
Controller Design Using the Root Locus Design GUI8-9Opening the Import LTI Design Model WindowTo import thelinearized electrohydraulicservomechanism m
LTI Properties1-7LTI PropertiesInadditiontothemodeldata,theTF,ZPK,FRD,andSSobjectscanstoreextrainformation, such as the system sample time, time delay
8 The Root Locus Design GUI8-10Choosing a Feedback StructureTheRootLocus designtoolcan beapplied toSISO LTIsystems whosefeedbackstructure is i n one o
Controller Design Using the Root Locus Design GUI8-11The Feedback Structure portionoftheImport LTI De sign Model windowshows the current selection for
8 The Root Locus Design GUI8-12To specify the design model components for this servomechanism example:1 Load the linearized servomechanism model Gserv
Controller Design Using the Root Locus Design GUI8-13The root locus of the design model is displayed in the plot region of the GUI.Your Root Locus Des
8 The Root Locus Design GUI8-14unstable if the gain set point is increased so as to place any of the closed-looppoles in the right-half of the complex
Controller Design Using the Root Locus Design GUI8-15The following two figures capture this procedure.The right-most pair of closed-loop poles seem to
8 The Root Locus Design GUI8-16The Zoom controls are shown below.Once it is selected, you can operate any of the first threeZoom buttons in oneof two
Controller Design Using the Root Locus Design GUI8-17The use of zooming to find the limits of stability on the root locus is depicted inthefollowingth
8 The Root Locus Design GUI8-18The critical gain value for stability is approximately 43.9.Note: You can also test how much the g ain ca n be incre a
Controller Design Using the Root Locus Design GUI8-19Storing and Retrieving Axes LimitsYou can store and change axes limits in two ways:• Using the Ax
1 Quick Start1-8Type:get(sys)a: -1 b: 1 c: 1 d: 0 e: [] StateName: {''} Ts: 0.5 InputDelay:
8 The Root Locus Design GUI8-20You can also set or revise axes limits and other axes preferences in the RootLocus Axes Preferenceswindow. To open this
Controller Design Using the Root Locus Design GUI8-21Change the gain to 20 by edi ting the text box next to Gain,andpressingtheEnter key. Notice that
8 The Root Locus Design GUI8-22Check the Step box, as shown below.Once you check theStep b ox, an LTI Viewer window opens. The plot type forthis LTI V
Controller Design Using the Root Locus Design GUI8-23To increase the gain to about 33 using your mouse:1 Hold your mouse button down as you click on a
8 The Root Locus Design GUI8-24The step response plot on the dynamically linked LTI Viewer automaticallyupdates when you release the mouse button.As y
Controller Design Using the Root Locus Design GUI8-25Let’s place approximate design region bo undaries on our root locus plot basedon our design speci
8 The Root Locus Design GUI8-26After you press OK, the Root Locus Design GUI calculates and displays thespecified boundaries.Not all four branches of
Controller Design Using the Root Locus Design GUI8-27Once you have the gain specified, you can add poles or zeros to thecompensator.Youcan addpolesand
8 The Root Locus Design GUI8-28The default mode for the toolbar is the drag mode. In this mode, you can:• Click on a specific location on the root loc
Controller Design Using the Root Locus Design GUI8-29Try placing a pair of complex poles just above the right-most real closed-looppole. The resulting
LTI Properties1-9MATLAB returnsans = 3.0000e–01
8 The Root Locus Design GUI8-30Try adding a pair of complex zeros just to the left of and a little bit below thecomplexclosed-looppolesclosesttotheima
Controller Design Using the Root Locus Design GUI8-31Editing Compensator Pole and Zero LocationsIn this section we use the Edit Compensator window to
8 The Root Locus Design GUI8-32You can use the Edit Compensator window to:• Edit the locations of compensator poles and zeros.• Add compensator poles
Controller Design Using the Root Locus Design GUI8-33With the gain set point at 9.7, your root locus looks as follows.Note: Whenever the numerator or
8 The Root Locus Design GUI8-34To check where the closed-loop roots are with respect to the boundary of thedesign region, let’s zoom in a bit.Wedon’t
Controller Design Using the Root Locus Design GUI8-35The step response looks good. However, to be certain that you’ve met yourdesign specifications, y
8 The Root Locus Design GUI8-36Saving the Compensator and ModelsNow that you have successfully designed your compensator, you may want tosave your des
Controller Design Using the Root Locus Design GUI8-37the compensator is now in the workspace, in the variable named comp.Then typecompto see that this
8 The Root Locus Design GUI8-38Additional Root Locus Design GUI FeaturesThis section describes several features of the Root Locus Design GUI notcovere
Additional Root Locus Design GUI Features8-39Designating the Model SourceThe source of your design model data is indicated in the Import From fieldsho
iContentsPrefaceInstallation ... 3Getting Started ... 4Typographic Con
1 Quick Start1-10Model CharacteristicsThe Control System Toolbox contains commands to query such modelcharacteristics as the I/O dimensions, poles, ze
8 The Root Locus Design GUI8-40Using the Help MenuClick on the Help menu and you find that it contains five menu items:•Main Help• Edit Compensator• C
Additional Root Locus Design GUI Features8-41Erasing Compensator Poles and ZerosYou ca n delete any co m p ens ator poles and zeros in o ne of two way
8 The Root Locus Design GUI8-42To view the current closed-loop poles:• Select List Closed-Loop Poles fromtheTools menu. Ifyous elect thismenu,a window
Additional Root Locus Design GUI Features8-43The following window opens.For each component of the design model, this window t ells you:• The component
8 The Root Locus Design GUI8-44Note: The name s you enter in this windo w are only u sed whe n you ge neratea Simulink diagram of the closed-lo op st
Additional Root Locus Design GUI Features8-45If you a nswered Yes, a Simulink diagram such as this appears.The Simulink diagram is linked tothe worksp
8 The Root Locus Design GUI8-46The Convert Model/Compensator window, shown below, opens.Once you select a discretization method, sampling time, and cr
Additional Root Locus Design GUI Features8-47Totestthese features,select Clear Model. Notice that your compensator is notaltered, and its poles and ze
8 The Root Locus Design GUI8-48References[1] Clark, R.N., Control System Dynamics, Cambridge University Press, 1996.[2] Dorf, R.C. and R.H. Bishop, Mo
9 Design Case StudiesYaw Damper for a 747 Jet Transport ...9-3Open-LoopAnalysis ...9-6RootLocusDesign...9-9WashoutF
Operations on LTI Models1-11Operations on LTI ModelsYou can perform simple matrix operations, such as addition, multiplication, orconcatenation on LTI
9 Design Case Studies9-2This chapter contains four detailed case studies of control system design a ndanalysis using the Control System Toolbox.Demons
Yaw Damper for a 747 Jet Transport9-3Yaw Damper for a 747 Jet TransportThis case study demonstrates the tools for classical control design by stepping
9 Design Case Studies9-4You can display the LTI model sys by typing sys.MATLABrespondswitha = beta yaw roll
Yaw Damper for a 747 Jet Transport9-5Compute the open-loop eigenvalues and plot them in the -plane.damp(sys)Eigenvalue Damping Freq.
9 Design Case Studies9-6Supposeyou wantto designa compensatorthatincreasesthe dampingof thesepoles, so tha t the resulting complex poles have a dampin
Yaw Damper for a 747 Jet Transport9-7concerned about the behavior during the first few seconds rather than the firstfew minutes. Nextlook at the respo
9 Design Case Studies9-8Typically, yaw dampers are designed using the yaw rate as sensed output andthe rudder as control input. Look at the correspond
Yaw Damper for a 747 Jet Transport9-9Root Locus DesignSince t he simplest compensator is a static gain, first try t o determineappropriate gain values
9 Design Case Studies9-10This is the root locus for negative feedback and shows that the system goesunstable almost immediately. If, instead, you use
Yaw Damper for a 747 Jet Transport9-11The '+' marks on the previous figure show a possible selection. Thecorresponding gain and closed-loop
1 Quick Start1-12extracts the subsystem mapping the first input to the third output. Note thatrow indices select the outputs while columnindices selec
9 Design Case Studies9-12Plot the closed-loop impulse response for a duration of 20 seconds.impulse(cl11,20)The response settles quickly and does not
Yaw Damper for a 747 Jet Transport9-13feedback with index vectors selecting this input/output pair). At the MATLABprompt, typecloop = feedback(sys,–k,
9 Design Case Studies9-14Plot the MIMO impulse response.impulse(cloop,20)Look at the plot from aileron (input 2)to bankangle (output 2).When you movet
Yaw Damper for a 747 Jet Transport9-15The washout filter places azero at the origin, which constrains the spiral modepole to remain near the origin. W
9 Design Case Studies9-16and draw another root locus for this open-loop model.rlocus(–oloop)sgridNow the maximum damping is about . You ca n select th
Yaw Damper for a 747 Jet Transport9-17The selected pole locations are marked by '+' on the root locus above. Theresulting gain value and clo
9 Design Case Studies9-18Look at the closed-loop response from rudder to yaw rate.cl11 = feedback(oloop,–k);impulse(cl11,20)The response settles nicel
Yaw Damper for a 747 Jet Transport9-19Then close t he loop around the first I/O pair of the MIMO model sys andsimulate the impulse response.cloop = fe
9 Design Case Studies9-20Hard-Disk Read/Write Head ControllerThis case study demonstrates the ability to perform classical digital controldesign by go
Hard-Disk Read/Write Head Controller9-21Using the values kg , Nm/(rad/sec), Nm/rad,and Nm/rad, form the transfer function description of this system.A
Continuous/Discrete Conversions1-13Continuous/Discrete ConversionsThe commands c2d, d2c,andd2d perform continuous to discrete, discrete tocontinuous,
9 Design Case Studies9-22You can compare the Bode plots of the continuous and discretized models withbode(H,'-',Hd,'--')
Hard-Disk Read/Write Head Controller9-23To analyze the discrete system, plot its step response, typestep(Hd)The system oscillates quite a bit. This is
9 Design Case Studies9-24Thesimplestcompensatoris just again,so try therootlocus technique to selectan appropriate feedback gain.rlocus(Hd)As shown in
Hard-Disk Read/Write Head Controller9-25The corresponding open-loop modelis obtained by the series connectionD = zpk(0.85,0,1,Ts)oloop = Hd * DNow see
9 Design Case Studies9-26The p lant response is the dashed line and the open-loop response with thecompensator is the solid line.The plot above shows
Hard-Disk Read/Write Head Controller9-27Now try the root locus again with the plant and compensator as open loop.rlocus(oloop)zgridThis time, the pole
9 Design Case Studies9-28Typeddamp(poles,Ts)to see the equivalent damping and natural frequency for each of theeigenvalues.To analyze this design, for
Hard-Disk Read/Write Head Controller9-29Now look at the robustness of your design. The m ost common classicalrobustness criteriaare the gain andphase
9 Design Case Studies9-30The command produces t he plot shown below.This design is robust and can tolerate a 11 dB gain increase or a 40 degreephase l
LQG Regulation9-31LQG RegulationThis case study demonstrates the use of the LQG design tools in a processcontrolapplication.Theg oal istoregulatethe h
1 Quick Start1-14Time and Frequency ResponseThefollowingcommandsproducevarioustimeandfrequencyresponseplotsforLTI models (see “Time and Frequency Resp
9 Design Case Studies9-32This shape is impressed by two pairs of rolling cylinders (one per axis)positioned by hydraulic actuators. The gap between th
LQG Regulation9-33This leads to the following generic model for each axis of the rolling process.Figure 9-1: Open-loop model for x- or y-axisThe meas
9 Design Case Studies9-34The model data for each axis is summarized below.Model Data for the x-AxisModel Data for the y-AxisLQG Design for the x-AxisA
LQG Regulation9-35Start with the -axis. First specify the model components as transfer functionobjects .% Hydraulic actuator (with input "u-x&quo
9 Design Case Studies9-36The variable Px now contains an open-loop state-space model complete withinput and output names.Px.inputnameans = 'u
LQG Regulation9-37high-frequency content of with the low-pass filter and use thefiltered value in the LQ performance criterion.lpf = tf(30,[1 30])% Co
9 Design Case Studies9-38Let’s look at the regulator Bode response between 0.1 and 1000 rad/sec.bode(Regx,{0.1 1000})The phase response has an interes
LQG Regulation9-39Next, compare the open- and closed-loop responses from disturbance tothickness gap. Usefeedback to close the loop. To help specify t
9 Design Case Studies9-40You are now ready to compare the open- and closed-loop Bode responses fromdisturbance to thickness gap.bode(Px(1,2:3),'-
LQG Regulation9-41simulation, and derive equivalent discrete white noise inputs for this samplingrate.dt = 0.01t = 0:dt:50 % time samples% Generate u
Time and Frequency Response1-15produces the Bode plot shown below.To superimpose and compare the responses of several LTI systems, use thesyntaxbode(s
9 Design Case Studies9-42LQG Design for the y-AxisTheLQG design for the -axis (regulation of the thickness)followsthe exactsamestepsasforthe -axis.% S
LQG Regulation9-43Compare the open- and closed-loop response to the white noise inputdisturban ces.dt = 0.01t = 0:dt:50wy = sqrt(1/dt) * randn(2,lengt
9 Design Case Studies9-44process exhibits some degree of cross-coupling between axes. Physically, anincrease in hydraulic force along the -axis compre
LQG Regulation9-45Accordingly, the thickness gaps and rolling forces are related to the outputsof the - and -axis models byLet’s see how the previous
9 Design Case Studies9-46You are now ready to simulate the open- and closed-loop responses to thedriving white noiseswx (for the -axis) and wy (for th
LQG Regulation9-47MIMO LQG DesignStart with the complete two-axis state-space model Pc derived above. Themodel inputs and outputs arePc.inputnameans =
9 Design Case Studies9-48The resulting LQG regulator RegMIMO has two inputs and two outputs.RegMIMO.inputnameans = 'x-force' 'y-
LQG Regulation9-49Next, plot the open- and closed-loo p time responses to the white noise inputs(using the MIMO LQG regulator for feedback).% Form the
9 Design Case Studies9-50Kalman FilteringThis final case study illustrates the use of the Control System Toolbox forKalman filter design and simulatio
Kalman Filtering9-51In these equations:• is the estimate of given past measuremen ts up to• is the updated estimate based on the last measurementGiven
1 Quick Start1-16These commands automatically determine an appropriate simulation horizonor frequency range ba sed on t he system dynamics. To o verri
9 Design Case Studies9-52This is done by% Note: set sample time to –1 to mark model as discretePlant = ss(A,[B B],C,0,–1,'inputname',{'
Kalman Filtering9-53Becauseyouareinterestedinthe outputestimate ,keeponlythefirstoutputofkalmf.Typekalmf = kalmf(1,:);kalmfa = x
9 Design Case Studies9-54The blockdiagram below shows how to generateboth true and filtered outputs.You can construct a state-space model of this bloc
Kalman Filtering9-55Finally, close the sensor loop by connecting the plant output to the filterinput with positive feedback.% Close loop around input
9 Design Case Studies9-56and compare the true and filtered responses graphically.subplot(211), plot(t,y,'--',t,ye,'-'), xlabel(&ap
Kalman Filtering9-57The error covariance before filtering (measurement error) isMeasErrCov MeasErrCov = 1.1138while the error covariance after filt
9 Design Case Studies9-58with and as defined on page 9-50, and in the following.For simplicity, we have dropped the subscripts indicating the time dep
Kalman Filtering9-59you can implement the time-varying filter with the following for loop.P = B*Q*B'; % Initial error covariancex = zeros
9 Design Case Studies9-60You can now compare the true and estimated output graphically.subplot(211), plot(t,y,'--',t,ye,'-') subpl
Kalman Filtering9-61The time-varying filter also estimates the covariance errcov of the estimatio nerror at each sample. Plot it to see if your filter
The LTI Viewer1-17The LTI ViewerYou can also analyze time and frequency domain responses using the LTIViewer; see “The LTI Viewer” on page 6-1 for mor
9 Design Case Studies9-62Compare with the estimation error covariance derived from the experimentaldata. TypeEstErr = y–ye;EstErrCov = sum(EstErr.*Est
Kalman Filtering9-63References[1] Grimble, M.J., Robust Industrial Control: Optimal Design Approach forPolynomial Systems, Prentice Hall, 1994, p. 261
9 Design Case Studies9-64
10 Reliable ComputationsConditioning and Numerical Stability ...10-4Conditioning ...10-4Numerical Stability . . . . . . . . . .
10 Reliable Computations10-2When working with low-order SISO models (less than five states), computersare usually quite forgiving and insensitive to n
10-3At the same time, it is important to appreciate the limitations of computeranalyses. By following a few guidelines, you can avoid certain tools an
10 Reliable Computations10-4Conditioning and Numerical StabilityTwo of the key concepts in numerical anal ysis are the conditioning of problemsand the
Conditioning and Numerical Stability10-5Notice how much the smal l change in the data is magnified in the solution.One way t o measure the magnificati
10 Reliable Computations10-6row of A. This perturbed matrix has n distinct eigenvalues with. Thus, you can see that this small perturbation in thedata
Conditioning and Numerical Stability10-7Using row 1 as the pivot row (i.e., subtracting 1000 times row 1 from row 2) youarrive at the equivalent trian
1 Quick Start1-18For more detail on the use of the LTI Viewer and how it can be integrated intoa Simulink diagram, see Chapter 6, “The LTI Viewer.”
10 Reliable Computations10-8Choice of LTI ModelNow turn to the implications of the results in the last se ction on the linearmodelingtechniques usedfo
Choice of LTI Model10-9A major difficulty is the extreme sensitivity of the roots of a polynomial to itscoefficients. This example is adapted from Wil
10 Reliable Computations10-10verylittle. Thisis true in general.Different roots have different sensitivitiestodifferent perturbations. Computed roots
Choice of LTI Model10-11and the conversionfrom zero-pole-gainto state s pace incurs no loss of accuracyin the poles.format long e[sort(eig(a1)) sort(e
10 Reliable Computations10-12Its eigenvectors and eigenvalues are given as follows.[v,d] = eig(A)v = 0.7071 –0.0000 –0.3162 0.6325 –0.7071
Choice of LTI Model10-13Note also that the eigenvectors have changed.[vc,dc] = eig(Ac)vc = –0.5017 0.2353 0.0510 0.0109 –0.8026 0.7531
10 Reliable Computations10-14• The pole locations are very sensitive to the coefficients of the denominatorpolynomial.• The balanced companion form pr
Scaling10-15ScalingStatespace isthepreferredmodelfor LTIsystems,especiallywithhigher ordermodels. Even with state-space models, however, accurate resu
10 Reliable Computations10-16excellent discussion of scaling is given in the introduction to the LINPACKUsers’ Guide, [1].Choose scaling based upon ph
Summary10-17SummaryThis chapter has described numerous things that can go wrong whenperforming numerical computations. You won’t encounter most of the
System Interconnections1-19System InterconnectionsYou ca n derive LTI models for various system interconnections ranging fromsimple series connections
10 Reliable Computations10-18References[1] Dongarra, J.J., J.R. Bunch, C.B. Moler, and G.W. Stewart, LINPACK UsersGuide, SIAM Publications, Philadelph
11 Reference
11 Reference11-2This chapter contains detailed descriptions of all Control System Toolboxfunctions. It begins with a list of functions grouped by subj
Category Tables11-3Category TablesTable 11-1: LTI ModelsFunction Name DescriptiondrssGenerate random discrete state-space model.dssCreate descriptor
11 Reference11-4Table 11-2: Model CharacteristicsFunction Name DescriptionclassDisplay model type ('tf', 'zpk', 'ss', o
Category Tables11-5residueProvide partial fraction expansion (see UsingMATLAB).ssConverttoastatespacemodel.tfConvert to a transfer function model.zpkC
11 Reference11-6ss2ssState coordinate transformation.ssbalDiagonal balancing of state-space realizations.Table 11-6: Model DynamicsFunction Name Desc
Category Tables11-7connectConnect the subsystems of a block-diagonal modelaccording to an interconnection scheme of yourchoice.convConvolve two polyno
11 Reference11-8ltiviewOpen the LTI Viewer for linear response analysis.stepCalculate step r esponse.Table 11-9: Frequency ResponseFunction Name Desc
Category Tables11-9sigmaCalc u late singular value plot.zgridSuperimpose z-plane grid on root locus or pole/zeromap.Table 11-10: Pole PlacementFuncti
ii ContentsSystem Interconnections ... 1-19Control Design Tools ... 1-20The Root Locus Design
1 Quick Start1-20Control Design ToolsThe Control System Toolbox supports three mainstream control designmethodologies: gain selection from root locus,
11 Reference11-10kalmdCalculate the discrete Kalman estimator forcontinuous models.lqgregForm LQG regulator given LQ gain and Kalmanfilter.Table 11-12
acker11-1111ackerPurpose Pole placement design for single-input systemsSyntax k = acker(A,b,p)Description Given the single-input systemand a vectorp o
append11-1211appendPurpose Group LTI models by appending their inputs and outputsSyntax sys = append(sys1,sys2,...,sysN)Description append appends the
append11-13Arguments The input arguments sys1,..., sysN can be LTI models of any type. Regularmatrices are also accepted as a representation of static
append11-14c = x1 x2 y1 1.00000 0 y2 0 0 y3
augstate11-1511augstatePurpose Append the state vector to the output vectorSyntax asys = augstate(sys)Description Given a state-space model sys with e
balreal11-1611balrealPurpose Input/output balancing of state-space realizationsSyntax sysb = balreal(sys)[sysb,g,T,Ti] = balreal(sys)Description sysb
balreal11-17which indicates that the last two states of sysb are weaklycoupledto the inputand output. You can then delete these states bysysr = modred
balreal11-18Algorithm Consider the modelwith controllability and observability gramians and . The statecoordinate transformation produces the equivale
bode11-1911bodePurpose Compute the Bode frequency response o f LTI modelsSyntax bode(sys)bode(sys,w)bode(sys1,sys2,...,sysN)bode(sys1,sys2,...,sysN,w)
Control Design Tools1-21Figure 1-1: Simple Regulation LoopThe following commands design the optimal LQG regulator for thisproblem.sys = ss(tf(100,[1
bode11-20uses red dashed lines for the first system sys1 and green 'x' markers for thesecond systemsys2.When invoked w ith left-hand argumen
bode11-21by typingg = tf([1 0.1 7.5],[1 0.12 9 0 0]);bode(g)To plot the response on a wider frequency range, for example, from 0.1 to 100rad/sec, type
bode11-22You can also discretize this system using zero-order hold and the sample timesecond, and compare the continuous and discretized responses byt
bode11-23structure. The reduction to Hessenberg form provides a good compromisebetween efficiency and reliability. See [1] for more details on this te
c2d11-2411c2dPurpose Discretize continuous-time systemsSyntax sysd = c2d(sys,Ts)sysd = c2d(sys,Ts,method)Description sysd = c2d(sys,Ts) discretizes t
c2d11-25with input delay second. To discretize this system using thetriangle approximation with sample time second, typeH = tf([1 –1],[1 4 5],'in
c2d11-26The next command compares the continuous and discretized step responses.step(H,'-',Hd,'--')See Also d2c Discrete to contin
canon11-2711canonPurpose Compute canoni cal state-space re alizationsSyntax csys = canon(sys,'type')[csys,T] = canon(sys,'type')De
canon11-28For state-space models sys,[csys,T] = canon(a,b,c,d,'type')also returns the state coordinate transformation T relating the origina
care11-2911carePurpose Solve continuous-time algebraic Riccati equations (CARE)Syntax [X,L,G,rr] = care(A,B,Q)[X,L,G,rr] = care(A,B,Q,R,S,E)[X,L,G,rep
1 Quick Start1-22To validate the design,closethe loop with feedback andcomparetheo pen- andclosed-loop impulse responses withimpulse.% Close loopclsys
care11-30Alternatively, [X1,X2,L,report] = care(A,B,Q,...,'implicit') also turnsoff error messages but now returns in implicit form.Note tha
care11-31Finally, note that the variable l contains the closed-loop eigenvalues eig(a–b*g).ll = –3.5026 –1.4370Example 2To solve the -like Riccati
care11-32See Also dare Solve discrete-time Riccati equationslyap Solve continuous-time Lyapunov equationsReferences [1] Arno ld , W.F., III and A.J. L
chgunits11-3311chgunitsPurpose Convert the frequency units of an FRD modelSyntax sys = chgunits(sys,units) Description sys = chgunits(sys,units) conve
connect11-3411connectPurpose Derive state-space model from block diagram descriptionSyntax sysc = connect(sys,Q,inputs,outputs)Description Complex dyn
connect11-35externaloutputsare outputs2 and7 of sys,theninputs and outputs shouldbe set toinputs = [1 2 15]; outputs = [2 7]; The final model sysc has
connect11-36Given the matrices of the state-space model sys2A = [ –9.0201 17.7791 –1.6943 3.2138 ];B = [ –.5112 .5362–.002 –1.8470];C = [ –3.2897
connect11-37c = x1 x2 x3 x4 ? 2.5 0 0 0
connect11-38You can obtain a state-space model for the overall interconnection by typingsysc = connect(sys,Q,inputs,outputs)a =
connect11-39References [1] Edwards, J.W., “A Fortran Program for the Analysis of Linear Continuousand Sampled-Data Systems,” NASA Report TM X56038, Dr
The Root Locus Design GUI1-23The Root Locus Design GUIYou ca n also design a compensator using the Root Locus Design GraphicalUser Interface (GUI). Se
covar11-4011covarPurpose Output and state covariance of a system driven by white noiseSyntax [P,Q] = covar(sys,W)Description covar calculates the stat
covar11-41and MATLAB returnsp =30.3167You ca n compare t his output of covar to simulation results.randn('seed',0)w = sqrt(5)∗randn(1,1000);
covar11-42and is given byNote that is well defined for nonzero in the discrete case.Limitations The state and output covariances are d efined for stab
ctrb11-4311ctrbPurpose Form the controllability matrixSyntax Co = ctrb(A,B)Co = ctrb(sys)Description ctrb computes the controllability matrix for stat
ctrb11-44Limitations The calculation of Co may be ill-conditioned with respect to inversion. Anindication of this can be seen f rom this simple exampl
ctrbf11-4511ctrbfPurpose Compute the controllability staircase formSyntax [Abar,Bbar,Cbar,T,k] = ctrbf(A,B,C)[Abar,Bbar,Cbar,T,k] = ctrbf(A,B,C,tol)De
ctrbf11-46Example Compute the controllability staircase form forA = 1 1 4 –2B = 1 –1 1 –1C = 1 0 0 1and l
ctrbf11-47Algorithm ctrbf is an M-file that implements the Staircase Algorithm of [1].See Also ctrb Form the controllability matrixminreal Minimum rea
d2c11-4811d2cPurpose Convert discrete-time L TI models to continuous timeSyntax sysc = d2c(sysd)sysc = d2c(sysd,method)Description d2c converts LTI mo
d2c11-49As with zero-order hold, the inverse discretization operationc2d(Hc,0.1,'tustin')gives back the original .Algorithm The 'zoh&ap
1 Quick Start1-24
d2c11-50Convert Hc back to discrete time by typingc2d(Hc,Ts)yieldingZero/pole/gain: (z+0.5) (z+0.2)-------------------------(z+0.5)^2 (z^2 + z + 0
d2d11-5111d2dPurpose Resample discrete-time LTI models or add input delaysSyntax sys1 = d2d(sys,Ts)Description sys1 = d2d(sys,Ts) resamples the discre
damp11-5211dampPurpose Compute damping factors and natural frequenciesSyntax [Wn,Z] = damp(sys)[Wn,Z,P] = damp(sys)Description damp calculates the dam
damp11-53Typedamp(H)and MATLAB returnsEigenvalue Damping Freq. (rad/s) –1.00e
dare11-5411darePurpose Solve discrete-time algebraic Riccati equations (DARE)Syntax [X,L,G,rr] = dare(A,B,Q,R)[X,L,G,rr] = dare(A,B,Q,R,S,E)[X,L,G,rep
dare11-55and L = eig(A–B*G,E).Two additional syntaxes are provided to help develop applications such as-optimal control design.[X,L,G,report] = dare(A
dare11-56References [1] Arno ld, W.F., III and A.J. Laub, “Generalized Eigenproblem Algori thmsand Software for Algebraic Riccati Equations,” Proc. IE
dcgain11-5711dcgainPurpose Compute low frequency (DC) gain of LTI systemSyntax k = dcgain(sys)Description k = dcgain(sys) computes the DC gain k of th
delay2z11-5811delay2zPurpose Replace delays of discrete-time TF, SS, or ZPK models by poles at z=0, orreplace delays of FRD models by a phase shiftSyn
dlqr11-5911dlqrPurpose Design linear-quadratic (LQ) state-feedback regulator for discrete-time plantSyntax [K,S,e] = dlqr(a,b,Q,R)[K,S,e] = dlqr(a,b,Q
2 LTI ModelsIntroduction ...2-2Creating LTI Models ...2-8LTI Properties ...2-26Model Conversion ...
dlqr11-60lqr State-feedback LQ regulator for continuous plantlqrd Discrete LQ regulator for continuous plantlqry State-feedback LQ regulator with outp
dlyap11-6111dlyapPurpose Solve discrete-time Lyapunov equationsSyntax X = dlyap(A,Q)Description dlyap solves the discrete-time Lyapunov equationwhere
drmodel, drss11-6211drmodel, drssPurpose Generate stable random discrete test modelsSyntax sys = drss(n)sys = drss(n,p)sys = drss(n,p,m)sys = drss(n,p
drmodel, drss11-63Example Generate a ran dom discrete LTI system with three states, two inputs, and twooutputs.sys = drss(3,2,2) a =
dsort11-6411dsortPurpose Sort discrete-time poles by magnitudeSyntax s = dsort(p)[s,ndx] = dsort(p)Description dsort sorts the discrete-time poles con
dss11-6511dssPurpose Specify descriptor state-space modelsSyntax sys = dss(a,b,c,d,e)sys = dss(a,b,c,d,e,Ts)sys = dss(a,b,c,d,e,ltisys)sys = dss(a,b,c
dss11-66Example The commandsys = dss(1,2,3,4,5,'td',0.1,'inputname','voltage',...'notes','Just an example
dssdata11-6711dssdataPurpose Quick access to descriptor state-space dataSyntax [a,b,c,d,e] = dssdata(sys)[a,b,c,d,e,Ts] = dssdata(sys)Description [a,b
esort11-6811esortPurpose Sort continuous-time poles by real partSyntax s = esort(p)[s,ndx] = esort(p)Description esort sorts the continuous-time poles
esort11-69See Also dsort, sort Sort system poleseig Calculate eigenvalues and eigenvectorspole Compute system polespzmap Pole-zero mapzero Compute (tr
2 LTI Models2-2IntroductionThe Control System Too lbox offers ex tensiv e to ols to manip ulate and anal yzelinear time-invariant (LTI) models. It sup
estim11-7011estimPurpose Form state estimator given estimator gainSyntax est = estim(sys,L)est = estim(sys,L,sensors,known)Description est = estim(sys
estim11-71estim handles both continuous- and discrete-time cases. You can use thefunctionsplace (pole placement) or kalman (Kalman filtering) to desig
evalfr11-7211evalfrPurpose Evaluate frequency response at a single (complex) frequencySyntax frsp = evalfr(sys,f)Description frsp = evalfr(sys,f) eval
feedback11-7311feedbackPurpose Feedback connection of two LTI modelsSyntax sys = feedback(sys1,sys2)sys = feedback(sys1,sys2,sign)sys = feedback(sys1,
feedback11-74computes a closed-loop model sys for the more general feedback loop.The vectorfeedin contains indices into the input vector of sys1 and s
feedback11-75Examples Example 1To connect the plantwith the controllerusing negative feedback, typeG = tf([2 5 1],[1 2 3],'inputname','
feedback11-76Example 2Consider a state-space plant P with five inp uts and four outputs and astate-spacefeedbackcontrollerK with threeinputsandtwo out
filt11-7711filtPurpose Specify discrete transfer functions in DSP formatSyntax sys = filt(num,den)sys = filt(num,den,Ts)sys = filt(M)sys = filt(num,de
filt11-78MIMO transfer functions are regarded as arrays of SISO transfer functions(one per I/O channel), each of which is characterized by its numerat
frd11-7911frdPurpose Create a frequency response data (FRD) object or convert another model typeto an FRD modelSyntax sys = frd(response,frequency)sys
Introduction2-3Using LTI Models in the Control System ToolboxYou can manipulate TF, SS, and ZPK models using the arithmetic and modelinterconnection o
frd11-80sysfrd = frd(sys,frequency,'Units',units)convertsan FRD model fromaTF, SS, or ZPK model while specifying the units forfrequency to b
frd11-81tf Create transfer functionszpk Create zero-pole-gain models
frdata11-8211frdataPurpose Quick access to data for a frequency response data objectSyntax [response,freq] = frdata(sys)[response,freq,Ts] = frdata(sy
frdata11-83returns the FRD model dataresp = 0.2040 + 0.4565i 2.4359 - 4.3665ifreq = 10 100See Also frd Create or convert to FRD modelsget Get t
freqresp11-8411freqrespPurpose Compute frequency response over grid of frequenciesSyntax H = freqresp(sys,w)Description H = freqresp(sys,w) computes t
freqresp11-85at the frequencies . Typew = [1 10 100]H = freqresp(P,w)H(:,:,1) = 0 0.5000– 0.5000i –0.2000+ 0.6000i 1.0000
freqresp11-86Algorithm For transfer functions or zero-pole-gain models, freqresp evaluates thenumerator(s) and denominator(s) at the specified frequen
gensig11-8711gensigPurpose Generate test input signals for lsimSyntax [u,t] = gensig(type,tau)[u,t] = gensig(type,tau,Tf,Ts)Description [u,t] = gensig
gensig11-88Plot the resulting signal.plot(t,u)axis([0 30 –1 2])See Also lsim Simulate response to arbi trary inputs0 5 10 15 20 25 30−1−0.500.511.52
get11-8911getPurpose Access/query LTI property valuesSyntax Value = get(sys,'PropertyName')get(sys)Description Value = get(sys,'Propert
2 LTI Models2-4Creating an LTI Object: An ExampleAn LTI object of the type TF, ZPK, SS, or FRD is created whenever you i nvokethe corresponding constr
get11-90or query only about the numerator and sample time values byget(h,'num')ans = [1x2 double]andget(h,'ts')ans = 0.1000
gram11-9111gramPurpose Compute controllability and observability gramiansSyntax Wc = gram(sys,'c')Wo = gram(sys,'o')Description gr
gram11-92tocompute thegramians ofa continuousor discretesystem.The LTImodel sysmust b e in state-space form.Algorithm The controllability gramian is o
hasdelay11-9311hasdelayPurpose Test if an LTI model has time delaysSyntax hasdelay(sys)Description hasdelay(sys) returns 1 (true) if the LTI model sys
impulse11-9411impulsePurpose Compute the impulse response of LTI modelsSyntax impulse(sys)impulse(sys,t)impulse(sys1,sys2,...,sysN)impulse(sys1,sys2,.
impulse11-95As with bode or plot, you can specify a particular color, linestyle, and/ormarker for each system, for example,impulse(sys1,'y:'
impulse11-96use t he following commands.a = [–0.5572 –0.7814;0.7814 0];b = [1 –1;0 2];c = [1.9691 6.4493];sys = ss(a,b,c,0);impulse(sys)The l eft
impulse11-97Because t his system has two inputs, y is a 3-D array with dimensionssize(y)ans = 101 1 2(the first dimension is the length of t
initial11-9811initialPurpose Compute the initial condition response of state-space modelsSyntax initial(sys,x0)initial(sys,x0,t)initial(sys1,sys2,...,
initial11-99To plot the initial condition responses of several LTI models on a single figure,useinitial(sys1,sys2,...,sysN,x0) initial(sys1,sys2,...,s
Introduction2-5Precedence RulesOperations like addition and commands like feedback operate on more thanone LTI model at a time. If these LTI models ar
initial11-100to the initial conditiona = [–0.5572 –0.7814;0.7814 0];c = [1.9691 6.4493];x0 = [1 ; 0]sys = ss(a,[],c,[]);initial(sys,x0)See Also im
inv11-10111invPurpose Invert LTI systemsSyntax isys = inv(sys)Description inv inverts the input/output relationto produce the LTI system with the tran
inv11-102You can verify thatH * Hiis the identity transfer f uncti on (static gain I).Limitations Do not use inv to model feedback connections such as
inv11-103Use feedback or star to avoid such pitfalls.cloop = feedback(g,h)Zero/pole/gain: s-------------(s^2 + s + 1)
isct, isdt11-10411isct, isdtPurpose Determine whether an LTI model is continuous or discreteSyntax boo = isct(sys)boo = isdt(sys)Description boo = isc
isempty11-10511isemptyPurpose Test if an LTI model is emptySyntax boo = isempty(sys)Description isempty(sys) returns 1 (true) if the LTI model sys has
isproper11-10611isproperPurpose Test if an LTI model is properSyntax boo = isproper(sys)Description isproper(sys) returns 1 (true) if the LTI model sy
issiso11-10711issisoPurpose Test if an LTI model is single-input/single-output (SISO)Syntax boo = issiso(sys)Description issiso(sys) returns 1 (true)
kalman11-10811kalmanPurpose Design continuous- or discrete-time Kalman estimatorSyntax [kest,L,P] = kalman(sys,Qn,Rn,Nn)[kest,L,P,M,Z] = kalman(sys,Qn
kalman11-109the output and state estimates and . Note that estimates the true plantoutputDiscrete-Time EstimationGiven the discrete plantand the noise
iiiLTI Properties ... 2-26GenericProperties ... 2-26Model-SpecificProperties ...
2 LTI Models2-6For example, the parallel connection of t wo LTI systems sys1 and sys2 can beexpr es sed assys = sys1 + sys2because parallel connection
kalman11-110andgeneratesoptimal“current”outputandstateestimates andusing all available measurements including . The gain matrices andare derived by so
kalman11-111for more general plants sys where the known inputs and stochastic inputsare mixed together, and not all outputs are measured. The index ve
kalmd11-11211kalmdPurpose Design discrete Kalman estimator for continuous plantSyntax [kest,L,P,M,Z] = kalmd(sys,Qn,Rn,Ts)Description kalmd designs a
kalmd11-113lqgreg Assemble LQG regulatorlqrd Discrete LQ-optimal gain for continuous plant References [1] Franklin, G.F., J.D. Powell, andM.L. Workman
kalmd11-114
lft11-11511lftPurpose Redheffer star product (linear fractional transformation) of two LTI modelsSyntax sys = lft(sys1,sys2)sys = lft(sys1,sys2,nu,ny)
lft11-116The abbreviated syntaxsys = lft(sys1,sys2)produces:• The lower LFT ofsys1 and sys2 if sys2 has fewer inputs and outputs thansys1. This amount
lqgreg11-11711lqgregPurpose Form LQG regulator given state-feedback gain and Kalman estimatorSyntax rlqg = lqgreg(kest,k)rlqg = lqgreg(kest,k,'cu
lqgreg11-118In discrete time, you can form the LQG regulator using either the predictionof basedonmeasurementsupto , orthe currentstateestimate based
lqgreg11-119• Continuous regulator for continuous plant: use lqr or lqry and kalman.• Discrete regulator for discrete plant: usedlqr or lqry and kalma
Introduction2-7setSet LTI model properties.sizeGet output/input/array dimensions or model order.ssCreate a state-space model.ssdata, dssdataRetrieve s
lqgreg11-120Example See the examples “Control Design Tools” on page 1-20 and “LQG Regulation”on page 9-31.See Also kalman Kalman estimator designkalmd
lqr11-12111lqrPurpose Design linear-quadratic ( LQ) state-feedback regulator for continuous plantSyntax [K,S,e] = lqr(A,B,Q,R)[K,S,e] = lqr(A,B,Q,R,N)
lqr11-122See Also care Solve continuous Riccati equationsdlqr State-feedback LQ regulator for discrete plantlqgreg Form LQG regulatorlqrd Discrete LQ
lqrd11-12311lqrdPurpose Design discrete LQ regulator for continuous plantSyntax [Kd,S,e] = lqrd(A,B,Q,R,Ts)[Kd,S,e] = lqrd(A,B,Q,R,N,Ts)Description lq
lqrd11-124With the notationthe discretized plant has equationsand the weighting matrices for the e quivalent discrete cost function areThe integrals a
lqry11-12511lqryPurpose Linear-quadratic (LQ) state-feedback regulator with output weightingSyntax [K,S,e] = lqry(sys,Q,R)[K,S,e] = lqry(sys,Q,R,N)Des
lsim11-12611lsimPurpose Simulate LTI model response to arbitrary inputsSyntax lsim(sys,u,t)lsim(sys,u,t,x0)lsim(sys1,sys2,...,sysN,u,t)lsim(sys1,sys2,
lsim11-127simulatestheresponsesofseveralLTI modelstothesameinputhistoryt,u andplots these responses on a single figure. As withbode or plot, you can s
lsim11-128Then simulate with lsim.H = [tf([2 5 1],[1 2 3]) ; tf([1 –1],[1 1 5])];lsim(H,u,t)
lsim11-129Note that if you begin the simulation with a nonzero value for t(1), then thezero-initial condition response is shifted in time, as shown be
2 LTI Models2-8Creating LTI ModelsThe functions tf, zpk, ss,andfrd creat e transfer function models,zero-pole-gain models, state-space models, and fre
lsim11-130To illustrate why resampling is sometimes necessary, consider thesecond-order modelTosimulateits responsetoasquarewavewithperiod1 second,you
lsim11-131The response exhibits strong oscillations. Less obvious from this plot is the factthatlsim has resampled the input to reveal the oscillatory
lsim11-132The two responses look quit e different. T o clarify this discrepancy,superimposethetwoplotsbylsim(h,'b--',hd,'r-',u,t)T
ltiview11-13311ltiviewPurpose Initialize an LTI Viewer for LTI system response analysisSyntax ltiviewltiview(plottype,sys)ltiview(plottype,sys,extras)
ltiview11-134extras is one o r more input arguments as specified by the function named inplottype.Theseargumentsmayberequiredoroptional,dependingonthe
lyap11-13511lyapPurpose Solve continuous-time Lyapunov equationsSyntax X = lyap(A,Q)X = lyap(A,B,C)Description lyap solves the special and g eneral fo
lyap11-136 References [1] B artels, R.H. and G.W. Stewart, “Solution of the Matrix Equation AX + XB=C,”Comm . of the ACM, Vol. 15, No. 9, 1972.[2] Bry
margin11-13711marginPurpose Compute gain and phase margins and associated crossover frequenciesSyntax [Gm,Pm,Wcg,Wcp] = margin(sys)[Gm,Pm,Wcg,Wcp] = m
margin11-138Example You can compute the gain and phase margins of the open-loop discrete-timetransfer function. Typehd = tf([0.04798 0.0464],[1 –1.81
margin11-139You can also display these margins graphically.margin(hd)Algorithm The phase margin is computed using theory, and the gain margin bysolvin
Creating LTI Models2-9where num and den are row vectors listing the coefficients of the polynomialsand , respectively, when these polynomials are orde
minreal11-14011minrealPurpose Minimal realization or pole-zero cancellationSyntax sysr = minreal(sys)sysr = minreal(sys,tol)Description sysr = minreal
minreal11-141See Also balreal Gramian-based input/output bal ancingmodred M odel order reductionsminreal Structured model reduction
modred11-14211modredPurpose Model order reductionSyntax rsys = modred(sys,elim)rsys = modred(sys,elim,'mdc')rsys = modred(sys,elim,'del
modred11-143The last three diagonal entries of the balanced gramians are small, soeliminate the last three states withmodred using both matched DC gai
modred11-144The reduced-order model hdel is clearly a better frequency-domainapproximation of . Now compare the step responses.step(h,'-',hm
modred11-145Next, the derivative of is set to zero and the resulting equation is solved for. T he reduced-order model is given byThe discrete-time cas
ndims11-14611ndimsPurpose Provide the number of the dimensions of an LTI model or LTI arraySyntax n = ndims(sys)Description n = ndims(sys) i s the num
ngrid11-14711ngridPurpose Superimpose a Nichols chart on a Nichols plotSyntax ngridDescription ngrid superimposes Nichols chart grid lines over the Ni
ngrid11-148Typenichols(H)ngridSee Also nichols Nichols plotsOpen−Loop Phase (deg)Open−Loop Gain (dB)Nichols Charts−500 −450 −400 −350 −300 −250 −200 −
nichols11-14911nicholsPurpose Compute N ichols frequency response of LTI modelsSyntax nichols(sys)nichols(sys,w)nichols(sys1,sys2,...,sysN)nichols(sys
2 LTI Models2-10MIMO Transfer Function ModelsMIMO transfer functions are two-dimensional arrays of elementary SISOtransfer f un c tio n s. There are s
nichols11-150When i nvoked with left-hand arguments,[mag,phase,w] = nichols(sys)[mag,phase] = nichols(sys,w)return the magnitude and phase (in degrees
nichols11-151Algorithm See bode.See Also bode Bode plotevalfr Response at single complex frequencyfreqresp Frequency response computationltiview LTIsy
norm11-15211normPurpose Compute LTI model normsSyntax norm(sys)norm(sys,2)norm(sys,inf)norm(sys,inf,tol)[ninf,fpeak] = norm(sys)Description norm compu
norm11-153The discret e-time counterpart isUsage norm(sys) or norm(sys,2) both return the norm of the TF, SS, or ZPKmodelsys. This norm is infinite in
norm11-154Compute its infinity norm by typing[ninf,fpeak] = norm(H,inf)ninf = 2.5488 fpeak = 3.0844These values are confirmed by the Bode plot o
norm11-155MATLAB returnsans = 8.1268Algorithm norm uses the same algorithm as covar for the norm, and the al gorithm of[1] for the infinity norm.sy
nyquist11-15611nyquistPurpose Compute Nyquist frequency response of LTI modelsSyntax nyquist(sys)nyquist(sys,w)nyquist(sys1,sys2,...,sysN)nyquist(sys1
nyquist11-157When i nvoked with left-hand arguments[re,im,w] = nyquist(sys)[re,im] = nyquist(sys,w)return the re al and imaginary parts of the frequ e
nyquist11-158H = tf([2 5 1],[1 2 3])nyquist(H)See Also bode Bode plotevalfr Response at s ingle complex frequencyfreqresp Frequency response computati
obsv11-15911obsvPurpose Form the observability matrixSyntax Ob = obsv(A,B)Ob = obsv(sys)Description obsv computes the observability matrix for state-s
Creating LTI Models2-11For example, for the rational transfer matrix , the two cell arrays N and Dshould contain the row-vector representations of the
obsv11-160MATLAB responds withunob = 0See Also obsvf Compute the o bservability staircase form
obsvf11-16111obsvfPurpose Compute the observability staircase formSyntax [Abar,Bbar,Cbar,T,k] = obsvf(A,B,C)[Abar,Bbar,Cbar,T,k] = obsvf(A,B,C,tol)Des
obsvf11-162Example Form the observability staircase form ofA = 1 1 4 –2B = 1 –1 1 –1C = 1 0 0 1by typing[
ord211-16311ord2Purpose Generate continuous second-order systemsSyntax [A,B,C,D] = ord2(wn,z)[num,den] = ord2(wn,z)Description [A,B,C,D] = ord2(wn,z)
pade11-16411padePurpose Compute the Padé approximation of models with time delaysSyntax [num,den] = pade(T,N)pade(T,N)sysx = pade(sys,N)sysx = pade(sy
pade11-165sysx = pade(sys,NI,NO,Nio) specifies independent approximation orders foreach input,output, and I/O delay.These approximation ordersare give
pade11-166Example Compute a third-order Padé approximation of a 0.1 second I/O delay andcompare the time and frequency responses of the true delay and
pade11-167 References [1]Golub,G.H.andC.F.VanLoan,Matrix Computations, Johns HopkinsUniversity Press, Baltimore, 1989, pp. 557–558.
parallel11-16811parallelPurpose Parallel connection of two LTI modelsSyntax sys = parallel(sys1,sys2)sys = parallel(sys1,sys2,inp1,inp2,out1,out2)Desc
parallel11-169sys = parallel(sys1,sys2,inp1,inp2,out1,out2) forms the more generalparallel connection.The index vectorsinp1 and inp2 s pecify which in
2 LTI Models2-12whileE = tfcreates an empty transfer function.Zero-Pole-Gain ModelsThis section explains how to specify continuous-time SISO and MIMOz
place11-17011placePurpose Pole placement designSyntax K = place(A,B,p)[K,prec,message] = place(A,B,p)Description Given the single- or multi-input syst
place11-171Algorithm place uses the algorithm of [1] which, for multi-input systems, optimizes thechoice of eigenvectors for a robust solution. We rec
pole11-17211polePurpose Compute the poles of an LTI systemSyntax p = pole(sys)Description pole computes the poles p of the SISO or M IMO LTI model sys
pzmap11-17311pzmapPurpose Compute the pole-zero ma p of an LTI modelSyntax pzmap(sys)[p,z] = pzmap(sys)Description pzmap(sys) plots the pole-zero map
pzmap11-174Example Plot the poles and zeros of the continuous-time system.H = tf([2 5 1],[1 2 3])pzmap(H)Algorithm pzmap uses a combination of pole an
pzmap11-175sgrid, zgrid Plot lines of constant damping and natural frequencyzero Compute system (transmission) zeros
reg11-17611regPurpose Form regulator given state-feedback and estimator gainsSyntax rsys = reg(sys,K,L)rsys = reg(sys,K,L,sensors,known,controls)Descr
reg11-177This regulator should be connected to the plant using positive feedback.rsys = reg(sys,K,L,sensors,known,controls) handles more generalregula
reg11-178Example Given a continuous-time s tate-space modelsys = ss(A,B,C,D) with seven outputs and four inputs, suppose you have designed:• A state-f
reshape11-17911reshapePurpose Change the shape of an LTI arraySyntax sys = reshape(sys,s1,s2,...,sk)sys = reshape(sys,[s1 s2 ... sk])Description sys =
Creating LTI Models2-13producesZero/pole/gain: –2 s--------------------(s–2) (s^2 – 2s + 2)You can also specify zero-pole-gain models as rational exp
rlocfind11-18011rlocfindPurpose Select feedback gain from root locus plotSyntax [k,poles] = rlocfind(sys)[k,poles] = rlocfind(sys,p)Description rlocfi
rlocfind11-181where p i s the complex point you supply as an input argument to rlocfind (orwhereyoupoint towith themouse),andn and d arerespectivelyth
rlocus11-18211rlocusPurpose Evans root locusSyntax rlocus(sys)rlocus(sys,k)[r,k] = rlocus(sys)r = rlocus(sys,k)Description rlocus computes the Evans r
rlocus11-183the closed-loop poles are the roots ofrlocus adaptively selects a set of positive gains to produce a smooth plot.Alternatively,rlocus(sys,
rlocus11-184h = tf([2 5 1],[1 2 3]);rlocus(h)For examples, see “Root Locus Design” on page 9-9 and “Hard-Disk Read/WriteHead Controller” on page 9-20.
rltool11-18511rltoolPurpose Initialize the Root Locus Design GUISyntax rltoolrltool(sys)rltool(sys,comp)rltool(sys,comp,LocationFlag,FeedbackSign)Desc
rltool11-186The R oot Locus Design GUI looks like t his.Edit the gain set point to change the closed-loop pole locations. Compensator descrip-tion: Th
rltool11-187This tool can be applied to S ISO LTI systems whose feedback structure is inone of the following two configurations.In either configuratio
rltool11-188model (sys) in the forward loop of a negative unity feedback system, as shownin the diagram below.In this case,F and H are taken to be 1,
rmodel, rss11-18911rmodel, rssPurpose Generate stable random continuous test modelsSyntax sys = rss(n)sys = rss(n,p)sys = rss(n,p,m)sys = rss(n,p,m,s1
2 LTI Models2-14wher e•Z is the p -by-m cell array o f zero s (Z{i,j} = zeros of )•P is the p-by-m cell array o f p oles (P{i,j} = poles of )•K is the
rmodel, rss11-190Example Obtain a stable random continuous LTI model with three states, two inputs,and two outputs by typingsys = rss(3,2,2)a =
series11-19111seriesPurpose Series connection o f two LTI modelsSyntax sys = series(sys1,sys2)sys = series(sys1,sys2,outputs1,inputs2)Description seri
series11-192Theindexvectorsoutputs1 andinputs2 indicatewhich outputs of sys1 andwhich inputs ofsys2 should be connected. The resulting model sys hasas
set11-19311setPurpose Set or modify LTI model propertiesSyntax set(sys,'Property',Value)set(sys,'Property1',Value1,'Property2
set11-194Notethatset doesnotrequire anyoutputargument.Checktheresultwithget by typingget(sys)a: 1 b: 2 c: 3 d: 0 e: []
set11-195Table 11-15: LTI PropertiesProperty Name Admissible Property ValuesTs• 0 (zero) for continuous-time systems• Sample time in seconds for disc
set11-196OutputDelayOutput delays specified with• Nonnegative real numbers for continuous-time models (seconds)• Integers for discrete-time models (nu
set11-197Table 11-17: TF Model PropertiesProperty Name Admissible Property Valuesnum, den• Real-valued row vectors for the coefficients of the numera
set11-198Remark For discrete-time transfer functions, the convention used to represent thenumerator anddenominatordepends onthe choice ofvariable (see
set11-199Because t he resulting transfer functions are different, make sure to use theconvention consistent with your choice of variable.See Also get
Creating LTI Models2-15Use the command ss to create state-space modelssys = ss(A,B,C,D)For a model with Nx states, Ny out pu t s, and Nu inputs•A is a
sgrid11-20011sgridPurpose Generate an s-plane grid of constant damping factors and natural frequenciesSyntax sgridsgrid(z,wn)Description sgrid generat
sgrid11-201Limitations sgrid plots the grid over the current axis regardless of whether the axiscontains a root locus diagram or pole-zero map. Theref
sigma11-20211sigmaPurpose Singular values of the frequency response of LTI modelsSyntax sigma(sys)sigma(sys,w)sigma(sys,w,type)sigma(sys1,sys2,...,sys
sigma11-203w = {wmin,wmax}. To use part icular frequency points, set w to thecorresponding vector of frequencies. Uselogspace to generate logarithmica
sigma11-204Remark If sys is an FRD model, sigma(sys,w), w can o nly include frequencies insys.frequency.Example Plot the singular value responses ofan
sigma11-205You can do this by typingH = [0 tf([3 0],[1 1 10]) ; tf([1 1],[1 5]) tf(2,[1 6])]subplot(211)sigma(H)subplot(212)sigma(H,[],2)Algorithm sig
sigma11-206nichols Nichols plotnyquist Nyquist plot
size11-20711sizePurpose Provide the output/input/array dimensions of LTI models, the model order ofTF, SS, and ZPK models, and the number of frequenci
size11-208Example Consider the random LTI array of state-space modelssys = rss(5,3,2,3);Itsdimensionsareobtainedbytypingsize(sys)3x1 array of state-sp
sminreal11-20911sminrealPurpose Perform model reduction based on structureSyntax msys = sminreal(sys)Description msys = sminreal(sys) eliminates the s
iv Contents3Operations on LTI ModelsIntroduction ... 3-2Precedence and Prop erty Inheritance ...
2 LTI Models2-16to which MATLAB respondsa = x1 x2 x1 0 1.00000 x2 –5.00000
sminreal11-210all of the states of sys, including those of sys2 are retained. To eliminate theunobservable states fromsys2, while retaining the states
ss11-21111ssPurpose Specify state-space models or convert an LTI model to state spaceSyntax sys = ss(a,b,c,d)sys = ss(a,b,c,d,Ts)sys = ss(d)sys = ss(a
ss11-212with sample time Ts (in seconds). Set Ts = –1 or Ts = [] to lea ve t he sampletime unspecified.sys = ss(d) specif ies a stat ic g ain ma trix
ss11-213Examples Example 1The commandsys = ss(A,B,C,D,0.05,'statename',{'position' 'velocity'},...'inputname',
ss11-214The resulting state-space model order has order three, t he minimum numberof states needed to represent H(s).ThiscanbeseendirectlybyfactoringH
ss2ss11-21511ss2ssPurpose State coordinate transformation for state-space modelsSyntax sysT = ss2ss(sys,T)Description Given a state-space model sys wi
ssbal11-21611ssbalPurpose Balance state-space models using a diagonal similarity transformationSyntax [sysb,T] = ssbal(sys)[sysb,T] = ssbal(sys,condT)
ssbal11-217Balance this model with ssbal by typingssbal(sys)a = x1 x2 x3 x1 1
ssdata11-21811ssdataPurpose Quick access to state-space model dataSyntax [a,b,c,d] = ssdata(sys)[a,b,c,d,Ts] = ssdata(sys)Description [a,b,c,d] = ssda
stack11-21911stackPurpose Build an LTI array b y stacking LTI models or LTI arrays along arraydimensions of an LTI arraySyntax sys = stack(arraydim,sy
Creating LTI Models2-17it is often desirable to work with the descriptor form when the matrix ispoorly conditioned with respect to inversion.The funct
step11-22011stepPurpose Step response of LTI systemsSyntax step(sys)step(sys,t)step(sys1,sys2,...,sysN)step(sys1,sys2,...,sysN,t)step(sys1,'PlotS
step11-221All systems must have the same number of inputs and outputs b ut mayotherwise be a mix of continuous- and discrete-time systems. This syntax
step11-222a = [–0.5572 –0.7814;0.7814 0];b = [1 –1;0 2];c = [1.9691 6.4493];sys = ss(a,b,c,0);step(sys)The l eft plot shows the step response of t
step11-223Algorithm Continuous-time models are converted to state space and discretized usingzero-order hold on the inputs. The sampling period is cho
tf11-22411tfPurpose Specify transfer functions or convert LTI model to transfer function formSyntax sys = tf(num,den)sys = tf(num,den,Ts)sys = tf(M)sy
tf11-225If all SISO entries of a MIMO transfer function have the same denominator,you can setden to the row vector representation of this common denom
tf11-226• s = tf('s') to specify a TF model using a rational function in the Laplacevariable,s.•z = tf('z',Ts) to specify a TF mod
tf11-227To do this, typenum = {[1 1] ; 1}den = {[1 2 2] ; [1 0]}H = tf(num,den,'inputn','current',...'outputn',{'to
tf11-228with common denominator and sample time of 0.2 seconds.nums = {1 [1 0];[–1 2] 3}Ts = 0.2H = tf(nums,[1 0.3],Ts) % Note: row vector for common
tf11-229engineers use the variable a nd order the numerator and denominator termsin descending powers of , for example,The polynomials and are then sp
2 LTI Models2-18Here is the input frequency of each sinusoid, i = 1 ... n,andG(w)=. The steady state output response of this system satisfiesA frequen
tf11-230uses the DSP convention and createsSee alsofilt for direct specification of discrete transfer functions using theDSP convention.Note thattf st
tfdata11-23111tfdataPurpose Quick access to transfer function dataSyntax [num,den] = tfdata(sys)[num,den] = tfdata(sys,'v')[num,den,Ts] = tf
tfdata11-232you can extract the numerator and denominator coefficients by ty ping[num,den] = tfdata(h,'v')num = 0 1 1 den =
tfdata11-233tf Specify transfer functionszpkdata Quick access to zero-pole-gain data
totaldelay11-23411totaldelayPurpose Return the total combined I/O delays for an LTI modelSyntax td = totaldelay(sys)Description td = totaldelay(sys) r
zero11-23511zeroPurpose Transmission zeros of LTI modelsSyntax z = zero(sys)[z,gain] = zero(sys)Description zero computesthe zeros of SISO systems and
zgrid11-23611zgridPurpose Generate a z-plane grid of constant damping factors and nat ural frequenciesSyntax zgridzgrid(z,wn)Description zgrid generat
zgrid11-237To see t he z -plane grid o n the root locus plot, typerlocus(H)zgridaxis('square')Limitations zgrid plots the grid over the curr
zpk11-23811zpkPurpose Specify zero-pole-gain models or convert LTI model to zero-pole-gain formSyntax sys = zpk(z,p,k)sys = zpk(z,p,k,Ts)sys = zpk(M)s
zpk11-239• s = zpk('s') to specify a ZPK model from a rational transfer function of theLaplace variable,s.•z = zpk('z',Ts) to spec
Creating LTI Models2-19For example, the MAT-file LTIexamples.mat contains a frequency vector freq,and a corresponding complex frequency response data
zpk11-240Each pair specifies a particular LTI property of the model, for example, theinput names or the input delay time. Seeset entry and the example
zpk11-241Example Example 1Specify the following zero-pole-gain model.To do this, typez = {[] ; –0.5}p = {0.3 ; [0.1+i 0.1–i]}k = [1 ; 2]H = zpk(z,p,k,
zpk11-242Example 3Create a discrete- time ZPK model from a rational expression in the variable z,by typingz = zpk('z',0.1); H = (z+.1)*(z+.2
zpkdata11-24311zpkdataPurpose Quick access to zero-pole-gain dataSyntax [z,p,k] = zpkdata(sys)[z,p,k] = zpkdata(sys,'v')[z,p,k,Ts,Td] = zpkd
zpkdata11-244Example Given a zero-pole-gain model with two outputs and one inputH = zpk({[0];[–0.5]},{[0.3];[0.1+i 0.1–i]},[1;2],–1)Zero/pole/gain fro
zpkdata11-245See Also get Get properties of LTI modelsssdata Quick access to state-space datatfdata Quick access to transfer function datazpk Specify
zpkdata11-246
I-1IndexAacker 11-11addition of LTI models 3-11scalar 3-12adjoint.See pertranspositionalgebraic loop 11-76aliasing 5-13analysis modelsspecifying 6-56S
IndexI-2SS model, to 2-42state-space, to 2-44, 11-212TF model, to 2-42ZPK model, to 2-42covar 11-40covarianceerror 9-56, 9-62, 11-110noise 7-9, 11-110
IndexI-3control design 9-20equivalent continuous poles 11-52frequency 5-13, 11-23Kalman estimator 9-50, 11-108random 11-62resampling 3-27See also LTI
2 LTI Models2-20Discrete-Time ModelsCreating discrete-time models is very much like creating continuous-timemodels, exce p t that you must als o spe c
IndexI-4Nyquist 5-13, 11-23range 5-12frequency response 2-18, 5-11at single frequency (evalfr) 11-72Bode plot 11-19customized plots 5-17discrete-time
IndexI-5square wave 11-87input point block 6-56See also Simulink LTI ViewerInputDelay. See delaysInputGroup 2-26, 2-27conflicts, naming 3-4See also I/
IndexI-6extracting subsystems 4-21indexing into 4-20interconnection functions 4-25LTI Viewer, model selector 6-28, 6-31model d imensions 4-7operations
IndexI-7model-specific properties 2-28online help (ltiprops)2-26property names 2-26, 2-30, 11-89, 11-193property values 2-26, 2-31, 11-89, 11-193setti
IndexI-8multiplication 3-13scalar 3-13multiselection of items in a window 6-11Nnatural fr equency 11-52ndims 11-146ngrid 11-147Nicholschart 11-147plot
IndexI-9See also I/O, groupsOutputName 2-34conflicts, naming 3-4See also I/O, namesovershoot 5-9Ppade 11-164Padé approximation (pade) 2 -55, 11-164par
IndexI-10See also LTI Viewerresponse preferences, setting 6-40response, I/O 3-5Riccati equation 7-9continuous (care) 11-29discrete (dare) 11-54for LQG
IndexI-11analysis models 6-50clearing 6-53open and closed loop 6-56saving 6-65specifying 6-53, 6-56input point blocks 6-53linearizing models 6-53, 6-6
IndexI-12tfdataoutput, form of 2-24time delays.See delaystime response 5-9customized plots 5-17final time 5-10, 11-94impulse response (impulse) 11-94i
IndexI-13pole-zero map 11-173property 2-28transmission 11-235zoomingLTI Viewer 6-12Root Locus Design GUI 8-15zpk 2-12, 11-238ZPK objects.See zero-pole
Creating LTI Models2-21producesTransfer function:z – 0.2-------z + 0.3 Sampling time: unspecifiedNote: Do no t simply omit Ts in this case . This wou
2 LTI Models2-22Similarly,z = zpk('z', 0.1);H = [z/(z+0.1)/(z+0.2) ; (z^2+0.2*z+0.1)/(z^2+0.2*z+0.01)]produces the single-input, two-output
Creating LTI Models2-23produces the transfer functionwhich differs from by a factor .To avoid such convention clashes, the Control System Toolbox offe
2 LTI Models2-24Data RetrievalThe functions tf, zpk, ss,andfrd pack the model data and sample time in asingleLTI object.Conversely,thefollowingcommand
Creating LTI Models2-25displays the coefficients of the numerator and denominator of the first inputchannel.ans = 0 1 –1ans = 1 2
vResampling of Discrete-Time Models ... 3-27References ... 3-284Arrays of LTI ModelsIntroductio
2 LTI Models2-26LTI PropertiesThe previous s ection shows how to create LTI objects that encapsulate themodel data and sample time. You also have the
LTI Properties2-27ThesampletimepropertyTs keeps track of the sample time (in seconds) ofdiscrete-time systems. By convention,Ts is 0 (zero) for contin
2 LTI Models2-28Model-Specific PropertiesThe remaining LTI properties are specific to one of the four model types (TF,ZPK, SS, or FRD). For single LTI
LTI Properties2-29Most of these properties are dedicated to storing the model data. Note that thematrix is set to[] (the empty matrix) for standard st
2 LTI Models2-30Setting LTI PropertiesThere are three ways to specify LTI property values:• You can set properties when creating LTI models withtf, zp
LTI Properties2-31For example, you can specify the delay directly when you create the model, andthen use theset command to assign InputName, OutputNam
2 LTI Models2-32where the string PropertyName is ei ther the full pr o pe r ty name, or a nyabbreviatio n wi th enoug h charact ers to i denti fy the
LTI Properties2-33Direct Property ReferencingAn alternative way t o q uery /mo d ify pro p ert y values is by s tructure- lik ereferencing. Recall t h
2 LTI Models2-34prod ucesans = 'u'Any valid syntax for structures extends to LTI objects. For example, given theTF modelh = tf(1,[1,0],&
LTI Properties2-35This sets the Ts property to the v alue 0.5, as is confirmed byh.Tsans = 0.5000Forcontinuous-timemodels,thesampletimepropertyTs i
vi ContentsDimensionRequirements ... 4-27SpecialCasesforOperationsonLTIArrays ... 4-27Examples of Operations on L
2 LTI Models2-36Note thattf(0.1,[1 –1],0.1) + tf(1,[1 0.5],0.5)returns an error message.??? Error using ==> lti/plusIn SYS1+SYS2, both models must
LTI Properties2-37This producesTransfer function from input "thrust" to output "velocity": 1------p + 10Note how the display refl
2 LTI Models2-38To see how input and output groups (I/O groups) work:1 Create a random state-space model with one state, three inputs, and threeoutput
LTI Properties2-39To do this, typeh = rss(1,3,3);set(h, 'InputGroup',{[1 2] 'controls'})set(h, 'OutputGroup', {[1] &apos
2 LTI Models2-40Notice that the middle column of the I/O group listing indicates whether thegroupisaninputgroup(I)oranoutputgroup(O).In general, to sp
LTI Properties2-41You can use regular cell array syntax for accessing or modifying I/O groupcomponents. For example, to delete the first output group,
2 LTI Models2-42Model ConversionThere are four LTI model types you can use with the Control System Toolbox:TF,ZPK,SS,andFRD.Thissection shows how toco
Model Conversion2-43for continu ous-time models, andfor discret e-time models.Automatic Conversion Some algorithms operate only on one type of LTI mod
2 LTI Models2-44balancing automatically when you convert any TF or ZPK model to statespace u s in gss.• Conversions to the transfer function represent
Time Delays2-45Time DelaysUsing the ioDelayMatrix, InputDelay,andOutputDelay properties of LTIobjects,youcanspecifydelaysinbothcontinuous-anddiscrete-
viiDisplayingResponseCharacteristicsonaPlot ... 6-9ImportingModels... 6-11Zooming ...
2 LTI Models2-46• Interconnections of continuous-time delay systems as long a s the resultingtransfer function from input to output is of t he formwhe
Time Delays2-47This creates the LTI model with the following transfer function.Here is the entry ofNote: State-space models with I/O delays have only
2 LTI Models2-48Figure 2-3: Distillation ColumnSchematica lly, t he dis tillat io n p rocess functions as follo ws:• Stea m flow s into the reb oil e
Time Delays2-49The regulated output variabl es are:• Percentage of methanol in the distillate• Percentage of methanol in the bottom products.The goal
2 LTI Models2-50The resulti ng T F mod e l i s dis play ed asTransfer function from input "R" to output... 12.8 Xd: exp
Time Delays2-51Note that the 0.1 second delay is on the input in the first model, and on theoutput in the second model.InputDelay and OutputDelay Prop
2 LTI Models2-52The resulting model is displayed asTransfer function from input to output... 1 #1: exp(–0.1*s) * -
Time Delays2-53produces the discrete-time transfer functionTransfer function: 1z^(–3) * ----------------- z^2 + 0.5 z + 0.2 Sa
2 LTI Models2-54absorbs the input delay in H1 int o thetransfer functiondenom inatorto producethe third -ord e r tra nsf er functionTransfer function:
Time Delays2-55channel delays. The resulting model has a minimum number of delays. Whenthis minimization takes place:• All orpartof theI/O delaymatrix
Commentaires sur ces manuels