Sunteți pe pagina 1din 71

GOVT.ENGG.

COLLEGE,BHUJ 2018

CONTROL
SYSTEM ENGINEERING

B. E. - Semester -V
Electrical Engineering Department

Government Engineering College


Bhuj -370001
GOVT.ENGG.COLLEGE,BHUJ 2018

CERTIFICATE

This is to Certify that


Shri/Miss/Ms_________________________________________
Enrollment No.____________________ of 5th Semester, B. E.
Electrical has satisfactorily completed the term work in Control
System Engineering (2150909) within four walls of
Government Engineering College, Bhuj – 370001.

Date:

Staff-in-Charge Head of Department


GOVT.ENGG.COLLEGE,BHUJ 2018

INDEX
Sr. Page
Title Date Sign
No. No.
1. Introduction to Control Systems. 1

2. Introduction of MATLAB Software. 12

To study the Basic Operational


3. 36
Commands of MATLAB Software.
Find the transfer function from given z
4. (Zero), p (Pole) and k (Gain) using 43
MATLAB.
Find out the Overall Transfer Function for
5. the given Block Diagram using MATLAB 47
Functions.
Obtain the state model of given system
6. 52
using MATLAB.
Generating Standard Test Signals (Unit
7. Impulse, Step, Ramp & Exponential) 55
using MATLAB.
Graphically represent the Time Response
8. of a First Order and Second Order Control 57
System.
For Unity feedback Control System with
9. Given Transfer Function Plot Root Locus 62
of the System.
For Unity feedback Control System with
10. Given Transfer Function Obtain Bode Plot 65
of the System.
Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-1

AIM- INTRODUCTION TO CONTROL SYSTEMS

INTRODUCTION:

Control systems in an interdisciplinary field covering many


areas of engineering and sciences. Control systems exist in many
systems of engineering, sciences, and in human body. Some type
of control systems affects most aspects of our day-to-day
activities. This chapter presents a brief introduction and
overview of control systems. Some of the terms commonly used to
describe the operation, analysis, and design of control systems
are presented.

CONTROL SYSTEM:

Control means to regulate, direct, command, or govern. A system


is a collection, set, or arrangement of elements (subsystems). A
control system is an interconnection of components forming a
system configuration that will provide a desired system
response. Hence, a control system is an arrangement of physical
components connected or related in such a manner as to command,
regulate, direct, or govern itself or another system. In order
to identify, delineate, or define a control system, we introduce
two terms: input and output here. The input is the stimulus,
excitation, or command applied to a control system, and the
output is the actual response resulting from a control system.
The output may or may not be equal to the specified response
implied by the input. Inputs could be physical variables or
abstract ones such as reference, set point or desired values for
the output of the control system. Control systems can have more
than one input or output. The input and the output represent the
desired response and the actual response respectively. A control
system provides an output or response for a given input or
stimulus, as shown in Fig. 1.1.

Government Engg. College, Bhuj Page 1


Control System Engineering (2150909) B. E. Electrical Sem-5th

The output may not be equal to the specified response implied by


the input. If the output
and input are given, it is possible to identify or define the
nature of the system’s components.
Broadly speaking, there are three basic types of control
systems:
(a) Man-made control systems
(b) Natural, including biological-control systems
(c) Control systems whose components are both man-made and
natural.

An electric switch is a man-made control system controlling


the electricity-flow. The simple act of pointing at an object
with a finger requires a biological control system consisting
chiefly of eyes, the arm, hand and finger and the brain of a
person, where the input is precise direction of the object with
respect to some reference and the output is the actual pointed
direction with respect to the same reference. The control system
consisting of a person driving an automobile has components,
which are clearly both man-made and biological. The driver wants
to keep the automobile in the appropriate lane of the roadway.
The driver accomplishes this by constantly watching the
direction of the automobile with respect to the direction of
road. Fig. 1.2 is an alternate way of showing the basic entities
in a general control system.

In the steering control of an automobile for example, the


direction of two front wheels can be regarded as the result or
controlled output variable and the direction of the steering

Government Engg. College, Bhuj Page 2


Control System Engineering (2150909) B. E. Electrical Sem-5th

wheel as the actuating signal or objective. The control-system


in this case is composed of the steering mechanism and the
dynamics of the entire automobile. As another example, consider
the idle-speed control of an automobile engine, where it is
necessary to maintain the engine idle speed at a relatively low-
value (for fuel economy) regardless of the applied engine loads
(like air-conditioning, power steering, etc.). Without the idle-
speed control, any sudden engine-load application would cause a
drop in engine speed that might cause the engine to stall. In
this case, throttle angle and load-torque are the inputs
(objectives) and the engine-speed is the output. The engine is
the controlled process of the system. A few more applications of
control systems can be found in the print wheel control of an
electronic typewriter, the thermostatically controlled heater or
furnace which automatically regulates the temperature of a room
or enclosure, and the sun tracking control of solar collector
dish.
Control system applications are found in robotics, space-
vehicle systems, aircraft autopilots and controls, ship and
marine control systems, intercontinental missile guidance
systems, automatic control systems for hydrofoils, surface-
effect ships, and high-speed rail systems including the magnetic
levitation systems.

CONTROL SYSTEM CONFIGURATION

There are two control system configurations: open-loop control


system and closed-loop control system.
(a) Block. A block is a set of elements that can be grouped
together, with overall characteristics described by an
input/output relationship as shown in Fig. 1.3. A block diagram
is a simplified pictorial representation of the cause-and-effect
relationship between the input(s) and output(s) of a physical
system.

Government Engg. College, Bhuj Page 3


Control System Engineering (2150909) B. E. Electrical Sem-5th

The simplest form of the block diagram is the single block as


shown in Fig. 1.3. The input and output characteristics of
entire groups of elements within the block can be described by
an appropriate mathematical expressions as shown in Fig. 1.4.

(b) Transfer Function. The transfer function is a property of


the system elements only, and is not dependent on the excitation
and initial conditions. The transfer function of a system (or a
block) is defined as the ratio of output to input as shown in
Fig.1.5.

Transfer functions are generally used to represent a


mathematical model of each block in the block diagram
representation. All the signals are transfer functions on the
block diagrams. For instance, the time function reference input
is r(t), and its transfer function is R(s) where t is time and s
is the Laplace transform variable or complex frequency. Transfer
functions can be used to represent closed-loop as well as open-
loop systems.

(c) Open-loop Control System. Open-loop control systems


represent the simplest form of controlling devices. A general
block diagram of open-loop system is shown in Fig. 1.6.

Government Engg. College, Bhuj Page 4


Control System Engineering (2150909) B. E. Electrical Sem-5th

(d) Closed-loop (Feedback Control) System. Closed-loop control


systems derive their valuable accurate reproduction of the input
from feedback comparison. The general architecture of a closed-
loop control system is shown in Fig. 1.7. A system with one or
more feedback paths is called a closed-loop system.

CONTROL SYSTEM TERMINOLOGY

The variables in Figs. 1.6 and 1.7 are defined as follows:


C(s) controlled output, transfer function of c(t)
D(s) disturbance input, transfer function of d(t)
Ea(s) actuating error, transfer function of ea(t)
Ga(s) transfer function of the actuator
Gc(s) transfer function of the controller
Gp(s) transfer function of the plant or process

Government Engg. College, Bhuj Page 5


Control System Engineering (2150909) B. E. Electrical Sem-5th

H(s) transfer function of the sensor or output transducer=Gs(s)


R(s) reference input, transfer function of r (t).

Actuating or Error Signal: The actuating or error signal is the


