0% found this document useful (0 votes)
11 views23 pages

574720133

control with matlab application

Uploaded by

abbasmiry83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
11 views23 pages

574720133

control with matlab application

Uploaded by

abbasmiry83
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 23
Dp OKLAHOMA STATE UNIVERSITY @ ECEN 4413 - Automatic Control Systems Matlab Lecture 1 Introduction and Control Basics Presented by Moayed Daneshyari 1 What is Matlab? + Invented by Cleve Moler in late 1970s to give students access to LINPACK and EISPACK without having to learn Fortran. * Together with Jack Little and Steve Bangert they founded Mathworks in 1984 and created Matlab. * The current version is 7. + Interpreted-code based system in which the fundamental element is a matrix. The Interface Workspace and Launch Pad Command Window Command History and Current Directory Variable assignment *Scalar: a=4 *Vector: v= (35 1] == v=[3 5 1] v@)=8=—> v=[3 8 1] t=[0:0.1:5]==—— t=[0 01 02 =. 49 5] ee = (2:3 m=) “| Ao m(12-0=—> m=|. ° Basic Operations * Scalar expressions 10 b= 10/ (sar(a) +3) / =p b= Va+3 c= cos (b* pi) ==> © =cos(bz) + Matrix expressions om tor=enls ala) (3 Useful matrix operations * Determinant: det(m) * Inverse: inv(m) + Rank: rank(m) + i by j matrix of zeros: m = zerosii,)) + i by j matrix of ones: m = ones(i,)) + i by i identity matrix: m = eye(i) Example » Generate and plot a cosine function Example + Adding titles to graphs and axis Adding graphs to reports * Three options: 1) Print the figure directly 2) Save it to a JPG / BMP / TIFF file and add to the report (File > Export...) 3) Copy to clipboard and paste to the report (Edit — Copy Figure) * * The background is copied too! By default it is gray. To change the background color use: set(gcf,’color’,’white’) The .m files + Programming in Matlab is done by creating “.m’” files. File New > M-File + Useful for storing a sequence of commands or creating new functions. * Call the program by writing the name of the file where it is saved (check the “current directory”) *“%” can be used for commenting. Other useful information * help displays the help for the function ex.; help plot + helpdesk brings up a GUI for browsing very comprehensive help documents * save saves everything in the workspace (all variables) to .mat. + load loads the file. Using Matlab to create models + Why model? - Represent - Analyze + What kind of systems are we interested? - Single-Input-Single-Output (SISO) - Linear Time Invariant (LT1) - Continuous Model representations —————__ Three Basic types of model representations for continuous LTI systems: + Transfer Function representation (TF) + Zero-Pole-Gain representation (ZPK) + State Space representation (SS) ! More help is available for each model representation by typing: help Itimodels 13 Transfer Function representation 25 Y¥(s)_ Se 2) (a) eS Matlab function: tf Method (a) Method (b) Zero-Pole-Gain representation on ye Ys) 8(5-1) SN SS ia) a (emOR GEE) Matlab function: zpk State Space representation 3 1 0 1 : . [x=Ax+ Bu A-| e-| | Given: ees : ol 0 c=[3 -2] D=[0] Matlab function: ss System analysis + Once a model has been introduced in Matlab, we can use a series of functions to analyze the system. + Key analyses at our disposal: 1) Stability analysis e.g. pole placement 2) Time domain analysis e.g. response to different inputs 3) Frequency domain analysis e.g. bode plot Stability analysis Is the system stable? Recall: All poles of the system must be on the right hand side of the S plain for continuous LTI systems to be stable. Manually: Poles are the roots for the denominator of transfer functions or eigen values of matrix A for state space representations In Matlab: pole(sys) Time domain analysis Once a model has been inserted in Matlab, the step response can be obtained directly from: step(sys) Unit Step Response of G(s) Steady State overshoot Amplitude 1 i i i i Settling Time; Peak Time i o A 1.5 2 25 3 4 Time (sec) 19 Rise Time Time domain analysis Matlab also caries other useful functions for time domain analysis: + Impulse response + Response to an arbitrary input e.g. ! It is also possible to assign a variable to those functions to obtain a vector with the output. For example: y = impulse(sys); 20 Frequency domain analysis Bode plots can be created directly by using: bode(sys) Frequency domain analysis For a pole and zero plot: _pzmap(sys) | Imaginary Ais Extra: partial fraction expansion 2 Given: G@uee 9 +354+2 num=[2 3 2]; den=[1 3 2]; [,p,k] = residue(num,den) Answer: re 7 6(s)=k(s) 4g... ! s-pll) pla) re i, a © 5-2) 5-(-1)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy