DOC PREVIEW
UK EE 422G - Using Matlab’s Control System Toolbox to study continuous time linear system

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

EE 422G Notes: Chapter 6 Instructor: Cheung Page 6-39Using Matlab’s Control System Toolbox to study continuous time linear system The Control System Toolbox in Matlab supports continuous-time and discrete-time linear models of the following types:  Transfer functions  State-space models Here we will discuss transfer function modeling of continuous-time function and leave the rest to future chapters. Creating Models The matlab function tf creates transfer functions. tf needs two MATLAB-vectors, one containing the coefficients of the numerator polynomial - taken in descending orders - and one for the denominator polynomial of the transfer function. As an example we will create the transfer function 1)(000+=sTsKsH >> K0=2; T0=4; >> num0=[K0 0]; >> den0=[T0 1]; >> H0=tf(num0,den0); To display 0H , we execute >> H0 Transfer function: 2 s ------- 4 s + 1EE 422G Notes: Chapter 6 Instructor: Cheung Page 6-40An LTI-model can contain a time-delay, as in the following model: sTddelayesTsKsH−+=1)(00 This system is created by (except from the time-delay term, dH is equal to 0H defined above): >> Tdelay = 1; >> Hd = tf(num0,den0,'InputDelay',Tdelay) Transfer function: 2 s exp(-1*s) * ------- 4 s + 1 Suppose we have created a transfer function, and we want to retrieve detailed information about the model. The function tfdate retrieves the information: >> [numHd,denHd] = tfdata(Hd,'v') numHd = 2 0 denHd = 4 1 ’v’ indicates that we are dealing with 1-d input and output. Input delay can be retrieved by the get command: >> get(Hd,'InputDelay') ans = 1 Try the following command: >> get(Hd)EE 422G Notes: Chapter 6 Instructor: Cheung Page 6-41Time Response To show the impulse response of a system, we use the command impulse: >> impulse(Hd) The following plot will be displayed: 0 5 10 15 20 25-0.14-0.12-0.1-0.08-0.06-0.04-0.020Impulse ResponseTime (sec)Amplitude We can also get the step response: >> step(Hd) 0 5 10 15 20 2500.050.10.150.20.250.30.350.40.450.5Step ResponseTime (sec)AmplitudeEE 422G Notes: Chapter 6 Instructor: Cheung Page 6-42It should be noted that in order to actually plot the time response, Matlab always converts the continuous-time output signal into discrete-time signal by sampling at the “appropriate” sampling frequency. We can actually simulate the system for any input by using the lsim command, which plots both the input (gray color) and the output (blue): >> t = 0:0.01:10; % time range >> x = sin(2*t); % input >> lsim(Hd,x,t) 0 1 2 3 4 5 6 7 8 9 10-1-0.8-0.6-0.4-0.200.20.40.60.81Linear Simulation ResultsTime (sec)Amplitude Poles and Zeros Poles and Zeros can be retrieved using the command pole and zero. Their locations are conveniently displayed by the command pzmap. >> pole(Hd) ans = -0.2500 >> zero(Hd) ans = 0EE 422G Notes: Chapter 6 Instructor: Cheung Page 6-43>> pzmap(Hd) -0.25 -0.2 -0.15 -0.1 -0.05 0-1-0.8-0.6-0.4-0.200.20.40.60.81Pole-Zero MapReal AxisImaginary Axis Frequency Response Frequency response of a system is the Fourier Transform of the impulse response. It is an important analysis and design tool which will be the subject of our next lecture. To get a preview, we can use the command bode to plot the magnitude and phase of the frequency response: >> bode(Hd) -35-30-25-20-15-10-5Magnitude (dB)10-210-1100101-540-360-1800180Phase (deg)Bode DiagramFrequency (rad/sec)EE 422G Notes: Chapter 6 Instructor: Cheung Page 6-44Finally, to make things really convenient for you, Matlab has wrapped all the above commands (plus a lot more) into the function ltiview: >> ltiview A plot window will pop up. Click Import under the File menu and the following window will open: This window allows use to select all the LTI systems we have defined so far for analysis. You can click to select any one of them (or CTRL-click to select multiple).EE 422G Notes: Chapter 6 Instructor: Cheung Page 6-45The nicest thing about ltiview is that you can show many different kinds of plots by clicking the right mouse button and select the one you want. Also, you can click on any point of the curve with the left mouse button to get the precise numerical value as well as the identification of the corresponding system: Using ltiview, get the impulse response, step response, bode plot, and the pole zero plots of the following transfer functions: a. 21)(2++=sssH b. 11)(++=sssH c. 1)(−=sssH d.


View Full Document

UK EE 422G - Using Matlab’s Control System Toolbox to study continuous time linear system

Documents in this Course
Load more
Download Using Matlab’s Control System Toolbox to study continuous time linear system
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Using Matlab’s Control System Toolbox to study continuous time linear system and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Using Matlab’s Control System Toolbox to study continuous time linear system 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?