Control system Lab Manual V 1 PDF

Title Control system Lab Manual V 1
Author Engr. M. Farhan Faculty Member UET Kohat
Course BS(CS)
Institution University of Engineering and Technology Peshawar
Pages 173
File Size 8.4 MB
File Type PDF
Total Downloads 22
Total Views 127

Summary

Control system Lab Manual V 1...


Description

Control Systems Lab Manual (Based on OBE System) (Version 1.0: Spring 2019)

Prepared by: Engr. M.Farhan (Lecturer, UET Campus Kohat)

1

List of Experiment Lab - 1: Modeling – Transfer Function...................................................................................................... 06 Exercises Assessment Sheet Lab - 2: Transfer Function block in Simulink.......................................................................................... 21 Exercises Assessment Sheet Lab - 3: The Representation of a State Space Expression in MATLAB............................................. 43 Exercises Assessment Sheet Lab - 4: Transient Response Analysis with MATLAB............................................................................. 57 Exercises Assessment Sheet Lab - 5: System Stability Analysis using MATLAB.................................................................................. 77 Exercises Assessment Sheet Lab - 6: Steady State Analysis with MATLAB ........................................................................................... 85 Exercises Assessment Sheet Lab - 7: Time Response Characteristics and LTI Viewer...................................................................... 98 Exercises Assessment Sheet Lab - 8: Plotting Root Loci with MATLAB................................................................................................ 108 Exercises Assessment Sheet Lab - 9: Root Locus Design and SISO Design Tools.............................................................................. 117 Exercises Assessment Sheet Lab - 10: Stability Analysis on Bode / Nyquist Plots.......................................................................... 147 Exercises Assessment Sheet Lab - 11: To study DC Servo trainer and its uses...................................................................................160 Exercises Assessment Sheet Lab - 12: Testing the Motor direction in easy motion studio............................................................164 Exercises Assessment Sheet Lab - 13: Testing the voltage applied and current control in EMS.................................................167 Exercises Assessment Sheet Lab - 14: Open Ended Lab.............................................................................................................................170 Exercises Assessment Sheet 2

Instructions for Students 1. Attendance is mandatory for students in all the labs. If a student is absent from a lab due to any reason, he/she will have to get written permission of the Chairman to perform that lab. The Chairman may allow students to perform lab if he finds that the student has a genuine excuse. 2. Students should bring their text books to the lab, so that they can refer to theory and diagrams whenever required. 3. Labs will be graded in double entry fashion; one entry in the assessment sheet given at the end of every lab and another entry in the instructor’s record. This system of keeping records will keep students aware of their performance throughout the lab. 4. The tentative marks distribution for final grade is as follows:  Lab Performance – 30 %  Mid (Practical + Simulation) – 20%  Lab Project– 20%  Lab Final (Practical + Simulation) – 30 %

3

Control System Course learning Outcomes: Upon successful completion of the course Lab, the student will be able to:

S. No

CLO

Domain

Taxonomy level

PLO

1.

Practice basic knowledge to mathematically Model the behavior of different physical systems

Psychomotor

3

1

2.

Analyze the behavior of system using mathematical techniques

Psychomotor

4

2

3.

Design controllers to meet the specified control design objectives such as faster transient response and smaller steady state errors while ensuring system stability.

Psychomotor

5

3

4.

Use Modern Tools for system modeling, analysis, design validation and performance comparison of different types of controllers.

Psychomotor

5

5

4

Lab No. _____________

The Rubric assessment sheet at the end of every lab looks like this:

Rubrics for Assessment of Lab OBE System

Name:_______________ Date:_________________

Level of Proficiency Criteria

PLO

Model

1

Below Basic (1)

Excellent (4)

Very Good (3)

Basic (2)

Perfectly apply basic knowledge knowledge to Model the behavior of physical systems with supporting materials (mathematically , block diagram, formula)

Model the behavior of physical systems but have no supporting materials

Model the behavior of physical systems in bit and pieces with no supporting material

Could not Model the behavior of physical systems

Analyzes and interprets data correctly for all tasks / experiments in the lab

Analyzes and interprets data correctly for few tasks / experiments in the lab

Analyzes a data correctly however unable to interprets it for tasks / experiments in the lab Some Specifications, parameters, constraints of design are present. Insufficient calculations and / or procedures to obtain the designs are provided.

