Lab 1&2 Lcs
Lab 1&2 Lcs
1
Introduction to Simulink Basics
Objectives
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.
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.
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.
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 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:
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
Fig
(1)…RC circuit
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.