reference input signal plus or minus the primary feedback
signal.
Controlled Output C(s): The controlled output C(s) is the output
variable of the plant under the control of the control system.
Controller: The elements of an open-loop control system can
usually be divided into two parts: controller and the controlled
process. The controller drives a process or plant.
Disturbance or Noise Input: A disturbance or noise input is an
undesired stimulus or input signal affecting the value of the
controlled output.
Feed Forward (Control) Elements: The feed forward (control)
elements are the components of the forward path that generate
the control signal applied to the plant or process. The feed
forward (control) elements include controller(s),
compensator(s), or equalization elements, and amplifiers.

Government Engg. College, Bhuj Page 6


Control System Engineering (2150909) B. E. Electrical Sem-5th
Feedback Elements: The feedback elements establish the
fundamental relationship between the controlled output C(s) and
the primary feedback signal B(s). They include sensors of the
controlled output, compensators, and controller elements.
Feedback Path: The feedback path is the transmission path from
the controlled output back to the summing point.
Forward Path: The forward path is the transmission path from the
summing point to the controlled output.
Input Transducer: Input transducer converts the form of input to
that used by the controller.
Loop: A loop is a path that originates and terminates on the
same node, and along which no other node is encountered more
than once.
Loop Gain: The loop gain is the path gain of a loop.
Negative Feedback: Negative feedback implies that the summing
point is a sub tractor.
Path: A path is any collection of a continuous succession of
branches traversed in the same direction.
Path Gain: The product of the branch gains encountered in
traversing a path is called the path gain.
Plant, Process or Controlled System Gp(s): The plant, process,
or controlled system is the system, subsystem, process, or
object controlled by the feedback control system. For example,
the plant can be a furnace system where the output variable is
temperature.
Positive Feedback: Positive feedback implies that the summing
point is an adder.
Primary Feedback Signal: The primary feedback signal is a
function of the controlled output summed algebraically with the
reference input to establish the actuating or error signal. An
open-loop system has no primary feedback signal.
Reference Input R(s): The reference input is an external signal
applied to the control system generally at the first summing
input, so as to command a specified action of the process or
plant. It typically represents ideal or desired process or plant
output response.
Summing Point: As shown in Fig. 1.8 the block is a small circle
called a summing point with the appropriate plus or minus sign
associated with the arrows entering the circle. The output is
the algebraic sum of the inputs. There is no limit on the number
of inputs entering a summing point.

Government Engg. College, Bhuj Page 7


Control System Engineering (2150909) B. E. Electrical Sem-5th
Takeoff Point: A takeoff point allows the same signal or
variable as input to more than one block or summing point, thus
permitting the signal to proceed unaltered along several
different paths to several destinations as shown in Fig. 1.9.
Time Response: The time response of a system, subsystem, or
element is the output as a function of time, generally following
the application of a prescribed input under specified operating
conditions.
Transducer: A transducer is a device that converts one energy
form into another.

CONTROL SYSTEM CLASSIFICATION:

Control systems are sometimes divided into two classes:


(a) Servomechanisms and (b) Regulators.

(a) Servomechanisms: Feedback control systems used to control


position, velocity, and acceleration are very common in industry
and military applications. They are known as servomechanisms. A
servomechanism is a power-amplifying feedback control system in
which the controlled variable is a mechanical position or a time
derivative of position such as velocity or acceleration. An
automatic aircraft landing system is an example of
servomechanism. The aircraft follows a ramp to the desired
touchdown point. Another example is the control system of an
industrial robot in which the robot arm is forced to follow some
desired path in space.

(b) Regulators: A regulator or regulating system is a feedback


control system in which the reference input or command is
constant for long periods of time, generally for the entire time
interval during which the system is operational. Such an input
is known as set point. The objective of the idle-speed control
system is known as a regulator system. Another example of a
regulator control system is the human biological system that
maintains the body temperature at approximately 98.6ºF in an
environment that usually has a different temperature.

Government Engg. College, Bhuj Page 8


Control System Engineering (2150909) B. E. Electrical Sem-5th
Supplementary Terminology:

(a) Linear System: A linear system is a system where input/


output relationships may be represented by a linear differential
equation. The plant is linear if it can be accurately described
using a set of linear differential equations. This attribute
indicates that system parameters do not vary as a function of
signal level. For linear systems, the equations that constitute
the model are linear. Similarly, the plant is a lumped-parameter
(rather than distributed parameter) system if it can be
described using ordinary (rather than partial) differential
equations. This condition is generally accomplished if the
physical size of the system is very small in comparison to the
wavelength of the highest frequency of interest.

(b) Time-Variant System: A time-variant is a system if the


parameters vary as a function of time. Thus, a time-variant
system is a system described by a differential equation with
variable coefficients. A linear time variant system is described
by linear differential equations with variable coefficients. Its
derivatives appear as linear combinations, but a coefficient or
coefficients of terms may involve the independent variable. A
rocket-burning fuel system is an example of time variant system
since the rocket mass varies during the flight as the fuel is
burned.

(c) Time-Invariant System: A time-invariant system is a system


described by a differential equation with constant coefficients.
Thus, the plant is time invariant if the parameters do not
change as a function of time. A linear time invariant system is
described by linear differential equations with constant
coefficients. A single degree of freedom spring mass viscous
damper system is an example of a time-invariant system provided
the characteristics of all the three components do not vary with
time.

(d) Multivariable Feedback System: The block diagram


representing a multivariable feedback system where the
interrelationships of many controlled variables are considered
is shown in Fig. 1.10.

Government Engg. College, Bhuj Page 9


Control System Engineering (2150909) B. E. Electrical Sem-5th

Fig. 1.10 Multivariable control system

FEEDBACK SYSTEM:

Feedback is the property of a closed-loop system, which allows


the output to be compared with the input to the system such that
the appropriate control action may be formed as some function of
the input and output. For more accurate and more adaptive
control, a link or feedback must be provided from output to the
input of an open-loop control system. So the controlled signal
should be fed back and compared with the reference input, and an
actuating signal proportional to the difference of input and
output must be sent through the system to correct the error. In
general, feedback is said to exist in a system when a closed
sequence of cause-and-effect relations exists between system
variables.
A closed-loop idle-speed control system is shown in Fig.
1.11. The reference input Nr sets the desired idle-speed. The
engine idle speed N should agree with the reference value Nr and
any difference such as the load-torque T is sensed by the speed-
transducer and the error detector. The controller will operate
on the difference and provide a signal to adjust the throttle
angle to correct the error.

Fig. 1.11 closed-loop idle-speed control system

Government Engg. College, Bhuj Page 10


Control System Engineering (2150909) B. E. Electrical Sem-5th
CONTROL SYSTEM ANALYSIS AND DESIGN OBJECTIVE:

Control systems engineering consists of analysis and design of


control systems configurations. Control systems are dynamic, in
that they respond to an input by first undergoing a transient
response before attaining a steady-state response which
corresponds to the input. There are three main objectives of
control systems analysis and design. They are:
1. Producing the response to a transient disturbance which is
acceptable
2. Minimizing the steady-state errors: Here, the concern is
about the accuracy of the steady-state response
3. Achieving stability: Control systems must be designed to be
stable. Their natural response should decay to a zero values as
time approaches infinity, or oscillate. System analysis means
the investigation, under specified condition, of the performance
of a system whose mathematical model is known. Analysis is
investigation of the properties and performance of an existing
control system. By synthesis we mean using an explicit procedure
to find a system that will perform in a specified way. System
design refers to the process of finding a system that
accomplishes a given task. Design is the selection and
arrangement of the control system components to perform a
prescribed task. The design of control systems is accomplished
in two ways: design by analysis in which the characteristics of
an existing or standard system configuration are modified, and
design by synthesis, in which the form of the control system is
obtained directly from its specifications.

