You are on page 1of 124

LAB MANUAL

Linear Control Systems

| Muhammad Noman Wazir


Linear Control Systems
Lab Manual

Submitted To:
Ma’am Nashita Alwaz
Submitted BY:
Muhammad Noman Wazir
P-1
2K17-ELE-02
List Of Experiments
Linear Control Systems
Sr. Experiments Name CLO’s
No. Covered
1 To describe a brief introduction of LabVIEW software. CLO1& CLO2
2 To understand the modeling of a system using transfer CLO1& CLO2
function with while loop.
3 To understand Closed Loop Control simulation in CLO1& CLO2
LabVIEW.
4 To understand the modeling of a system using state space CLO1& CLO2
representation with while loop.
5 To understand the Time response of a First order system CLO1& CLO2
in LabVIEW.
6 To understand the Time Response Analysis of a 2nd order CLO1& CLO2
system in LabVIEW.
7 To understand the modeling of a DC Motor in LabVIEW. CLO1, CLO2
&CLO3
8 To understand the speed control of DC Motor using CLO1, CLO2
QNET-DCMCT in LabVIEW. &CLO3
9 To understand the DC Motor position control using CLO1, CLO2
QNET-DCMCT in LabVIEW. & CLO3
10 To implement Routh-Hurwitz criterion in LabVIEW CLO1& CLO2
Software.
11 To analyze the location of poles & zeros using Root CLO1& CLO2
Locus in LabVIEW.
12 To understand the application of Root Locus for CLO1& CLO2
comparing the sensitivity of various parameters at
different root locations.
13 To implement Bode diagram for the Liquid level control CLO1& CLO2
system in LabVIEW.
14 To implement Bode diagram for the Remotely Controlled CLO1& CLO2
Vehicle in LabVIEW.
15 To understand the simulation of Tank Level Control CLO1& CLO2
System using PID Controller in LabVIEW.
16 To perform the simulation of the Simple Pendulum by CLO1& CLO2
using LABVIEW.
EXPERIMENT No.1 (CLO1 & CLO2)
Objective:

To understand a brief introduction of LabVIEW software.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:
A linear control system is a system that is linear, and is used to control another system. A good
example is the proportional integral derivative (PID) controllers. Linear control systems can be
described by a transfer function.

A linear system has these properties:

1. If you multiply the input by a number, the output will be multiplied by the same number.
2. The output for the sum of two input signals is the sum of the corresponding output
signals.

LabVIEW abbreviated as Laboratory Virtual Instrument Engineering work bench.

Dataflow Programming:

The programming language used in LabVIEW, also referred to as G, is a dataflow programming


language. Execution is determined by the structure of a graphical block diagram on which the
programmer connects different function-nodes by drawing wires. These wires propagate
variables and any node can execute as soon as all its input data become available. G is inherently
capable of parallel execution.

Graphical Programming:

LabVIEW realize on graphical symbols rather than textual language to describe programming
actions.

Virtual Instruments (VIs)

A LabVIEW program is called virtual instrument. The appearance and operation of


VIs imitate physical instruments, such as oscilloscopes and digital multimeters.
Creating a VI

Go to start up menu click on LabVIEW 2013.Start up window is open. Click on blank VI, two
windows are open.

1. Front Panel.

2. Block Diagram.

Figure 1.1: Creating A VI

Front panel:
The front panel is that the user interface of the VI.

Controls Palette:
The Controls palette is obtainable solely on the front panel. The Controls palette contains the
controls and indicators you use to create the front panel as shown in figure1.
Figure 1.2: Control Pallets

Controls and Indicators

Numeric Controls and Indicators


The numeric data type can represent numbers of various types, such as integer or real. The two
common numeric objects are the numeric control and the numeric indicator, as shown in Figure
3. Objects such as meters and dials also represent numeric data.

(1) Increment/Decrement Buttons | (2) Numeric Control | (3) Numeric Indicator

Figure 1.3: Numeric Controls and Indicators

Boolean Controls and Indicators


The Boolean data type represents data that has only two possible states, such as TRUE and
FALSE or ON and OFF. Boolean objects simulate switches, push buttons, and LEDs. The
vertical toggle switch and the round LED Boolean objects are shown in Figure 1.4.
Figure 1.4: Boolean Controls and Indicators

String Controls and Indicators


The string data type is a sequence of ASCII characters. Use string controls to receive text from
the user such as a password or user name. Use string indicators to display text to the user. The
most common string objects are tables and text entry boxes as shown in Figure 1.5.

Figure 1.5: String Controls and Indicators

• Block diagram:
Contains the graphical source code that defines the functionality of the VI. After you build the
front panel, you add code exploitation graphical representations of functions to control the front
panel objects. Additionally, the block diagram contains functions and structures from inbuilt lab
view VI libraries.

Functions Palette:
The Functions palette is obtainable solely on the diagram. The Functions palette contains the VIs
and functions you employ to build the block diagram as shown in figure 3.
Figure 1.6: Function Pallets

Structures

G Structures include While Loop, For Loop, Case, and Sequence structures. This palette also
contains the global and local variable nodes, and the formula node.

Numeric Functions

Numeric functions perform arithmetic operations, conversions, trigonometric, logarithmic, and


complex mathematical functions. This palette also contains additional numeric constants, such as
π.

Boolean Functions

Boolean functions perform Boolean and logical operations.


String Functions

String functions manipulate strings and convert numbers to and from strings. This palette also
includes Additional String to Number functions and String Conversion functions.

Array Functions

Array functions assemble, disassemble, and process arrays.

Cluster Functions

Cluster functions assemble, access, and change elements in a cluster.

Comparison Functions

Comparison functions compare data (greater than, less than and so on) and operations that are
based on a comparison, such as finding the minimum and maximum ranges for a group or array
of values.
Time and Dialog Functions

Time and Dialog functions manipulate time functions and display dialog boxes. This palette also
includes the VIs that performs error handling.

File I/O Functions

File I/O functions manipulate files and directories. This palette also contains the sub palettes
Advanced File Functions, Binary File VIs, and File Constants.

Dialog & User Interface VIs and Functions


Use the Dialog & User Interface VIs and functions to create dialog boxes to prompt users with
instructions.
Instrument I/O

Instrument I/O VIs communicate with instruments using GPIB, VISA, or serial communication.

• Icon and connector panel:


Identifies the VI. You can use the VI in another VI .A VI within another VI is termed a sub VI.
Tools Palette:
The Tools palette is available on the front panel and in addition the block diagram. A tool may
be a special in operation mode of the mouse indicator.

Automatic Tool Selector


The top item in the Tools palette is the Automatic Tool Selection button. When you select this,
LabVIEW automatically chooses a tool based on the location of your cursor. You can turn off
automatic tool selection by deselecting the item or by selecting another item in the palette.

Figure 1.7: Tool Pallets


Status Tool Bar

Benefits of LabVIEW software:

The following are the advantages of LabVIEW:

• Graphical user interface: Design professionals use the drag-and-drop user interface
library by interactively customizing the hundreds of built-in user objects on the controls
palette.
• Multiple high level development tools: Develop faster with application specific
development tools, including the LabVIEW State chart Module, LabVIEW Control Design
and Simulation Module and LabVIEW FPGA Module.
• Multi platforms: The majority of computer systems use the Microsoft Windows
operating system. LabVIEW works on other platforms like Mac OS, Sun Solaris and
Linux. LabVIEW applications are portable across platforms.
• Reduces cost and preserves investment: A single computer equipped with
LabVIEW is used for countless applications and purposes—it is a versatile product.
Complete instrumentation libraries can be created for less than the cost of a single
traditional, commercial instrument.
• Connectivity and instrument control: LabVIEW has ready-to-use libraries for
integrating stand-alone instruments, data acquisition devices, motion control and vision
products, GPIB/IEEE 488 and serial/RS-232 devices, and PLCs to build a complete
measurement and automation solution.
• Distributed development: Can easily develop distributed applications with
LabVIEW, even across different platforms. With powerful server technology you can
offload processor-intensive routines to other machines for faster execution, or create
remote monitoring and control applications.
• Target management: Easily manage multiple targets, from real-time to embedded
devices including FPGAs, microprocessors, microcontrollers, PDAs and touch panels.
• Algorithm design: Develop algorithms using math-oriented textual programming and
interactively debug .m file script syntax with LabVIEW MathScript.

CREATE A VI THAT TAKES A NUMBER REPRESENTING DEGREE


CENTIGRADE AND CONVERTS IT INTO A NUMBER REPRESENTING
DEGREE FAHRENHEIT

PROCEDURE

1. Open a new front panel by selecting the New VI button from the startup window. Double click
on “Blank VI “to open the window.

2. View the front panel and block diagram windows side by side by choosing Tile Left and
Right from the Window menu.

3. You will now build the front panel and block diagram shown below.
Figure 1.8: Front Panel of 0C to 0F

Figure 1.9: Block Diagram of 0C to 0F


A. Create the front Panel

1. Create the Numeric Control. You will use this control to enter the value for degrees
Centigrade. When the left (front panel) window is active, the Tools palette and the Controls
palette should be visible. To make them visible, select Show Tools Palette and/or Show Controls
Palette from the Windows menu.

a. Select Numeric Control from the Numeric sub palette of the Controls palette.

b. Drag the Control to where you want it and release the mouse button.

c. Type deg C inside the label and press the Enter Button (check mark) on the Toolbar.

2. Create the Numeric Indicator. You will use this indicator to display the result from a
calculation to convert temperature from degrees Centigrade to degrees Fahrenheit.

a. Select Numeric Indicator from the Numeric sub palette of the Controls palette.

b. Drag the indicator to where you want it and then release the mouse button. c. Type deg F
inside the label and click outside the label when finished.

c. Type deg F inside the label and click outside the label when finished.

B. Create the block Diagram

1. Select the multiply and Add functions one at a time from the Numeric sub palette of the
Functions palette and place them in the diagram window.

2. Select the two numeric constants one at a time from the Numeric sub palette of the Functions
palette. When you first place the numeric constant on the Diagram window, it is highlighted so
you can type a value into it. Type 1.8 into one constant and 32.0 into the other one

3. Using the Wiring Tool from the Tools palette, wire the icons as shown in the block diagram
above. To wire from one terminal to another, click the Wiring tool on the first terminal, move the
tool to the second terminal, and click on the second terminal.
C. Save the VI

a. Select Save from the File menu.

b. A dialog box will open. Type in the name of the VI: Convert C to F.vi.

c. Click on OK. This will save the VI to your library.

D. Run the VI

a. Using the Operate Tool, double-click in the Numeric Control and type in a new number.

b. Run the VI by clicking on the Run Arrow on the Toolbar.

c. Try several different numbers.

E. Close the VI

IMPLEMENT PYTHAGOREAN THEOREM USING LABVIEW

PROCEDURE

We can compute the length of the hypotenuse using the Pythagorean Theorem which is

a2+b2 ( equation 1.1)

Which means that c=√a2+b2

A. Create the front Panel

1. Controls are input values to the program and indicators are output from the program. We have
two controls that the user can enter, these are "a" and "b", and we have one indicator, "c".

2. The "Num Ctrls" contains all of the numeric controls available to you and "Num Inds"
contains all of the numeric indicators. Click on Num Ctrls and then drag the icon that says "Num
Ctrl" to the front panel. This will have the value of the "a" side and you can rename this control
by double clicking the text above the control and typing an "a", the click anywhere on the front
panel. This is how you can change the label above any front panel item. Do the same thing for
the "b" side.

3. To create the indicator for the value of "c" select "Num Inds" in the Express window and then
drag a numeric indicator, labeled "Num Ind" to your front panel. You can now arrange these
controls and indicators like the Front Panel below.

4. Now we need to add the code to make the program take the values of "a" and "b" and
compute "c". If we run the program like it is right now it will only print a value of zero for "c"
because it isn't computing anything! Here are the steps to compute "c".

Figure 1.10: Block Diagram of Pythagorean Theorem

B. Create the block Diagram

1. Move your cursor to the block diagram. This will be a window containing only the two
controls for "a" and "b", and the one indicator for "c". When you add a control or an indicator to
the front panel it also adds it to the block diagram. We will add the code to this now. The image
below shows the actual block diagram that you are going to create.

2. Right click on the block diagram and a functions window will come up. We want to square
the value of "a" and "b" and to do that you want to click on the small arrow at the bottom of the
functions window. Then click on the Mathematics Numeric icon and then drag the "Square" icon
to the block diagram.

3. To square the value of a, we have to connect the control containing the 'a' value to the "square"
function. When you move the cursor to the right of the control a roll of wire will appear and you
want to hold the mouse and drag it to the left of the square function.

4. To square the value of b, you want to do steps 2 and 3 with the value of b. After you do that
you will have the a 2 and b 2 and the next thing to do is to add these two values together.

5 You want to add an "add" function to the block diagram and you can do this by right clicking
on it, selecting Mathematics, clicking on numeric, and then dragging the "add" icon to the block
diagram.

6. The add function has two inputs and one output. The inputs are always on the left and the
outputs on the right. So take the output of where you squared "a" and connect it to the top input
of the add function and then take the output of squaring "b" and connect it to the bottom input of
he add function. You now have a 2 + b 2.

7. The next step is to take the square root of a 2 and b 2 and you can do this by right clicking on
the block diagram, select mathematics, select numeric, and then drag the square root icon to the
block diagram. There is a single output from the add function and you want to drag that to the
input of the square root function.

8. The last step is to drag the output of the square root function to the indicator having the "c"
value. This will take the value of sqrt (a 2 + b 2) and display it on the screen.
Figure 1.11: Block Diagram of Pythagorean Theorem

C. Save the VI

a. Select Save from the File menu.

b. A dialog box will open. Type in the name of the VI: Pythagorean Theorem VI.

c. Click on OK. This will save the VI to your library.

D. Run the VI

a. Using the Operate Tool, double-click in the Numeric Control and type in a new number.

b. Run the VI by clicking on the Run Arrow on the Toolbar.

c. Try several different numbers.

E. Close the VI

CONCLUSION:

From this lab we are able to understand basic tools of LabVIEW software. We are also able to
understand how simple control and mathematics functions can be implemented by using
LabVIEW Software.
EXPERIMENT No.2 (CLO1 & CLO2)
Objective:

To understand the modeling of a system using transfer function with while


loop.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Modeling of a System:
The control system can be represented by a set of mathematical equations known as
mathematical modeling. There are three ways of mathematical modeling:

1. Differential Equations.
2. Transfer Functions.
3. State-Space Analysis.

Transfer Function:
The Transfer Function of a control system defined as the ratio of Laplace Transform of output
variables to the Laplace Transform of the input variables. Assuming all initial conditions to be
zero.

G(s) = C(s) / R(s)

Use of Laplace Transform:


The Laplace Transform turns integral and differential equations into the polynomial equations
which are much easier to solve.
Train System:
The system can be represented by following Free Body Diagrams.

Figure 2.1: Free Body Diagrams

M1(d2 x1/ dt2) + ug M1(d x1/ dt) + k(x1 – x2) = F

M2(d2 x2/ dt2) + ug M2(d x2/ dt) + k(x2 - x1) = 0

x1 (s) / F(s) = M2s2 + u Mgs + k / M1 M2 s4 + (2M1 M2ug) s3 + (M1 k + M1 M2 u2g2 + M2 k) s2

+ (M1ug + u M1 gk)s

LABVIEW
Block Diagram Parameters:

While Loop:
Execute a Block of subdiagram until a Boolean condition is met.
CD Construct Transfer Function:
• Symbolic.
• Creates a transfer function representation of a system using sampling time(s), numerator,
denominator and delay.

CD Draw Transfer Function:


Display the transfer function equation of the model.

PROCEDURE:

A. Create a Block Diagram

1. If you choose to use the transfer function, create a blank VI and add the Construct Transfer
Function Model VI to your block diagram. This VI is located in the Model Construction section
of the Control Design palette.

2. Click the drop-down box that shows “SISO” and select “Single-Input Single-Output
(Symbolic)”.

3. To create inputs for this transfer function, right-click on the Symbolic Numerator terminal and
select Create » Control. Repeat this for the Symbolic Denominator and Variables terminals.
These controls will now appear on the front panel.

4. Next, add the CD Draw Transfer Function VI to your block diagram, located in the Model
Construction section of the Control Design palette.

5. Connect the Transfer Function Model output from the Create Transfer Function Model VI to
the Transfer Function Model input on the CD Draw Transfer Function VI.

Finally, create an indicator from the CD Draw Transfer Function VI. To do this, right-click on
the Equation terminal and select Create»Indicator.

Now create a While Loop, located in the Structures palette, and surround all of the code in the
block diagram. Next, right-click on the Loop Condition terminal in the bottom-right corner of the
While Loop, and select Create»Control.
Figure 2.1: Transfer Function with While Loop

Figure 2.2: Transfer Function Front Panel

CONCLUSION
Once the differential equation representing the system model has been created in LabVIEW in
the transfer function the open-loop and closed-loop system behavior can be studied. From this
example we are able to understand how to enter a differential equation model into LabVIEW
using the LabVIEW Control Design and Simulation Module.
EXPERIMENT No.3 (CLO1 & CLO2)
Objective:

To understand the Closed Loop Control simulation in LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Control System:
A control system manages, commands, directs, or regulates the behavior of other devices
or systems using control loops. It can range from a single home heating controller using a
thermostat controlling a domestic boiler to large Industrial control systems which are used
for controlling processes or machines.

There are two types of Control System:

1. Open Loop Control System.


2. Closed Loop Control System.

1. Open Loop Control System:


An open loop control system acts completely on the basis of input and output has no effect on the
controlling action.

1. Simple in Construction.
2. Ease in maintenance.
3. Inaccurate.
4. More sensitive to noise disturbance and changes in environment.
5. Used when inputs are known ahead of time.

2. Closed Loop Control System:


The control system which uses its feedback signal to generate the output is called as Closed Loop
Control System.

1. Complicated Structure.
2. Difficult in maintenance.
3. Accurate.
4. Less sensitive to noise disturbance and changes in the environment.
5. Used when inputs are known ahead of time.

Closed Loop Example:

Simulation:
Simulation is the representation of the functioning of the System.

Block Diagram Parameters:

1. Control and Simulation Loop:


Execute the simulation diagram until the control and simulation loop reaches the final time.

➢ Input Node.
➢ Output Node.

Control & Simulation >> Simulation >> Loop

2. Step Signal:
Generate point by point value of a step signal.

Control & Simulation >> Simulation >> Signal Generation >> Step Signal

3. Summing Point:
To perform basic arithmetic operation on a signal present in simulation diagram.

Control & Simulation >> Simulation >> Signal Arithmetic >> Summing Point
4. Gain:
Used as the gain control. The output is proportional to the error signal.

Control & Simulation >> Simulation >> Signal Arithmetic >> Gain

5. Transfer Function:
Implement a system model in T.F form.

Control & Simulation >> Simulation >> Continuous Linear System >> T.F

6. Sim Time Waveform:


Plot a value versus Simulation time on a waveform chart.

Control & Simulation >> Simulation >> Graph Utilities >> Sim Time Waveform

PROCEDURE:
A. Create the Block Diagram

1. Firstly place control and simulation loop from the control and simulation module on the block
diagram which is necessary to execute the simulation diagram.

2. Place Step input to provide sudden input to the system. Step input select from signal generator
function which is present in the control and simulation module.

3. Select summation point from the signal arithmetic function which is basically used to provide
the difference between the desired input and actual input. Attach summation point to the step
input.

4. Place gain which is also selected from the signal arithmetic functions. Right click on the gain
and then click on control. Rename that control with proportional gain. Basically in this example
we are using proportional gain only.

5. Then select transfer function from continuous linear system function. Double click on that
transfer function then a window will open. In that window click on configure on dialog box and
then give the value of numerator and denominator as shown in figure 2
Figure 3.1: Transfer function configuration

6. Then move to display the output. For displaying the output select Sim Time waveform from
the graph utilities. Then attach that waveform to transfer function block.

7. Double click on the input node of the control and simulation loop. Set simulation and timing
parameters. Set the final time of 10 second. Means our program simulate in 10 second of time.
Then give timing source of 1KHZ clock.

8. At last provide feedback as shown in figure 3 to create the schematic of closed loop.
Figure 3.2: Block Diagram of LabVIEW

B. Create the Front Panel

1. Sim wave form chart and proportional gain are present on the front panel.

2. Enter the value of proportional gain.


Figure3. 3: Front panel of LabVIEW

C. Save the VI

a. Select Save from the File menu.

b. A dialog box will open. Type in the name of the VI: Closed loop.vi.

c. Click on OK. This will save the VI to your library.

D. Run the VI

a.Run the VI by clicking on the Run Arrow on the Toolbar.

b. Try several different numbers.

E. Close the VI
CONCLUSION
From the graph we can analyze that as we increase the proportional gain steady state error of the
system decreases. So closed loop system reduces the error and make system more stable.
Feedback Control the amplitude of oscillations. The faster the open loop amplifier faster the time
scale.
EXPERIMENT No.4 (CLO1 & CLO2)
Objective:

To understand the Modeling of a System using State Space representation


with while loop.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

