You are on page 1of 9

NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)

DEPARTMENT OF ELECTRICAL ENGINEERING

Linear Control Systems Lab


(EE-3302)

EXPERIMENT NO: 2

Name and Roll No:

Batch:

Date of Experiment:

Obtained Marks (Rubric Based): P1: P2: P3:

Total Marks: P1: 5 P2: 5 P3: 5 = 15

Remarks:

Instructor’s Signature
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

Experiment No 2:
Mathematical Modeling of Electrical Systems using LabVIEW and Matlab

Objective:
In this lab, we will learn to implement the transfer function in LAB VIEW, MATHSCRIPT, and
MATLAB.

Overview:
A transfer function (also known as the system function or network function and, when plotted as a graph,
transfer curve) is a mathematical representation, in terms of spatial or temporal frequency, of the relation
between the input and output of a linear time-invariant system with zero initial conditions and zero-point
equilibrium.
MATLAB, lab view and math-script provide functions for the implementation of transfer function.

Procedure:
We took a simple RLC circuit and found its transfer function as follows:

di(t ) 1
L + Ri (t ) +  i (t )dt = v(t )
dt C
as q(t) =  i(t)dt
d 2 q (t ) dq(t ) 1
L +R + q (t ) = v(t )
dt 2 dt C
output v C , q(t) = Cv C (t )
d 2 v C (t ) dv C (t )
LC 2
+ RC + v C (t ) = v(t )
dt dt
LCs 2 VC ( s ) + RCsVC ( s ) + VC ( s ) = V ( s )
VC ( s ) 1
G ( s) = =
V ( s) LCs + RCs + 1
2

1
G ( s) = LC
R 1
s2 + s +
L LC

Consider R = 20 Ω, L = 50 mH, and C = 10 μF and create transfer function equation.

1
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

LAB VIEW:

1. Simple SISO:
For this method, simply follow the following path in “block diagram” of lab view:
➢ Control system and simulation
➢ Control design
➢ Model construction
➢ Construct transfer function
➢ Right click and label
➢ Select SISO
➢ Create controls i.e. num and denum
➢ Draw transfer function
➢ Create indicator

Figure:
Block Diagram:

Front Panel:

2
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

The CD Construct Transfer Function Model VI creates a continuous model. You can create a discrete
transfer function model in one of two ways.

The method you use depends on whether you know the coefficients of the discrete transfer function model.
If you know the coefficients of the discrete transfer function model, you can enter in the appropriate values
for Numerator and Denominator and set the Sampling Time (s) to a value greater than zero.

If you do not know the coefficients of the discrete transfer function model, you must use the CD Convert
Continuous to Discrete VI for the conversion. Set the Sampling Time (s) parameter of this VI to a value
greater than zero.

2. Symbolic SISO:

For this method, simply follow the following path in “block diagram” of lab view:
➢ Control system and simulation
➢ Control design
➢ Model construction
➢ Construct transfer function
➢ Right click and label
➢ Select SISO(symbolic)
➢ Create controls i.e., num(symbolic) and denum(symbolic) and variable
➢ Draw transfer function
➢ Create indicator
3
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

Figure:
Block Diagram:

Front Panel:

Math Script:

For this method, simply follow the following path in “block diagram” of lab view:
➢ Programming
➢ Structures
➢ Mathscript node
➢ Add input R
➢ Add input L
➢ Add input C
➢ Write program in mathscript node
➢ Add output

4
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

➢ Draw transfer function


➢ Create indicator

Figure:
Block Diagram:

Front Panel:

5
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

MATLAB:

Write Matlab Program to generate transfer function of above RLC circuit using same values of R, L and C given
above.
Command for generating transfer function in Matlab is:

tf(num,den)

where num denotes numerator and den denotes denominator.

You have to define numerator and denominator and then calculate the transfer function.

Applications of RLC series circuit:

RLC circuits have many applications as oscillator circuits. Radio receivers and television sets use them for tuning to select a
narrow frequency range from ambient radio waves. In this role, the circuit is often referred to as a tuned circuit.

An electronic oscillator is an electronic circuit that produces a periodic, oscillating electronic signal, often a sine wave or a
square wave or a triangle wave. Oscillators convert direct current (DC) from a power supply to an alternating current (AC)
signal.

Example:

An RLC circuit is used in a radio to tune into an FM station broadcasting at f = 99.7 MHz. The resistance in the circuit is R =
12.6 Ω, and the inductance is L = 1.70 µH. What capacitance should be used?

Solution:

The resonance frequency of an RLC circuit


1
ω=2πf=
√𝐿𝐶

Therefore,
1
C=
4𝜋2 𝑓 2 𝐿

C = 1.50 pF

6
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

Comments:

7
NATIONAL UNIVERSITY OF TECHNOLOGY (NUTECH)
DEPARTMENT OF ELECTRICAL ENGINEERING

Lab Report should include the following:

• Create a Matlab program which takes input from user to enter numerator and denominator of a
transfer function and then calculate transfer function using Matlab Command.
• Design a LabVIEW VI to create transfer function of series RLC circuit by taking R, L and C values
by yourself. Design using SISO symbolic and convert to discrete transfer function. Also design
the system using Mathscript code.

In your Lab Report, use front page and comments page as provided in this lab experiment. Your Lab report
should cover Objectives (which you cover in your lab), Introduction, Schematics and Results (Software),
and Conclusion.

Use Font Style (Times New Roman) and Font Size (12). Also use header as provided.

You might also like