Government Engg. College, Bhuj Page 11


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-2

AIM- INTRODUCTION TO MATLAB SOFTWARE

MATLAB:

MATLAB is a software package for high performance


numerical computation and visualization. It provides an
interactive environment with hundreds of built-in functions for
technical computation, graphics, and animation. Best of all, it
also provides easy extensibility with its own high-level
programming language.

The name MATLAB stands for Matrix Laboratory.

Typical uses include:

• Math and computation


• Algorithm development
• Data acquisition
• Modelling, simulation, and prototyping
• Data analysis, exploration, and visualization
• Scientific and engineering graphics
• Application development, including graphical user
interface building
The basic building block of MATLAB is the matrix. The
fundamental data-type is the array. Vectors, scalars, real
matrices and complex matrices are all automatically handled as
special cases of the basic data-type. Also it never requires
declaring the dimensions of a matrix. MATLAB simply loves
matrices and matrix operations. The built-in functions are
optimized for vector operations. Consequently, vectorized
commands or codes run much faster in MATLAB than in C.

Government Engg. College, Bhuj Page 12


Control System Engineering (2150909) B. E. Electrical Sem-5th
MATLAB engines incorporate the LPACK and BLAS libraries,
embedding the state of the art in software for matrix
computation.

In university environments, it is the standard


instructional tool for introductory and advanced courses in
mathematics, engineering, and science. In industry, MATLAB is
the tool of choice for high-productivity research, development,
and analysis.

Government Engg. College, Bhuj Page 13


Control System Engineering (2150909) B. E. Electrical Sem-5th
MAIN FEATURES AND CAPABILITIES OF MATLAB:

MATLAB

User written functions

Built-in functions

E E
X X
Graphics T Computations T External Interface
R R
• 2-D Graphics • Linear Algebra (Mex-files)
• 3-D Graphics A • Data Analysis A
• Color & Lighting • Signal Processing • Interface with C and
F F FORTRAN Programs
• Animation • Polynomials and
U U
Interpolation
N • Quadrature N
C • Solution of ODEs C
TI TI
O O
N N
S S

Toolboxes

(Collections of specialized Functions)


• Signal Processing • Image Processing
• Statistics • Splines
• Control System • Robust Control
• System Identification • Mu-Analysis &
• Neural Networks Synthesis
• Communications • Optimization
• Symbolic Mathematics • Financial
(Maple inside)

And many more

Fig.2.1: A schematic diagram of MATLAB main features

Government Engg. College, Bhuj Page 14


Control System Engineering (2150909) B. E. Electrical Sem-5th
The MATLAB System

The MATLAB system consists of five main parts:

 Development Environment.

 The MATLAB Mathematical Function Library.


 The MATLAB Language.
 Graphics.
 The MATLAB Application Program Interface (API).
Development Environment:

This is the set of tools and facilities that help


you use MATLAB functions and files. Many of these tools are
graphical user interfaces.

It includes:

MATLAB desktop, Command Window, Command history, An


editor and debugger, Start button and Launch Pad, Browsers for
viewing help, The workspace browser, Array editor, Editor and
debugger, Profilers

The MATLAB Mathematical Function Library:

This is a vast collection of computational algorithms


ranging from elementary functions, like sum, sine, cosine, and
complex arithmetic, to more sophisticated functions like matrix
inverse, matrix Eigen values, Bessel functions, and fast Fourier
transforms.

The MATLAB Language:

This is a high-level matrix/array language with


control flow statements, functions, data structures,
input/output, and object-oriented programming features. It
allows both "programming in the small" to rapidly create quick

Government Engg. College, Bhuj Page 15


Control System Engineering (2150909) B. E. Electrical Sem-5th
and dirty throw-away programs, and "programming in the large" to
create large and complex application programs.

Graphics:

MATLAB has extensive facilities for displaying


vectors and matrices as graphs, as well as annotating and
printing these graphs. It includes high-level functions for two-
dimensional and three-dimensional data visualization, image
processing, animation, and presentation graphics. It also
includes low-level functions that allow you to fully customize
the appearance of graphics as well as to build complete
graphical user interfaces on your MATLAB applications.

The MATLAB Application Program Interface (API):

This is a library that allows you to write C and


FORTRAN programs that interact with MATLAB. It includes
facilities for calling routines from MATLAB (dynamic linking),
calling MATLAB as a computational engine, and for reading and
writing MAT-files.

Development Environment:

MATLAB Desktop:

When we start the MATLAB, the MATLAB desktop


appears, containing tools (graphical user interfaces) for
managing files, variables, and applications associated with
MATLAB.

The following illustration shows the default configuration of


the MATLAB desktop.

Government Engg. College, Bhuj Page 16


Control System Engineering (2150909) B. E. Electrical Sem-5th
Menu changes
Show the View or change
depending on
title bar for Get the current
tool choice Enter MATLAB
current tool Help directory
statement at
prompt

Drag the separator


Click the start button bar to resize the
to quick access window

Fig.2.2: MATLAB Desktop

Command window:

This is the main window. It is characterized by the MATLAB


command prompt “>>”. Command Window is used t enter variables
and run functions and M-files.

Government Engg. College, Bhuj Page 17


Control System Engineering (2150909) B. E. Electrical Sem-5th

Type variables and Functions at MATLAB


the MATLAB prompt displays the
results

Fig.2.3: Command Window

Command History:

All commands typed on the MATLAB prompt in the


command window get recorded, even across multiple sessions in
this window. We can select a command form this window with the
mouse and execute it in the command window by double clicking on
it. We can also select a set of commands from this window and
create and M-file with the right click of the mouse (and
selecting the appropriate option form the menu)

Government Engg. College, Bhuj Page 18


Control System Engineering (2150909) B. E. Electrical Sem-5th

Select one or more


Timestamp marks the entries and right click to
start of each session
copy, evaluate

Fig.2.4: Command History

Simulink:

In the simulation process, the computer is provided with


appropriate input data and other information about system
structure, operates on this input data and generates output
data, which it subsequently displays. Several software packages
that have been produced over the last two decades include
computer programs that allow these simulation operations. Over
the years, these simulation packages have become quite
sophisticated, powerful and very "user-friendly". The usefulness
and importance of these software packages is undeniable, because
they greatly facilitate the analysis and design of control
systems. They provide a tremendous tool in the hands of control
engineers. However, a word of caution must be sounded. The
availability of such packages and the ease with which one can

Government Engg. College, Bhuj Page 19


Control System Engineering (2150909) B. E. Electrical Sem-5th
use them should in no way detract one from learning the
underlying concepts. Mastery of the theoretical foundation is a
prerequisite for its correct implementation.

MATLAB/SIMULINK is one of the most successful


software packages currently available, and is particularly
suited for work in control. It is a powerful, comprehensive and
user-friendly software package for simulation studies. Our
objective here is to help the reader gain a basic understanding
of this software package by showing how to set up and solve a
simulation problem. Interested readers are encouraged to further
explore this very complete and versatile mathematical
computation package.

What Is Simulink?

Simulink is a software package for modelling,


simulating, and analyzing dynamic systems. It supports linear
and nonlinear systems, modelled in continuous time, sampled
time, or a hybrid of the two. Systems can also be multirate,
i.e., have different parts that are sampled or updated at
different rates.

