$24
Objective
The primary focus of this series of experiments is to write MATLAB scripts to automate the measurement equipment in the lab, namely the arbitrary waveform generator (AWG), digital multimeter (DMM), and the oscilloscope. The goal is to estimate the value of a resistor by sweeping the DC voltage out of the AWG and measuring the current, using the DMM, at that voltage, measured using the oscilloscope.
Firstly, the output voltage on the AWG will be changed manually and the data will be recorded from the DMM. In order to capture more data points more efficiently, scripts will be written for the equipment to estimate the value of the resistor. Afterwards, the process will be repeated using MATLAB to automate the voltage sweep and data recording. Finally, the oscilloscope will be tested to automate generating a signal of varying duty cycle and recording the corresponding on-times.
Equipment List
BNC to BNC cable
BNC to 2-alligator clip cable
(2) banana-jack to alligator clip cables
(1) 2 kΩ resistor
HP Digital multimeter (DMM)
HP Waveform generator (AWG)
HP Oscilloscope
Procedure
The first experiment measures the current for a sweep of DC voltages manually set on the AWG. The voltage is swept from 0 to 10V in 1V increments. Both the voltage and current are recorded in order to cross-check the value of the resistor used.
For the second part of the experiment, the process is automated using MATLAB’s USB commands. Both the AWG and DMM are set up using MATLAB to sweep the DC voltage from 0 to 10V in 0.1V increments and record the corresponding readings.
The third part of the experiment connects the AWG to the oscilloscope. Periodic pulse signals of known amplitude and varying duty cycle are automatically generated using MATLAB’s USB commands. The duty cycle is swept from 20% to 80% and back down to 20% in 5% increments, and the corresponding on-times are recorded.
Finally, the data from all the experiments are plotted using MATLAB and linear regression is applied to each set of data to compare experimental results with best fit estimates.
Deliverables
Plot of Current vs. Applied Voltage for manually swept data set and accompanying best fit line.
Plot of Current vs. Applied Voltage for automatically swept data set and accompanying best fit line.
Plot of On-Time vs. Duty Cycle for automatically swept data set and accompanying best fit line.
Results