State:
Group of variables which summarizes the history of the system in order to predict the future
values.

State Variables:
The smallest set of variables that determines the state of the system are known as state variables.

State Vector:
Vectors contain Sate variables as elements.

State Space Representation:


State Space Analysis is a mathematical model of a physical system as a set of input, output and
state variables related by first order differential equation.

Replaces the nth order differential equation into the first order differential equation.

Comparison between State Space & Transfer Function:

Transfer Function:
➢ Linear Time Invariant.
➢ SISO.
➢ Less Accurate.
➢ Not any idea about internal State of the System.
State Space:
➢ Linear + Non-Linear.
➢ MIMO.
➢ More Accurate.
➢ Give idea about internal state of the System.

Two Equations:

Consider a system

Figure 4.1: Free Body Diagrams

M1 x1’’ = F – k(x1 – x2) – uM1gx1

M2 x2’’ = k(x1 – x2) – uM2gx2

[ x1’ [ 0 1 0 0 [x1 [0

v1’ = -k/M1 -ug k/M1 0 v1 + 1/M1 [F]

x2’ 0 0 0 1 x2 0

v2’] k/M2 0 -k/M2 -ug] v2] 0]


[x1

y = [ 0 1 0 0] v1 + [0][F]

x2

v2]

Block Diagram Parameters:

1. While Loop:
Continuous the process until the Boolean condition is satisfied.

2. Mathscript Node:
Mathscript adds the textual maths to the LABVIEW development environment.

3. CD Draw State Space:


Display the State Space equation of the State Space Model.

PROCEDURE:
A. LabVIEW Hybrid Graphical/MathScript Approach

1. To do this, create a blank VI and insert a MathScript Node from the Structures palette. Write
the above A matrix in the math script node.

2. Next, right-click on the left border of the MathScript Node and select “Add Input”. Name the
input “M1”. Repeat this process to create inputs for M2, k, u, and g.

3. Right-click on the right border of the MathScript Node and select “Add Output” to create an
output called “sys”. After creating this output, right-click on it and select Choose Data Type »
Add-ons » SS object.

Next, right-click on each input and select Create » Control.

4. Add the Draw State-Space Equation VI to the block diagram, and create an equation indicator.

5. Connect the “sys” output from the MathScript Node to the “State-Space Model” input of the
Draw State-Space Equation VI.

6. Finally, create a While Loop around the code, and create a control for the Loop Condition
terminal.
Figure 4.2: Using MathScript Node to Create State-Space Equation

OBSERVATIONS

1. From this VI, you can now create a state-space model for the train system.

2. Try changing the terms in the front panel, and observe the effects on the state-space model.

Figure 4.3: State-Space Equation Front Panel


CONCLUSION
Once the differential equation representing the system model has been created in LabVIEW in
the state-space form, the open-loop and closed-loop system behavior can be studied. From this
example we are able to understand how to enter a differential equation model into LabVIEW
using the LabVIEW Control Design and Simulation Module.
EXPERIMENT No.5 (CLO1 & CLO2)
Objective:

To understand the Time Response Analysis of a First order system in


LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Time Response Analysis:


➢ Also known as Time Domain Analysis.
➢ Time Response Analysis of a Dynamic System provides information how the system
responds to a certain input.
➢ Time Response Analysis = Transient Response + Steady State Response
➢ When a system takes an excitation(input), there is a response(output). This response
varies with time is called Time Response.

Time Response:
The variation of output response during the time it takes to reach its final value is called
Transient Response.

Steady State Response:


The response of the system that remains after the transient response has dies out is called Steady
State Response.

Order of a System:
The order of a system determines by the power of s in the denominator of its transfer function.

First Order System:


In first order system, we have one integrator.

C(s) = R(s) G(s)

C(s) = a/s(s + a)
c(t) = 1- e-at

DC Gain:
The ratio of the steady state output of the system to its constant input.

Time Constant:
Time to get 63% of its final value.

Parameters of Time Response Analysis:

1. Rise Time(Tr):
Time required for the waveform to go from 0.1 to 0.9 percent of its final value.

2. Peak Time(TP):
Time required to reach first or final peak.

3. Settling Time(TS):
Time required for a response to reach 2% to 5% of its final value.

Labview Block Diagram Parameters:

1. While Loop:
Continuous the process until the Boolean condition is satisfied

2. CD Construct Special T.F. Model:


Generates Transfer Function w.r.t any mathematical equation.

Control & Simulation >> Control Design >> Model Construct

3. CD Draw T.F Model:


Display T.F Model Equation.

Control & Simulation >> Control Design >> Model Construct

4. CD Step Response:
Calculates the output of the system when a step input excites it.

Control & Simulation >> Control Design >> Time Response


5. CD Parametric Time Response:
Calculates parametric information peak time, rise time etc of an input model based on time
response data.

Control & Simulation >> Control Design >> Time Response

PROCEDURE:
Create the Block Diagram:

▪ Create a new VI.


▪ Save the VI as 1st order VI.
▪ Right-click on the block diagram and navigate to Control Design & Simulation» Control
Design» Model Construction and drag the CD Construct Special TF Model VI onto the
block diagram.
▪ See the figure below. Left-click on the polymorphic VI selector of the CD Construct
Special TF Model VI in the block diagram and select 1st Order Model.
▪ Navigate to Control Design & Simulation» Control Design» Time Response and drag
the CD Step Response VI onto the block diagram. The polymorphic instance of the CD
Step Response VI will show SS for state space but this will change after the next step.
▪ Wire the Transfer Function Model output of the CD Construct Special TF VI to the State-
Space Model input of the CD Step Response VI. The polymorphic instance of the CD
Step Response VI will automatically change to TF.
▪ Right-click on the Step Response Graph output of the CD Step Response VI and
select Create» Indicator.
▪ Navigate to Control Design & Simulation» Control Design» Time Response and drag
the CD Parametric Time Response VI onto the block diagram. Then select internal
instances. Then select Transfer Function.
▪ Right-click on the Time Parametric Data output of the CD Step Parametric Time
response VI and select Create» Indicator.
▪ Navigate to Control Design & Simulation» Control Design» Model Construction and
drag the CD Draw Transfer Function VI onto the block diagram.
▪ Right-click on the Transfer Function Model output of the CD Draw Transfer Function
and select Create» Indicator.
▪ Go to programming>>structures>>while loop>> and place the while loop on the diagram
around the existing code.
▪ However the loop condition terminal at the bottom right of the loop, right click and select
create control to put a stop button on the front panel for the VI.
▪ The block diagram of your VI should look like this:
Figure 5.1: Block Diagram

Create the Front Panel:

Run the VI after putting in nonzero values for Static Gain and Time Constant on the front
panel. Adjust the parameters on the front panel and observe the system response. Your front
panel should be similar to this:

Figure 5.2: Front Panel

CONCLUSION:
From this we are able to understand the time response of first order system. We can see that in
first order there is no overshoot and non-zero initial slop. From the response we can measure the
time constant which is exactly 63 % of its final value.
EXPERIMENT No.6 (CLO1 & CLO2)
Objective:

To understand the Time Response Analysis of a 2nd order system in


LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Second Order Control System:


If the power of s in the denominator of Transfer Function of a control system is 2, then the
system is said to be second order system.

Figure 6.1: Second Order Control System

General Expression is

Damping Ratio(Zeta ζ):


Dimensionless measure describing how oscillations in a system decay after a disturbance.
Natural Frequency(wn):
The frequency at which a system oscillates when not subjected to a repeated or continuous
external force.

If ζ = 0 >> Undamped System.

If 0<ζ<1 >> Underdamped System.

If ζ=1 >> Critically Damped System.

If ζ>1 >> Over Damped System.

Maximum Overshoot:
The amount that the waveform overshoots, the steady state or final value at the peak time
expressed as the percentage of the steady state value.

Figure 6.2: Step response of a second order system for percentage overshoot
PROCEDURE:
1. Create a new VI.
2. Save the VI as My Controls Example VI.
3. Right-click on the block diagram and navigate to Control Design & Simulation» Control
Design» Model Construction and drag the CD Construct Special TF Model VI onto the block
diagram.
4. See the figure below. Left-click on the polymorphic VI selector of the CD Construct Special
TF Model VI in the block diagram and select 2nd Order Model. The second order model can
be used to describe a mass-spring-damper system or an RLC circuit.
5. On the front panel, right-click to display the Controls palette. Navigate to Modern
»Numeric» Horizontal Pointer Slide and drag a Horizontal Pointer Slide onto the front
panel. While the name of the slide is highlighted, change it to Damping Ratio. Follow the
same procedure to create another slide and make its name Natural Frequency.
6. On the front panel, click on the maximum number for the Damping Ratio slide and change it
to 1. Change the maximum number for the Natural Frequency slide to 5.
7. On the block diagram, wire the Damping Ratio and the Natural Frequency slides to
the Damping Ratio and Natural Frequency inputs respectively of the CD Construct Special
TF VI.
8. Navigate to Control Design & Simulation» Control Design» Time Response and drag the CD
Step Response VI onto the block diagram. The polymorphic instance of the CD Step
Response VI will show SS for state space but this will change after the next step.
9. Wire the Transfer Function Model output of the CD Construct Special TF VI to the State-
Space Model input of the CD Step Response VI. The polymorphic instance of the CD Step
Response VI will automatically change to TF.
10. Right-click on the Step Response Graph output of the CD Step Response VI and
select Create» Indicator.
11. Go to Programming» Structures» While Loop and place a While Loop on the diagram around
the existing code.
12. Hover over the Loop Condition terminal at the bottom right of the loop, right-click, and
select Create Control to put a Stop button on the front panel for the VI.
13. Additionally the statics on the performance of the step response can be calculated the
implementation and results of the CD Parametric Time response VI can be seen in the
following figure.
14. The block diagram of your VI should look like this:
Figure 6.1: Block Diagram

14. Run the VI after putting in nonzero values for Damping Ratio and Natural Frequency on the
front panel. Adjust the parameters on the front panel and observe the system response. Your
front panel should be similar to this:
Figure 6.2: Front Panel

CONCLUSION:
From this we are able to understand the time response of 2nd order system. We can see that in
first order there is overshoot.
EXPERIMENT No.7 (CLO1, CLO2 & CLO3)
Objective:

To understand the modeling of a DC Motor in LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

DC Motor Working Principle:


A machine that converts DC Power into mechanical power is known as DC Motor.

When a current carrying conductor is placed in a magnetic field, the conductor experiences a
mechanical force. Force on each conductor is tending to rotate the armature in anti-clockwise
direction. All these force together produce a driving torque which sets the armature rotating.

Basic Control System:


➢ Understand the system.
➢ Develop a mathematical model.
➢ Design a Controller.
➢ Simulate and Validate.
➢ Implement the Controller.
➢ Run and evaluate.

NI ELVIS:
NI-ELVIS stands for NI Engineering Laboratory Virtual Instrument Site is a modular
engineering education laboratory device. It includes an oscilloscope, digital multimeter, function
generator, variable power supply, Bode Analyzer and other common Lab instruments.

DC Motor Control Trainer(DC MCT):

1. DC Motor.
2. High Resolution Encoder.
3. Motor Metal Chamber.
4. Inertial Load.
5. PCI Connector to Elvis.
6. PWM/Encoder Board.
7. 24V QNET Power Jack.
8. Fuse.
9. +B, +15V, -15V, +5V LED

DC MCT has an input voltage of +-24V. The motor has an encoder that measures its position, a
digital tachometer that measures its speed and a current sensor to measure the actual current
being fed into motor.

Modeling of DC Motor:
Electrical equations describing the open loop response of DC Motor.

Vm(t) – RmIm(t) – Eemf(t) = 0

Eemf(t) = Kmwm(t)

The mechanical equation describing the torque of the motor are

Tm = Jeq(d/dt . wm(t))

The step response is generated using the transfer function.

Y(s) / U(s) = k / T(s) + 1

k = 5.0 rad/s

T = 0.05s

Bump Test:
Bump test method is used to find out the model parameters of the DC motor. Runs the DC Motor
in open loop and plots the corresponding speed and input voltage responses.

This model is compared with the measured response by running the simulation and actual system
in parallel. The model parameters are then tuned for better fit.

Sampling Rate:
The rate at which sample of analog signal are taken into account to be converted into digital
form.

Build Array:
Concatenates multiple arrays or appends elements to an n-dimensional arrays.
Unbundled by Name:
Returns the cluster elements whose name you specify.

Signal Generator:
Creates an output waveform based on signal type.

Control & Simulation >> Simulation >> Signal Generation

Collector Function:
Collects a signal at each time step of the simulation and returns the history of the signal value.

Control & Simulation >> Simulation >> Utilities

Halt simulation:
Stop the simulation at specific time limit.

Control & Simulation >> Simulation >> Utilities

SIM Time Waveform:


Display the graph of simulation.

Control & Simulation >> Simulation >> Graph Utilities

PROCEDURE:
Start Up:
I followed these steps to check the actual response of the motor.
1. Power the NI-ELVIS and QNET
2. Open and run the LabVIEW Virtual Instrument QNET-DCMCT.
Create the Block Diagram:
1. Firstly, I connected the icon of sampling rate. This icon is basically used to acquire analog
data from DCMCT and after that converting this analog data into digital form. It is
basically measuring the samples per second of analog data.
2. For taking the reference values, I done simulation at the start of experiment. In which
bump test is performed by providing the step input to the DC motor model. For
performing simulation, I need control and simulation loop on the block diagram of
LabVIEW. I picked the control and simulation loop from the control and simulation
block which is presented on the function pallet of the block diagram. Halt Simulation icon
is used here which is presented in control and simulation and then utilities. It is used here
to stop the simulation.
3. At the start of control and simulation loop, I used the icon of T.F. The main purpose to
utilize it is to filter the speed coming from the hardware block.
4. After that I used the icon of sampling generator. This icon can be picked from the control
and simulation, simulation and then signal generator block. I placed three input terminals
at the input of signal generator by using the unbundled by name. Three terminals are
amplitude, frequency and offset.
5. In the next step, I used one more unbundled by name icon which is selected from the array
block of the function pallet. The purpose for using this is the partition of two model
parameters (Proportion gain, Time constant).
6. In this experiment, I am dealing with the dc motor which is basically a system. We need a
controller for our system. Hence, it is necessary to place the T.F. block (Model Sim
Model) here for representing the system modeling.
7. Then I used the icon of build array which is selected from the array block of function
pallet. The main purpose for utilizing it is to combine the response of hardware filter
speed and the current simulated mode speed. The output of this block is further passed
through the waveform chart. Waveform chart displays the response of actual speed and
the simulated speed.
8. Another waveform chart is connected in control and simulation loop to display the
response of voltage according to the simulated system of motor.
9. In the next step, two collector icons are connected to collect the response of simulation at
each step.
10. For acquiring and transmitting the data from hardware, digital read and write blocks are
connected.
11. Speed and voltage waveforms connected outside the simulation loop are basically
displaying the response of hardware system.

Figure 7.1: Block Diagram of Modeling of a DC Motor


Create the Front Panel:
1. In the first step, set the signal type for the signal generator icon as square. Set the desired
frequency, amplitude and offset as :
Amplitude =1.00 V
Frequency=0.40 HZ
Offset=2.00V
2. Set the model parameters as:
K=10.0rad / (V.s)
Tau=0.100s
3. In the next step. Set the value for graph buffer which is used to manage the multiple
functions that are relying on each other.
Graph buffer=5.0s
4. Set the accurate device name and sampling rate.

Figure 7.1 Selecting Correct Device

5. The digital scope demonstrates the digital speed, voltage and current.
Figure 7.2 QNET DCMCT Modeling VI Running

Figure7.3QNET-DCMCT Modeling Virtual Instruments


6. Measurement graphs depicts the actual speed and voltage of motor.

Figure7.4 QNET-DCMCT Modeling VI: “Measurements Graphs”

7. Two scopes are representing the actual and simulated responses of speed and voltage.

CONCLUSION:
From this we are able to understand the time response of second order system. We can see that in
second order there is overshoot.
EXPERIMENT No.8 (CLO1, CLO2 & CLO3)
Objective:

To understand the speed control of DC Motor using QNET-DCMCT in

LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

DC Motor:
The electric motor operated by dc is called dc motor. This is a device that converts DC electrical
energy into a mechanical energy. DC Motors are electromechanical devices which use the
interaction of magnetic fields and conductors to convert the electrical energy into rotary
mechanical energy.

Figure 8.1: DC Motor


Motor principle:
The current carrying conductor placed in a magnetic field experiences a force.

Figure 8.2: Motor Principle

Speed Control of DC motor:


1. By varying the supply voltage
2. By varying the flux
3. By varying the armature voltage
Controller:
PI Controller:
PI Controller is a feedback control loop that calculates an error signal by taking the difference
between the output of a system, which is the power being drawn from the set point.

Figure 8.3: PI Controller

Proportional Controller:
• Continuous linear relation between value of the controlled variable and position of the
final control element.

• Output of proportional controller is:

𝐶𝑃 = 𝐾𝑃 ∗ 𝑒(𝑡)

Figure 8.3: Proportional Controller


Integral Controller:
• Output proportional to the integral of the input signal.

• Eliminates steady state error and return the controlled variable back to the exact set point
by following a disturbance.

• Integral Controller makes transient response worse.

Proportional + Integral Controller:


• Decrease the steady state error without disturbing the stability of the system.

• Provides a balance between complexity and capability.

• Generates high starting overshoots and sensitive to the selection of controller gains.

Analysis of PI Controller:

𝑢(𝑡) = 𝐾𝑃 e(t)+𝐾𝐼 ∫ 𝑒(𝑡)𝑑𝑡


𝐾
U(s)= (𝐾𝑃 + 𝐼 )E(s)
𝑠

𝑈(𝑠) 𝐾
= (𝐾𝑃 + 𝐼 )
𝐸(𝑠) 𝑠

Block Diagram of DC Motor Control System:

Figure 8.4: Block Diagram of DC Motor


• Closed loop transfer function from the speed reference to the angular motor speed output
is:

• The proportional and integral gains are:

Software and Hardware implementation

Description of Block Diagram parameters:

Control & Simulation loop:


Executes the simulation diagram until the Loop reaches the simulation final time.

Sampling Rate:
Rate at which analog signal are taken in order to be converted into digital signals.

Signal Generation:
Collect a signal at each time step of the simulation and returns a history of the signal value.

Transfer function of the filter:


Implements a system model in transfer function form.

Build Array:
Concatenates multiple arrays or appends elements to an n-dimensional array.
Unbundled By Name:
Returns the cluster elements whose name you specify.

Halt Simulation:
Returns the simulation at the end of current time step.

Simulation Time:
Returns the simulation before final time.

SIM time Waveform:


Plots a value versus the simulation time on a waveform.

Hardware Description

NI Engineering Laboratory Virtual Instrumentation Suite (NI ELVIS):

Figure 8.5: NI ELVIS


ID Description

1 NI ELVIS II

2 Prototyping board power switch

3 Power LED

4 Ready LED

5 Power Cable for ELVIS II

6 USB Connection between PC and ELVIS II

7 QNET Power LEDS

8 QNET Power Cables

Figure 8.6: NI ELVIS Description


ID Description

1 DC Motor

2 High Resolution Encoder

3 Motor Metal Chamber

4 Inertial Load

5 PCI Connector to NI ELVIS

6 QNET PWM/Encoder board

7 24V QNET power jack

8 Fuse

9 +B, +15V, -15V, +5V LEDs

PROCEDURE:
Start Up:
I followed these steps to check the actual response of the motor.
1. Power the NI-ELVIS and QNET
2. Open and run the LabVIEW Virtual Instrument QNET-DCMCT.
Create the Block Diagram:
1. Firstly, I connected the icon of sampling rate. This icon is basically used to acquire analog
data from DCMCT and after that converting this analog data into digital form. It is
basically measuring the samples per second of analog data.
2. For taking the reference values, I done simulation at the start of experiment. In which
bump test is performed by providing the step input to the DC motor model. For
performing simulation, I need control and simulation loop on the block diagram of
LabVIEW. I picked the control and simulation loop from the control and simulation
block which is presented on the function pallet of the block diagram. Halt Simulation icon
is used here which is presented in control and simulation and then utilities. It is used here
to stop the simulation.
3. At the start of control and simulation loop, I used the icon of T.F. The main purpose to
utilize it is to filter the speed coming from the hardware block.
4. After that I used the icon of sampling generator. This icon can be picked from the control
and simulation, simulation and then signal generator block. I placed three input terminals
at the input of signal generator by using the unbundled by name. Three terminals are
amplitude, frequency and offset.
5. In the next step, I used one more unbundled by name icon which is selected from the array
block of the function pallet. The purpose for using this is the partition of two model
parameters (Proportion gain, Time constant).
6. In this experiment, I am dealing with the dc motor which is basically a system. We need a
controller for our system. Hence, it is necessary to place the T.F. block (Model Sim
Model) here for representing the system modeling.
7. Then I used the icon of build array which is selected from the array block of function
pallet. The main purpose for utilizing it is to combine the response of hardware filter
speed and the current simulated mode speed. The output of this block is further passed
through the waveform chart. Waveform chart displays the response of actual speed and
the simulated speed.
8. Another waveform chart is connected in control and simulation loop to display the
response of voltage according to the simulated system of motor.
9. In the next step, two collector icons are connected to collect the response of simulation at
each step.
10. For acquiring and transmitting the data from hardware, digital read and write blocks are
connected.
11. Speed and voltage waveforms connected outside the simulation loop are basically
displaying the response of hardware system.
Figure 8.7: Block Diagram of speed control of DC Motor using QNET-DCMCT

