control system using matlab

Upload: anish-benny

Post on 11-Oct-2015

103 views

Category:

Documents


0 download

DESCRIPTION

Matlab PPT - Control System

TRANSCRIPT

  • FEAR OF THE LORD IS THE BEGINNING OF WISDOMCONTROL SYSTEM ANALYSIS USING MATLABBy

    Mr. Anish BennyAsst. Professor

    KITES - 2014, RIT PAMPADY

  • CONTROL SYSTEMThe study and design of automatic Control Systems is a vast field.Control systems, and control engineering techniques have become a ubiquitous part of modern technical society. From devices as simple as a toaster, to complex machines like space shuttles and rockets, control engineering is a part of our everyday life.MATLAB is an aid to design and analyze various control system using control system toolbox.KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • CONTROL SYSTEMA control system is an interconnection of components forming a system configuration to provide a desired system responseAircraft autopilotDisk drive read-write head positioning systemRobot arm control systemAutomobile cruise control system etc.KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • Basic Control System ComponentsPlant (or Process) - The portion of the system to be controlled ProcessProcess InputOutput

    KITES - 2014, RIT PAMPADY

  • Actuator An actuator is a device that provides the motive power to the process (i.e., a device that causes the process to provide the output).

    Sensor:- Sensors are the inputs to the system

    Controller:- Controller will provide necessary control signals to the actuator

    KITES - 2014, RIT PAMPADY

  • Open-Loop Control Systems

    An open-loop control system utilizes an actuating device to control the process directly without using feedback.Actuating DeviceProcessInputOutputProperty:The system outputs have no effect upon the signals entering the process. That is, the control inputs are not influenced by the process outputs.

    KITES - 2014, RIT PAMPADY

  • Closed Loop (Feedback) Control Systems A closed-loop control system uses a measurement of the output and feedback of this signal to compare it with the desired input (i.e., reference or command).ComparisonComparisonControllerPlantMeasurementDesired Output ResponseOutputClosed-loop: General FormInput

    KITES - 2014, RIT PAMPADY

  • CONCEPT OF A SYSTEMKITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • SIMPLE CONTROL SYSTEMFigure shows the feedback control system model

    KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • ROOM TEMPERATURE CONTROL SYSTEMKITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • CONTROL SYSTEM MODELLINGTime domain modeling is done on the system to get the mathematical equation of the system.Time domain model is the foundation of State Space (SS) approach.By applying a frequency domain transformation on the above time domain model will result in Transfer Function (TF) of the system.By using the model (SS or TF) of a system we can analyze the system for its stability and other properties.

    KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • EXAMPLE CIRCUIT MODELINGKITES - 2014, RIT PAMPADYFind the model of the system? Take v1(t) as input and v2(t) as the output.

    Solution

    KITES - 2014, RIT PAMPADY

  • EXAMPLE CIRCUIT MODELINGFind the model of the system? Take v1(t) as input and v2(t) as the output.

    Solution

    KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • TRANSFER FUNCTION OF THE MODELCase 1By applying Laplace transform we get,RCSV2(s)+V2 (s) = V1 (s)Output/Input = V2 (s)/ V1 (s) = 1/(SRC + 1)

    Case 2By applying Laplace transform we get,LCS2V2 (s)+RCSV2(s)+V2 (s) = V1 (s)Output/Input = V2 (s)/ V1 (s) = 1/(S2LC + SRC + 1)KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • STATE SPACE OF THE MODELCase 1Take

    Equations are

    KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • STATE SPACE OF THE MODELCase 2TakeEquations are

    KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • MATLAB COMMANDSss - Specify state-space models or convert LTI model to state spacetf - Create or convert to transfer function modelzpk - Create or convert to zero-pole-gain modelbodeplot - Plot Bode frequency response and return plot handleimpulseplot - Plot impulse response and return plot handlenicholsplot - Plot Nichols frequency responses and return plot handlenyquistplot - Plot Nyquist frequency responses and return plot handleKITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • pzplot - Plot pole-zero map of LTI model and return plot handlerlocusplot - Plot root locus and return plot handlestepplot - Plot step response of LTI systems and return plot handlectrb - Controllability matrixobsv - Observability matrixacker - Pole placement design for single-input systemsplace - Pole placement designrlocus - Evans root locusKITES - 2014, RIT PAMPADYMATLAB COMMANDS

    KITES - 2014, RIT PAMPADY

  • allmargin - All crossover frequencies and corresponding stability marginsbode - Bode diagram of frequency responsebodemag - Bode magnitude response of LTI modelsevalfr - Evaluate frequency response at given frequencyfreqresp - Evaluate frequency response over frequency gridfrd - Create or convert to frequency-response data modelsmargin - Gain and phase margins and associated crossover frequenciesnichols - Nichols plot of LTI modelsnyquist - Nyquist plot of LTI modelsimpulse - Impulse response of LTI modelstep - Step response of LTI systems

    KITES - 2014, RIT PAMPADYMATLAB COMMANDS

    KITES - 2014, RIT PAMPADY

  • MATLAB COMMANDSbandwidth - Frequency response bandwidthlti/order - LTI model orderpole - Compute poles of LTI systemzero - Transmission zeros of LTI modelpzmap - Compute pole-zero map of LTI modelsss2tf - Convert state-space filter parameters to transfer function formtf2ss - Convert transfer function filter parameters to state-space formfeedback - Feedback connection of two LTI modelsKITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • CONTINUOUS TIME SYSTEM ANALYSISTransfer Function RepresentationTime SimulationsFrequency Response PlotsControl Design State Space Representation

  • TRANSFER FUNCTION REPRESENTATIONTf2zpZp2tfFeedbackParallelseries

  • CONTTransfer functions are defined in MATLAB by storing the coefficients of the numerator and the denominator in vectors. Given a continuous-time transfer function B(s) H(s) = --------- A(s)

  • CONTWhere B(s) = bMsM+bM-1sM-1++b0 and A(s) = aNsN+aN-1sN-1++a0 Store the coefficients of B(s) and A(s) in the vectors num = [bM bM-1 b0] den = [aN aN-1 a0]

  • EXAMPLE 5s+6 H(s) = ---------------- s3+10s2+5num = [5 6]; den = [1 10 0 5];

    all coefficients must be included in the vector, even zero coefficients

  • CONTTo find the zeros, poles and gain of a transfer function from the vectors num and den which contain the coefficients of the numerator and denominator polynomials: [z,p,k] = tf2zp(num,den)

  • EXAMPLEnum = [5 6]; den = [1 10 0 5]; [z,p,k] = tf2zp(num,den)

    z = -1.2000p = -10.0495 0.0248+0.7049i 0.0248-0.7049ik = 5

  • EXAMPLE CONT (s-z1)(s-z2)...(s-zn) H(s) = K -------------------------- (s-p1)(s-p2)...(s-pn)

    5*(s+1.2) ---------------------------------------------------------- (s+10.0495)(s-{0.0248+0.7049i})(s-{0.0248-0.7049i})

  • CONTTo find the numerator and denominator polynomials from z, p, and k: [num,den] = zp2tf(z,p,k)To reduce the general feedback system to a single transfer function: T(s) = G(s)/(1+G(s)H(s)) [numT,denT]=feedback(numG,denG,numH,denH);

  • CONTTo reduce the series system to a single transfer function, T(s) = G(s)H(s)[numT,denT] = series(numG,denG,numH,denH);To reduce the parallel system to a single transfer function, T(s) = G(s) + H(s)[numT,denT] = parallel(numG,denG,numH,denH);

  • TIME SIMULATIONSresidue StepImpulselsim

  • CONT[R,P,K] = residue (B,A) finds the residues, poles and direct term of a partial fraction expansion of the ratio of two polynomials B(s)/A(s)The residues are stored in r, the corresponding poles are stored in p, and the gain is stored in k.

  • EXAMPLEIf the ratio of two polynomials is expressed as b(s) 5s3+3s2-2s+7 ------- = ------------------- a(s) -4s3+8s+3

    b = [ 5 3 -2 7]a = [-4 0 8 3]

  • EXAMPLE CONTr = -1.4167 -0.6653 1.3320p = 1.5737 -1.1644 -0.4093k = -1.2500

    B(s) R(1) R(2) R(n)------ = -------- + --------- + ... + --------- + K(s)A(s) s - P(1) s - P(2) s - P(n)

  • FIND THE RESPONSE OF A SYSTEM TO A PARTICULAR INPUTFirst store the numerator and denominator of the transfer function in num and den, respectively.To plot the step response: step(num,den)To plot the impulse response: impulse(num,den)

  • CONTFor the response to an arbitrary input, use the command lsim (linear simulation)Create a vector t which contains the time values in seconds t = a:b:c;Define the input x as a function of time, for example, a ramp is defined as x = t lsim(num,den,x,t);

  • FREQUENCY RESPONSE PLOTSFreqsBodeLogspaceLog10Semilogx

  • CONTTo compute the frequency response H of a transfer function, store the numerator and denominator of the transfer function in the vectors num and den.Define a vector w that contains the frequencies for which H) is to be computed, for example w = a:b:c where a is the lowest frequency, c is the highest frequency and b is the increment in frequency. H = freqs(num,den,w)

  • CONTTo draw a Bode plot of a transfer function which has been stored in the vectors num and den: bode(num,den)

  • CONTTo customize the plot, first define the vector w which contains the frequencies at which the Bode plot will be calculated.Since w should be defined on a log scale, the command logspace is used.For example, to make a Bode plot ranging in frequencies from 0.1 to 100, define w by w = logspace(-1,2);The magnitude and phase information for the Bode plot can then be found by: [mag,phase] = bode(num,den,w);

  • CONTTo plot the magnitude in decibels, convert mag using the following command: magdb = 20*log10(mag);To plot the results on a semilog scale where the y-axis is linear and the x-axis is logarithmic: semilogx(w,magdb)For the log-magnitude plot : semilogx(w,phase)

  • CONTROL DESIGN Rlocus

    Consider a feedback loop where G(s)H(s) = KP(s) and K is a gain and P(s) contains the poles and zeros of the controller and of the plant.Suppose that the numerator and denominator coefficients of P(s) are stored in the vectors num and den. rlocus(num,den)

  • STATE SPACE REPRESENTATIONSsStepLsimSs2tfTf2ssss2ss

  • VERY SHORT SIMULINK TUTORIALIn the Matlab command window write simulink.The window that has opened is the Simulink Library Browser. It is used to choose various Simulink modules to use in your simulation.From this window, choose the File menu, and then New (Model). Now we have a blank window, in which we will build our model. This blank window and the library browser window, will be the windows well work with.We choose components from the library browser, and then drag them to our work window. Well use only the Simulink library (also called toolbox) for now.KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • SIMULINK TUTORIALAs we can see, the Simulink library is divided into several categories:Continuous Provides functions for continuous time, such as integration, derivative, etc.Discrete Provides functions for discrete time.Functions & Tables Just what the name says.Math Simple math functions.Nonlinear Several non-linear functions, such as switches, limiters, etc.Signals & Systems Components that work with signals. Sinks Components that handle the outputs of the system (e.g. display it on the screen).Sources Components that generate source signals for the system.KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • EXAMPLE OF SIMULINK KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • EXAMPLE OF SIMULINK KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY

  • EXAMPLE OF SIMULINK KITES - 2014, RIT PAMPADY

    KITES - 2014, RIT PAMPADY