EMI Lab04 - updated

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

Electrical Measurements and Instrumentation Lab Manual EE-383L

Electrical Measurements and Instrumentation


Laboratory (EE-383L)
(Fall - 2024)

Lab Report # 04

Submitted by:

Name:
Roll No:

Submitted to:
Engr. Muhammad Zain Ul Abideen

Department of Electrical Engineering

Air University - Aerospace and Aviation Campus,


Kamra

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

AIR UNIVERSITY, AEROSPACE AND AVIATION


CAMPUS KAMRA
DEPARTMENT OF ELECTRICAL ENGINEERING
LAB ASSESSMENT RUBRICS

Lab Performance (Psychomotor Domain)


Unsatisfactory Average Good Excellent
CLO Attributes
0 1-2 3-4 5
Ability to
simulate and
CLO-1
interpret the
results

Total Marks Obtained Marks


Unsatisfactory Average Good Excellent
CLO Attributes 0 1-2 3-4 5
Fulfill
Assigned
Tasks
CLO-3
Safety Rules

Total Marks Obtained Marks

AIR UNIVERSITY, AEROSPACE AND AVIATION


CAMPUS KAMRA
DEPARTMENT OF ELECTRICAL ENGINEERING
LAB REPORT RUBRICS

ASSESSMENT RUBRIC FOR GRADING OF LAB REPORT


CLO-3: PLO-6 (A3)
Unsatisfactory Average Good Excellent
Attributes 0 1-2 3-4 5
Tasks
completed
Questions &
Conclusion
Report
Submission

Total Marks Obtained Marks

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

EXPERIMENT NO 04:
Analysis of Different Structures and Waveforms parameters using
LabVIEW
OBJECTIVE:
 To become familiarize with various structures i.e. While loop, for loop, Case
structures, Flat sequences and Shift Registers.
 Measurement of different parameters for standard AC signals using LabVIEW.
TOOL REQUIRED:
 Computer/Laptop
 LabVIEW Software

DISCUSSION:
What is “while loop”?
A While Loop is a structure that repeats a section of code until a condition is met. It is
comparable to a Do Loop or a Repeat-Until Loop in traditional programming language.
The While Loop, shown in the following illustration, is a resizable box you use to execute the
diagram inside it until the Boolean value passed to the conditional terminal (an input
terminal) is FALSE. The VI checks the conditional terminal at the end of each iteration;
therefore, the While Loop always executes at least once. The iteration terminal is an output
numeric terminal that outputs the number of times the loop has executed. However, the
iteration count always starts at zero, so if the loop runs once, the iteration terminal outputs 0.

The following illustration shows a While Loop in LabVIEW, a flowchart equivalent of the
While Loop functionality, and a pseudo code example of the functionality of the While Loop.
The While Loop is located on the Structures palette. Select the While Loop from the palette
then use the cursor to drag a selection rectangle around the section of the block diagram you
want to repeat. When you release the mouse button, a While Loop boundary encloses the
section you selected.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

What is “for loop”?


A For Loop executes a section of code a defined number of times.
It is resizable, and, like the While Loop, is not dropped on the block diagram immediately.
Instead, a small icon representing the For Loop appears in the block diagram, and you have
the opportunity to size and position it. To do so, first click in an area above and to the left of
all the terminals. While holding down the mouse button, drag out a rectangle that
encompasses the terminals you want to place inside the For Loop. When you release the
mouse button, G creates a For Loop of the size and position you selected. You place the For
Loop on the block diagram by selecting it from Functions “Structures.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Example:
The For Loop in Figure generates a random number every second for 100 seconds and displays
the random numbers in a numeric indicator.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Case and Sequence Structures:

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Example:
In the following examples, the numeric values pass through tunnels to the Case structure and
are either added or subtracted, depending on the value wired to the selector terminal.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Flat Sequence:
Consists of one or more sub diagrams, or frames, that execute sequentially. Use the Flat
Sequence structure to ensure that a sub diagram executes before or after another sub diagram.
Data flow for the Flat Sequence structure differs from data flow for other structures. Frames
in a Flat Sequence structure execute from left to right and when all data values wired to a
frame are available. The data leaves each frame as the frame finishes executing. This means
the input of one frame can depend on the output of another frame.