Simulink is built on top of MATLAB. As an


extension of MATLAB, Simulink adds many features specific to
dynamic systems while retaining all of general purpose
functionality of MATLAB. So using Simulink we can direct access
the wide range of MATLAB based tools for generating, analyzing,
and optimizing system implemented in Simulink.

 Simulink has following features:

 Availability of extensive library of predefined


blocks.

Government Engg. College, Bhuj Page 20


Control System Engineering (2150909) B. E. Electrical Sem-5th

 Models can be grouped to hierarchies of create a


simplified view of components of subsystems.
 Availability of model browser for navigating model
hierarchies.
 Availability of library browser for convenient block
selection.
 Availability of finder tools for searching models
and libraries.
 Availability of auto-connection and auto-routing
simplifies editing.
 Supports operations on matrix, frame-based and
complex signals.
 Supported data types includes single/double
precision floating point, signed 8, 16, 32 bit
integer, unsigned 8, 16, 32 bit integer, Boolean.
 Model discretizer easily converts continuous designs
to discrete.
 Simulink data explorer GUI is available for viewing
and editing data.

Operation of Simulink:

A Simulink block diagram model is a graphical


representation of a mathematical model of a dynamic system. A
mathematical model of a dynamic system is described by set of
equations. The mathematical equations described by a block
diagram model are known as algebraic, differential, and/or
difference equations. At any given instant of time, these
equations may be viewed as relationships between the system’s
output response, the system’s inputs at that time, the current
state of the system, the systems parameters, and time. The state

Government Engg. College, Bhuj Page 21


Control System Engineering (2150909) B. E. Electrical Sem-5th
of the system may be thought of as a numerical representation of
the dynamically changing configuration of the system.

Simulink provides a graphical editor that


allows us to create and connect instance block types selected
from libraries of block types via a library browser. Simulink
provides libraries of blocks representing elementary systems
that can be used as building blocks. The blocks supplied with
Simulink are called built-in blocks. We can also create our own
block types and use the Simulink editor to create instances of
them in a diagram. Blocks that we create are called custom
blocks.

Fig.2.5: Facilities of Simulink.

This diagram illustrates some of the tools provided by the Math


Works that may help in the design, analysis, and implementation
of dynamic systems.

Simulink provides a richest of modelling


capabilities for dynamic systems, which can further be extended
by domain specific products such as State flow for event driven

Government Engg. College, Bhuj Page 22


Control System Engineering (2150909) B. E. Electrical Sem-5th

systems, Sim Mechanics for modelling physical systems, and many


Block sets such as the DSP Bloc k set for signal processing.

If we are modelling a system that will be deployed


outside of the simulation environment on, we can use the Real-
Time Workshop and related products to automatically generate
highly optimized code for the block diagram.

We can then use Math Works real-time targets design


exploration of the model executing on a real-time system.

In addition, many targets support monitoring and


parameter tuning from the Simulink environment whereby signals
in the real-time system can be viewed and parameters changed.

At any point during the design cycle, we can use the


power of MATLAB and the many toolboxes to analyze the simulation
or real-time results or improve designs.

 Using Simulink we can:

 Build a block diagram.


 Simulate the system’s behaviour.
Evaluate its performance and refine the design

Simulink Library Browser:

The Simulink library window displays icons


representing the block libraries that come with Simulink. You
can create models by copying blocks from the library into a
model window.

1) In the MATLAB Command Window, type Simulink


The Simulink library window opens.

2) From the File menu, point to New, and then click Model.
A blank Simulink model window opens.

Government Engg. College, Bhuj Page 23


Control System Engineering (2150909) B. E. Electrical Sem-5th

3) In the left pane, double-click Simulink, and then click


Continuous. In the right pane, the Simulink library
shows a list of blocks.

4) Then we can create new model select new model button in


the library Browser’s toolbar

5) Then select the necessary blocks from the appropriate


sub-libraries by either dragging in the new model’s
window or right clicking the blocks.

Open New
Model

Fig.2.6: Simulink library browser

Along with these libraries, we can create customized blocks and


block libraries. Custom blocks can be saved in our own block

Government Engg. College, Bhuj Page 24


Control System Engineering (2150909) B. E. Electrical Sem-5th
library for future use. They can be shared with work groups,
vendors and customers.

We have described some of the subsystem


libraries available that contain the basic building blocks of
simulation diagrams. The reader is encouraged to explore the
other libraries as well. You can also customize and create your
own blocks. For information on creating your own blocks, see the
MATLAB documentation on "Writing S-Functions".

Application tool-boxes of Simulink:

In Simulink all toolboxes are built using MATLAB. They are


specialized collection of m-files for working on particular
class of problem. We can inspect m-files, add to them, or use
them for templates when creating our own functions. Every
toolbox is available on any computer platform that runs MATLAB.
Every toolbox builds on the robust numeric, rock-solid accuracy.

Followings are the some of the available toolboxes of Math


Works. Every year the list is increasing because new toolboxes
are invented every year.

• The Communication toolbox.


• The Control toolbox.
• The LMI Control toolbox.
• The Model predictive toolbox.
• The Robust control toolbox.
• The Mu- analysis and synthesis toolbox.
• The Fuzzy logic toolbox.
• The Neural Network toolbox.
• The system identification toolbox.
• The signal processing toolbox.

Government Engg. College, Bhuj Page 25


Control System Engineering (2150909) B. E. Electrical Sem-5th

• The image processing toolbox.


• The wavelet toolbox.
• The model predictive control toolbox.
• The optimization toolbox.
• The partial differential equation toolbox.
• The spline toolbox.
• The statistics toolbox.
• The symbolic Math toolbox.
• The financial toolbox, etc.

In the project, Communication, Fuzzy, Neural Network,


optimization toolboxes are used.

Graphical User Interface:

A graphical user interface (GUI) is a user


interface built with graphical objects; the components of the
GUI; such as buttons, text fields, sliders, and menus. If the
GUI is designed well-designed, it should be intuitively obvious
to the user how its components function.

Applications that provide GUIs are


generally easier to learn and use since the person using the
application does not need to know what commands are available or
how they work. The action that results from a particular user
action can be made clear by design of the interface.

MATLAB implements GUIs as figure


windows containing various styles of ui controls objects. We
must program each object to perform the intended action when
activated by user of the GUI. All of these tasks are simplified
by GUIDE, MATLAB’s Graphical User Interface Development
Environment.

Government Engg. College, Bhuj Page 26


Control System Engineering (2150909) B. E. Electrical Sem-5th
Implementation of GUI:

Creating a GUI involves following basic tasks:

1) Laying out the GUI components.


2) Programming the GUI components.
3) Saving and running the GUI.
GUIDE primarily is a set of layout tools. However,
GUIDE also generates an M-file that contains code to handle the
initialization and launching of the GUI. This M-file provides a
framework for the implementation of the call-backs; the
functions that execute when users activate components in the
GUI.

GUIDE stores GUIs in two files, which are generated the first
time we save or run the GUI:

 FIG-file: A file with extension .fig that contains a


complete description of the GUI figure layout and the
components of the GUI: push buttons, menus, axes, and so
on.
When we make changes to the GUI layout in the Layout
Editor, out changes are saved in the FIG-file.

 M-file: A file with extension .m that contains the code


that controls the GUI, including the call-backs for its
components. This file is referred to as the GUI M-file.
When we first run or save a GUI from the
Layout Editor, GUIDE generates the GUI M-file with blank
stubs for each of the call-backs. We can than program the
call-backs using the M-file editor.

Following diagram illustrate the parts of GUI


