module1 - clg; echo on %-% % Dept. of Electrical & Computer...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
clg; echo on %--------------------------------------------------------- % % % University of California, Santa Barbara. % % ECE 147 A: Feedback Control Systems % % module1: Dynamic responses % % ------------------------------------------------- % % This module will illustrate MATLAB routines for analyzing % dynamic control systems. For this module, a % spring-mass-dashpot (SMD) example system will be used. We will % first discuss methods for creating the numerator denominator % form, and converting those vectors to the system matrix form. % Then we will show how to set up time and frequency response graphs, % and give some insight into their use. The relationship between % pole and zero position and the system time response will be % investigated. We will also demonstrate how % to "close the loop", and calculate the resulting closed % loop pole positions. % % This module will introduce a number of mu-Tools commands % that will be unfamiliar to you - even if you are a Matlab % guru. Take the time to study these commands, and the % underlying data structure, as there are a number of these % commands that you will find very handy for control design. % % Please, take some time and adjust the Graph and Command % windows for maximum size viewing. pause % press any key to continue % Matlab bases many routines on a polynomial coeficient vector. % A polynomial of the form, % % p = an * s^n + an-1 * s^n-1 +. ..+ a1 * s + a0, % % can be written as a vector, % % p = [an an-1 . ... a2 a1 a0]; % % Matlab uses a numerator, denominator format for many routines % which involve transfer functions. mu-Tools functions go one % better than this by storing all of the transfer function data % in a single matrix variable. Examples of this will be given % throughout. I strongly suggest that you spend some time % looking at the Matlab and mu-Tools manuals when you run this % module. Other commands are often located by referring to % the "See Other:" section of the command documentation. pause % press any key to continue % Begin defining the SMD system in MATLAB. Create the numerator % denominator plant form for the SMD system.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
k = 1000; % spring constant m = 10; % the mass w0 = sqrt(k/m); b = .1; % the damping coefficient sen = .9; % physical measurement to voltage gain % The transfer function for this system is % Y(s) (sen*k/m) % = ----------------------------- % U(s) (s^2 + 2*b*w0*s + w0^2) % % So, the numerator is, num = [0 0 sen*k/m] % and the denominator is, den = [1 2*b*w0 w0^2] pause % press any key to continue % To determine the poles and zeros we find the roots of the numerator % and denominator of the system. SMD_zeros = roots(num) SMD_poles = roots(den) % Once we know the poles and zeros of the system, we can use other % methods to create the num, den form. POLY creates the nth ordered % polynomial coefficient vector from the n-1 roots of the system. den2 = poly(SMD_poles)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/06/2010 for the course ECE 145 taught by Professor Rodwell during the Spring '07 term at UCSB.

Page1 / 12

module1 - clg; echo on %-% % Dept. of Electrical & Computer...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online