Unlike in the Stacked Sequence structure, you do not need to use sequence locals to pass
data from frame to frame in the Flat Sequence structure. Since the Flat Sequence structure
displays each frame on the block diagram, you can wire from frame to frame without using
sequence locals and without hiding code.

When you add or delete frames in a Flat Sequence structure, the structure resizes
automatically.

You cannot drag tunnels across the frames of a Flat Sequence structure.

To avoid overusing Flat Sequence structures, attempt to control the data flow of your VI
by establishing data dependency or using flow-through parameters.

(Real-Time, Windows) To convert a Flat Sequence structure to a Timed Sequence structure,


right-click the Flat Sequence structure and select Replace with Timed Sequence from the
shortcut menu.

Example:

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Shift Registers:

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Example:
a). Current and previous value without initialing shift register value.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

b). Current and previous two values by initializing shift register with 0.

c). Current and previous two values by initializing shift register with 0 and sum of iteration
values in front panel..

Waveform Analysis:
Important parameters of the AC waveform are Vpeak, Vpeak-peak, VRMS, Vave. Amplitude, better
known as its Maximum or Peak value represented by the terms, Vmax for voltage or Imax for
current. The peak value is the greatest value of either voltage or current that the waveform
reaches during each half cycle measured from the zero baseline. Unlike a DC voltage or
current which has a steady state that can be measured or calculated using Ohm’s Law, an
alternating quantity is constantly changing its value over time. A virtual instrument can be
programmed in LabVIEW to measure important parameters of any AC waveform.

PROCEDURE:
In the following exercise, you will build a VI that generates a signal and displays that signal
in a graph and give its +Vpeak, -Vpeak, Vpeak-peak, VRMS, and Vave value. When you complete the
exercises, the front panel of the VI will look similar to the front panel in Figure 1.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Figure 1 - Front Panel of the VI

 Open a new VI. You can open a blank VI by selecting File≫ New VI.
 Then you will see front panel and block diagram panel.
 Right click on block diagram panel and select the different blocks according to the
given block diagram.
 By using selected different blocks construct a complete block diagram.
 Create indicators to the required measuring blocks.
 Give the standard ac signals of amplitude 5 & 10 and frequency 50Hz as input.
 By double clicking on the simulate signal block change the wave forms to sine,
square, triangular, and sawtooth to display different waveforms.
 Run the program.
 Note down the results from Front panel.
 Attach snapshot of your block diagram and front panel for each type of waveform
with lab report.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

Figure 2 - Block Diagram


OBSERVATIONS
Positive Negative Peak Mean
Waveform Amplitude RMS
Peak Peak to (DC)
Peak
5
Sine
10

5
Square
10

5
Triangular
10

5
Sawtooth
10

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

LAB TASKS
Q1) Create a VI using “for loop”, taking loop count as 100, one Boolean indicator (LED)
which turns “ON” when (Loop count % 2 == 0) with a delay of 1 second for each iteration.

Q2) Perform the given task in Q1, Using “While loop”.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Q3) Design a simple calculator (Addition, Subtraction, Multiplication and Division) Using
“case structure”, taking two numeric on front panel and show the output for each operation
performed through proper selector.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Q4) Create a simple VI Using “Flat Sequence”, taking two LED’s as indicators. Make one
LED “ON” for 1sec and other “OFF” for 1sec continuously.
 Note: You can also use while loop in this task (optional).

QUESTIONS:
1. Briefly describe Amplitude and Level Measurements Express VI can perform which
voltage measurements on a signal?

Ans: The Amplitude and Level Measurements Express VI in LabVIEW can perform the
following voltage measurements on a signal:

1. Peak Voltage - Measures the maximum positive or negative amplitude of the signal.
2. RMS Voltage - Provides the root mean square value, which is an indicator of the signal's
power.
3. Average Voltage - Computes the average voltage over time, often used for DC components.
4. Peak-to-Peak Voltage - Measures the difference between the highest and lowest points of
the signal.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
2. How can we build a VI that take voltage, current and phase angle and give
apparent, active and reactive power as output?