implementation.

Government Engg. College, Bhuj Page 27


Control System Engineering (2150909) B. E. Electrical Sem-5th

Fig.2.7: Parts of GUI implementation.

GUI Development Environment

Laying out the GUI component:


GUIDE, the MATLAB Graphical User
Interface development environment, provides a set of tools for
creating GUIs. These tools greatly simplify the process of
laying out and programming a GUI.

When we open a GUI in GUIDE, it is displayed in the


Layout Editor, which is the control panel for all of the GUIDE
tools. The following figure shows the Layout Editor with a blank
GUI template.

Government Engg. College, Bhuj Page 28


Control System Engineering (2150909) B. E. Electrical Sem-5th

Object
Menu
Alignment Browser
Editor
tool M-file Property
Editor Run
Inspector
Button

Figure
Resize Tab
Fig.2.8: Layout Editor

The layout Editor enables us to layout a GUI


quickly and easily by dragging components, such as push buttons,
pop-up menus, or axes, from the component palette into the
layout area.

Once the GUI is layout and each component’s


properties are set, using the tools in the Layout Editor, we can
program the GUI with the M-file Editor. Finally, when we press
the Run button on the toolbar, the functioning GUI appears
outside the Layout Editor window.

Government Engg. College, Bhuj Page 29


Control System Engineering (2150909) B. E. Electrical Sem-5th
The GUI Development Environment allows following
features for developing new GUI.

 Laying Out GUIs:


Using the Layout Editor we can add and arrange
objects in the figure window.

 Aligning Components in the Layout Editor:


We can align objects vertically or horizontally and
can distribute them in group of components with respect to
each other.

Align all components


to selected reference
line

Fig.2.9: Align Objects


Set spacing between
selected components

Government Engg. College, Bhuj Page 30


Control System Engineering (2150909) B. E. Electrical Sem-5th

 Setting of Component Properties:


Using the property Inspector we can inspect
and set property values. Property Inspector provides a list of
all settable properties and displays the current value. Each
property in the list is associated with an editing device that
is appropriate for the values accepted by t he particular
property.

Fig.2.10: Property Inspector

1. Select Property Inspector from the View menu or click the


Property Inspector button.
2. In the Property Inspector, scroll to the Units property and
note its current setting, then change the setting to
inches.
3. Scroll to the Position property. A null value means that
the element differs in value for the different components.
This figure shows the Position property for multiple
components of the same size.

Government Engg. College, Bhuj Page 31


Control System Engineering (2150909) B. E. Electrical Sem-5th
4. Change the value of x to align their left sides. Change the
value of y to align their bottom edges. For example,
setting x to 2.0 aligns the left sides of the components 2
inches from the left side of the GUI.
5. When the components are aligned, change the Units property
back to its original setting.
Programming the GUI components:

We can program the GUI components with


understanding following features

Understanding the GUI M-file:


The GUI M-file generated by GUIDE controls the
GUI and determines how it responds to a user's action, such as
pressing a push button or selecting a menu item. The M-file
contains all the code needed to run the GUI, including the call-
backs for the GUI components. While GUIDE generates the
framework for this M-file, you must program the call-backs,
which are sub functions of the M-file, to perform the functions
we want them to. When we run a GUI, the M-file creates a handles
structure that contains all the data for GUI objects, such as
controls, menus, and axes. The handles structure is passed as an
input to each call-back. We can use the handles structure to
Share data between call-backs Access GUI data. We can add code
to the Opening function; executes before the GUI becomes visible
to the user, Output function; outputs data to the command line,
if necessary and in Call-backs; execute each time the user
activates the corresponding component of the GUI.

Government Engg. College, Bhuj Page 32


Control System Engineering (2150909) B. E. Electrical Sem-5th

Fig.2.11: M-file Execution path

Managing GUI Data with the Handles Structure: GUIDE provides a


mechanism, called the handles structure, for storing and
retrieving shared data using the same structure that contains
the GUI component handles. The handles structure, which contains
the handles of all the components in the GUI, is passed to each
call-back in the GUI M-file. Therefore, this structure is useful
for saving any shared data.

Design for Cross-Platform Compatibility: We can use specific


property settings to create a GUI that behaves more consistently
when run on different platforms: Use the default font or default
background colour or figure character units for different
platforms.

Interrupting Executing Call-backs: By default, MATLAB allows an


executing call-back to be interrupted by subsequently invoked
call-backs. The GUI programmer can control whether user actions
can interrupt executing call-backs or not.

Government Engg. College, Bhuj Page 33


Control System Engineering (2150909) B. E. Electrical Sem-5th
CONTROL SYSTEM DESIGN USING MATLAB:

Government Engg. College, Bhuj Page 34


Control System Engineering (2150909) B. E. Electrical Sem-5th

Government Engg. College, Bhuj Page 35


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-3

AIM- TO STUDY THE BASIC OPERATIONAL COMMANDS OF MATLAB SOFTWARE

(1) DEVELOPMENT OF 3X3 MATRIX

A=[5 9 8;3 2 6;6 5 4]

A =

5 9 8

3 2 6

6 5 4

B=[3,2,5;2,1,3;3,2,1]

B =

3 2 5

2 1 3

3 2 1

(2) ADDITION OF TWO MATRICES

C=A+B

C =

8 11 13

5 3 9

9 7 5

(3) SUBTRACTION OF TWO MATRICES

D=A- B

D =

2 7 3

1 1 3

3 3 3

Government Engg. College, Bhuj Page 36


Control System Engineering (2150909) B. E. Electrical Sem-5th
(4) MULTIPLICATION OF TWO MATRICES

E=A*B

E =

57 35 60

31 20 27

40 25 49

(5) DIVISION OF TWO MATRICES

F=A\B

F =

0.4308 0.2769 -0.4615

-0.0154 0.0615 0.2308

0.1231 0.0077 0.6538

(6) TRANSPOSE OF MATRIX

G=A'

G =

5 3 6

9 2 5

8 6 4

(7) INVERSE OF MATRIX

H=A^(-1)

H =

-0.1692 0.0308 0.2923

0.1846 -0.2154 -0.0462

0.0231 0.2231 -0.1308

Government Engg. College, Bhuj Page 37


Control System Engineering (2150909) B. E. Electrical Sem-5th
(8) DETERMINATION OF MATRIX

J=det(A)

J =

130

(9) EIGEN VALUES OF TWO MATRIX

K=eigs(A)

K =

15.7710

-2.3855 - 1.5976i

-2.3855 + 1.5976i

(10) LOGICAL FUNCTIONS

A=[1 0 2;0 1 0;3 2 0]

B=[5 0 6;1 4 0;4 3 0]

A =

1 0 2

0 1 0

3 2 0

B =

5 0 6

1 4 0

4 3 0

Government Engg. College, Bhuj Page 38


Control System Engineering (2150909) B. E. Electrical Sem-5th
(I) LOGICAL AND

M=A&B

M = 1 0 1

0 1 0

1 1 0

(II) LOGICAL OR

N=A|B

N =

1 0 1

1 1 0

1 1 0

(III) LOGICAL EXCLUSIVE OR

P=xor(A,B)

P = 0 0 0

1 0 0

0 0 0

(IV) LOGICAL COMPLEMENT

F=~A

F = 0 1 0

1 0 1

0 0 0

Government Engg. College, Bhuj Page 39


Control System Engineering (2150909) B. E. Electrical Sem-5th
(11) MATRIX AND VECTOR MANIPULATION

P=zeros(3)

P =

0 0 0

0 0 0

