0% found this document useful (0 votes)
67 views13 pages

Lab 1&2 Lcs

The document introduces control systems and simulations using Simulink, providing examples of modeling electrical networks by deriving transfer functions using Laplace transforms and analyzing step responses; lab tasks involve finding transfer functions and simulating step responses for RC, nodal analysis, and mesh analysis networks.

Uploaded by

Moiz Siddiqui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views13 pages

Lab 1&2 Lcs

The document introduces control systems and simulations using Simulink, providing examples of modeling electrical networks by deriving transfer functions using Laplace transforms and analyzing step responses; lab tasks involve finding transfer functions and simulating step responses for RC, nodal analysis, and mesh analysis networks.

Uploaded by

Moiz Siddiqui
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Lab No.

1
Introduction to Simulink Basics

Objectives

1. Introduction to Control Systems Analysis.


2. Introduction to Matlab/Simulink.
3. Example: Inverted Pendulum.

Introduction to Control Systems

Suppose a slave who used to fan his master using some kind of a cloth and he does
this all day long. To make his life easy, fans were introduced. To this Modern day,
different types of engineering techniques are being put together to make the life
easy for a normal man. Control systems are just one and the most important of
these fields.

Whenever the name of Control systems is taken, it always comes with the name of
Control Systems Analysis. It basically analyses the system parameters like velocity,
temperature, mass, damping ratio, etc… which are necessary for its quality output.
Using these parameters one can judge its real life state and then implement it. WWII
accelerated the development of classical control theory and practice. Heavy guns
had to be rapidly and accurately positioned. Precise navigation and target tracking
were increasingly important, and aircraft performance was improved greatly with
the incorporation of complex control systems to aid the pilot.

Today, control systems are pervasive in industry and in our everyday lives. They
range from governmental regulation (such as that governing monetary policy) to
automated and highly flexible manufacturing plants to sophisticated automobiles,
household appliances, and entertainment systems. It is our purpose to learn to
design control systems for a wide variety of applications.

Control systems in Human body

Human body contains various control mechanism like the balancing mechanism is
carried out by gyros in our ear, all the six senses are very good example of control
systems as they are giving feedback required by the body to function accurately, if
any one of our senses gets disturbed we can our self feel the malfunctioning of our
body like this example, Just stand with your feet one in front of other and place your
hands on your back and make sure your eyes are open. After you are in the desired
position close your eyes, you will notice the importance of feedback control systems.
Introduction to Simulink
SIMULINK is a program for simulating dynamic systems. As an extension to MATLAB,
SIMULINK adds many features specific to dynamic systems while retaining all of
MATLAB’s general-purpose functionality. SIMULINK has two phases of use: model
definition and model analysis. A typical session starts by either defining a model or
retrieving a previously defined model, and then proceeds to analysis of that model.
These two steps are often performed iteratively until the model achieves the desired
behavior.

To facilitate model definition, SIMULINK adds a new class of windows called block
diagram windows. In these windows, models are created and edited principally by
mouse driven commands. Part of mastering SIMULINK is to become familiar with the
manipulation of model components within these windows. After you define a model,
you can analyze it either by choosing options from the SIMULINK menus or by
entering commands in MATLAB’s command window.

Constructing a Simple Model:

At the MATLAB prompt type >> simulink. This command displays a new window
containing icons for the subsystem blocks that make up the standard library. These
subsystems can be opened (by double-clicking) to produce the windows containing
the prototype blocks to be copied into your models. Click on File and New, and then
move the window to a comfortable position.

Open Sources, Sinks, Continuous, and Connections by double-clicking on the icon


with the left mouse button. Move the windows to a comfortable position. Blocks can
be copied from one window to another by dragging them from the original location
to the new location by holding down the left mouse button. Assemble the following
diagram in your working window. [e.g. Step Input -> Sources; Sum ->Math
operations, Transfer Fcn -> Continuous; Scope -> Sinks ]
Demo Simulink
The above two figures shows Simulation 1 and Simulation 2 for the same system.

Simulation 1:

The system which is usually represented by ‘G’ is shown as Integrator. Input to this
system is a step function. In response to this input, the integrator’s output will be a
Ramp. Another block, Gain, is attached in between the input and system. This gain
will affect the output. Higher the value of this gain, more rapid will be the slope.

Simulation 2:

An advantage associated with this system is that it has faster response. As can be
seen from the graph that the output is achieved in a less time due to faster response.
LAB TASK
Enlarge the blocks, arrange into order, and wire them together as shown.
Blocks are expanded by dragging the corner indicators outward with the
mouse. To wire a block, drag the block’s output arrow to the input arrow of the
next icon using the left mouse button.

Double click on the Transfer Function block and change the coefficients.

Click on File, then Save and name your model.

Click on Simulation, then Parameters and set these according to your need.

Click on Simulation, then Start and observe the trace on the scope.

Soloution:

1.System:
2.Response:

3.By taking step input final value=10s:


Lab No. 2
Modeling of Electrical Networks

Objectives
1. Laplace Transformation of any electrical network
2. Should be able to Create the Transfer Function of a system Of both Mesh &
Nodal Networks
3. Finding the Impulse and Step Response of System by using Matlab code &
Simulink

Theory

Laplace Transform

The Laplace transform can be used to solve differential equations. Besides being a
different and efficient alternative to variation of parameters and undetermined
coefficients, the Laplace method is particularly advantageous for input terms that are
piecewise-defined, periodic or impulsive.
The direct Laplace transform or the Laplace integral of a function f(t) defined for 0 ≤ t
< 1 is the ordinary calculus integration problem

∫ f ( t ) e−st dt
0

Normally denoted as Lf (t)

Consider and RC Network

Fig
(1)…RC circuit

Time domain Equation is:


1
Vi( t)=i(t) R+
C
∫ i(t )dt
The Laplace transforms of the above equation yields
1
Vi ( s )=R I ( s ) + I (s )……. (i)
sC
And conversely the Output is
1
Vo ( s )= I (s) …………………… (ii)
sC
Solving both (i) & (ii) we get
Vo(s) 1
=
Vi (s) 1+ sCR
For C=10F; R=1O OHM
MATLAB CODE:
>> close all;
>> clear all;
>> sym s;
>> num=[1];
>> den=[100 1];
>> sys=tf(num,den)
Ans:
>> step (sys)

Fig (2)… Step Response

 Now Open “Simulink” in Matlab

Fig (3)...Simulink Digram


 Open the Scope & compare the output.
Lab Task 2.1
Find the transfer Function and Step response for a given network using Nodal
analysis. Compare the Both Simulink and step Results. Assuming R= 1kΩ & C= 100
µF:

Figure 4
Time Domain Equations:
-Vi(t) +1/sc +R(I1-I2)=0
Laplace Equation:
(i2-i1)+1/100s=0
Transfer Function:
Vo(s)
Vi (s)
= ____1/400s_____________
MATLAB CODE:
close all;
clear all;
sym s;
num=[1];
den=[1 400];
sys=tf(num,den)

Output:
Lab Task 2.2
Solve the RLC network using Laplace Transform and find the transfer function. Write
Matlab code and the also draw the step Response of a system using Simulink
Blockset.

Fig .5 Series RLC circuit


Lab Task 2.3(Lab Assignment)
Find the transfer Function and Strep response for a given network using Mesh
analysis. Compare the Both Simulink and step Results. Assuming R1= 1kΩ,
R2=100kΩ & C1 = C2= 1 µF:

Checked By: Date: _

You might also like