Unable to Analyzes and interprets data for any tasks / experiments in the lab

Data Interpreta tion

2

Design

3

Specifications, parameters, constraints of design are present. Detailed calculations and / or procedures to obtain the designs are provided.

Specifications, parameters, constraints of design are present. Sufficient calculations and / or procedures to obtain the designs are provided.

Apparatus Usage

5

Can independently setup, operate and handle the apparatus

Can setup, operate and handle the apparatus with minimal help.

5

Cannot setup apparatus according to design but know how to handle apparatus

No specifications, parameters, constraints of design are present. No sufficient calculations and / or procedures to obtain the designs are provided. Cannot setup or handle the apparatus

Marks

Lab – 1:

Modeling – Transfer Function

1.1 Introduction MATLAB provide “Control System Toolbox” for the analysis and design of different control system. We will be using some of thes commands, because of limited nature of course profile. Description of these commands will be distributed in different modules. In this section, we will present commands related to Transfer Functions. To see all the commands in the control system toolbox and their functionalities, type help control in the MATLAB window. >> help control Control System Toolbox Version 9.9 (R2015a) 09-Feb-2015

General. ctrlpref InputOutputModel DynamicSystem lti objects.

-

Set Control Overview of Overview of Overview of

System Toolbox preferences. input/output model objects. dynamic system objects. linear time-invariant system

Graphical User Interfaces. ltiview - LTI Viewer(time and frequency response analysis). sisotool - SISO Design Tool(interactive compensator tuning). pidtool - PID Design Tool(interactive PID controller tuning). sisoinit - Configure the SISO Design Tool at startup. Linear models. tf - Create transfer function (TF) models. zpk - Create zero/pole/gain (ZPK) models. ss - Create state-space (SS) models. dss - Create descriptor state-space models. delayss - Create state-space models with delayed terms. frd - Create frequency response data (FRD) models. pid - Create PID controller in parallel form. pidstd - Create PID controller in standard form. tf/exp - Create pure continuous-time delays(TF and ZPK ) filt - Specify digital filters. InputOutputModel/set - Set/modify properties of model object. setDelayModel - Specify internal delay model (state space only). 6

Data extraction. tfdata - Extract numerators and denominators. zpkdata - Extract zero/pole/gain data. ssdata - Extract state-space matrices. dssdata - Descriptor version of SSDATA. frdata - Extract frequency response data. piddata - Extract PID parameters in parallel form. pidstddata - Extract PID parameters in standard form. InputOutputModel/get - Access properties of model object. ss/getDelayModel - Access internal delay model (state space only). Model conversion. tf zpk ss frd pid pidstd c2d d2c d2d upsample chgTimeUnit imp2exp -

Conversion to transfer function. Conversion to zero/pole/gain. Conversion to state space. Conversion to frequency data. Conversion to PID controller in parallel form. Conversion to PID controller in standard form. Continuous to discrete conversion. Discrete to continuous conversion. Resample discrete-time model. Upsample discrete-time systems. Change time units. Implicit to explicit conversion.

System interconnection. append - Aggregate models by appending inputs and outputs. parallel - Connect models in parallel (see overloaded +). series - Connect models in series (see also overloaded *). feedback - connect models with a feedback loop. lft - Generalized feedback interconnection. connect - Arbitrary block-diagram interconnection. sumblk - Specify summing junction (for use with connect). strseq - Builds sequence of indexed strings (for I/O naming). System dynamics. dcgain pole zero tzero order pzmap iopzmap damp esort dsort stabsep freqsep modsep

-

Steady-state (D.C.) gain. System poles. Zeros and gain of SISO system. Invariant zeros of MIMO system. System order (number of states). Pole-zero map. Input/output pole-zero map. Natural frequency and damping of system poles. Sort continuous poles by real part. Sort discrete poles by magnitude. Stable/unstable decomposition. Slow/fast decomposition. Region-based modal decomposition.

Time-domain analysis. 7

step stepinfo impulse initial lsim lsiminfo gensig covar

-

Step response. Step response characteristics (rise time, ...) Impulse response. Free response with initial conditions. Response to user-defined input signal. Linear response characteristics. Generate input signal for LSIM. Covariance of response to white noise.