0 0 0

Q=ones(3)

Q =

1 1 1

1 1 1

1 1 1

R=eye(3)

R =

1 0 0

0 1 0

0 0 1

S=size(R)

S =

3 3

T=linspace(1,5,10)

T =

Columns 1 through 7

1.0000 1.4444 1.8889 2.3333 2.7778 3.2222


3.6667

Columns 8 through 10

4.1111 4.5556 5.0000

Government Engg. College, Bhuj Page 40


Control System Engineering (2150909) B. E. Electrical Sem-5th

U=0:4:8

U =

0 4 8

V=logspace(1,4,5)

V =

1.0e+004 *

0.0010 0.0056 0.0316 0.1778 1.0000

(12)MATH FUNCTIONS

D=[4 5 6;5 9 7;1 5 3]

D =

4 5 6

5 9 7

1 5 3

A=sinh(D) SINEHYPERBOLIC FUNCTION

A =

1.0e+003 *

0.0273 0.0742 0.2017

0.0742 4.0515 0.5483

0.0012 0.0742 0.0100

B=asinh(A) INVERSE SINEHYPERBOLIC FUNCTION

B =

4 5 6

5 9 7

1 5 3

Government Engg. College, Bhuj Page 41


Control System Engineering (2150909) B. E. Electrical Sem-5th
c=exp(D) EXPONATIAL FUNCTION

c =

1.0e+003 *

0.0546 0.1484 0.4034

0.1484 8.1031 1.0966

0.0027 0.1484 0.0201

D=log(c) LOGARITHAMIC FUNCTION

D =

4 5 6

5 9 7

1 5 3

E=[2+j*3 1+j*4 3+j*4]

E =

2.0000 + 3.0000i 1.0000 + 4.0000i 3.0000 + 4.0000i

F=abs(E) ABSOLUTE VALUE FUNCTION

F =

3.6056 4.1231 5.0000

G=angle(E) PHASE ANGLE FUNCTION

G =0.9828 1.3258 0.92

Government Engg. College, Bhuj Page 42


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-4

AIM- FIND THE TRANSFER FUNCTION FROM GIVEN Z (Zero), P (Pole)


and K (Gain) USING MATLAB.

PROGRAM-1
clc;
clear all;
close all;
num=[1 1];
den=[1 -1];
TF=tf(num,den)

OUTPUT-1

Transfer function:

s+1

-----

s-1

PROGRAM-2

clc;
clear all;
close all;
num=[1 2 1];
den=[1 3 3 1];
TF=tf(num,den)

OUTPUT-2

Transfer function:

s^2 + 2 s + 1
---------------------
s^3 + 3 s^2 + 3 s + 1

Government Engg. College, Bhuj Page 43


Control System Engineering (2150909) B. E. Electrical Sem-5th
PROGRAM-3

clc;
clear all;
close all;
num=[1 2 0 3];
den=[1 0 9 3 1];
TF=tf(num,den)
OUTPUT-3

Transfer function:

s^3 + 2 s^2 + 3
---------------------
s^4 + 9 s^2 + 3 s + 1

PROGRAM-4

clc;
clear all;
close all;
num=[1 0 0 0 0 1];
den=[1 0 0 0 0 0 9];
TF=tf(num,den)

OUTPUT-4

Transfer function:

s^5 + 1
-------
s^6 + 9

PROGRAM-5

clc;
clear all;
close all;
num=[1 0 1];

Government Engg. College, Bhuj Page 44


Control System Engineering (2150909) B. E. Electrical Sem-5th
den=[1 0 -1];
TF=tf(num,den)

OUTPUT-5

Transfer function:

s^2 + 1
-------
s^2 - 1

PROGRAM-6

clc;
clear all;
close all;
z=[0];
p=[-1 -2];
k=[10];
T=zpk(z,p,k)

OUTPUT-6

Zero/pole/gain:

10 s
-----------
(s+1) (s+2)

PROGRAM-7

clc;
clear all;
close all;
z=[ ];
p=[-1];
k=[1];
T=zpk(z,p,k)

Government Engg. College, Bhuj Page 45


Control System Engineering (2150909) B. E. Electrical Sem-5th
OUTPUT-7

Zero/pole/gain:

1
-----
(s+1)

PROGRAM-8

clc;
clear all;
close all;
z=[1 -1];
p=[1j -1j];
k=[1];
T=zpk(z,p,k)
OUTPUT-8

Zero/pole/gain:

(s-1) (s+1)
-----------
(s^2 + 1)

PROGRAM-9
clc;
clear all;
close all;
z=[-1 1];
p=[3 -9 -1];
k=[10];
T=zpk(z,p,k)
OUTPUT-9

Zero/pole/gain:

10 (s+1) (s-1)
-----------------
(s-3) (s+9) (s+1)

Government Engg. College, Bhuj Page 46


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-5

AIM- FIND OUT THE OVERALL TRANSFER FUNCTION FOR THE GIVEN BLOCK
DIAGRAM USING MATLAB FUNCTIONS.

1.

1 𝑆+1
R(S) C(S)
500 𝑆 2 𝑆+2

C (S) S+1
Over All Transfer Function = = 3
R (S) 500 S +1000 S2
2.
R(S) 𝑆+1
𝑆+2 C(S)

+
𝑆+1
𝑆+5

C (S) 2S2+9S+7
Over All Transfer Function = =
R (S) S2+7S+10
3.

S 2 + 2𝑆 + 3
R(S) C(S)
S 2 + 9𝑆 + 23
__

1
𝑆+1

C (S) 3 2
Over All Transfer Function =
S
= 3
+3S +5S+3
2
R (S) S +11S 34S+26

Government Engg. College, Bhuj Page 47


Control System Engineering (2150909) B. E. Electrical Sem-5th

4.

G1 G3
𝑆+2 𝑆+5 C(S)
R(S)
3S 2 + 𝑆 S 2 + 6𝑆 + 3

__
2
+
𝑆+7

G2

1
𝑆

H1
C (S) 4 3 2
Over All Transfer Function = =
7S +46S +69S +70S
6 5 4 3
R (S) 3S +40S +148S +115S +67S2+69S+70

Government Engg. College, Bhuj Page 48


Control System Engineering (2150909) B. E. Electrical Sem-5th
PROGRAM-1

clc,
clear all,
close all,
num1=[0 0 1];
den1=[500 0 0];
num2=[0 1 1];
den2=[0 1 2];
[num,den]=series(num1,den1,num2,den2)
printsys(num,den);

OUTPUT-1

s+1

------------------

500 s^3 + 1000 s^2

PROGRAM-2

clc,
clear all,
close all,
num1=[0 1 1];
den1=[0 1 2];
num2=[0 1 1];
den2=[0 1 5];
[num,den]=parallel(num1,den1,num2,den2)
printsys(num,den);

OUTPUT-2

2 s^2 + 9 s + 7
---------------
s^2 + 7 s + 10

Government Engg. College, Bhuj Page 49


Control System Engineering (2150909) B. E. Electrical Sem-5th
PROGRAM-3

clc,
clear all,
close all,
num1=[1 2 3];
den1=[1 9 23];
num2=[0 0 1];
den2=[0 1 1];
[num,den]=feedback(num1,den1,num2,den2)
printsys(num,den);

OUTPUT-3

s^3 + 3 s^2 + 5 s + 3
------------------------
s^3 + 11 s^2 + 34 s + 26

PROGRAM-4