Create the Front Panel:


Case 1
In signal generation set :
1.Signal Type=‘Square Wave’
2.Amplitude=25.0 rad/s
3.Frequency=0.40 HZ
4.Offset=100.0 rad/s
5.bsp=0.00
Examine the behavior of measured speed with respect to the reference speed

Figure 8.8: Front Panel of speed control of DC Motor using QNET-DCMCT


Case 2
Signal generation set :
1.Signal Type=‘Square Wave’
2.Amplitude=25.0 rad/s
3.Frequency=0.40 HZ
4.Offset=100.0 rad/s
Control section set:
1.Kp=0.106 V.s/rad
2.Ki =1.48 V/rad
Increment and decrement Kp and check response

Figure 8.9: Front Panel of speed control of DC Motor using QNET-DCMCT

Case 3
Signal generation set :
1.Signal Type=‘Triangular Wave’
2.Amplitude=25.0 rad/s
3.Frequency=0.40 HZ
4.Offset=100.0 rad/s
Control section set:
1.Kp=0.106V.s/rad
2.Ki =1.50 V/rad
3.bsp= 1.00
Vary the Ki and check the motor response.
Figure 8.10: Front Panel of speed control of DC Motor using QNET-DCMCT

Case 4
Signal generation set :
1.Signal Type=‘Triangular Wave’
2.Amplitude=25.0 rad/s
3.Frequency=0.40 HZ
4.Offset=100.0 rad/s
Control section set:
1.Kp=0 V.s/rad
2.Ki =0 V/rad
3.bsp= 0.00
Check the motor response.

Figure 8.11: Front Panel of speed control of DC Motor using QNET-DCMCT


CONCLUSION:
As the reference signal switches from low to high motor accelerates quickly and to decelerate a
bit after reaching the desired speed. As the proportional gain increases, the response becomes
more damped. As the integral gain increases, system becomes more oscillatory. As the controller
parameters set to zero motor stop spinning.
EXPERIMENT No.9 (CLO1, CLO2 & CLO3)
Objective:

To understand the DC Motor position control using QNET-DCMCT in


LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

DC Motor Position Control:


Purpose of a motor position controller is to take a signal representing the required angle and to
drive a motor at that position. Used in a number of robotic applications, including automatic
assembly lines.
Block Diagram of closed loop motor position system using PD

Proportional Controller:
• Continuous linear relation between value of the controlled variable and position of the
final control element.
• Output of proportional controller is:
𝐶𝑃 = 𝐾𝑃 ∗ 𝑒(𝑡)
Figure 9.1: Proportional Controller

Limitations:
As the gain is increased the system responds faster to changes in set-point but becomes
progressively under damped and eventually unstable.

Derivative Controller:
• Brings the rate of change of error to zero.
• Slope of the error over time and multiplying this rate of change by the derivative gain.

• Resist the change in the system.


• Predicts system behavior and thus improves system stability.

Proportional Derivative Controller:


• Combination of the outputs of proportional and derivative controllers.
• Preferred when the integral action is not needed.

• Stability problems arise when a proportional controller is used at high gain can be
reduced by adding a term proportional to the time-derivative of the error signal.

• Deal with fast process changes better .

• Higher the error signal rate of change, sooner the final control element positioned to the
desired set point.

Analysis of PD Controller:
𝑑𝑒
𝑢(𝑡) = 𝐾𝑃 e(t)+𝐾𝑑 𝑑𝑡

U(s)= (𝐾𝑃 +s𝐾𝑑 )E(s)


𝑈(𝑠)
= 𝐾𝑃 +s𝐾𝑑
𝐸(𝑠)

Figure 9.2: PD Controller

Description of Block Diagram parameters:

Control & Simulation loop:


Executes the simulation diagram until the Control & Simulation Loop reaches the simulation
final time.
Sampling Rate:
Rate at which analog signal are taken in order to be converted into digital signals.

Signal Generation:
Collect a signal at each time step of the simulation and returns a history of the signal value.

Build Array:
Concatenates multiple arrays or appends elements to an n-dimensional array.

Unbundled By Name:
Returns the cluster elements whose name you specify.

Halt Simulation:
Returns the simulation at the end of current time step.

PROCEDURE:
Start Up:
I followed these steps to check the actual response of the motor.
1. Power the NI-ELVIS and QNET
2. Open and run the LabVIEW Virtual Instrument QNET-DCMCT.

Create the Block Diagram:


1. Firstly, I connected the icon of sampling rate. This icon is basically used to acquire analog
data from DCMCT and after that converting this analog data into digital form. It is
basically measuring the samples per second of analog data.
2. For taking the reference values, I done simulation at the start of experiment. In which
bump test is performed by providing the step input to the DC motor model. For
performing simulation, I need control and simulation loop on the block diagram of
LabVIEW. I picked the control and simulation loop from the control and simulation
block which is presented on the function pallet of the block diagram. Halt Simulation icon
is used here which is presented in control and simulation and then utilities. It is used here
to stop the simulation.
3. At the start of control and simulation loop, I used the icon of T.F. The main purpose to
utilize it is to filter the speed coming from the hardware block.
4. After that I used the icon of sampling generator. This icon can be picked from the control
and simulation, simulation and then signal generator block. I placed three input terminals
at the input of signal generator by using the unbundled by name. Three terminals are
amplitude, frequency and offset.
5. In the next step, I used one more unbundled by name icon which is selected from the array
block of the function pallet. The purpose for using this is the partition of two model
parameters (Proportion gain, Time constant).
6. In this experiment, I am dealing with the dc motor which is basically a system. We need a
controller for our system. Hence, it is necessary to place the T.F. block (Model Sim
Model) here for representing the system modeling.
7. Then I used the icon of build array which is selected from the array block of function
pallet. The main purpose for utilizing it is to combine the response of hardware filter
speed and the current simulated mode speed. The output of this block is further passed
through the waveform chart. Waveform chart displays the response of actual speed and
the simulated speed.
8. Another waveform chart is connected in control and simulation loop to display the
response of voltage according to the simulated system of motor.
9. In the next step, two collector icons are connected to collect the response of simulation at
each step.
10. For acquiring and transmitting the data from hardware, digital read and write blocks are
connected.
11. Speed and voltage waveforms connected outside the simulation loop are basically
displaying the response of hardware system.

Figure 9.3: Block Diagram of DC Motor position control using QNET-DCMCT


Create the Front Panel:
Case 1:
Signal generation set :

1.Signal Type=‘Square Wave’

2.Amplitude=2.00 rad/s

3.Frequency=0.40 HZ

4.Offset=0.00 rad/s

Control section set:

1.Kp=2.00V.s/rad

2.Kd =0.020 V/rad

Set parameters and check DC motor position

Figure 9.4: Front Panel of DC Motor position control using QNET-DCMCT

Case 2:
Signal generation set :

1.Signal Type=‘Square Wave’


2.Amplitude=2.00 rad/s

3.Frequency=0.40 HZ

4.Offset=0.00 rad/s

Control section set:

1.Kp=2.75V.s/rad

2.Ki =0.00 V/rad

3.Kd=0.190V/rad

Add disturbance in to the system and check DC motor response

Figure 9.5: Front Panel of DC Motor position control using QNET-DCMCT

CONSLUSION:
With no derivative action the motor response is oscillatory and has a large overshoot. The
overshoot of response decreases as the derivative gain increases.
EXPERIMENT No.10 (CLO1 & CLO2)
Objective:

To implement Routh-Hurwitz criterion in LabVIEW Software.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Stability:
• Requirements for the designing of a control system are :

-Transient Response

-Stability

-Steady-State Error

• Stability is the most important specification

C(t) =𝐶𝐹𝑜𝑟𝑐𝑒𝑑 (t)+𝐶𝑁𝑎𝑡𝑢𝑟𝑎𝑙 (t)

According to natural Response:


A system is stable if every bounded input yields a bounded output.

A system is unstable if any bounded input yields an unbounded output.

Figure 10.1: Stable System


Figure 10.2: Unstable System

According to linear, time invariant systems:

Stable System:
Natural response approaches zero as time approaches infinity.

Unstable System:
Natural response approaches infinity as time approaches infinity.

Marginally Stable System:


Natural response neither decays nor grows but remains constant and oscillates.

According to Transfer Function:


Transfer Function ratio of Laplace transform of the output to the Laplace transform of the input
by considering all initial conditions to zero.

Y (S )
G(S ) =
U (S )

U(S) G(S) Y(S)


• Roots of denominator polynomial of a transfer function are called ‘poles’.
• Roots of numerator polynomials of a transfer function are called ‘zeros’.
• Pole is the frequency at which system becomes infinite.
• Zero is the frequency at which system becomes 0.

Poles for checking the stability of the system:


The poles and zeros of the system are plotted in s-plane to check the stability of the system.

j

LHP RHP

s-plane

Stability of a System:

1.Stable System:
Roots of the characteristic equation lie on the left half of the 'S' plane.

2. Marginally Stable System:


Roots of the system lie on the imaginary axis of the 'S' plane.

3. Unstable System:
Roots of the system lie on the right half of the 'S' plane.
Figure 10.3: Stability of a System

Routh-Hurwitz Stability Criterion:


• It is a method for determining the continuous system stability.

• Yields stability information without the need to solve for the closed loop system poles.

• Tells how many closed loop system poles are in the left half plane, right half plane and on
the imaginary axis.

• “The number of roots of the characteristic equation with positive real part is equal to the
number of changes in sign of the first column of the Routh array”.

• Power of the method lies in designing rather than analysis.


Routh Hurwitz Criterion Steps:

Step 1:
Generate a data table called a Routh table.

Step 2:
Interpret the Routh table to tell how many closed loop system poles are in the LHP, the RHP and
on the jw-axis.

Interpretation of Routh Table:


• The number of roots in the open right half-plane is equal to the number of sign changes in
the first column of Routh array.

• If the requirements are met, we still must investigate the system further to determine the
stability of the system

Advantages of Routh Hurwitz Criterion:


1. Stability of the system without solving the equation.

2. Determine the relative stability of the system.

3. Determine the range of K for stability.

Limitations of Routh Hurwitz Criterion:


1. Applicable only for a linear system.