Frequency-domain analysis. bode - Bode diagrams of the frequency response. bodemag - Bode magnitude diagram only. sigma - Singular value frequency plot. nyquist - Nyquist plot. nichols - Nichols plot. freqresp - Frequency response over a frequency grid. evalfr - Evaluate frequency response at given frequency. margin - Gain and phase margins. allmargin - All crossover frequencies and related gain/phase margins. bandwidth - System bandwidth. getPeakGain - Peak gain of frequency response. getGainCrossover - Gain crossover frequencies. DynamicSystem/norm - H2 and Hinfinity norms of LTI models. Model simplification. minreal - Minimal realization and pole/zero cancellation. sminreal - Structurally minimal realization (state space). hsvd - Hankel singular values (state contributions) balred - Reduced-order approximations of linear models. modred - Model order reduction. Compensator design. pidtune - Tune PID controller based on linear plant model. rlocus - Evans root locus. place - Pole placement. estim - Form estimator given estimator gain. reg - Form regulator given state-feedback and estimator gains. ss/lqg - Single-step LQG design. lqr, dlqr - Linear-Quadratic (LQ) state-feedback regulator. lqry - LQ regulator with output weighting. lqrd - Discrete LQ regulator for continuous plant. lqi - Linear-Quadratic-Integral (LQI) controller. kalman - Kalman state estimator. kalmd - Discrete Kalman estimator for continuous plant. lqgreg - Build LQG regulator from LQ gain and Kalman estimator. lqgtrack - Build LQG servo-controller. augstate - Augment output by appending states. Time delays. 8

hasdelay totaldelay absorbDelay pade thiran delays.

-

True for models with time delays. Total delay between each input/output pair. Replace delays by poles at z=0 or phase shift. Pade approximation of continuous-time delays. Thiran approximation of fractional discrete-time

State-space (SS) models. rss - Random stable continuous-time state-space models. drss - Random stable discrete-time state-space models. ss2ss - State coordinate transformation. canon - Canonical forms of state-space models. ctrb - Controllability matrix. obsv - Observability matrix. gram - Controllability and observability gramians. prescale - Optimal scaling of state-space models. balreal - Gramian-based input/output balancing. xperm - Reorder states. Frequency response chgFreqUnit fcat fselect fnorm frd/abs frd/real frd/imag frd/interp mag2db db2mag -

data (FRD) models. Change frequency vector units. Merge frequency responses. Select frequency range or subgrid. Peak gain as a function of frequency. Entrywise magnitude of the frequency response. Real part of the frequency response. Imaginary part of the frequency response. Interpolate frequency response data. Convert magnitude to decibels (dB). Convert decibels (dB) to magnitude.

Generalized linear models. realp - Tunable real parameter. ltiblock.gain - Tunable static gain. ltiblock.pid - Tunable 1-DOF PID controller. ltiblock.pid2 - Tunable 2-DOF PID controller. ltiblock.tf - Tunable SISO transfer function. ltiblock.ss - Tunable state-space model. AnalysisPoint - Point of interest for analysis and tuning. genmat - Generalized matrix. genss - Generalized state-space model. genfrd - Generalized FRD model. getValue - Evaluate generalized model. getBlockValue - Get block value. setBlockValue - Update block value. showBlockValue - Display block values. showTunable - Display values of tunable blocks. getPoints - Get analysis point locations. getLoopTransfer - Compute open-loop transfer function. getIOTransfer - Compute closed-loop transfer function. getSensitivity - Compute loop sensitivity function. getCompSensitivity - Compute complementary sensitivity function. 9

replaceBlock

- Replace block by value or by another block.

Model characteristics and model arrays. isct - True for continuous-time models. isdt - True for discrete-time models. isproper - True for proper models. issiso - True for single-input/single-output models. isstable - True for models with stable dynamics. InputOutputModel/size - Size of model or model array. InputOutputModel/ndims - Number of dimensions. InputOutputModel/nmodels - Number of models in model array. InputOutputModel/isempty - True for empty models. InputOutputModel/reshape - Reshape model array. InputOutputModel/permute - Permute model array dimensions. Overloaded arithmetic operations. +, - Add and subtract systems (parallel connection). * - Multiply systems (series connection). / - Left divide -- sys1\sys2 means inv(sys1)*sys2. / - Right divide -- sys1/sys2 means sys1*inv(sys2). ^ - Powers of a given system. ' - Pertransposition. .' - Transposition of input/output map. .* - Element-by-element multiplication. [..] - Concatenate models along inputs or outputs. stack - Stack models/arrays along some array dimension. InputOutputModel/inv - Inverse of input/output model. InputOutputModel/conj - Complex conjugation of model coefficients. Matrix equation solvers lyap, dlyap lyapchol, dlyapchol care, dare gcare, gdare bdschur -

