This preview shows page 1. Sign up to view the full content.
Unformatted text preview: MECH 431L – CONTROL SYSTEMS LABORATORY MODULE 2 – USING MATLAB IN CONTROL LEARNING OBJECTIVES Use MATLAB to perform the following: 1. Form and manipulate transfer functions of a SISO 2. Determine response of a LTI system to various test input signals 3. Calculate various properties of a SISO 4. Calculate poles (pole, zero) and plot pole/zero map 5. Use plotting tools USEFUL FUNCTIONS Command <Trans_Fn>=tf(num,den) [r,p,k]=residue(num, den) [num, den]=residue(r,p,k) [z,p,k]=tf2zp(num, den) [A,B,C,D]=tf2ss(num, den) [num, den]=ss2tf(A,B,C,D) Description Finds the transfer function defined by num and den Finds residues, poles, and constant of TF Obtains the transfer function from partial fraction Finds zeros, poles, and gain of transfer function Transforms num and den to state space representation Transforms from state space representation to num and den ACTIVITY 1 – PARTIAL FRACTION EXPANSION A transfer function of the form G ( s ) = k fraction expansion G ( s ) = ( s − z1 )( s − z2 ) ... can be written in the form of partial ( s − p1 )( s − p2 ) ... r1 r + 2 + ... + k ( s ) s − p1 s − p2 Use MATLAB function residue() to find the partial fraction expansion for the transfer function: ( s + 2 )( s + 4 ) G (s) = s ( s + 1)( s + 3) Use the same function to recalculate the numerator and denominator of the calculated partial fraction constants. MATLAB Code Num=[1, 6, 8]; %Numerator of transfer function Den=[1, 4, 3, 0]; %Denominator of transfer function [r,p,k]=residue(Num,Den); %Calculating the partial fraction constants [Num2,Den2]=residue(r,p,k); %Recalculating the numerator and denominator 1 MECH431L– SP09 Mechanical Engineering Department, American University of Beirut ACTIVITY 2 – RESPONSE OF LTI TO INPUTS Find the step and impulse responses of the transfer function G ( s ) = Use the functions tf(), step(), and impulse(). 2s + 1 . s + 3s + 2
2 ACTIVITY 3 – RESPONSE OF LTI TO ARBITRARY INPUT The response of a LTI system to an arbitrary input can be found using lsim() command. Find the response of a pendulum with l = 1 m, m = 0.2 kg, and applied torque of TC = 1 N. The torque is applied for 1 sec. The transfer function due to a square pulse applied is: θ (s) 1/ ml 2 G (s) = =2 Tc ( s ) s + g / l TIPS: Use lsim() in the following format y=lsim(TF,u,t). Use simulation time from 0 to 10 seconds To create a square pulse use u=[ones(l1,1);zeros(l2,1)] where l1 and l2 are the length of the simulation time. ACTIVITY 4 – SOLVING 2ND ORDER SYSTEMS Let G ( s ) = 1. 2. 3. 4. 5. 2 s+2 be the transfer function of a second order dynamic system. s + s +1 Create G(s) using tf() Use the functions pole() and zero() to determine the poles and zeros of G(s) Plot the pole zero map using pzmap() Plot the step response of G(s) Find the maximum value of this response. −p ) to the transfer function ( H ( s ) = G ( s ) P ( s ) ) s− p For values of p equal to: ‐5, ‐2, ‐1, 0.1 1. Find H(s), and plot the new pole zero map 2. Plot the step response on the same graph 3. Compare the different responses and comment s−z Effect of adding a zero at z ( Z ( s ) = ) to the transfer function ( F ( s ) = G ( s ) Z ( s ) ) −z For values of z equal to: ‐5, ‐2, ‐1, 0.1 1. Find F(s), and plot the new pole zero map 2. Plot the step response on the same graph 3. Compare the different responses and comment Effect of adding a pole at p ( P ( s ) = 2 MECH431L – SP09 Mechanical Engineering Department, American University of Beirut ...
View Full Document
This note was uploaded on 02/07/2011 for the course MECH 431L taught by Professor Danielasmar during the Spring '09 term at American University of Beirut.
- Spring '09