Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interface between Velleman PCSGU250 and MATLAB

Similar presentations

Presentation on theme: "Interface between Velleman PCSGU250 and MATLAB"— Presentation transcript:

1 Interface between Velleman PCSGU250 and MATLAB
Week 0 Interface between Velleman PCSGU250 and MATLAB

2 MATLAB Interface for Velleman Scope
Download MATLAB Support Package Follow the instructions in the README file after you unzip the package.   There are a few example programs in the support package, which more or less work.  I have found that they work reasonably well on a Dell laptop, but one of which did not run properly as-written on my Fujitsu tablet . 

3 m files In MATLAB Support Package are several program that can be used to export library files, used by the Velleman function generator, and to import data from Channel 1 and 2 of the Velleman scope. getScopeData.m makeSampleLibs.m seeGeneratorOutput.m

4 makeSampleLibs.m Creates two library files
AM Wave.lib will cause the function generator to output a signal that is the combination of two sine waves. The frequency of one sine wave is at whatever frequency you have selected on the Velleman function generator and the other is at 20 time this frequency. Noisy Sine.lib will add random noise to a sine wave. Note that everyone will create a slightly different Noisy Sine.lib using this function. These .lib files are saved in Velleman directory, which is created by the MATLAB program. You will have to copy them to the LIB directory in the correct directory associated with PcLab2000LT

5 getScopeData.m You start the scope and function generator and measure the data as normal.  Then run the MATLAB file getScopeData.m. Data will be imported into two vectors, data1 for the Channel 1 and data2 for Channel 2. Plots of the data will be displayed in MATLAB.  For some reason, the scope will turned off after the data has been imported (at least with my computer).  I am still reviewing the functions that MATLAB wrote to interface to the scope and haven’t figured out why as of yet. 

6 seeGeneratorOutput.m You should have the Velleman oscilloscope connected to your computer and configured to make a measurement on Channel 1. You do not have to launch Velleman PcLab2000LT. The MATLAB program creates a half wave rectified sine wave lib file and plots it, then starts up the scope and function generator on the PCSGU250, Collects the data from the oscilloscope (which should be the function generator output), and plots it on the same plot. This should match up (roughly) with the original lib file plot.

7 New lib File As part of the Week 1 assignment, you will modify makeSampleLibs.m to write a library file that will cause the function generator to output three sinusoidal signals at once. Note that 4096 data points in the vector is one full cycle of the fundamental sine wave sin(2pfo) + sin(4pfo) + sin(8pfo) Call the new library file Three Sines.lib

8 Adding a new library file
Import into the Velleman PcLab2000LT LIB directory on your computer. Launch PcLab2000LT. Click MORE FUNC. Click LIB in the pop-up window Select Three Sines.lib from the list of files that are then displayed.

9 Collecting Data Set the frequency fo to 10 kHz and the peak-to-peak amplitude to 2V. Connect Channel 1 to function generator output. Save a screen capture of the function generator output as measured using the Velleman oscilloscope program Using getScopeData.m, collect the signal from the function generator created by your library file and save the plot.

10 Spectrum Analyzer Using the Spectrum Analyzer option on the Velleman scope, collect a plot that shows the three frequencies in the output of the function generator. Select the Frequency Range such that all three frequencies are on the same plot. Use a linear frequency scale Select a reasonable Zoom Save image from spectrum analyzer.

11 Pre-lab, Validation, and Post-validation Report
No Pre-Lab report. No Validation. Two Post-Lab reports One link – upload the m file that you modified to create Three Sines.lib using the correctly labeled assignment link Second link – upload the completed report template (found on the Week 0 Module) Screen capture from Channel 1 of the Velleman scope. Screen capture from the Velleman spectrum analyzer that displays three peaks associated with the three components of Three Sines.lib. Plot from MATLAB of the Velleman oscilloscope trace. Due: 8pm on 9/8/2012

Download ppt "Interface between Velleman PCSGU250 and MATLAB"

Similar presentations

Ads by Google