clc;
clear all;
close all;
num1=[0 1 2];
den1=[3 1 0];
G1=tf(num1,den1)
G2=tf([2],[1 7])
G3=tf([1 5],[1 6 3])
H1=tf([1],[1 0])
T1=parallel(G1,G2)
T2=series(T1,G3)
T=feedback(T2,H1,-1)

OUTPUT-4

Transfer function:

s+2

---------

3 s^2 + s

Transfer function:

Government Engg. College, Bhuj Page 50


Control System Engineering (2150909) B. E. Electrical Sem-5th

-----

s+7

Transfer function:

s+5

-------------

s^2 + 6 s + 3

Transfer function:

Transfer function:

7 s^2 + 11 s + 14

--------------------

3 s^3 + 22 s^2 + 7 s

Transfer function:

7 s^3 + 46 s^2 + 69 s + 70

-----------------------------------------

3 s^5 + 40 s^4 + 148 s^3 + 108 s^2 + 21 s

Transfer function:

7 s^4 + 46 s^3 + 69 s^2 + 70 s

-------------------------------------------------------

3 s^6 + 40 s^5 + 148 s^4 + 115 s^3 + 67 s^2 + 69 s + 70

Government Engg. College, Bhuj Page 51


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-6

AIM- OBTAIN THE STATE MODEL OF GIVEN SYSTEM USING MATLAB

1. Obtain the state model for the system when the open loop
transfer function is given by
(𝑆+2)
T(s) = (𝑆+1)(𝑆+3)

PROGRAM-1
num = [1 2];
den = [1 4 3];
[A, B, C, D] = tf2ss(num,den)
p=[0 1;1 0];
%Phase variable form
Ap=inv(p)*A*p
Bp=inv(p)*B
Cp=C*p
Dp=D

OUTPUT-1

A =

-4 -3
1 0

B =

1
0

C =

1 2

D =

Ap =

0 1
-3 -4

Government Engg. College, Bhuj Page 52


Control System Engineering (2150909) B. E. Electrical Sem-5th

Bp =

0
1

Cp =

2 1

Dp =

2. Obtain the transfer function from the following data.

−𝟓 𝟏 𝟏
A=� � , B= � � , C=[𝟐 𝟏], D=0
−𝟔 𝟎 𝟐

PROGRAM-2
clc
A=[-5 1;-6 0];
B=[1;2];
C=[2 1];
D=0;
[num,den]=ss2tf(A,B,C,D)
printsys (num,den)

OUTPUT-2
num =

0 4 8

den =

1 5 6

num/den =

4 s + 8
-------------
s^2 + 5 s + 6

Government Engg. College, Bhuj Page 53


Control System Engineering (2150909) B. E. Electrical Sem-5th

3. Obtain the state model for the following transfer function by


direct decomposition.
1
T(s)= (𝑆 2 +2𝑆+5)

PROGRAM-3
num = [ 1 ];
den = [ 1 2 5];
[A, B, C, D] = tf2ss(num,den)
p=[0 1;1 0];
%Phase variable form
Ap=inv(p)*A*p
Bp=inv(p)*B
Cp=C*p
Dp=D

OUTPUT-3

A =

-2 -5
1 0
B =

1
0
C =

0 1
D =

0
Ap =

0 1
-5 -2
Bp =

0
1
Cp =

1 0
Dp =

Government Engg. College, Bhuj Page 54


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-7

AIM: GENERATING STANDARD TEST SIGNALS (UNIT IMPULSE, STEP, RAMP


& EXPONENTIAL) USING MATLAB.

PROGRAM
% Program for the generation of unit impulse signal

clc;
clear all;
close all;
t=-2:1:2;%
y=[zeros(1,2),ones(1,1),zeros(1,2)];
subplot(2,2,1);
stem(t,y);
ylabel('Amplitude --.');
xlabel('(a) n --.');

% Program for the generation of unit step sequence [u(n)- u(n –


N)]

n=input('enter the N value=');


t=0:1:n-1;
y1=ones(1,n);subplot(2,2,2);
stem(t,y1);ylabel('Amplitude -->');
xlabel('(b) n -->');

OUTPUT
enter the N value= 4

% Program for the generation of ramp sequence

clc
n1=input('enter the length of ramp sequence=');
t=0:n1;
subplot(2,2,3);stem(t,t);ylabel('Amplitude -->');
xlabel('(c) n -->');

OUTPUT
enter the length of ramp sequence=5

Government Engg. College, Bhuj Page 55


Control System Engineering (2150909) B. E. Electrical Sem-5th
% Program for the generation of Exponential sequence
n2=input('enter the length of exponential sequence');
t=0:n2;
a=input('Enter the a value=');
y2=exp(a*t);subplot(2,2,4);
stem(t,y2);ylabel('Amplitude -->');
xlabel('(d) n -->');

OUTPUT
enter the length of exponential sequence7
Enter the a value=1

1 Amplitude --> 1
Amplitude --.

0.5 0.5

0 0
-2 -1 0 1 2 0 2 4 6
(a) n --. (b) n -->

8 1500

6
Amplitude -->

Amplitude -->

1000
4
500
2

0 0
0 2 4 6 8 0 2 4 6 8
(c) n --> (d) n -->

Government Engg. College, Bhuj Page 56


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-8

AIM- GRAPHICALLY REPRESENT TIME RESPONSE OF A FIRST ORDER AND SECOND


ORDER CONTROL SYSTEM

FIRST ORDER CONTROL SYSTEM

PROGRAM-1

clc,
clear all,
close all,
num=[1];
den=[1 1];
t=tf(num,den);
step(t);

OUTPUT-1

Step Response
1
System: t
System: t Final Value: 1
Settling Time (sec): 39.1

System: t
Rise Time (sec): 22

0.8

0.6
Amplitude

0.4

0.2

0
0 10 20 30 40 50 60
Time (sec)

PROGRAM-2

clc,
clear all,
close all,
num=[1];
den=[1 1];
t=tf(num,den);
impulse(t);

Government Engg. College, Bhuj Page 57


Control System Engineering (2150909) B. E. Electrical Sem-5th
OUTPUT-2

Impulse Response
1
System: t
Peak amplitude: 1
At time (sec): 0
0.9

0.8

0.7

0.6
Amplitude

0.5

0.4

0.3

0.2

0.1 System: t
Settling Time (sec): 3.91

0
0 1 2 3 4 5 6
Time (sec)

PROGRAM-3

clc,
clear all,
close all,
num=[1];
den=[10 1];
t1=tf(num,den);
num=[1];
den=[100 1];
t2=tf(num,den);
num=[1];
den=[1000 1];
t3=tf(num,den);
step(t1,t2,t3);

Government Engg. College, Bhuj Page 58


Control System Engineering (2150909) B. E. Electrical Sem-5th
OUTPUT-3

Step Response
1
System: t3
System: t2 System: t3 Final Value: 1
Settling Time (sec): 391 Settling Time (sec): 3.91e+003

System: t2 System: t3
Rise Time (sec): 220 Rise Time (sec): 2.2e+003

0.8

0.6
Amplitude

0.4

0.2

0
0 1000 2000 3000 4000 5000 6000
Time (sec)

SECOND ORDER CONTROL SYSTEM

PROGRAM-4
clc;
clear all;
close all;
t=0:0.2:10;
zeta=[0 0.2 0.4 0.6 0.8 1];
for n=1:6
num=[1];
den=[1 2*zeta(n) 1];
[y(1:51,n),x,t]=step(num,den,t);
end
plot(t,y);
grid;
title('Plot of unit step response curve
with\omega_n=1and\zeta=0,0.2,0.4,0.6,0.8,1')
xlabel('t(sec)');
ylabel('response');
text(3.2,1.9, '\zeta=0');
text(3.2,1.5, '\zeta=0.2');
text(3.5,1.3, '\zeta=0.4');
text(3.5,1.1, '\zeta=0.6');
text(3.5,1.0, '\zeta=0.8');
text(3.5,0.9, '\zeta=1.0');

Government Engg. College, Bhuj Page 59


Control System Engineering (2150909) B. E. Electrical Sem-5th
OUTPUT-4

Plot of unit step response curve withωn=1andζ=0,0.2,0.4,0.6,0.8,1


2
ζ=0

1.5 ζ=0.2

ζ=0.4
response

ζ=0.6
1 ζ=0.8
ζ=1.0

0.5

0
0 1 2 3 4 5 6 7 8 9 10
t(sec)
Unit ramp response of the second order system:
PROGRAM-5

clc;
clear all;
close all;
num=[2 1];
den=[1 1 1 0];
t=0:0.1:10;
c=step(num,den,t);
plot(t,c,'D',t,t,'h');
xlable('t (sec)');
ylable('output response');
title('unit ramp response for G(s)=2s+1/(s^2+s+1)');

Government Engg. College, Bhuj Page 60


Control System Engineering (2150909) B. E. Electrical Sem-5th
OUTPUT-5

Unit ramp response for G(s)=2s+1/(s^2+s+1)


12

10
output response

0
0 1 2 3 4 5 6 7 8 9 10

t(sec)

Government Engg. College, Bhuj Page 61


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-9

AIM- FOR UNITY FEEDBACK CONTROL SYSTEM WITH GIVEN TRANSFER


FUNCTION PLOT ROOT LOCUS OF THE SYSTEM.

1. Sketch the root locus plot for the system when the open loop
transfer function is given by
1
G(s) = 𝑆(𝑆+3)(𝑆+6)
PROGRAM-1

clc;
clear all;
num=[1];
den=[1 9 18 0];
t=tf(num,den);
rlocus(t)

OUTPUT-1

Root Locus
15

10

5
Imaginary Axis

-5

-10

-15
-20 -15 -10 -5 0 5
Real Axis

Government Engg. College, Bhuj Page 62


Control System Engineering (2150909) B. E. Electrical Sem-5th

2. Sketch the root locus plot for the system when the open loop
transfer function is given by

𝐾
G(s) = 𝑆(𝑆+4)(𝑆 2 +4𝑆+13)
PROGRAM-2

p=1;
q= [1 8 29 52 0];
sys4=tf(p,q)
rlocus(p,q)

OUTPUT-2
Transfer function:
1
---------------------------
s^4 + 8 s^3 + 29 s^2 + 52 s

Root Locus
10

2
Imaginary Axis

-2

-4

-6

-8

-10
-12 -10 -8 -6 -4 -2 0 2 4 6 8
Real Axis

Government Engg. College, Bhuj Page 63


Control System Engineering (2150909) B. E. Electrical Sem-5th

3. Sketch the root locus plot for the system when the open loop
transfer function is given by

(𝑆+5)
G(s) = 𝑆 2 +7𝑆+25

PROGRAM-3

clc;
clear all;
num=[1 5];
den=[1 7 25];
t=tf(num,den);
rlocus(t)

OUTPUT-3

Root Locus
5

1
Imaginary Axis

-1

-2

-3

-4

-5
-18 -16 -14 -12 -10 -8 -6 -4 -2 0 2
Real Axis

Government Engg. College, Bhuj Page 64


Control System Engineering (2150909) B. E. Electrical Sem-5th

EXPERIMENT-10

AIM: FOR UNITY FEEDBACK CONTROL SYSTEM WITH GIVEN TRANSFER


FUNCTION OBTAIN BODE PLOT.

1. Sketch the bode plot for the transfer function given Unity
Feedback Control System using MATLAB.
15
G(s) = 𝑠(𝑠+3)(0.7𝑠+5)

PROGRAM-1

clf
num = 15;
den = conv([1 0], conv([1 3],[0.7 5]));
bode(num, den)

OUTPUT-1

Bode Diagram
50

0
Magnitude (dB)

-50

-100

-150
-90

-135
Phase (deg)

-180

-225

-270
-1 0 1 2 3
10 10 10 10 10
Frequency (rad/sec)

Government Engg. College, Bhuj Page 65


Control System Engineering (2150909) B. E. Electrical Sem-5th

2. Sketch the bode plot for the transfer function given below:

𝟐(𝒔+𝟎.𝟐𝟓)
G(s) H(s) =
𝒔𝟐 (𝒔+𝟏)(𝒔+𝟎.𝟓)

PROGRAM-2

num=[2 0.5]
den=[1 1.5 0.5 0]
sys=tf(num,den)
margin(sys

OUTPUT-2

Bode Diagram
Gm = Inf dB (at Inf rad/sec) , Pm = 50.5 deg (at 1.2 rad/sec)
50
Magnitude (dB)

-50

-100
-45
Phase (deg)

-90

-135

-180
-2 -1 0 1 2
10 10 10 10 10
Frequency (rad/sec)

Government Engg. College, Bhuj Page 66


Control System Engineering (2150909) B. E. Electrical Sem-5th

3. For the Unity Feedback Control System


50(𝑆+1)
G(s) = 𝑆(𝑆+3)(𝑆+5)

(a) Sketch the Bode plot.


(b) Estimate the percent overshoot, settling time, and peak
time.

PROGRAM-3

num=[50 5];
den=[1 8 15 0];
G=tf(num,den);
bode (G)
title ('System 1')
%title (‘System 1’)
pause
%Find phase margin
[Gm, Pm, Wcg, Wcp] = margin (G);
w = 1:.01:20;
[M, P, w] =bode (G, w);
%Find bandwidth
for k = 1:1: length (M);
if 20*log10 (M (k)) +7<=0;
'Mag'
20*log10 (M (k))
'BW'
wBW = w(k)
break
end
end
%Find damping ratio, percent overshoot, settling time, and peak
time
for z = 0:.01:10
Pt = atan (2*z/ (sqrt (- 2*z^2 + sqrt (1 + 4*z^4))))*(180/pi);
if (Pm -Pt) <= 0
z;
Po = exp (- z*pi/sqrt (1 - z^2));
Ts = (4/ (wBW*z))*sqrt ((1 - 2*z^2) + sqrt (4*z^4 - 4*z^2 +
2));
Tp = (pi/ (wBW*sqrt (1 - z^2)))*sqrt ((1 - 2*z^2) + sqrt (4*z^4
- 4*z^2 + 2));
fprintf ('Bandwidth = %g', wBW)
fprintf ('Phase margin = %g', Pm)
fprintf (' Damping ratio = %g', z)
fprintf (' Percent overshoot = %g', Po*100)
fprintf (' Settling time = %g', Ts)
Government Engg. College, Bhuj Page 67
Control System Engineering (2150909) B. E. Electrical Sem-5th

fprintf (' Peak time= %g', Tp)


break
end
end

OUTPUT-3

System 1
100

50
Magnitude (dB)

-50

-100
0

-45
Phase (deg)

-90

-135

-180
-3 -2 -1 0 1 2 3
10 10 10 10 10 10 10
Frequency (rad/sec)

Mag =
-7.0023

wBW =
9.7600

Bandwidth = 9.76
Phase margin = 67.1233
Damping ratio = 0.74
Percent overshoot = 3.1544
Settling time = 0.528125
Peak time= 0.456349

Government Engg. College, Bhuj Page 68

S-ar putea să vă placă și