2. Not provides the exact location of poles on the right and left half of the S plane.
3. Valid only for real coefficients.

Description of Block Diagram parameters:

For Loop:
Executes sub diagram n times, where n is the value wired to the count (N) terminal. The iteration
(i) terminal provides the current loop iteration count, which ranges from 0 to n-1.

Polynomial Roots:
Finds the roots of polynomial P(x).

Complex to Re/Im Function:


Breaks a complex number into its rectangular components.

Build Array:
Concatenates multiple arrays or appends elements to an n-dimensional array.

Build XY Graph Express:


Formats data to be displayed on an XY graph.

PROCEDURE:
• Open a blank VI, two windows will be appeared, block diagram and front panel.
• Firstly, I will move towards the block diagram. Then right click on the block diagram,
function pallet will be opened. Then I will move towards the structures and from there I’ll
place For Loop on Block Diagram. There are two terminal of For loop nth and i. At nth
create constant and give value 40.
• From Function Pallet, go to numeric and pick division icon from there. Right click on the
icon and create constant and specify its value as 2. Connect the second terminal of
division with i.
• From Function Pallet, go to array and pick Build Array concatenate input and connect
this with division block. On the other side of the Build array create control rename it as
P(x).
• From Function Pallet, go to Mathematics and there to polynomial and pick poly roots.
• In Block Diagram, numeric go to complex and from there pick complex root imaginary
parts.
• Then I will move towards Front Panel, go to graph and pick XY Graph from there.
• In Block Diagram, connect Build XY Graph to complex root imaginary part.
Figure 10.4: Block Diagram of Routh-Hurwitz criterion

• Then in Front Panel, put polynomial value.

Figure 10.5: Front Panel of Routh-Hurwitz criterion

CONCLUSION:
Stability depend upon natural response. Gives information that how many poles are in each
section of the s-plane without giving us the coordinates of the poles.
EXPERIMENT No.11 (CLO1 & CLO2)
Objective:

To analyze the location of poles & zeros using Root Locus in LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Root Locus Technique:


• Important technique for the analysis and design of control system.
• Root locus of a feedback system is the graphical representation in the complex s-plane of
the possible locations of its closed-loop poles for varying values of a certain system
parameter.
• Root locus technique in control system was first introduced in the year 1948 by Evans.
• Gives an idea about the absolute stability and to some extent the relative stability of a
control system.
• Describe qualitatively the performance of a system as various parameters are changed.
• Gives graphic representation of a system’s transient response and also stability.

Characteristic Equation : 1+KG(s)=0


When K=0, this collapses to D(s )= 0.
Since the roots of D(s )= 0 are the poles of G(s), those are the closed-loop poles for K=0.

When K=∞ ,
thus the roots of N(s )=0 are the zeros of G(s).
• Root Locus can be draw using the open loop information of the system without
computing the closed loop poles.

Figure 11.1: Feedback Transfer Function

Figure 11.2: Location of poles & zeros using Root Locus

Steps for Root Locus:


Step 1:
Determine all the Open Loop Poles and Zeros of open Loop Transfer Function.
Step 2:
Define Starting and ending point.
Step 3:
Find out No. of Branches of Root Locus.
Step 4:
Determine Direction of branches.
Step 5:
Find out the Break Away Point.
Step 6:
Find out higher Root Loci branches for higher value of K.
Step 7:
Determine the points where the root Loci Branches intersects the imaginary axis.
Step 8:
Determine the angle of departure and arrival in case of complex poles.
Step 9:
Determine the value of K on Root Locus.

Rule 1 : Plotting Poles and Zeros


To determine all the poles and zeros of open loop transfer function and plot them in S-plane.

Rule 2: Starting and ending Points


Root Locus Starts from the open loop and terminates on open loop zeros.

Rule 3: No. of Branches of Root Locus


P >Z then no. branches equals to the no. of poles
Z > P then no. of branches equals to the no. of zeros
If P=3 , Z=5
No. of branches =5 (2 branches will start from infinity and remaining 3 branches basically start
from open loop poles)
All branches will terminate at 5 finite location of zeros
If P=5 , Z=3
No. of branches =5
2 Branches will start from poles and terminate at infinity

Rule 4: Direction of Branches of root loci on real axis


A branch of root locus lies on the real axis: if the total number of open loop poles and zeros to
the right side of the point is odd

Rule 5: Break Away Point


When two branches move towards each other on the real axis, coincident point is called break
away point
𝑑𝐺(𝑆)
Break Away Point = =0
𝑑𝑠

Rule 6: Root Loci branches for higher values of K


For higher values of K, the root locus branches approximated by asymptotes

(i) Determination of intersection point of Asymptotes with real axis

∑𝑃 − ∑𝑍
𝑥=
𝑃−𝑍
For Example; Poles S= 0, -1, -2

Zeros S =1,4
−3−5
𝑥= =-8
3−2
(ii) Determination of angle of Asymptotes with real axis

(2𝑚 + 1) × 1800
𝑃−𝑍
m=0,1,2……, P-Z-1

Rule 7: Determine the point where the root loci branches intersect the
imaginary axis

Rule 8: To determine the angle of departure and arrival in case of complex


poles
Departure angle from complex pole is given by
∅𝐷𝑒𝑝𝑎𝑟𝑡𝑢𝑟𝑒 =1800 -(∅𝑃 -∅𝑍 )
∅𝑃 =∅𝑃1 +∅𝑃2 +∅𝑃3 +………..+∅𝑃𝑛
∅𝑍 =∅𝑍1 +∅𝑍2 +∅𝑍3 +………..+∅𝑍𝑛
Angle of arrival:
∅𝐴𝑟𝑟𝑖𝑣𝑎𝑙 =−1800 +(∅𝑃 -∅𝑍 )
Rule 9: Determine the value of K on the Root Locus

𝑃𝑟𝑜𝑑𝑢𝑐𝑡 𝑜𝑓 𝑙𝑒𝑛𝑔𝑡ℎ 𝑜𝑓
𝑣𝑒𝑐𝑡𝑜𝑟𝑠 𝑑𝑟𝑎𝑤𝑛 𝑓𝑟𝑜𝑚 𝑡ℎ𝑒 𝑝𝑜𝑙𝑒𝑠 𝑜𝑓
𝑜𝑝𝑒𝑛 𝑙𝑜𝑜𝑝 𝑡𝑟𝑎𝑛𝑠𝑓𝑒𝑟 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑡𝑜 𝑃
𝑥=
𝑃𝑟𝑜𝑑𝑢𝑐𝑡 𝑜𝑓 𝑙𝑒𝑛𝑔𝑡ℎ 𝑜𝑓
𝑣𝑒𝑐𝑡𝑜𝑟𝑠 𝑑𝑟𝑎𝑤𝑛 𝑓𝑟𝑜𝑚 𝑡ℎ𝑒 𝑧𝑒𝑟𝑜𝑠 𝑜𝑓
𝑜𝑝𝑒𝑛 𝑙𝑜𝑜𝑝 𝑡𝑟𝑎𝑛𝑠𝑓𝑒𝑟 𝑓𝑢𝑛𝑐𝑡𝑖𝑜𝑛 𝑡𝑜 𝑃

Advantages of Root Locus Technique:

1. Easy to implement as compared to other methods.


2. With the help of root locus we can easily predict the performance of the whole system.
3. Provides the better way to indicate the parameters.

Description of Block Diagram parameters


CD Construct Transfer Function:
Creates a transfer function representation of a system using the Sampling Time
(s), Numerator, Denominator, and Delay.

CD Draw Transfer Function:


Displays the transfer function equation of the model.

CD Step Response:
Calculates the output of the system when a step input excites it.

CD Root Locus:
Plots the closed loop poles of a single input single output system as the feedback gain varies
from zero to infinity.

CD Get Data:
Obtains data that describes the dynamics of the given system model.

Partial Fraction Expansion:


Calculates the partial fraction expansion of a polynomial.

CD Time Response Parametric Data:


Calculates parametric information based on time response data.
PROCEDURE:
• Open a blank VI, two windows will be appeared, block diagram and front panel.
• Firstly, I will move towards the block diagram. Then right click on the block diagram,
function pallet will be opened. Go to control and simulation and from there to Control
design to model construct to CD construct Transfer Function. Right click on the icon and
create control. In this way, numerator and denominator is created.
• From Function Pallet, go to control & simulation to control design to model construct and
from there pick CD Draw Transfer Function and place on block diagram. Connect
generated transfer function output to the input of CD Draw Transfer Function and create
control.
• From Function Pallet, go to control & simulation to control design to Time Response and
from there drag CD Step Response icon and place on Block Diagram. Then, connect its
input to the output of transfer function and create indicator at its output.
• From Function Pallet, go to control & simulation to control design to Dynamic
Characteristic and from there pick CD Root Locus on Block Diagram. Now, connect its
input with transfer function output.
• From Function Pallet, go to control & simulation to control design to Model information
and from there pick CD Get Data icon and place it on Block Diagram. Connect its input
as output of transfer function and at its output create control.
• From Function Pallet, go to Mathematics to polynomial and from there pick Partial
Fraction Block. Then, connect its input to output of Transfer Function and at its output
create control of polynomial, poles and residue.
• From Function Pallet, go to control & simulation to control design to Time response and
from there pick CD Parametric Time Response. Connect its input to the output of
Transfer Function. Then, create control at the second output pin of CD Parametric Time
Response.
• Then I will go to Front Panel and give the values of numerator and denominator and
check the response of the system. It tells also by graph that the system is stable or
unstable.
Figure 11.3: Block Diagram of the location of poles & zeros using Root Locus

Figure 11.4: Front Panel of the location of poles & zeros using Root Locus
CONCLUSION:
Graphical method for examining how the roots of a system change with variation of a certain
system parameter, commonly a gain within a feedback system.
EXPERIMENT No.12 (CLO1 & CLO2)
Objective:

To understand the application of Root Locus for comparing the sensitivity of


various parameters at different root locations.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Root Locus:
• Root locus is a graphical representation of the closed-loop poles as a system parameter is
varied
• Provides a qualitative description of systems performance
• Ability to provide solution for systems of order higher than two
• Provide a graphical representation of system’s stability:
-Ranges of stability
-Ranges of instability
• Poles of open-loop transfer function are easy to obtain
• Poles of closed-loop transfer function are more difficult to obtain
• With KG(s) as the forward transfer function and H(s) as the feedback transfer function,
the closed-loop transfer function T(s) are reduced to:
𝐾𝐺(𝑠)
T(s)= 1+𝐾𝐺(𝑠)𝐻(𝑠)

Figure 12.1: (a)Closed Loop System (b)Equivalent Transfer Function


