EE Lab 2

docx

School

The City College of New York, CUNY *

*We aren’t endorsed by this school

Course

221

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

docx

Pages

11

Uploaded by JusticeScorpionPerson9187

Report
The City College of New York School of Engineering EE22100 Electrical Engineering Laboratory I Fall Semester 1BC (9936) Lab Report Experiment #2 Data Acquisition, Circuit Simulation, Data Analysis and Computer Report Preparation
Objective: The purpose of this lab is to become accustomed with the equipment of the oscilloscope, multimeter, function generator and power supply, and we can use that equipment to create graphs and plots with several software such as LabVIEW VI, MATLAB, and Multisim. Thus, for this lab we want to ensure that we collect our data by measuring its voltage with the equipment and LabVIEW VI and compare it to the simulation done through Multisim as we will need it for our plots in MATLAB. In this lab, we will be experimenting with DC and RC circuits and further expand our knowledge from the manual to complete our report in Word document. Procedures: 1. DC Measurements In this first part of the experiment, we will design a DC resistor circuit according to the given illustration in the manual. The circuit consists of a power supply, 1kOhm resistor, and a digital multimeter. Set the voltage of the power supply to 1V and record the voltage from the multimeter to calculate for %error. Next, we proceed to use one of the apps called Lab VIEW VI, which will allow us to measure and display both the input and output voltage into a txt file. Then, make sure your data is logical from the file to prevent inaccuracy. Thus, the final report will be required to plot the data from your txt file. Figure 2: Simple DC resistor Circuit for sweep experiment.
2. Time Dependent Waveforms The second part of the experiment, we will design an RC circuit according to the given illustration in the manual. The circuit consists of a function generator as our AC voltage source, a capacitor that is 0.1microfarad, a 1kOhm resistor, and an oscilloscope. Once the circuit is built then set the function generator to 10V p-p sinusoidal and a frequency of 5KHz. Then set the oscilloscope to channel 1 and channel 2, so when you use the Lab View VI to capture the image of your data. After capturing your oscilloscope image, save the data to the file and place it in a txt file so you’re able to plot the data into MATLAB. Figure 3: RC Circuit 3. Circuit Simulation The third part of the lab is about using the simulation called Multisim and obtaining data and graphs through its simulation. Starting with the DC circuit, we start to place all the components
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
then once it completed, click on the analysis to DC sweep and adjust the settings of the starting value to 1V and end value to 10V. Then begin the simulation and obtain the txt file for DC sweep. Secondly, the RC circuit will utilize the AC signal voltage instead of the function generator. Adjust the value to 5V and 5kHz then proceed to transient analysis and set the time to 0 and the end time to 0.001. Then set the maximum time step at 2e-6 and display the nodes through the sheet options. Lastly, start the simulation and obtain both the txt file and the input data. 4. Data/Graphical Analysis Lastly, start with plotting the DC sweep txt files for both the measured and simulation to display the graph of output and input voltages. Then plot the percent error as we will use theory as our input voltage and measured as our output voltage. Create another plot for your capacitor as you plot the input and output voltage on the (2,1,1) subplot. Then create another plot using both LabVIEW and Multisim with the (2,1,1) subplot and the output voltage as function of time with the (2,1,2) subplot window. Data Tables & Graphs: DC Sweep: The power supply outputted its theoretical value: 0.998V The multimeter measured value is: 0.991V 100%*(Measured-Theoretical)/Theoretical 100%*(0.991-0.998)/0.998 = 0.70 % Percent Error: 0.70% Measured Voltage Theoretical Voltage Percent Error% 0.991 0.998 0.70%
Time Dependent Waveforms: Oscilloscope Image of channel 1&2 **Capacitor Measured.Txt file was saved but contains a lot of values Circuit Simulation: DC sweep simulation "
R1 1kΩ V1 12V 1 0 Multisim Sketch for DC Circuit Time Dependent Waveforms: **The txt file is very big for the RC circuit so I’m not able to copy paste its 100 values. V1 5Vpk 5kHz R1 1kΩ C1 0.1µF 1 2 0 Multisim Sketch for RC Circuit
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Data and Graphical Analysis: DC_sweep_measured txt and DC_sweep_simulation txt plot/MATLAB code- Data1 = load( 'dc_sweep.txt' ) Data2 = load( 'dc_sweep_simulation.txt' ) inputV = Data1(:,1); outputV = Data1(:,2); outputVV = Data2(:,2); plot(inputV,outputV,inputV,outputVV, '--' ) xlabel( 'input voltage(V)' ) ylabel( 'output voltage(V)' ) legend ( 'measured' , 'simulation' ) DC_sweep_measured txt Percent Error graph & Matlab code D1 = load( 'dc_sweep.txt' ) input = D1(:,1) output = D1(:,2) PercentError = 100*(output-input)./input plot(input,PercentError) title( 'Percent error' ) xlabel( 'Input V' ) ylabel( 'Percent Error' )
Capacitor_measured txt & Capacitor_simulation txt plot/Matlab cap_m =load( 'capacitor_measured (1).txt' ) cap_s = load( 'Capacitor_simulation.txt' ) inputV = cap_m(:,2); outputV = cap_m(:,3); time = cap_m(:,1); subplot(2,1,1) plot(time,inputV, '--' ,time,outputV) title ( 'Capacitor' ) xlabel( 'Time(s)' ) ylabel( 'Voltage(v)' ) legend( 'Input' , 'Output' )
Capacitor_measured txt & input_simulation txt Matlab code/Graph- cap_m = load( 'capacitor_measured (1).txt' ); cap_s = load( 'input_simulation.txt' ) cap_w = load( 'input_simulation.txt' ) inputV = cap_s(:,2); outputV = cap_w(:,2); time = cap_w(:,1); subplot(2,1,2) plot(time,inputV, '--' ,time,outputV) title( 'Capacitor sim' ) xlabel( 'Time(s)' ) ylabel( 'Volatage(v)' ) legend( 'input' , 'output' ) Discussion & Analysis:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 1: How accurate is the DMM in making the voltage measurements? Does the Multi- meter require any calibration? The DMM is off by 0.70% from the theoretical voltage value so its not off by much but does require some calibration, so we can accurately measure the voltage. Question 2: How do RC circuit measurements obtained by LabVIEW differ with those obtained by Multisim? Explain any perceived differences. RC circuit measurements obtained by LabVIEW differ by displaying an infinite loop of values that have a strong correlation between each input and output voltage values and its values tend to repeat itself frequently, while the Multisim values has a shorter number of values displayed and reoccurs in a pattern like a sinusoidal wave. Question 3: Why must we generate and save separate input waveforms in Multisim? We need to generate and save separate input waveforms in Multisim since we want to plot its data, we need to know the inputs and outputs of voltage and its time. Question 4: Explain how the input and output differs in an RC circuit. The input increases in a steady state while the output interchanges as it goes through a waveform. Question 5: If we define the phase delay as the angle difference between the output and input sinusoid waveforms, calculate the phase delay. For the first part of the capacitor, the peak is at the same time around 1.1x10^-3 seconds but could be off by 0.1x10^-3 seconds as we may consider this as our phase delay, but there is no phase delay with the second part. Question 6: If we define the gain as amplitude of the output voltage sinusoid divided by the amplitude of the input voltage sinusoid, calculate gain. Output sim/ input sim = gain 2.20V/5.00V = 0.44 Question 7: Is the gain and phase delay a function of the input peak voltage? A function of the input frequency? Gain is what defines peak voltage of both output and input, but phase delay is the changes in shift between the input and output in terms of the time. Input frequency is not relevant in this subject, but we do notice a high peak of voltage in which it might relate something to it. Question 8: How is the frequency of the output related to the frequency of the input? Depending on the input, the frequency of the output should be lower or equal to its input.
Conclusion: Overall, this lab was designed to understand the use of software and equipment as we design two circuits to experiment their inputs and outputs. The software allowed us to generate a waveform from our circuit with the aid of the oscilloscope and several other equipment. Then we shifted to Multisim that allowed us to get our theoretical values, by designing and simulating to obtain values and graphs from the circuit. Lastly, MATLAB allowed us to execute our commands and scripts to generate the plots for us to compare our results and answer the following discussion questions.