Home

User`s Manual for PZGui,v.8.0.xx - People

image

Contents

1. Kp prop gain Zero 1 Zero 2 Multiplier Ki integ gain Location Location 0 Kd deriv gain 40 50 how far to the left rad s of the two zeros T F Gain fero 1 fero 2 2nd pole mult rad s Whether you change a parameter by entering a new value in the appropriate edit window or by select ing that parameter in the menu and using the slider any open PZGui plots will preview the effect of that parameter value in the controller If you use the slider all previews will be updated in real time while you are moving the slider The preview lines are generally magenta but in the open loop Bode plots there is additional infor mation about the controller design In particular the open loop Bode magnitude plot shows the magni tude plot of the controller itself as a dashed cyan line Likewise the open loop Bode phase plot shows the phase plot of the controller itself as a dashed cyan line cva 4 Continuous Time Qpen Loop Magnitude A gt X 4 Continuous Time Open Loop Phase l File Model Tools Help File Model Tools Help Continuous Time Open Loop Bode Magnitude Continuous Time Open Loop Bode Phase _ jaa o pe ad pa Cc oO wo Phase degrees Frequency rad s E unwrap Frequency rad s E z Log Page 40 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins The red lines are the uncompensated system the only lines in the plot when preview mode
2. Continuous Time P Z Map GUL File Tools Help c MA Export model to a workspace variable Save model to a File Import model from a workspace variable Load model from a File L Generate a random tlexible structure like model Clear the model delete all zeros poles set gain 1 PZGui recognizes the Controls Toolbox standard objects ss t and zpk and also can import frequency response data from fra objects It will also try to extract models from struc ture variables when they contain field names that suggest standard objects such as a structure var iable that contains the fields Zz p and K or one that contains the fields num and den Page 5 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Here is an example of the user interface that appears when you select Import model from a work space variable when the Matlab workspace contains any variables that PZGui recognizes as sys tem models In this example there are several such variables Select a Variable to Load ct_frdmodel_ia out 2 in 3 class frd continuous time ct_frdmodel_ 5b out 1 in 1 class frd continuous time global ct_ssmodel ta order 12 fout 2 in 3 class ss continuous time ct_timodel_4c order 3 out 1 in 1 class tf continuous time global dt_ssmodel_2a_ order 49 out 4 in 2 class ss discr
3. When the model is saved in this way both the continuous time model and the discrete time model currently in PZGui are saved Later if the saved file is loaded there is an option to load either one or both of the saved models 2 Export to a Matlab workspace variable You can export the current PZGui model into a Matlab workspace variable using the menu selec tion highlighted below If you select this option from a continuous time figure the continuous Page 49 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins time model will be exported Likewise if you select this option from a discrete time figure the discrete time model will be exported You will be prompted to give a name to the variable a Discrete Time P Z Map G U le File Model Tools Help T E PLE Export model to a workspace variable pii 0 Save model to a File Import model from a workspace wariable j 7 Gain 8 65 Load model from a File 2 POLE Generate a random flexible structure like model 0 973302 0 Clear the model delete all zeros poles set gain 1 z4 De Mowe i This menu selection has a submenu as shown here for the continuous time case sa g F Continuous Time P Z Map G UL File Tools Help rc WA Export model to a workspace variable i as a Zero Pole Gain zpk variable Save model to a File as a State Space ss variable modal canenic form Import model from a workspace variable as a
4. T Lead and Lag Design PID Design t show RF computation Real S 40 _Undo Redo Se ec EEES fake This tool works similarly in the discrete time domain except that it does not produce a figure that shows the details of the z plane computation That figure is only generated for the s plane computa tion Page 43 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins 5 Zooming In and Out in the Plots All plots by default are completely zoom enabled If you click on the Zoom menu item File Mod Help Pure Gain Design Lead and Lag Design PID Design Don t show FRF computation All PZGUI plots are zoom enabled from the start To ZOOM IN click the left mouse button once or hold down the left mouse button to drag a zoom box To ZOOM OUT click the right mouse button once Double click either button to zoom all the way out Page 44 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins XII Adding Pure Delay to a Model The PZGui tool has the capability to model pure delay in systems For continuous time systems the amount of pure delay is specified in seconds For discrete time systems delay is specified in terms of the integer number of samples of delay The default value of delay is zero but this 1s easily changed by entering a different value into the edit window at the upper right corner of the main pole zero interface figure as shown below Notice that discrete time
5. The matrix has a 3x3 Jordan block for the eigenvalues at 5 e OOOO It gets yet more complicated if there are non real valued repeated poles and one could argue that the resulting A matrix is not actually in modal canonic form Whatever the classification the resulting form is still quite useful and extremely well conditioned again because the e1 genvalues can be determined exactly without the need for any computation When you elect to export the model to modal canonic form all these details are handled cor rectly even when there are repeated poles For more information about Matlab s ss object at the Matlab command line type gt gt doc ss c State space ss zeta form This option is only available in the export of continuous time models In this form the state space model A matrix is block diagonal with a 1x1 block for each real valued eigenvalue and a 2x2 block for each complex conjugate pair of eigenvalues Each 2x2 block corresponding to eigenvalues 0 lw has the form ug 2 un Page 51 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins O where wp o iw o iw is known as the natural frequency and is known as Wn the damping factor d Partial fraction expansion PFE form The best conditioned form of the transfer function is the partial fraction expansion form In this form the transfer function is expanded into a sum of terms that have constants in the nu merato
6. ce LL _ 1 m E m l o Real Part of FRF Full Qut Unit Circ Show Nyq Contour I equimargins Ej Hybrid Scale Page 48 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins XIII Saving Models and Exporting Models Transfer function models that are in PZGui can be saved in two ways 1 Save to a file 2 Export to a Matlab workspace variable 1 Save to a file a Discrete Time P Z Map G UL File Model Tools Help L E hy Pori Export model to a workspace variable l Save model to a File e Import model from a workspace variable j j Gain 8 65 Load model from a File 2 POLE Generate a random flexible structure like model 0 973302 0 Clear the model delete all zeros poles set gain 1 ye De Move f This is fairly self explanatory The menu selection highlighted immediately above brings up the standard Matlab save file user interface as seen in this example MA Specify Save File Path amp Name I s G a Documents My Documents MATLAB work l Organize New folder vr Favorites Documents library Ta Desktop work mi Downloads 5 Recent Places Arrange by Folder Name Date modified Size Type No items match your search ou Libraries Documents al Music E Pictures Videos JE Computer Local Disk C Filename mat Save as type MAT files mat Hide Folders S Cancel
7. Mark A Hopkins Continuous Time System Nichols Chart X File Model Tools Help Continuous Time System Nichols Chart Magnitude dB 250 200 150 100 50 Phase degrees E equimargins Because the Nichols grid is generally so important you can elect to highlight the Nichols grid at the current mouse cursor position That feature is enabled by the Nich grid hilite checkbox as shown in the next figure In the figure the mouse cursor was positioned at open loop 20 17 5 dB which corresponds to closed loop 2 7 1 0 dB The grid is highlighted by a cyan dashed line showing other points that map to 1 0 dB closed loop magnitude and a yellow dashed line showing other points that map to 20 closed loop phase These two dashed lines intersect at the mouse cursor posi tion As the mouse cursor is moved the dashed lines track its position and display is updated Continuous Time System Nichols Chart File Model Tools Help Continuous Time System Nichols Chart Magnitude dB 250 200 150 100 Phase degrees Nich grid Nich grid hilite O equimargins C Nyg Mapping Page 19 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Simultaneously if the closed loop Bode plots are open that same magnitude and phase are high lighted in the closed loop plots as shown here n Time Loeil NM itude al x l Continuous Time Closed Loop Phase ontinuous Time
8. a D D ah D oy oy a a Z D D oA i m m p pam iS iS i E Q QA 10 10 10 10 Frequency hertz unwrap Frequency hertz oe a Log Wrapped Unwrapped Page 13 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins VI Frequency Response Plots the Nyquist Contour and the Nyquist Plot In PZGui the Nyquist contour and the resulting Nyquist plot have been developed into quite sophisti cated tools The following features are the reason e The contour is automatically adjusted for poles and zeros that lie exactly on the stability bounda ry Specifically the contour is automatically detoured around such points into the unstable re gion in a circle with infinitesimal radius as specified by Nyquist gt Technically it isn t necessary to detour around zeros that are on the stability boundary but it turns out that the resulting Nyquist plot is much more illuminating if you do e In PZGui the Nyquist plot has a fairly unique nonlinear logarithmic scaling option that shrinks very large parts of the Nyquist plot and blows up very small parts so they can be reasonably viewed simultaneously e There is a Nyquist movie capability which shows how the Nyquist plot is generated or mapped as the transfer function is evaluated clockwise around the Nyquist contour Here is an example of these two plots d Continuous Time System Nyquist Plot File Model Tools Help Continuous Time Nyquist Plot ad
9. including the additional pole and zero of the controller A Continuous Time System Root Loa File Model Tools Help Continuous Time System Root Locus Center O L zeros O L poles C L poles asymptote Imaginary Part of S Plane 100 50 Real S rad s Parameter K Apply K lo Gain I Negative Loci Grid Page 37 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Again for that same phase lag controller here is the Nichols chart with its preview Notice the thin yellow lines that show the way individual frequency points are changed by this controller Continuous Time System Nichols Chart File Model Tools Help Continuous Time System Nichols Chart 0 5 T r T on mi 180 160 140 120 100 80 60 40 Phase degrees a Hyg Mapping Nich grid I Nich grid hilite equimargins If the clear preview pushbutton is clicked preview mode is turned off and the gain slider disap pears If the Apply pushbutton is clicked the values of pole zero and gain currently in the design tool will be worked into the open loop transfer function i e applied that is currently in the main pole zero interface and preview mode will be exited As usual you can undo the apply step using the Undo pushbutton in the main pole zero interface Page 38 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins 3 The PID Controller Design To
10. 100 150 200 250 300 350 Frequency hertz 10 Frequency hertz Page 12 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins c y axis units in the magnitude plots Here is an example of changing y axis magnitude from units of decibels dB to raw magnitude When a Bode magnitude plot is created the default units are decibels but it will be created in ac cordance with any pre existing Bode magnitude plot a Continuous Time Open Loop Magnitud x no Continuous Time Open Loop Magnitud File Model Tools Help File Model Tools Help Continuous Time Open Loop Bode Magnitude Continuous Time Open Loop Bode Magnitude 7 20 10 20 Magnitude dB 30 Magnitude NOT in dB 40 50 eh E A AA 10 101 Frequency hertz 10 10 mcs Frequency hertz F m H Log d phase unwrapping in the phase plots Here is an example of unwrapping the phase plot When a phase plot is created the default is wrapped but it will be created in accordance with any pre existing phase plot Essentially a phase plot that is wrapped is constrained to remain between 180 and 180 whereas an unwrapped plot is allowed to go beyond those limits as in this example z Continucus Time Open Loop Phase F Ez E i F Continuous Time Open Loop Phase af x File Model Tools Help File Model Tools Help Continuous Time Open Loop Bode Phase 200 7 200 p 100 Q OQ
11. Help C T Open Loop Unit Step Response 2r 5 5 1 0825 Max Time 2 4561 Perform ce 0 36146 Perf heas Perf Range High 15 o 24561 Time seconds natural Wi forced I Show Input Output i o gi Ter a g E O am al oe og i di B on m T Tr jam L ak akm gI In each time response plot there is a dropdown menu to select any one of five different input signals e unit impulse t e unit step Us t Unit Step Response sout e unit ramp tus t 142 n e unit parabola 5fu t or impuse e unit cosine cos at us t with adjustable frequency ramp 5 5 1 0825 parabola cosine Page 25 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins The maximum time of the time response plot can be specified by simply editing the number that ap pears in the Max Time window In this case the final time is 2 4561 seconds Whenever the mouse cursor is inside the plot area the values of input and output are highlighted The time axis location of the mouse is taken as the point of interest and crosshairs appear at the corre sponding time points on the plot In most of the plots the difference input minus output is also highlighted Here is an example Loop Unit Cosine Resp t 0 9575 The Tracking Error Sometimes in control design one of the design goals is to achieve a certain maximum level of track ing error which is computed by subtrac
12. Manual 2014 Mark A Hopkins 4 Continuous Time System Root Locus File Model Tools Help Continuous Time System Root Locus C O L zeros O L poles C L poles asymptote a w Aa to 5 m m u Fati i amm Parameter K 5 215 s 42 11 68 351 52 45 w 12 78 Hz 0 1917 4 5 215 200 150 100 50 Real S rad s Parameter K SS lt Apply K to Gain I Negative Loci Grid Whenever the mouse cursor has that small circular shape if you click the left mouse button the indi cated gain will be copied into the Parameter K window and the preview locations will be high lighted as yellow asterisks For example with the mouse in the same location as the previous figure a left click results in the following figure 4 Continuous Time System Root Locus a ES File Model Tools Help Continuous Time System Root Locus Center O L Zeros O L poles C L poles asymptote a a a a a a a o E M M as Imaginary Part of S Plane 300 250 200 150 100 50 Real S rad s Parameter K 5 215 lt Apply K to Gain H Negative Loci Grid Alternatively the gain 5 215 can be entered directly into the Parameter K window If the lt Apply K to Gain pushbutton is clicked that factor will immediately be multiplied into the transfer function gain that is currently in the main pole zero interface Page 23 of 55 pzg
13. PZGui is available free of cost via the author s home pages at RIT Download the zip file pzgui80xx zip from http people rit edu maheee pzgui Download_PZGUI_Matlab_ toolbox htm Version 8 0 xx has been tested on several Matlab versions from 2008a through 2014b It should be compatible with any version from 2008a on up To install on your machine Unzip the files into a new subdirectory e g My Documents Matlab pzgui From the Matlab command window menu select Set Path In the user interface window that comes up click Add Folder and select that subdirectory You might want to Save the new path before you close the set path interface To run the program in Matlab Once you have the PZGui subdirectory included in the path at the Matlab command prompt simply type gt gt pzgui Page 3 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins I Overview of PZGui This overview is written in the context of continuous time transfer functions but with only minor changes it also applies to the discrete time half of the PZGui tool dpzgui PZGui is used to study single input single output SISO linear systems A system to be studied must be entered into the tool in pole zero gain form Several different ways to do that are described in section II below In the main graphical user interface GUI figure the system model is always represented as a pole zero_ map and an associated transfer function gain Tha
14. WLA Hopking 199 Ver 3 0 01 pure Open Loop S plane P Z Map eee delay 400 300 oe 41 200 lt a A ES 343i selected pole Delete Mowe Add S plane locations or amame j selected eran Delete Mowe Add plane locations r 600 500 400 300 200 100 I or varname Real S rad s D T pzgui vin ian I D T Link by bilinear L En Unda Center E GEY Fi Olbode FR Clbode PB Nichols 3 Nyquist n A o a EEES BBY Discrete Time P Z Map G UL File Model Tools Help Ver 8 0 01 pure O1Juio14 delay io 8 656e 2 0 973730240152 Y Selected pole Delete Move Add 2 plane locations or varmname Open Loop Z plane P Z Map oso E oo oo ha ETIES 0 701369 selected A ZET Delete Move Add 7 2 plane locations 0 A or vamame Real 2 a ECE Gi Mi C T Link bylbinear BA M oraw Box center L E Wi Olbode e PB Nichols PR Nyquist QB Olresp A PF Rtloc EEES D L V o i Page 31 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins If the box 1s drawn in the discrete time domain instead here 1s what results Ey Discrete Time P Z Map GUL File Model Tools Help a MA Hopkins 1996 2014 Wer 6 0 01 Open Loop Z plane P Z Map O1Jui2014 656e 2 0 9733027 0 152 Y selected pole Delete Move Add plane lorations or vamame 0 7016369 selected aor Delete Move Add 2 plane locatio
15. Z plane pure delay must be an integer Of course delay must be non negative Ver 3 0001 Pure Jez D Loop S plane P Z Map E a lay j Ts 5e 3 Ver 6 001 PUTE l oop Z plane P Z Map 01Jul20 icy 2 D Gain 8 656e 2 2 POLES 0 973307H 1 selected pole Delete Move Ada 2 plane locations For discrete time models it is straightforward to model the effects of an integer number of samples of delay because each sample of delay corresponds to the addition of another pole at z 0 However for continuous time models it is not as simple Difficulties arise in two cases the closed loop time response plot simulation and the root locus plot In these two cases delay is handled by introducing the standard fourth order Pade approximation of delay The algorithm used by Matlab for Pade approximation of delay is from Golub and VanLoan Matrix Methods 3 ed pp 572 574 and for a fourth order approximation it is Page 45 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins s4 20 Pie A a Pa 840 4 1680 3 5 4 etos a 180 i a s4 s3 s2 s Ea O In effect this introduces four more poles and four more zeros into the transfer function This approximation is only used for the closed loop time response and the root locus plot While use of the Pade approximation in the closed loop time response plot is not obvious in the root locus plot it 1s guite obvious because four additiona
16. clicked those plots will show previews of how they would look with the specified Gain in series with the zpk transfer function currently entered into PZGui h P Doman Ma Gain Desig i Vary the Gain with this slider i E Gain 1 Gain can be changed by moving the slider or by entering a different gain in the edit window For open loop computations the only effect is the change in dc gain because pole and zero locations are unchanged However for closed loop computations the pure gain controller 1s assumed to be in the forward path in series with the plant as shown in the following block diagram Thus all closed loop pole locations will change as the gain is varied Page 33 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins pure gain controller transfer function model output I I I onl ee ee a a a a a For example here is the way two of the PZGui open loop frequency response plots look with Pre view on and Gain 2 Preview lines are shown in In the case of the Nichols chart nar row yellow lines show how the individual frequency points change for pure gain change they simply move vertically a i d Continuous Time System Nichols Chart Continuous Time ee oop Magnitude as LE x File Model Tools Help File Model Tools Help Continuous Time System Nichols Chart Continuous Time Open Loop Bode Magnitude 0 52 Magnitude dB Magnitude dB 40 101 150 100 50 i
17. either mouse button the nearest pole or zero will move with the mouse cursor i e it will be dragged until you release the mouse button While you are dragging the pole or zero all of the plots that you have open Bode Nichols Nyquist time response efc will be continuously updated with previews of what they will look like if you release the button dropping the pole or zero at that point These previews are extremely useful in understanding the relationship of pole zero location to frequency and time responses d Adding new poles similar for adding zeros Enter numerical locations for the new poles just below the Add button then click Add Notice that you don t have to enter both poles of a complex conjugate pair because any non real valued poles or zeros are always added in conjugate pairs Also notice that you can enter the name of a variable that is in the Matlab workspace rather than entering numeric values If that variable is a numeric vector then PZGui will add poles at all of the locations specified in the elements of the vector III An Important Option when Modifying a Model Fixing the DC Gain There is one major option that greatly affects what happens when a pole or zero is deleted modified or added You can elect to have the dc gain held constant fixed when poles and zeros are changed It is important to note that the de gain is usually not the same as the transfer functi
18. i Frequency hertz Phase degrees E Nyq Mapping aeg Nich grid fi Nich grid hilite File Model Tools Help File Model Tools Help Input C T Closed Loop Unit Step Response O S 57 73 peak H 05739 C T Open Loop Unit Step Response w hax Time Ferform ce 0 33496 Perf Meas Max Time Perform ce 0 36146 7 5 af 1 5 Mi 0 08734 yh pene 329 2 1 0825 Perf Meas U S 59 87 LAE wd tee We o 0 0 57198 Perf Range Perf Range 0 5 1 1 5 1 0 2 0 4 0 6 ee eee 45 i 0 70174 Time seconds po 2 4561 Time seconds Lo 0 70174 natural s i forced I Show Input Output Wi natural 6s forced I Show Input Output Step Input dashed amp Response solid Step Input dashed amp Response solid Page 34 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Whether you change the Gain by entering a new value in the edit window or by moving the slider any open PZGui plots will preview the effect of that variation If you use the slider all previews will be updated in real time while you are moving the slider If the clear preview pushbutton is clicked preview mode is turned off and the gain slider disap pears If the Apply pushbutton is clicked the value of gain currently in the design tool will be multiplied into the transfer function gain i e applied in the main pole zero interface and preview mode will be turn
19. of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins II Entering a Model into PZGui When you first start up PZGui the main graphical user interface GUI figure will appear Initially there is a default second order system defined but it can easily be deleted replaced or modified Any time a model is deleted replaced or modified the change can be undone using the Undo button There is also a Redo button to go back again 40 20 20 LU rae L 2u or vamame eal S rad s alls Grid W Fi oc LF iur awex EES undo Redo A E er Nyquist F OLresp E C Lresp a Rt Loc ry sensitivity 1 Deleting the current model Continuous Time P Z Map G UL File Tools Help fc MLA a Export model to a workspace variable Save model to a File ae 5e lt Gain 15 Import model from a workspace wartable Load model from a File E Ly Generate a random flexible structure like model 2 POLE otal Clear the model delete all zeros poles set gain 1 selected pole Deh Move A 2 Importing and loading models The current model can be replaced by either one of the two selections highlighted below Models can be imported from objects in the Matlab workspace or loaded from mat files If the specified object is multi input multi output MIMO you will be prompted to select one of the inputs and one of the outputs so that PZGui can extract a SISO submodel from the specified MIMO object
20. plot is also annotated to es graphically show these steady state values There is an Max Time option to show only the part of the plot around steady EN state specified maximum time is disregarded 6 E stdy state gt Page 28 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins X Linking the Continuous Time and Discrete Time Domains In the study of control it is often useful to view the discrete time equivalent of a continuous time system For instance a controller might be designed in continuous time but implemented in discrete time e g implemented by a microcontroller P2ZGui has the capability to transform and link a continuous time model into its equivalent discrete time model In PZGui there is a choice of three mathematical methods by which the transformation may be done e By simple mapping of the poles and zeros according to the relation z e s e By zero order hold equivalence e By the bilinear transformation In any of these cases the transformation is based on the sample period T that is specified in the main interface as shown here Ver 6 0 01 pure 01Jut2014 delay 0 Pos s3 i Gain 15 The default is by zero order hold equivalence but this can be changed using the dropdown menu as shown here OLbode z e 8T chols ZOH equiv bilinear The link between continuous time and discrete time domains can be established in either direction de pending upon in which main interfa
21. the main interface figure and in the root locus plot By default the pole zero maps have background grids that show the lines of constant damping factor and lines of constant natural frequency At times these lines might distract from the purpose of the figure so it 1s useful to be able to turn off their visibility That is done by de selecting the check box labeled Grid Delete Move Add S plane locations 20 20 Ur mnane 20 J rad s Grid E Dc rad s Grid B poc i GE WE Erase E Undo Redo m M elp ist E OLresp i C Lresp Rt Loc rm Sensitivity ist i e m Lresp Fl Rt Loc Sensitivity F There is a similar checkbox in the lower right corner of the root locus plot 4 Centering the pole zero maps There are pole zero maps in the main interface figure and in the root locus plot Sometimes in the process of zooming in and out the scaling of the plot becomes less than useful At such times the pushbutton labeled Center will rescale the plot to a more useful region of the pole zero map In the main interface figure the Center pushbutton appears just below the Grid checkbox as can be seen in the figure directly above By contrast in the root locus plot the Center pushbut ton appears at the upper right corner of the figure Page 10 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins V Frequency Response Plots Bode Plots and Output Sensitivity On the
22. well conditioned form because all pole locations and all zero locations are specified exactly For more information about Matlab s zpk object at the Matlab command line type gt gt doc zpk Page 50 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins b State space ss modal canonic form The modal canonic form of a state space model has the mathematically best conditioned A matrix of all real valued similarity transformations That s because the eigenvalues can be de termined exactly with no computation required Here is an example of modal canonic form Suppose a model has the following poles 3 31i 3 31i 20 A modal canonic A matrix for a model of this is any one of the ae TERELTE ee More caine the modal canonic A matrix is a iai with a 1x1 block for each real valued eigenvalue and a 2x2 block for each complex conjugate pair of eigenvalues In each 2x2 block the two diagonal elements are the real parts and the two off diagonal elements are the imaginary parts of the eigenvalues Thus the eigenvalues can be determined by inspec tion without any computation When there are pole repetitions the modal canonic form is not as pure For example here is a modal canonic A matrix when a triply repeated pole at 5 is appended to the previous exam ple assuming complete observability and controllability 3 Sol 40 0 0 31 3 0 0 0 0 0 20 0 0 0 0 0 5 1 0 0 0 0 5 0 0 0 0 0 5
23. y axis units in the magnitude plots d phase unwrapping in the phase plots Page 11 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Whenever any of one these checkboxes is changed the same change is applied to all of the other simi lar plots both in the continuous time and discrete time domains The next two pages show how these checkboxes affect the Bode plot format a x axis units either hertz or radians second Here is an example of changing frequency units from hertz to radians second When a Bode plot is created the default is hertz but it will be created in accordance with any pre existing Bode plot File Model Tools Help File Model Tools Help Continuous Time Open Loop Bode Magnitude Continuous Time Open Loop Bode Magnitude Magnitude dB Magnitude dB 10 Frequenc b x axis scaling either log scaled or linear scaled Here is an example of changing x axis scaling from log to linear This example is from a discrete time plot which is necessarily periodic at the sample frequency in this case 200 Hz When a Bode plot is created the default is log scaling but it will be created in accordance with any pre existing Bode plot Discrete Time Open Loop Magnitude Lo sc Eh File Model Tools Help File Model Tools Help Discrete Time Open Loop Magnitude Discrete Time Open Loop Bode Magnitude Discrete Time Open Loop Bode Magnitude Magnitude dB Magnitude dB 0
24. 014 Mark A Hopkins Continuous Time Open Loop Time Response R File Model Tools Help C T Open Loop Unit Parabola 12 t Response Input ar 4 F parabola 0 035 t 0 761 Max Time _ aD p d 5 S mik d a a i E D m m ou 0 1 0 15 Time seconds ee Eoee IB Show Input Output k Some Input Specific Features a Unit Impulse Input Tracking error is not shown because it is simply the negative of the output for all t gt 0 b Unit Step Input If the specified maximum time is at least approximately 20 longer than the settling time then the step response plot will automatically be annotated with rise time peak time percent overshoot percent undershoot settling time and steady state error A set of controls appears that will compute any one of four standard performance measures Over any part of the step response up to the specified maximum time The selectable perfor mance measures are IAE integrated absolute error ITAE integrated time by absolute error ISE integrated square error and ITSE integrated time by square error selectable by a dropdown menu c Unit Cosine Input The default cosine frequency is hertz but this can easily be changed by way of the Freq Hz edit window cosine Steady state magnitude and phase are displayed and if jimmie the maximum time is at least approximately three times sshag 1 132 longer than the settling time the
25. Box Conversely Draw Box is deselected when you select Help As you move the mouse cursor around the main pole zero interface the text that appears in this figure changes so that it always describes the object nearest to the mouse cursor For example if the cursor is placed near the OLbode checkbox the pushbutton that creates the open loop Bode plot the Help Window text is updated as follows E PZGui Help Window OPEN LOOP BODE PLOTTING CHECKBOX J You can check this box simply by clicking on tt When this box is checked the OPEN LOOP Bode i ma gnitude and phase plots will be created and will automatically be updated as you change the pole zero configuration or the GAIN or the delay IN THE RESULTING BODE PLOT if you position the cursor near the FREQ RESPONSE UNE itself that frequency will be highlighted in all the Bode Nichols and Nyquist plots and the frequency will be displayed near the cursor The ZOOM feature is enabled and linked in all of the Bode plots so whenever you zoom In or out in one of the plots the frequency ranges in the other plots are adjusted to be identical Page 55 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins
26. Closed Loop Magnitu File Model Tools Help File Model Tools Help Continuous Time Closed Loop Bode Magnitude Magnitude dB 300 10 10 10 10 Frequency hertz Frequency hertz unwrap Hz Log Notice that the frequencies at which the closed loop magnitude plot exceeds 1 0 dB are high lighted white both in the Nichols plot and in the closed loop magnitude plot This highlighting across multiple figures has proved to be very helpful to students trying to under stand what the Nichols grid is all about 3 The Equi Margin Grid The notion of a combined gain and phase margin can be useful This has been called the gain phase margin and the idea is that it is important to consider the actual distance of the frequency response plot from the point 1 not just in one direction i e gain direction or phase direction For that reason the Nichols chart has an equi margins checkbox 4 Continuous Time System Nichols Chart File Model Tools Help Continuous Time System Nichols Chart ail 3 140 120 80 60 Phase degrees O OE Nich grid I Nich grid hilite equi margins 3 3 9 Page 20 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins There is one feature of the Nichols plot that presents a significant departure from the standard Nichols chart The Nyq Mapping checkbox enables you to view the rest of the mapping from the Nyquis
27. File Model Tools Help Ver 3 0 01 pure Open Loop S plane P Z Map eee lay 700 H00 500 400 300 200 100 Real S rad s H D T pzqui Grid a Fix DE Fi oOlbode 3 oG J Nichoe Nyquist PB obresp AE a Sensitivity File Model Tools Help c MLA Hopkins 1996 2014 pure O1Julo14 delay Gain 8 656e 2 2 POLES 0 973302 0 152 selected pole Delete Move Add 2 plane locations or vamame 1 ZERO 0 7018369 aot Delete Mowe Add q 2 plane locations E or vamame Real 2 ie ETE Goan Wi Olbode 3 FR Clbode BB Nichos PB Nyquist PR Olresp BB Clresp FI Rtloc Ol Sensitivity The continuous time lines of constant damping factor are not straight as they would otherwise be Page 30 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins When both main interfaces are open an interesting feature called Draw Box becomes available When the Draw Box checkbox is selected the mouse cursor becomes box like to remind you that you can t use the mouse to zoom as you normally would Instead when you press and hold the left mouse button a box is drawn in the pole zero map and is also immediately mapped to the other do main by whichever link method is selected The boxes are also drawn simultaneously in the root locus plots if they are open Here is a s plane to z plane example with the bilinear transformation selected Continuous Time P 7 Map GUL YA A P i File Model Tools Help c
28. Help Continuous Time System Root Locus O L zeros O L poles O C Lopoles 2 asymptote Center m i iv O 0 E oo a a fc nm wo 200 150 100 50 0 50 100 150 Real S rad s Parameter Sam Apply Kto Gain I NegativeLoci Grid By contrast if the delay is changed from one millisecond to five milliseconds the effect 1s dramatic The root locus in the near vicinity of the transfer function poles and zeros is quite different The ten dency of delay to destabilize a system is clearly illustrated by this example Continuous Time System Root Locus File Model Tools Help Continuous Time System Root Locus O L zeros a O L poles 7 O cC Lopoles al Center Ee NE asymptote Q H HA ae Imaginary Part of S Plane 290 200 150 100 50 0 Real S rad s Parameter K Apply K to Gain E Negative Loci rt Grid Page 47 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Some interesting aspects of the effects of pure delay can be studied in PZGui For example through the use of nonlinear scaling the Hybrid Scaling checkbox the Nyquist plot can show a different perspective on the frequency response effects of delay As shown in the following figure the Nyquist plot shows how at high frequencies the frequency response function spirals in to zero Continuous Time System Nyquist Plot File Model Tools Help of CCW encircimnts LL i
29. PZGui main interface figure there are five pushbuttons that create frequency response plots 1 The open loop Bode plots magnitude vs frequency and phase vs frequency I D T Link by bilinear OLbode KN 2 The closed loop Bode plots magnitude vs frequency and phase vs frequency Le pzgui E D T Link py biincar WM Clbode D Nichok 3 The Nichols chart a Draw Box P Nyquist D OLresp Poe DL BB Sensitivity NOTE When the closed loop system is unstable the closed loop Bode plots and output sensitivity plot will not display any FRF information The resulting plots are all interconnected and interactive When you bring the mouse cursor near the frequency response line in any one of these plots the corresponding point is highlighted in all of them simultaneously The highlighting displays the frequency at that point and in the open loop plots also shows the magnitude and phase values at that frequency Moreover the corresponding transfer function evaluation point on the stability boundary is also high lighted in the pole zero maps For continuous time that will be a point on the j axis of the s plane For discrete time that is a point on the unit circle e s in the z plane There are some very useful user interface controls that are located in the lower left parts of these plots a x axis units either hertz or radians second b x axis scaling either log scaled or linear scaled c
30. State Space ss variable zeta Wn form Load model from a File as a Partial Fraction Expansion to a struct variable Generate a random flexible structure like model as a Transfer Function tf variable lt unfactored form gt Clear the model delete all zeros poles set gain 1 Export its FRF as a frequency response frd variable iove naa There is a slight difference between the submenus for the continuous time and discrete time mod els Specifically a discrete time model cannot be saved in zeta Wn form There is more dis cussion about the various forms of model below Here is the discrete time submenu which does not offer that option Discrete Time P Z Map GUL A File Tools Help Hir Export model to a workspace variable i as a Zero Pole Gain zpk variable Save model to a File as a State Space ss variable modal canonic form Import model from a workspace variable as a Partial Fraction Expansion to a struct variable Load medel from a File as a Transfer Function tf variable lt unfactored form gt Generate a random flexible structure like model Export its FRF as a frequency response frd variable Selected Clear the model delete all zeros poles set gain 1 we Delete Move Add Let us consider the various submodel selections one by one a Zero pole gain zpk form The PZGui model is exported as a Matlab Controls Toolbox zpk object Mathematically this is a very
31. User s Manual for PZGui v 8 0 xx Pole Zero Graphical user interface a Matlab Toolbox by Prof Mark A Hopkins Ph D Electrical amp Microelectronic Engineering Department Kate Gleason College of Engineering Rochester Institute of Technology July 2014 File Model Tools Help tt 1201 O1Juczo14 delay Onen Loon 7 nlane PIZ Man D1Jutz014 2 Continuous Time BZ Map G U Enka MadelenTaniseettelp Open Loop 5 plane P Z Map Ver 3 0 01 01Jutz014 M an 60 100 ii 60 40 20 Real S rad s I D T Link byl ZOH equiv I Draw Box Help O Olbode FB Clbode FB Nichole PR Nyquist PB Olresp PP Cioresp QB Rtloc Sensitivity Table of Contents TOF OGUCUION cavcsesescsccecsstaversGadcceseasscascaatavebesGadadededediewneiakeoesies 0 Installing and Running PZGui ssesesecsosececescecesecessocesesecssosesesesseseseseooeoos Pe OVERVIEW OF PZCUL cnrriiee aa aae a a a a a a II Entering a Model into PZGui CE Deleting a Model siisecierrrnire ostensae EEE EEEN AS 2 Importing and Loading Models esseseeseseesesoesesoesecoesoesesoeseeoesseeseseee 3 Modifying an Existing Model a Changing the Transfer Function Gain sssssssesoesoesoecoceceeoecseoeeoeooso b Deleting existing poles and Zeros essssosesesccesesesesoesesesseseseseseesooooeceee c Modifying existing poles and zeros ssesssesecesssesesoesesessoseseseceesoeooeceee d Adding new poles and zeros esessesescesecoocesosese
32. XIII Saving Models and Exporting Models cssccccccccccccsssccccccccsssssccccces XIV The Help Menu and Context Sensitive Help ccccccccccssssccccccccsssccccecs Page 2 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins F P gt P Wn PPE PoF pF oS S G NAN NN QO 10 10 11 14 18 22 lt 25 29 Introduction The toolbox PZGui comprising over 65 m files is a Matlab add on tool that helps build understand ing of the complicated relationships among the following e pole zero maps e frequency response plots gt open loop Bode plots gt closed loop Bode plots gt Nichols plot gt Nyquist plot gt Output sensitivity plots e open loop and closed loop time responses gt impulse step ramp parabola and sinusoidal inputs gt root locus gt the continuous time domain and the discrete time domain PZGui is useful in many situations It was originally intended for the purpose of creating bullet proof classroom demos But over years of development thanks to its increasingly advanced interac tive and cross linked graphics it has become an excellent tool for understanding almost any aspect of single input single output transfer functions It is suitable not only for students but also for profes sionals trying to deepen their understanding of linear systems 0 Installing and Running PZGui Provided it is used only for educational purposes
33. ce figure the link is selected For instance the figure directly above is the continuous time main interface and checking the box labeled D T Link by will cause the continuous time model to be mapped into the discrete time domain where it will replace any mod el that is currently in the discrete time main interface 60 Real S rad s D T Link by iw I Draw Box Fi Olbode BC lbode Nichols If instead the corresponding link checkbox in the discrete time main interface had been checked then the inverse transformation of the discrete time model into continuous time would have been done and the resulting continuous time model would have replaced the model that was currently in the continu ous time interface Page 29 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Whenever a link is active i e one of the link checkboxes is selected any change made to the trans fer function model that is being linked to the other domain will immediately result in a model having the corresponding change in the other domain Even if no link is active both of the main interfaces i e continuous time and discrete time can be open at the same time Whenever they are open at the same time the continuous time grid of constant damping lines and constant natural frequency lines will correspond to the selected transformation method Consider for example how the two main interfaces look when bilinear is selected
34. e while you are moving the slider The preview lines are generally magenta but in the open loop Bode plots there is additional infor mation about the controller design In particular the open loop Bode magnitude plot shows the magni tude plot of the controller itself as a dashed cyan line Likewise the open loop Bode phase plot shows the phase plot of the controller itself as a dashed cyan line Page 36 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins As an example here are the open loop Bode plots previewing a phase lag design with extreme phase of 25 a center frequency of 22 rad s and a gain crossover frequency of 18 rad s 4 Continuous Time Open Loop Magnitude z o7 File Model Tools Help File Model Tools Help x 4 Continuous Time Open Loop Phase Continuous Time Open Loop Bode Magnitude Continuous Time Open Loop Bode Phase Magnitude dB a 1 AY T k ak oA m pm a I Sree I 10 Frequency rad s 10 Frequency rad s E unwrap a Hz Log The red lines are the uncompensated system the only lines in the plot when preview mode is turned off The magenta lines are the preview lines of the compensated system The dashed cyan lines are the magnitude and phase of the phase lag compensator by itself For that same phase lag controller here is the root locus plot with its preview Note that because the basic plot is magenta colored the preview plot color is gray
35. e a white background is usually the best choice for two reasons First the amount of toner or ink required is significantly greater if the background is not white Second and more importantly the resulting print usually looks better with a white background For that reason if you select either Print Preview or Print the background color will be changed temporarily to white if it is not already white When you finish with the printing process it will be changed back to black if it was black before Continuous Time P Z Map G UL y sil Model Tools Help Figure background WHITE Figure background BLACK Hide Controls this figure Show Controls this figure Close all P GUI plots Clear Undo amp Redo history Export Setup Print Preview Print Page 9 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins 2 Hiding the controls There is an option to hide all the controls in a figure This option is useful when having the con trols appear in the figure distracts from the purpose of the figure For the same reason it is also useful when printing a figure I Continuous Time P Z Map G ULL a ee Figure background WHITE Figure background BLACK Ci Hide Controls this figure Show Controls this figure Close all P GUI plots Clear Undo amp Redo history Export Setup Print Preview Print 3 Hiding the pole zero map grid lines There are pole zero maps in
36. e it easier to use a Nichols chart for design purposes 1 Frequency annotation Because the Nichols chart is a plot of frequency response magnitude in dB versus frequency response phase in degrees the actual frequencies of the points along the plot cannot be directly determined Frequency information is said to be implicit For that reason when the mouse cur sor is placed near the plot line the frequency of the nearest point is displayed as well as the mag nitude and phase information at that point Here is how that looks h Continuous Time System Nichols Chart File Model Tools Help Continuous Time System Nichols Chart a oO E a ay 2 50 2 00 150 100 I hiya Mappin Phase degree yg Mi g i Nich grid e hilite WM equimargins Re Ba Because the cursor was placed near the point 204 7 20 0 dB that point is highlighted and the frequency at that point 13 39 Hz is also displayed nearby 2 The Nichols Grid and Highlight Option Although the Nichols grid is one of the main points of the Nichols chart it is sometimes useful to be able to view the plot without it For instance when finding the closed loop gain margin and phase margin from a Nichols plot the Nichols grid is not used The visibility of the Nichols grid is controlled by the Nich grid checkbox Here is the same plot viewed with the Nichols grid turned off Page 18 of 55 pzgui v 8 0 xx User Manual 2014
37. ed off 2 The Lead Controller and Lag Controller Design Tool Both the lead controller and the lag controller consist of one pole one zero and a gain factor _K s 4 G s S Pp where the pole p and zero must be non positive real numbers i e not greater than zero and K gt 0 If pole location p gt the controller is a phase lag or lag controller If pole location p lt the con troller is a phase lead or lead controller When the Lead and Lag Design menu item is selected the following interface figure will appear with the default unity gain and no zero or pole specified 4 s Domain Lead Lag Design GU Extreme Phase Center Freg Gain Crossover Preview degrees rad s rad s Gain Pole Location Zero Location 1 rad s rad s D gain 1 The controller may be specified either e in terms of its pole and zero or e in terms of its phase characteristics extreme phase value and frequency at which that occurs For example specifying a controller p 42 10 and Gain 2 results in the following figure FJ s Domain Lead Lag Design SU Extreme Phase Center Freg Gain Crossover 37 9799 20 4939 21 3229 degrees rad s rad s Ap Y Gain Pole Location Zero Location 2 42 10 rad s rad s O DCgain 1 Notice that the upper row of parameters has been calculated and entered automatically Page 35 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins As an
38. erstand how computation of the unit cosine response frequency response at any frequency is related to vectors drawn from the various poles and zeros of the system to the point on the positive imaginary axis j i Continuous Time P Z Map G U L File Mod Help uc M A Hopkins Pure Gain Design Lead and Lag Design PID Design Show FRF computation foom Here is what happens when the Show FRF Computation menu item is selected in the Tools menu If the cursor is placed near the positive imaginary axis in the main pole zero interface the nearest point on the axis is highlighted by a small cyan circle Furthermore vectors are drawn to that point from the various poles and zeros in the pole zero map and those vectors are annotated with their angles and their lengths Those angles and lengths can be used to compute the frequency response magnitude and angle at the highlighted frequency For example with a pole at 3 and zero at 9 the cursor was placed near to s 3 491 So 3 49 radians second The following figure shows the resulting vectors and highlights a Continuous Time P Map G U L File Model Tools Help c MA Hopkins Ver 3 0 01 pure Open Loop 5 plane P Z Map peepee Bi uf p r w T baky m E 4 2 0 D T pzqui Real S ra d s T Grid Fre DC BM D T Link 20H equi Box Center DE OLbode MM C Lbode Mf Nichols Nyquist J OLrespi C Lresp J RtLoc I Sensitivity The freq
39. ete time dt_timodel_3b order 49 out 4 in 2 class zpk discrete time dt_zpkstruc_6d order 4 fout 1 in 1 class struct discrete time Load Selection Note that if you load a frd frequency response data object it only shows up in the open loop Bode plots and has no effect on the transfer function that is loaded in the main interface figure This capability is primarily intended to enable the comparison of frequency response curves such as during system identification There is yet another way to replace the current model and that is to have PZGui generate a pseu do random flexible structure like model collocated to about 50x the first resonant peak frequency Continuous Time Py Map G U L File Tools Help c MA Ver 6 0 01 pure Export model to a workspace variable i Apem 1 Save model to a File Import model from a workspace variable Load model from a File a Generate a random flexible structure like model Clear the model delete all zeros poles set gain 1 Enter the poles to be in the model from 5 to 499 la Enter the frequency Hz of the first resonant peak 49 20l The subject of saving a PZGui model is covered in section XIII Page 6 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins 3 Modifying an existing model This is a very useful way to investigate how the frequency response and time response of a system depend upon the p
40. evious figure Help checkbox in main GUI or click on the Help checkbox near the lower right corner of the main pole zero GUI as shown in the next figure EI PZGui Help Window FOR HELP MOVE MOUSE CURSOR TO AN OBJECT P Gul is copyrighted c 1996 2014 by Professor Mark A Hopkins Ph D Electrical and Microelectronic Eng 9 Lomb Memorial Blvd Rochester Institute of Technology Rochester New York 14623 mark_hopkins rit edu The contents of these files may not be included in any other program without explicit written consent from the author Mark A Hopkins SHAREWARE DETAILS FREE if used ONLY for educational purposes Otherwise corporations companies other for profits Individual licenses may be purchased for U S 200 per computer or a site license may be purchased for U S 2000 A site license is good for any number of machines at one industrial site Make check payable to Mark A Hopkins Page 54 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins When the Help checkbox is selected it is ane with red text as follows cm ian res eT WW ser sitivity If you close the Help Window figure the Help checkbox will be de selected Under certain circumstances the Help checkbox will automatically be de selected For example if you drag and drop a pole or zero the help checkbox will be de selected It will also be deselected if you select Draw
41. function gain or e interms of its PID gains proportional gain K integral gain K and derivative gain K4 For example specifying a controller 40 50 T F Gain 0 04 and Pole 2 Multiplier 20 results in the following figure That puts p at s 50 x 20 1000 E s Domain PID Design GUI Prop Gain Integ Gain Deriv Gain Preview K_p K_i K_d 3 6 80 0 04 Apply Pole 2 Zero 1 Zero 2 i ig Multiplier T F Gain i Location on 0 04 50 how far to the left rad s rad s of the two zeros Notice that the upper row of gain parameters has been calculated and entered automatically based on those entered in the lower row Page 39 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins If the Preview pushbutton is clicked it puts the design tool in preview mode and it now appears as in this figure s Domain PID Design GUI Prop Gain Integ Gain Deriv Gain K_p K_i K_d SS P clear preview 3 6 80 0 04 Apply d Zero 1 Zero 2 irea ee T F Gain ati rae map 20 0 04 4 i how far to the left of the two zeros The green colored slider in the center enables you to smoothly vary whatever parameter is selected in the dropdown menu to its left All seven parameters can be varied this way s Domain PID Design GUI Prop Gain Integ Gain Deriv Gain T Ki S a8 oa Slearpreview Apply Kppropgain n a aaam Pole 2
42. i citi said ae quist Contour File Model Tool Help S Plane Nyquist Contour NOT TO SCALE L oe LL kimm O p mi 0 oy mi Ta mL m E 4 0 5 0 0 5 1 1 5 Real Part of FRF Full Qut Show Nya Contour i equimargins BJ Hybrid Scale Page 14 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Note the Nyquist movie checkbox in the lower left corner of the Nyquist contour plot In the simplest s plane Nyquist contour i e with no poles or zeros on the stability boundary there are four parts of the contour 1 the positive frequency axis also called the positive j axis 11 the negative frequency axis also called the negative j axis 111 the upper half of the infinite radius semicircle enclosing the right half plane iv the lower half of the infinite radius semicircle enclosing the right half plane Each of these four parts is plotted in a different line style and color and that is preserved in the map ping through the transfer function i e the Nyquist plot from each part of the contour That makes it easier to interpret the Nyquist plot Also if the mouse cursor is brought close to any point on the Nyquist contour that point is highlight ed and so is the corresponding mapped point on the Nyquist plot The converse is also true if you bring the mouse cursor close to a point on the Nyquist plot that point is highlighted and so is the cor responding source point on the Nyquist c
43. ial Fraction Expansion to a struct variable as a Transter Function tf variable lt unfactored form gt Generate a random flexible structure like model Export its FRF as a frequency response frd variable Clear the model delete all zeros poles set gain 1 Be aware that the exported frequency vector does not consist of equally spaced frequencies It generally doesn t consist of log space frequencies either because PZGui uses an adaptive fre quency selection algorithm to fill in more frequencies wherever magnitude and or phase are changing quickly The purpose of that in filling is to guarantee smooth looking frequency response plots For more information about Matlab s frd object at the Matlab command line type gt gt doc frd Page 53 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins XIV The Help Menu and Context Sensitive Help There are only two ways to get help in PZGui First there is this self same document User s Manual for PZGui v 8 0 xx which can be accessed from the Help menu provided that you have a PDF reader enabled Continuous Time P Z Map G UL Fie Model Took c M A Hopkins Ep l fer 200 i Pzgui User s Manual PDF pee Op 60 Help checkbox in main GUI Second there 1s a context sensitive help that works only in the main pole zero GUI This can be acti vated by either of two methods select the second menu item in the pr
44. ion handles repeated poles e Transfer function tf form The worst conditioned form of the transfer function is as a ratio of two unfactored polynomials This form is worst conditioned because the poles and zeros can only be determined by using a root finding routine It s not too bad when model order is less than about 12 but finding the roots of polynomials above that order is very difficult and generally inexact This is particular ly true if there are any repeated poles or zeros even when model order is less than 12 Page 52 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins That said the transfer function form is supported by Matlab as an object type the tf object For more information about Matlab s tf object at the Matlab command line type gt gt doc tf Frequency response data frd form Although this method of exporting the model does not preserve any direct information about the poles zeros and gain of the transfer function nevertheless it can be useful to save the fre quency response function of the model That is the only purpose of this menu selection z Continuous Time P Z Map G ULL Tools Help File ic WA Export model to a workspace variable as a Zero Pole Gain zpk variable Save model to a File as a State Space ss variable modal canonic form Import model from a workspace variable as a State Space ss variable zeta Wn form Load model from a File as a Part
45. is turned off The magenta lines are the preview lines of the compensated system i e with the controller The dashed cyan lines are the magnitude and phase of the phase lag controller by itself Here is the corresponding root locus preview The preview root locus is in gray and so are the poles and zeros of the PID controller h Continuous Time System Root Loc File Model Tools Help Continuous Time System Root Locus i D L Zeros D L poles C L poles 60 asymptote 80 a a a o gI kj g m o a m E E mi 80 180 160 140 120 100 80 60 40 20 Real S rad s Parameter K Ss lt Apply K to Gain IE Negative Loci Grid Here is the corresponding closed loop step response preview the magenta line Note that the annota tions still refer to the uncompensated response the red line d Continuous Time Closed Loop Time Respons File Model Tools Help C T Closed Loop Unit Step Response 45 5 37 13 T beak 6 05739 Max Time 0 70174 U S 27 14 Ferform ce 0 33496 Perf Meas l E 5 5 0 5198 Perf Range T oO i a on am o ua T og gt al a wo m A d a E a i gI 1 0 3 0 4 0 5 ina oti 0 7 Start Time seconds Ea 0 70174 O natural ingests Show Input Output z Page 41 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins 4 Illustrating the Frequency Response Computation This tool can help students und
46. l poles and four additional zeros appear in the plot These Pade poles and zeros are colored gray in the plot to emphasize that they are not ordinary poles and zeros For relatively small amounts of delay the Pade poles and zeros tend to be far from the dominant poles and zeros of the transfer function as shown in the following examples The first example has only a small amount of delay but the second example has much more significant delay The first plot 1s zoomed out to the point where the Pade poles and zeros are clearly visible The de lay is set to one millisecond Continuous Time System Root Locus File Model Tools Help Continuous Time System Root Locus Center 12000 40000 0 L zeros O L poles 8000 C L poles asymptote 2000 4000 i E i O to kj O pm m an eo m E m 6000 8000 10000 8000 6000 4000 2000 0 2000 4000 6000 Real S rad s Parameter Because the Pade poles and zeros are so far from the transfer function poles and zero they have very little effect on the root locus in the near vicinity of those transfer function poles and zero The next plot has been zoomed in to a region close around the poles and zeros of the transfer function to show that the effects of the relatively distant Pade poles and zeros are negligible Page 46 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Continuous Time System Root Locus File Model Tools
47. ns or vamame u ECE rxoc EET n P Nichols PB Nyquist PR Olresp S a Sensitivity File Model Tools Help Ver 6 0 01 pure O1Juio14 delay D Ts 5e 3 33i selected Move Add S plane locations or vamame Imag S rad s T F ected ars Delete Move Add S plane locations or varname ETE rxoc Olbode f CLbode Nichols Nyquist M Olresp I CLresp Rtloc il Sensitivity fH Draw Box ols E Nyquist rm OLresp ry C Lre Page 32 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins XI The Tools Menu The Tools menu is used to access the three major design tools in PZGui as well as a tool that visu ally highlights the way that frequency response is computed from the transfer function a Continuous Time P Z Map G UL ci Took Heb Pure Gain Design Ver 6 0 0 O1Jut201 Lead and Lag Design PID Design Show FRF computation Zoom 1 The Pure Gain Controller Design Tool The simplest possible feedback controller is a pure gain factor K gt 0 When teaching controls for ex ample when trying to teach root locus methods this is often the first type of controller to discuss When the Pure Gain Design menu item is selected the following interface figure will appear with the default unity gain 4 s Domain Pure Gain De ic 1 Gl F If any of the frequency response or time response plots are open and the Preview pushbutton is
48. ol The PID controller is specified by the following transfer function _ K s amp s 2 where the pole p and zeros and must be in the left half of the s plane for discrete time inside the unit circle and K gt 0 The two zeros may be real valued or they may be a complex conjugate pair The second pole pz is included in the PID transfer function for only one reason so that the PID trans fer function will be proper In the s plane pz is typically much farther to the left than either of the ze ros In the z plane it is placed at z 0 The transfer function denominator factor Cm 1 is expressed in that form in order to decouple the dc gain computation from changes in the location of p3 When the PID Design menu item is selected the following interface figure will appear with no gains and no zeros specified a s Domain PID Design GUI i Prop Gain Integ Gain Deriv Gain Preview K_p K_i K_d Apply Fole 2 Zero 1 Zero 2 Multiplier T F Gain Location Location 10 how far to the left rad s rad s of the two zeros Notice that the location of pz is always relative to the locations of the zeros This pole location is spec ified as a multiple of minus the absolute value of the left most zero location The default multiple is 10 but it can be specified anywhere from 3 to 1000 The controller may be specified either e in terms of its two zeros second pole and transfer
49. ole and zero locations and the gain There are several ways to do this but they essentially come down to a changing the transfer function gain b deleting an existing zero or pole c modifying an existing zero location or pole location d adding new zeros or new poles a Changing the transfer function gain This is done very easily by entering a different number in the Gain window aas Ver 6 0 01 pure ap Wamena Bey lt I Eecan_ 5 nue 3 11 z selected pole Delete Move Add b Deleting an existing pole similar for deleting a zero In the pole selection dropdown menu select the pole to delete Then click the Delete button located immediately below the menu c Modifying an existing pole similar for modifying a zero In the pole selection dropdown menu select the pole to modify Enter the new location just below the Move button then click Move Gain 19 pole Delete Page 7 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Modifying an existing pole continued There is another simpler way to modify pole and zero locations Using the mouse you can drag and drop any pole or zero to a new location When you position the mouse cursor close to one of the poles or zeros in the pole zero map the cursor shape will change from the magnifying glass i e ready to zoom in or out to the hand At that point if you press and hold
50. ome useful and interesting features of the PZGui root locus plot e Preview the effects of changing the gain by a factor K gt Place the mouse cursor near any branch of the root locus This previews the effect of a gain change in every open plot gt Click on any point along any branch of the root locus gt Enter the numerical value of K in the Parameter K window e Show the negative root locus plot i e the plot that results from negative gains e Show or hide the grid of constant damping factor and constant natural frequency The following figure highlights the controls that are related to these features z d Continuous Time System Root Locus Model Tools Help Continuous Time System Root Locus O L zeros O L poles C Lupoles asymptote Imaginary Part of S Plane 150 100 50 Real S rad s Parameter 7 oO lt Apply K to Gain IB Negative Loc Grid p 7 When the mouse cursor is brought close to any branch of the root locus the gain factor K that would put a closed loop pole at that point is automatically displayed as shown in the following figure No tice that two other things happen All of the closed loop pole locations that would result from that ad ditional gain factor are highlighted as small white squares and the mouse cursor is changed from its normal magnifying glass shape i e ready for zooming to a small circle Page 22 of 55 pzgui v 8 0 xx User
51. on gain The transfer function gain is entered as described above in section II 3 a whereas the dc gain is the value of the transfer function evaluated at dc For continuous time systems dc gain is H s o For example if a new pole is added at s 10 then the transfer function gain must be increased by a factor of ten to maintain the same dc gain This can be made automatic by selecting the checkbox la beled Fix DC Page 8 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins The usefulness of the fixed dc gain option is most apparent when a pole or zero is being dragged around If there are frequency response and or time response plots open it 1s usually easier to inter pret the effects of the changing location as seen in the previews if the dc gain is not also changing IV Other Options for Display and Format 1 Figure background color There are two choices of background color black or white The default is black because it is the best choice for overhead projection and PZGui is first and foremost a classroom teaching tool The figure background color is easily changed as shown here Continuous Time P Z Map GUT a Fre Model Tools Help Ci Figure background WHITE Figure background BLACK Hide Controls this figure Show Controls this figure Close all PFZGUI plots Clear Undo amp Redo history Export Setup Print Preview Print For printing a figur
52. ontour These highlights include information about the fre quency magnitude and phase Here is an example of highlighting at frequency w 4 475 Hz 28 12 rad s Lad Continuous Time System Nyquist Plc i i Continuous Time Nyquist Contour File Model Tools Help File Model Tools Help Continuous Time Nyquist Plot S Plane Nyquist Contour NOT TO SCALE Imag Part of FRF 0 5 0 5 1 Real Part of FRF Real S Full Qut Show Myg Contour IB equimargins e Scale Nyquist mowie The Hybrid Scale checkbox turns on the nonlinear scaling option mentioned above In the following figure the same transfer function that generated the preceding figure was used but hybrid scaling is Page 15 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins selected Under this scaling it is possible to see close to the origin the dashed line mapping from the infinite radius part of the Nyquist contour aa Continuous Time System Nyquist Plot File Model Tools Help Continuous Time Nyquist Plot Nonlinear Scale l z LL 5 T m D om m Real Part of FRF Full Out Only one part of the Nyquist contour is generally used in the other open loop frequency response plots and that is the positive j axis which is plotted as a solid red line that same line style and color is used in the other plots The exception is the Nichols plot discussed in the next section which has an option to
53. other example specifying a controller that has an extreme phase of 25 a center frequency of 22 radians second and a gain crossover frequency of 18 radians second results in the following figure Center Freq Gain Crossover 25 22 18 degrees rad s rad s oe Gain Pole Location Zero Location 0 585811 14 0155 34 5331 rad s rad s DCgain 1 Notice that the lower row of parameters has been calculated and entered automatically If the Preview pushbutton is clicked it puts the design tool in preview mode and it now appears as in this figure E s Domain Lead Lag Design GL Extreme Phase Center Freq Gain Crossover 22 18 _ rad s rad s clear preview Pole Location Zero Location 14 0155 34 5331 rad s rad s The green colored slider in the center enables you to smoothly vary whatever parameter is selected in the dropdown menu to its left All parameters but the gain crossover frequency can be varied this way Center Freq Gain Crossover Preview 22 18 SS rad s rad s clear preview Pole Location lo center freq 14 0155 gain rad s rad s O D gain 1 E pole loc Whether you change a parameter by entering a new value in the appropriate edit window or by select ing that parameter in the menu and using the slider any open PZGui plots will preview the effect of that parameter value in the controller If you use the slider all previews will be updated in real tim
54. rs and denominators that depend upon the pole repetition For non repeated poles the denominators are first order For a repeated pole with repetition m there will be m terms with denominators of increasing order from 1 to m For example suppose a model has the following zpk form transfer function H s 0 1 s 70 SERA AA s 3 31i s 34 31i s 2 The partial fraction expansion 1s 2 41 3 61i x 107 2 41 3 61i x 107 R 4 83 x 107 r 0 319 n 5 12 P s 2 s 2 s 2 Notice that the constant direct term is zero in this example It will only be nonzero if the order of the numerator polynomial is the same as the order of the denominator polynomial H s There is no pfe object defined in Matlab so when you select this form it is exported as a struc ture variable with fieldnames that are similar to terms used in the documentation of the Matlab residue function which can be used to find the partial fraction expansion of a transfer func tion The fieldnames are residues poles and direct In the preceding example the export variable was named my_pfe and it has the following fields 2 41 3 61i x 1073 3 31i 2 41 3 61i x 107 3 31i my_pfe residues 483 x 1073 my_pfe poles and 0 319 2 5 12 2 my_pfe direct 0 Notice that when a pole is repeated the residues i e numerators are given in order of increas ing denominator order That s the same way Matlab s residue funct
55. s Ferf Range Low High Time seconds T T co i D d oy e co al i tO natural E forced Show Input Output If there are more than 32 individual natural response lines i e decaying exponentials and decaying sinusoids they will not be plotted separately because of the excessive graphics burden it can impose in the figure Instead the total natural response will be plotted as a single yellow line Selecting the forced checkbox results in an additional cyan colored line that corresponds to the forced response The forced response is always similar to the input function so for a unit step input the forced response is also a step The forced response is a little more complicated for unit ramp input because the input has two poles at dc the forced response is actually a step plus a ramp two cyan lines Similarly the unit parabola input has three poles at dc so the forced response is a step plus a ramp plus a parabola three cyan lines Directly below is an example of the open loop response to a unit parabola showing the three cyan forced response lines because the forced checkbox is selected The forced response consists of a step at roughly 0 001 plus a ramp that increases to approximately 0 0025 during the quarter of a sec ond covered by the plot plus a parabola that ends up slightly below the red line of the output Page 27 of 55 pzgui v 8 0 xx User Manual 2
56. seoesoesesessosesessseseooosoe HI An Important Option when Modifying a Model Fixing the DC Gain 000 IV Other Options for Display and Format CL Figure Backoround Color avai vseciciacicnvvc tree stes ETa a TEE EE TENTE 2 Midin the C On hOls sses T ER 3 Hiding the pole zero map grid lines sesesessesesecesseseceseesesecesseseseseseoe 4 Centering the pole zero maps cccccccccccccccccccccccccsscccccccccssscsccccees V Frequency Response Plots Bode Plots and Output Sensitivity ccccceeeeees VI Frequency Response Plots the Nyquist Contour and the Nyquist Plot VII Frequency Response Plots Nichols Plot ccccccccccccccccccccccccccccccccscccees VIE Ene Root Locus Plot cerot a IX Time Response Plots Open Loop and Closed Loop Response _ ssssseeeee X Linking the Continuous Time and Discrete Time Domains _ ccccccsseccess XI The Tools Menu 1 Pure Gain Controller Design Tool eesesesessesecesecsesesesseseseseossssseoesooo 2 Lead Controller amp Lag Controller Design Tool ccscscseccsccccsscccesees 3 PID Controller Design Tool esessesccosesecessosesecesoeseseososesesesesseseseseooo 4 Illustrating the Frequency Response Computation ssscccccccccssscsees 5 Zooming In and Out in the Plots ossesesssseseseoseseseceosesesessosesesesoeoesooo ALE Addme Pure Delay toa Model sosesc isinin e E TANA
57. show all of the other Nyquist plot data in the Nichols chart style That can be quite interest ing and illuminating particularly when the Nyquist plot has encirclements of the point 1 The Equi Margin Grid The notion of a combined gain and phase margin can be useful This has been called the gain phase margin and the idea is that it is important to consider the actual distance of the frequency response plot from the point 1 not just in one direction i e gain direction or phase direction For that reason the Nichols chart has an equi margins checkbox When this checkbox is selected three equi margin contours 3dB 6dB and 9dB are shown as green lines as seen in the next figure Page 16 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins Continuous lime System lyquist Plo a eej File Model Tools Help of CCW encirclmnts 0 Continuous Time Nyquist Plot J dircle 3 2 1 0 Funout Real Part of FRF Unit Circ IE Hybrid Scale Lines of Constant Gain Phase Margin Page 17 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins VII Frequency Response Plots Nichols Plot The Nichols plot with its Nichols grid provides a visual link between the open loop frequency response and the closed loop frequency response Because the Nichols plot is so important there are some features of the PZGui Nichols chart that should be pointed out These features mak
58. t contour within a Nichols chart context This is quite interesting particularly when there are encircle ments of the point 1 in the Nyquist plot The non Nichols points are indicated in white negative j axis and by the dashed lines which map from all the other parts of the Nyquist contour The other parts are 1 any detours that must be made to avoid poles and zeros lying exactly on the stability boundary and 2 in continuous time the infi nite radius semicircle that completes the Nyquist contour s enclosure of the right half of the s plane When the Nyq Mapping option is selected as seen in the figure below all the points of the Nyquist plot are shown as well as the Nichols plot These two sets of data overlap along the solid red line of course because the Nyquist contour lies on the positive stability boundary the positive j axis in the s plane and the upper half of the unit circle in the z plane 4 PContinuous Time System Nichols Chart File Model Tools Help Continuous Time System Nichols Chart ewes eT ba ea 7 a ee hg nais et ae Mealy DEA mpa n aE a ge ee T ae j ae oe oe peop ge bee ct oe Ph ee ee ee ee ee PFeeeererel PEM e kek Lh Be ee ee bee ee ee ERE ae ee RE hh RP Magnitude dB 100 Phase degrees G E Nyg Mapping Nich grid W Nich grid hilite W equimargins Page 21 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins VIII The Root Locus Plot There are s
59. t corresponds to a Laplace domain transfer function in zero pole gain factored form also known as zpk form G s K s s 8 s p S Pa S Pa Optionally a nonzero pure delay can be included by specifying T the number of seconds of delay or in discrete time the number of samples of delay so that the model corresponds to E ST A a s p S pa Ss p It is a crucial point that any model entered into this tool is always treated as an open loop system Moreover the various closed loop plots are always based on the assumption of standard output feed back i e the output is fed back and subtracted from the input around this open loop system The main interface figure is pictured below with some of the interface areas highlighted The menubar Pure delay 7 in the _ open loop system BY Continuous Time P Z Map G UL 5 lo zero is the default c h A Hopking 19 Ver 6 0 01 HERRE 0 Open Loop S plane P Z Map a iy 0 L el e i Sample period T for discrete time linkage O E Transfer function Ta 3zi gain factor selected 4 pole Delete g Move ada Manipulation of D open loop poles zi acinar marked by X s 1 ZERO T ka ee Delete Manipulation of open loop zeros marked by O s 80 60 40 20 Real S rad s Micra irae I oraw Bo ener ele al Eir Peel D CETE Panera faim Ennn Plot creation checkboxes Page 4
60. ting the output from the input The tracking error can be viewed by selecting the Show Input Output checkbox as shown here A Continuous Time Ope Loop Time F File Model Tools Help C T Open Loop Unit Step Response Input step 5 5 1 0825 hax Time Perform ce Perf hleas Ferf Range Lo Wl H ig h 1 0 15 2 o f zese Time seconds Step Input dashed amp Response solid l natural Biggest Show Input Output gt Display of tracking error is especially useful when the difference between them is very small Page 26 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins The Natural Response and the Forced Response All time response figures have checkboxes along the lower left edge that enable you to view the natu ral part of the response and the forced part of the response When either or both of these are selected the total response i e sum of natural response plus forced response will still be visible i es L 1 Time second Selecting the natural checkbox results in additional yellow lines in the plot one for each decaying sinusoid the natural response of each complex conjugate pole pair in the system and each decaying real exponential the natural response of each real valued pole in the system For example here is the plot for a second order lightly damped system File Model Tools Help C T Open Loop Unit Step Response dax Time Perform ce 0 35143 Perf Mea
61. uency response magnitude at 3 49 rad s is the gain times the length of the vector from the ze ro and divided by the length of the vector from the pole i e 0 5 x 9 65 4 60 1 05 Also the frequency response phase at that frequency is the angle of the gain plus the angle of the vec tor from the zero minus the angle of the vector from the pole i e 0 21 2 49 3 28 1 Page 42 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins If the system doesn t exceed third order the details of the computation are also shown in a separate figure In this case because the system is only first order the following separate figure appears a CT 0 5e jw 9 0 5e 3 49 9 0 5 e 9 j3 49 2 2 0 5 2 9 j3 49 0 50 9 65 2 0 21 2 4 827 221 2 jw 3 3 49 3 3 j3 49 2 2 3 j3 49 4 6 2 49 3 4 602 249 3 H jw H 3 49 1 05 2 28 1 0 4dB 2 28 1 There are two ways to close this tool and get rid of the highlights vectors and computation figure First when this tool is open the Tools menu looks slightly different now one of the items you can select is Don t show FRF computation Note that the same Tools menu is available in any of the PZGui plots as well as the main interface figure Continuous Time P Z Map GUL no OO File Model Help Cc M A Hopkins ver 3 0 0 apen Pure Gain Design ps pae ap i 1Jue0
62. ui v 8 0 xx User Manual 2014 Mark A Hopkins The negative root locus is an interesting aspect of the root locus plot Normally the root locus plot is generated only from the positive values of gain factor K In PZGui if the Negative Loci checkbox is selected the complementary root locus plot based on negative values of K becomes visible The negative root locus is plotted in red to make it easily distinguishable from the ordinary positive K parts of the plot An example of this is shown in the following figure in which the mouse cursor has been brought close to one branch of the negative root locus The gain that would place a closed loop pole at that point is negative and is shown highlighted in red again to emphasize that it is negative e 3 P 4 Continuous Time System Root Locus e O h File Model Tool Help Continuous Time System Root Locus Center O L zeros O L poles C Lupoles asymptote i E Ex 0 tio kj p m a Fan m La c m i 350 300 250 200 150 100 50 Real S rad s Parameter K Page 24 of 55 pzgui v 8 0 xx User Manual 2014 Mark A Hopkins IX Time Response Plots Open Loop and Closed Loop Response On the PZGui main interface figure there are two pushbuttons that create time response plots 1 The open loop time response Erase quist W Olresp pb C Lresp 2 The closed loop time response File Model Tool

Download Pdf Manuals

image

Related Search

Related Contents

Garmin CARAVAN 675 User's Manual  ControlLogix System User Manual - Columbia Electric Supply Pasco  König CSTSTNDF100YE holder  Samsung Galaxy Note 8.0 用户手册(JB)  PIANO DI SICUREZZA E COORDINAMENTO  Soehnle Magical Mirror  Nino, culbuto rigolo  DIGラベルされたDNAを直接検出する  Montaggio del CP 441  

Copyright © All rights reserved.
Failed to retrieve file