𝑁 (𝑠) 𝑁 (𝑠)
Letting, G(s)= 𝐷𝐺(𝑠) H(s)= 𝐷𝐻(𝑠)
𝐺 𝐻

𝐾𝑁𝐺 (𝑠)𝐷𝐻 (𝑠)


Then, T(s)= 𝐷 (𝑠)𝐷
𝐺 𝐻 (𝑠)+𝐾𝑁𝐺 (𝑠)𝑁𝐻 (𝑠)

𝐾(𝑠+1) (𝑠+3)
If given, G(s)= H(s)= (𝑠+4)
𝑠(𝑠+2)

Poles of G(s) = -2, 0 Poles of H(s) = -4

Zeros of G(s) = -1 Zeros of H(s) = -3


𝐾(𝑠+1)(𝑠+4)
T(s)=
𝑠3 +(6+𝐾)𝑠2 +(8+4𝐾)𝑠+3𝐾

• Root locus are used to analyze and design the effect of loop gain upon the system’s
transient response and stability.

Figure 12.2: a)Security cameras with auto tracking can be used to follow moving
objectsautomatically; b)block diagram; c)closed-loop transfer function
Pole location as a function of gain for the Cameraman system:

Figure 12.3: (a) Pole plot from Table (b) root locus

With regards to transient response:


• At gains less than 25, the system is over damped
• At gain 25, the system is critically damped
• As gain increases above 25, system is underdamped
With regards to the underdamped portion of the root locus:
• The settling time remains the same.
• Damping ratio diminishes and percent overshoot increases.
• Damped frequency of oscillation increases.
With regards to stability:

• System always stable.

Sensitivity of Roots:

• Roots are important for defining the closed loop system transient response.
• Effect of parameter variations on the roots of characteristic equation is a useful measure
of sensitivity.

Description of Block Diagram:

MathScript:

Deploy custom textual math code within the LabVIEW environment.

Polynomial Roots:
Finds the roots of the polynomial.

Complex to Polar:
Breaks a complex number into its polar components.

Degree to Radians:
Converts data from degrees to radians.

PROCEDURE:
• Open a blank VI, two windows will be appeared, block diagram and front panel.
• Firstly, I will move towards the block diagram. Then right click on the block diagram,
function pallet will be opened. Go to structure block and pick MathScript from there on
Block Diagram. Then right click on the left side of MathScript and add one input as ‘k’
and other input as ‘dk’. Create control for both the inputs.
• Now, write the equations of numerator and denominator in the MathScript. Move right
side of the MathScript and add two outputs, one for numerator and other for enominator.
• From function Pallet, go to mathematics to polynomial and from there pick two poly
roots and place on Block Diagra, one for numerator output and second for denominator
output.
• From function Pallet, go to numeric and from there place icon of subtraction and add
roots of numerator and denominator to it as its input.
• From function Pallet, go to numeric and from there place icon of division. Connect one
input of division as ‘dk’ and other as ‘k’.
• From function Pallet, go to numeric and from there pick division icon. Connect its first
input as output of subtraction icon and second input as output of first division icon.
• From function Pallet, go to numeric to complex and from there place icon of complex to
polar on Block diagram. It has two output, one is radius and add indicator on it.
• From function Pallet, go to numeric to scaling and from there place icon of degree to
radius and connect its input as output of degree section and create indicator on its output.

• Then, it front panel give the value of ‘k’ and ‘dk’ and check its variations.

Figure 12.4: Block Diagram of Root Locus for comparing the sensitivity of various
parameters at different root locations

Figure 12.5: Front Panel of Root Locus for comparing the sensitivity of various parameters
at different root locations
CONCLUSION:
Roots of the characteristics equation helpful for defining the transient response of the system
.Efficiently measures the sensitivity of roots on LabVIEW Software.
EXPERIMENT No.13 (CLO1 & CLO2)
Objective:

To implement Bode diagram for the Liquid level control system in LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Frequency Response:

System response to sinusoidal input is known us frequency response


• Range of frequency used
• Used for system identification.
• Used for stability analysis.

System behavior determined from the steady state response to sinusoidal input in the form
R =A sinωt
Sine wave used :
• Easy to analyze
• Easy to generate
• Easy to measure experimentally

Sinusoidal applied to linear system:
• Output will be sinusoidal
• Output amplitude is proportional to input
• Harmonic input produces harmonic output at same frequency
Variation amplitude and phase
• Function of frequency

The Bode plot is the frequency response plot of the transfer function of a system.
Bode plot consists of two graphs:
• One is the plot of magnitude of sinusoidal transfer function versus log ω
• Other plot is the phase angle of a sinusoidal function versus log ω
Figure 13.1: Magnitude Plot Phase Plot

Bode Plot:

➢ Bode plots were first introduced in the 1930s by Hendrik Wade Bode while he was
working at Bell Labs in the United States
➢ The Bode plot of a transfer function is a useful graphical tool for the analysis and design
of linear control systems in the frequency domain.
➢ A Bode plot is a standard format for plotting frequency response of LTI systems
➢ A Bode plot maps the frequency response of the system through two graphs
➢ Bode magnitude plot (expressing the magnitude in decibels)
➢ Bode phase plot (expressing the phase shift in degrees)
➢ They are represented with the frequency in a logarithmic scale
➢ The magnitude in decibels (20log10(magnitude)) and the phase in a linear scale

Cross-Over Frequency:

• Phase Crossover Frequency


• Gain Crossover Frequency
Figure 13.2: Cross over Frequency

Gain Margin:
➢ Refers to the amount of gain, which can be increased or decreased without making the
system unstable.
➢ The greater the Gain Margin (GM), the greater the stability of the system
➢ It is usually expressed as a magnitude in dB
➢ This is done by calculating the vertical distance between the magnitude
curve (on the Bode magnitude plot) and the x-axis at the frequency where
the Bode phase plot = 180°
➢ This point is known as the phase crossover frequency
➢ The formula for Gain Margin (GM) can be expressed as:
Phase Margin:
➢ It refers to the phase which can be increased or decreased without making the system unstable. It
is usually expressed in phase.
➢ The formula for Phase Margin (PM) can be expressed as:

➢ Where is the phase lag (a number less than 0)


➢ This is the phase as read from the vertical axis of the phase plot at the gain crossover
frequency.

Figure 13.3: Gain Margin & Phase Margin


Stability Conditions of Bode Plot:

➢ Stable System:
Both the margins should be positive or phase margin should be greater than the gain
margin.

➢ Unstable System:
If any of them is negative of phase margin should be less than the gain margin.

➢ Marginally Stable System:


Both the margin should be zero or phase margin should be equal to the gain margin.

Stability Conditions of Bode Plot:

Figure 13.4: Stable & Unstable System according to Bode Plot


Rules for making Bode Plot:

Example of Bode Plot:

Construct the Bode Plot for a unity feedback system whose open loop transfer
function is given by:
𝟐𝟎𝟎(𝒔+𝟏)
G(s) = (𝒔+𝟏𝟎)𝟐

Step 1: Time Constant

200(𝑠+1)
G(s) = 𝑠
100 ( +1)2
10

(𝑠+1)
G(s) =2 𝑠
( +1)2
10
Step 2:Plot K
20logK=20log(2)=6dB

Step 3:Corner Frequency due to simple zero


ω𝐶 =1 ,+20dB slop

Y=M logw +c

Y=20log10+6

Y=20+6

Y=26
Step 4:Corner Frequency due to simple Pole
ω𝐶 =10 ,-40dB slop

Advantages of Bode Plot:


1. Based on the asymptotic approximation

2. The multiplication of various magnitude appears in the transfer function can be treated as
an addition, while division can be treated as subtraction as we are using a logarithmic
scale.

3. Determine stability of the system directly.

4. Bode plots provides relative stability in terms of gain margin and phase margin .

5. Covers from low frequency to high frequency range.

Liquid Level Control System Block Diagram


Figure 13.5: Liquid Level System

Description of Block Diagram parameters:

CD Construct Special TF Model:


Creates commonly used transfer function models.

MathScript:
Deploy custom textual math code within the LabVIEW environment

CD Series:
Connects two linear models in series.

CD Gain and Phase Margin:


Calculates the gain and phase margins

PROCEDURE:
• Open a blank VI, two windows will be appeared, block diagram and front panel.
• Firstly, I will move towards the block diagram. Then right click on the block diagram,
function pallet will be opened. Go to Control and Simulation to Model Construct and
from there pick CD Construct special TF. Then create control on the left side of the icon
for delay and create control for polynomial order.
• From function Pallet, go to Structures and from there pick MathScript. Then on the left
side of MathScript create numerator ‘k’ and right click on ‘k’ to create its control. Now,
write in Mathscript num=k and three den as den1, den2, den3. Then create three systems
Transfer Function. After this, multiply the these three systems and make it equal to ‘G’.
Then click on the right side of MathScript and add output of ‘G’.
• From function Pallet, go to control & simulation to Control Design to Model
Interconnection and from there pick CD Series icon and place on Block Diagram. Now,
connects its input, first input from G block and second from Delay Block.
• From function Pallet, go to control & simulation to Control Design to Frequency
Response and from there pick CD gain & phase model. Connect output of CD Series with
it. Then, at its output side create indicator for Magnitude Plot, Phase Plot and Gain &
Phase Magnitude.

Figure 13.6: Block Diagram of Bode diagram for the Liquid level control system

• Now go to Front Panel and give the value of ‘k’, polynomial order and delay and observe
the results.
Figure 13.7: Front Panel of Bode diagram for the Liquid level control system

CONCLUSION:
In this lab, we have leant about Bode plot is a graph of the magnitude (in dB) or phase of the
transfer function versus frequency and Efficiently control the liquid level using Bode Plot in
LabVIEW.
EXPERIMENT No.14 (CLO1 & CLO2)
Objective:

To implement Bode diagram for the Remotely Controlled Vehicle in


LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Frequency Response:

System response to sinusoidal input is known us frequency response


• Range of frequency used
• Used for system identification.
• Used for stability analysis.

System behavior determined from the steady state response to sinusoidal input in the form
R =A sinωt
Sine wave used :
• Easy to analyze
• Easy to generate
• Easy to measure experimentally

Sinusoidal applied to linear system:
• Output will be sinusoidal
• Output amplitude is proportional to input
• Harmonic input produces harmonic output at same frequency
Variation amplitude and phase
• Function of frequency