and linear algebra. Solve Lyapunov equations. Square-root Lyapunov solvers. Solve algebraic Riccati equations. Generalized Riccati solvers. Block diagonalization of a square matrix.

Visualization and plot manipulation. Type "help ctrlguis" for details on how to customize plots. Demonstrations. Type "demo toolbox control" for a list of available demos.

1.2 Model Development for Control System in MATLAB In this module, we will learn how to represent transfer functions in the MATLAB, partial fraction expansion of rational expressions, representation of transfer functions as LTI objects, and to obtain time domain responses of LTI systems. Important commands for this module are: 10

roots – Find polynomial roots poly – Convert roots to polynomial polyval – Evaluate polynomial value conv – Convolution and polynomial multiplication deconv – Deconvolution and polynomial division residue – Partial-fraction expansion (residues) tf – Creation of transfer functions or conversion to transfer functions pole – Compute the poles of LTI models zero – Transmission zeros of LTI systems tfdada – Quick access to transfer function data zpkdata – Quick access to zero-pole-gain data pzmap – Pole-zero map of LTI models zpk – Create zero-pole-gain models or convert to zero-pole-gain format step – Step response of LTI models impulse – Impulse response of LTI models lsim – Simulate time response of LTI models to arbitrary inputs gensig – Periodic signal generator for time response simulations with lsim

1.3 Polynomials 3 2 Consider a polynomial . MATLAB can interpret a vector of length as the coefficients of an th -order polynomial. Coefficients of the polynomial are interpreted in descending powers. Thus, if the polynomial is missing any coefficient, we must enter zeros in the appropriate places in the vector. For example, polynomial can be represented by the vector in MATLAB. For example:

>> p=[1 3 0 4] p = 1 3 0 4

Roots of the polynomial can be obtained by roots command. >> r=roots(p) r = -3.3553 0.1777 + 1.0773i 0.1777 - 1.0773i 11

Given roots of a polynomial in a vector, a vector of polynomial coefficients can be obtained by the command poly. Use the command polyval(p, s) to evaluate the polynomial represented by vector p at arbitrary value of s. For example, to evaluate the polynomial 2 s3 at √ type >> polyval(p,sqrt(2))

The product of two polynomials is found by taking the convolution of their coefficients. The function conv will do this for us. Consider an example of multiplying polynomial ‘ ' with ‘ : >> p1=[1 3 4]; >> p2=[1 2]; >> p3=conv(p1,p2) p3 = 1

5

6

4

8

The function deconv divides two polynomials and returns quotient as well as the remainder polynomial. >> [q,r]=deconv(p1,p2) q = 1

1

0

0

r = 2

where q is the quotient and r is the remainder polynomial.

12

Consider the rational fractions of the form:

Where the coefficients and are real constants, and and are integers. A fraction of the form can be expanded into partial fractions. To do this, first of all we factorize the denominator polynomial into first-order factors. The roots of can be real or complex; distinct or repeated. Let, vectors N and D specify the coefficients of numerator and denominator polynomials

and

respectively.

The command [A,p,K]=residue(N,D) returns residues in column vector A, the roots of the denominator in column vector p, and the direct term in scalar K. If there are no multiple roots, the fraction

If

can be represented as:

, K is empty (zero).

Supplying 3 arguments A, p, and K to residue convert the partial fraction expansion back to the polynomial with coefficients in N and D. Example 1: Consider the rational fraction:

MATLAB solution to partial fraction problem can be given by: >> N=[10 40]; >> D=[1 4 3 0]; >> [A,p,K]=residue(N,D) 13

A = 1.6667 -15.0000 13.3333 p = -3 -1 0 K = [ ]

Example 2: Consider the function

The following MATLAB session evaluates the residues. >> N = 13; >> D = [1 6 22 30 13 0]; >> [A,p,K]=residue(N,D) A = 0.0200 - 0.0567i 0.0200 + 0.0567i -1.0400 -1.3000 1.0000 p = -2.0000 + 3.0000i -2.0000 - 3.0000i -1.0000 -1.0000 0 K = [ ]

1.4 Transfer Function...


Similar Free PDFs