Ans To build a VI that takes voltage, current, and phase angle and outputs apparent, active, and
reactive power in LabVIEW, follow these steps:

1. Inputs: Create numeric controls for voltage (V), current (I), and phase angle (θ).
2. Apparent Power (S): Calculate using S=V×I
3. Active Power (P): Calculate using P=V×I×cos(θ).
4. Reactive Power (Q): Calculate using Q=V×I×sin(θ).
5. Outputs: Display the calculated values for apparent power (S), active power (P), and
reactive power (Q) using numeric indicators.

3. Why we “Flat sequences” in LabVIEW?

Ans: We use Flat Sequences in LabVIEW to ensure that certain parts of the code execute in a
specific, sequential order. This structure is helpful when you need to control the execution flow
of code that must happen step-by-step, especially when one operation depends on the completion
of a previous one.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

4. How “while loop” and “for loop” differ in structures in LabVIEW?

 While Loop: Executes repeatedly until a specified condition is met (stop condition). The
number of iterations is unknown beforehand.
 For Loop: Executes a set number of iterations based on a predefined count (N). The loop
runs exactly N times.

Structurally, both loops look similar but have distinct terminal conditions: the While Loop has a
stop condition, while the For Loop has an iteration count terminal.

5. what is the purpose of using “Enum”?

Ans: The purpose of using an Enum in LabVIEW is to create a list of predefined options or
named values that represent specific states or choices. It enhances code readability and helps
reduce errors by limiting inputs to valid, descriptive selections, often used in case structures or for
control selections in a user interface

6. Which structure is used to perform different events sequentially?

Ans: The Flat Sequence structure or the Stacked Sequence structure in LabVIEW is used to
perform different events sequentially. These structures ensure that code executes in a specific
order, with each frame of the sequence running after the previous one is completed.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Electrical Measurements and Instrumentation Lab Manual EE-383L

CONCLUSION:

In LabVIEW, the use of different programming structures such as While Loops, For
Loops, Case Structures, Flat Sequences, and Shift Registers allows for effective
control of data flow and execution logic in measurement and analysis tasks. Each
structure serves a distinct purpose:

 While Loops enable continuous execution until a specific condition is met,


making them ideal for applications requiring ongoing data monitoring or
processing.
 For Loops provide a defined number of iterations, perfect for repetitive tasks
where the exact count is known, such as processing a fixed set of data points.
 Case Structures facilitate decision-making within the program, allowing for
different code paths based on specific conditions or inputs.
 Flat Sequences and Stacked Sequences ensure that operations occur in a
defined order, which is crucial for tasks where the sequence of events impacts
the results.
 Shift Registers maintain state information between loop iterations, useful for
accumulating results or retaining data over multiple executions.

Application
When analyzing different parameters for standard AC signals using LabVIEW, these
structures can be applied as follows:

1. Data Acquisition: Use a While Loop to continuously sample AC signals over


time, ensuring real-time data capture.
2. Data Processing: Implement a For Loop to iterate over a fixed number of
samples for calculating parameters like RMS voltage, frequency, and phase
angle.
3. Conditional Logic: Utilize Case Structures to select different processing
methods based on the type of AC signal (e.g., sinusoidal, triangular).
4. Sequential Processing: Apply Flat Sequences to execute data processing
steps in the correct order, such as filtering, measurement, and display.
5. State Management: Employ Shift Registers to store and carry forward
calculated parameters across iterations, facilitating ongoing analysis.

By combining these structures, users can create robust and efficient LabVIEW
applications that measure, analyze, and visualize the parameters of AC signals,
leading to enhanced understanding and control in various engineering and scientific
contexts.

Department of Electrical Engineering- Air University Aerospace and Aviation Campus,


Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen
Department of Electrical Engineering- Air University Aerospace and Aviation Campus,
Kamra
Compiled By: Engr. Muhammad Zain Ul Abideen

You might also like