The Bode plot is the frequency response plot of the transfer function of a system.
Bode plot consists of two graphs:
• One is the plot of magnitude of sinusoidal transfer function versus log ω
• Other plot is the phase angle of a sinusoidal function versus log ω
Bode Plot:
• Bode plots were first introduced in the 1930s by Hendrik Wade Bode while he was
working at Bell Labs in the United States
• Bode plot is a graph of the frequency response of a system
• It is usually a combination of a Bode magnitude plot, expressing the magnitude (usually
in decibels) of the frequency response, and a Bode phase plot, expressing the phase shift
• A Bode plot maps the frequency response of the system through two graphs
• Bode magnitude plot (expressing the magnitude in decibels)
• Bode phase plot (expressing the phase shift in degrees)
• They are represented with the frequency in a logarithmic scale
• The magnitude in decibels (20log10(magnitude)) and the phase in a linear scale

Rules for the construction of Bode plot:


• Represent the open loop transfer function in the standard time constant form
• Substitute, s=jω in the above equation
• Find the corner frequencies and arrange them in ascending order
• Draw the magnitude plots for each term and combine these plots properly
• Draw the phase plots for each term and combine these plots properly

Example of Bode Plot:


Construct the Bode Plot for a unity feedback system whose open loop transfer function is
given by:
50
G(s) = 𝑠(𝑠+1)(1+0.5𝑠)

𝒋𝛚
Step 1: Write given transfer function in corner frequency form (1+ )
𝛚𝒄

50
G(s) = 𝑠(𝑠+1)(1+0.5𝑠)

50
G(ω) = 𝑗ω(𝑗ω+1)(0.5𝑗ω+1)

Step 2: Calculate the magnitude M


M=20 log|𝐺(𝑗ω)|
50
G(jω) = 𝑗ω(𝑗ω+1)(0.5𝑗ω+1)

|𝐺(𝑗ω)|=20log50-20log|𝑗ω|-20log|(1 + 𝑗ω)|-20log|(1 + 0.5𝑗ω)|


|𝐺(𝑗ω)|=34-20logω-20log√1 + ω2-20log√1 + (0.5ω2 )

Step 3: Calculate the Phase Angle


50
G(jω) = 𝑗ω(𝑗ω+1)(0.5𝑗ω+1)

𝑦
∅ = tan−1(𝑥 )

0 ω ω 0.5ω
∅ = tan−1(50) - tan−1 ( 0 ) − tan−1 ( 1 ) − tan−1 ( )
1

Step 4: Magnitude Plot

Step 5: Phase Plot


Drawing of Magnitude Plot (i)

Drawing of Magnitude Plot (ii)


Drawing of Magnitude Plot (iii)

Drawing of Magnitude Plot (iv)


Drawing of Magnitude Plot (v)

Drawing of Magnitude Plot (vi)


Drawing of Magnitude Plot (vii)

Drawing of Phase Plot


Phase Crossover Frequency and Gain Margin

Gain Crossover Frequency and Phase Margin


Comments about the System Response
Phase Margin = −53𝑜 Phase Crossover Frequency= 1.4rad/sec

Gain Margin =-27dB Gain Cross Frequency =4.4rad/sec

Gain and phase margin are negative so the system is unstable

Remotely Controlled Vehicle Block Diagram

Description of Block Diagram parameters:

For Loop:
Executes sub diagram n times, where n is the value wired to the count (N) terminal. The iteration
(i) terminal provides the current loop iteration count, which ranges from 0 to n-1

MathScript:
Deploy custom textual math code within the LabVIEW environment

CD Series:
Connects two linear models in series.

CD Feedback:
Connects two linear models in feedback configuration

CD Bode :
Produces the Bode magnitude and Bode phase plots of the system model on an XY graph
CD Time Response Parametric Data:
Calculates parametric information based on time response data.
PROCEDURE:
• Open a blank VI, two windows will be appeared, block diagram and front panel.
• Firstly, I will move towards the block diagram. Then right click on the block diagram,
function pallet will be opened. Go to Structures and from there pick For loop. Then create
control for n input on the left side of For loop.
• From Function Pallet, go to structures and from there pick MathScript and place it on
block diagram. From the left side of the MathScript add input and create control drag it
outside of For loop. Then, write down general equation of transfer function and create
output on the right side of MathScript as system1 and system2.
• From Function Pallet, go to control & simulation to Control Design to Model
Interconnection and from there pick CD series block and connect two systems of CD
series icon as input.
• From Function Pallet, go to control & simulation to Control Design to Model
Interconnection and from there pick CD Feedback icon and connect to output of CD
series.
• From Function Pallet, go to control & simulation to Control Design to Frequency
Response and from there pick CD Bode Plot. Now, connect the output of CD Feedback
as the input for CD Bode plot and create control of Frequency range on CD Bode plot.
Then create indicator at output of CD Bode plot and drag it outside of For loop and
connect it to output through shift register.
• From Function Pallet, go to control & simulation to Control Design to Time Response
and from there pick CD parametric response. Now, connect its input as transfer function
model and at its output create time response and time response parametric data indicators.

Figure 14.1: Block Diagram of implement Bode diagram for the Remotely Controlled
Vehicle
• Now, at Front Panel put the value of numeric and k and check the response for different
cases.
Case 1: K=4.44

Figure 14.2: Front Panel of implement Bode diagram for the Remotely Controlled Vehicle

Case 2: K=10

Figure 14.3: Front Panel of implement Bode diagram for the Remotely Controlled Vehicle
Case 3: K=20

Figure 14.4: Front Panel of implement Bode diagram for the Remotely Controlled Vehicle

Compensation Design Results:

CONCLUSION:
In this lab, we have learnt about Bode plot is a graph of the magnitude (in dB) or phase of the
transfer function versus frequency and Efficiently control the remotely controlled vehicle using
Bode Plot in LabVIEW.
EXPERIMENT No.15 (CLO1 & CLO2)
Objective:

To understand the simulation of Tank Level Control System using PID


Controller in LabVIEW.

Apparatus:

• Computer.
• Software:LABVIEW
Theory:

Tank Level Control Simulation:


The model simulates the controller with periodic changes in the setpoint of the water level.

Saturation:

The flow of water can neither be less than zero nor more than the height of the tank. Such a
restriction (saturation) is called non-linearity.

Propagation Delay:

Propagation delay is the amount of time it takes for the head of the signal to travel from the
sender to the receiver.

PID Controller:
• Control Loop Feedback Mechanism.
• Continuously calculates an error value e(t) as the difference between the desired set point
(SP) and a measured process variables (PV) and applies a correction based on
proportional, integral and derivative terms which gives the controller its name.
Proportional Controller:
• Continuous linear relation between value of the controlled variable and position of the
final control element.

• Output of proportional controller is:

𝐶𝑃 = 𝐾𝑃 ∗ 𝑒(𝑡)

Figure 15.1: Proportional Controller

Disadvantage of P Controller:
As the gain is increased the system responds faster to changes in set-point and eventually
unstable.
Integral Controller:

• Output proportional to the integral of the input signal.


• Eliminates steady state error and return the controlled variable back to the exact set point
by following a disturbance.
• Integral Controller makes transient response worse.

Derivative Controller:

• Brings the rate of change of error to zero


• Slope of the error over time and multiplying this rate of change by the derivative gain
• Resist the change in the system
• Predicts system behavior and thus improves system stability

Proportional Plus Integral Plus Derivative Control (PID):


Characteristics of P, I and D Controllers:

Mathematical Modeling of Tank:

Accumulating Volume:

Accumulating Volume in unit of Time:

Figure 15.2: Model of Tank


Outgoing Flow Rate:

Figure 15.3: Outgoing flow rate of tank

Description of Block Diagram parameters:

Control & Simulation loop:


Executes the simulation diagram until the Loop reaches the simulation final time.
Gain in Control and Simulation:
Amplify the input signal.
Summation in Control and Simulation:
Adds and/or subtracts the input signals.
Transfer Function in Control and Simulation:
Implements a system model in transfer function form.
Transport Delay:
Delays the input signal by the amount of time you specify.
Formula Node:
Evaluates mathematical formulas in LabVIEW
Saturation:
Limits the valid range of a signal.
SimTime Waveform:
Plots a value versus the simulation time on a waveform.
PROCEDURE:
• Open a blank VI, two windows will be appeared, block diagram and front panel.
• Firstly, I will move towards the block diagram. Then right click on the block diagram,
function pallet will be opened. Then I will move towards the control & Simulation
section. Pick control & simulation loop and place it on the block diagram. Double click
on the input node of control & Simulation loop and set the values as initial value of time:
0, final time: 1000 & period: 50.
• Pick a gain for the conversion of analog value into the digital data from the signal
arithmetic section of the control & simulation block of the function pallet & assign value:
0.1 using D/A interface.
• Add a control input on front panel on the input section of D/A interface & named set
point.
• After this add a summing junction from the signal arithmetic section of the control &
simulation block of the function pallet for providing the negative feedback
• After this pick a PID controller from the continuous linear system section of the control
and simulation block & made it terminal assigning value 1 for all parameters.
• On front panel, add three horizontal point slider for P, I & D. Attach these horizontal fill
point sliders with PID module input terminals on the block diagram.
• Add another gain with value 200.
• After this move towards control & simulation then simulation and then non-linear
systems in the function pallet select saturation & assign lower limit: 0 & upper limit: 250.
• After this move towards control & simulation then simulation and then continuous linear
systems in the function pallet and select transfer function & assign values of numerator
and denominator for the representation of pump.
• After this move towards control & simulation then simulation and then continuous linear
systems in the function pallet and select transport delay & assign values of initial delay as
0s, delay as 0.5s and final delay as 1s.
• On front panel, select Gauge from numeric & set limit: 300 attach it on the block diagram
before the transport delay block.
• Add a gain with value 0.001 to convert ms/s to liters/s.
• After this move towards control & simulation then simulation and then continuous linear
systems in the function pallet and select integrator with upper limit: 5 & lower limit: 0
• From structure, add a formula node with input h & output qo having formula;
• qo = 0.0314* Sqrt (2*10*h);
• From front panel, add tank from numeric section of the control pallet. Select visible item
& visible display to indicate the water level.
• Add build array from array section of function pallet to connect the output & desired
value. After this attach sim-time waveform at the output of build array. Pick it from
control & Simulation, simulation then graph utilities on the block diagram of LabVIEW
Software.
• Add gain as sensor giving value of 0.1& provide feedback to the summing junction. Pick
it from control & simulation, simulation, signal arithmetic section of the function pallet.
• Add the comparators & give the corresponding values.
• Add LED square indicators from Boolean in front panel for the representation of tank
level and the flow of water.
• Wire up the connections accordingly, run the simulation & observe the output.

Figure 15.4: Block Diagram of Tank Level Control System using PID Controller
Figure 15.5: Front Panel of Tank Level Control System using PID Controller

CONCLUAION:
In this experiment, we have leant about Proper understanding of PID Controlling schematic and
Efficiently control the level of water tank using PID Controller in LabVIEW Software.

You might also like