Lab 2: A/D, D/A, and Sampling Theorem

Similar documents
Session 1 Introduction to Data Acquisition and Real-Time Control

Working with a Tektronix TDS 3012B Oscilloscope EE 310: ELECTRONIC CIRCUIT DESIGN I

ME EN 363 ELEMENTARY INSTRUMENTATION Lab: Basic Lab Instruments and Data Acquisition

Experiment # 5. Pulse Code Modulation

MIE 402: WORKSHOP ON DATA ACQUISITION AND SIGNAL PROCESSING Spring 2003

INTRODUCTION This procedure should only be performed if the instrument fails to meet the Performance Check tests for Output Zero or Offset Accuracy

Introduction To LabVIEW and the DSP Board

Lab 1 Introduction to the Software Development Environment and Signal Sampling

GDB-03 Demo Module USER MANUAL GW INSTEK PART NO. 82DB-03000M01 ISO-9001 CERTIFIED MANUFACTURER

Experiment 2: Sampling and Quantization

Oscilloscope Guide Tektronix TDS3034B & TDS3052B

PB-507. Advanced Analog & Digital Electronic Design Workstation Instruction Manual. Revision: 2/2014

Manual Supplement. This supplement contains information necessary to ensure the accuracy of the above manual.

4.9 BEAM BLANKING AND PULSING OPTIONS

Lab experience 1: Introduction to LabView

Experiment 9 Analog/Digital Conversion

Quick Start. RSHS1000 Series Handheld Digital Oscilloscope

Basic LabVIEW Programming Amit J Nimunkar, Sara Karle, Michele Lorenz, Emily Maslonkowski

University of Utah Electrical & Computer Engineering Department ECE1050/1060 Oscilloscope

Spectrum Analyser Basics

Quick Start for TrueRTA (v3.5) on Windows XP (and earlier)

Fluke /

ENGR 1000, Introduction to Engineering Design

ORPHEUS ZERO U S E R M A N U A L

NanoGiant Oscilloscope/Function-Generator Program. Getting Started

Getting Started with the LabVIEW Sound and Vibration Toolkit

Capstone Experiment Setups & Procedures PHYS 1111L/2211L

PLASMA MONITOR (PT20 UVVis) USER GUIDE

Analog Discovery Scope and Waveform Generator Edited 11/15/2016 by Eric Scotti & DGH

Quick Operation Guide of LTN7700/7600 Series NVR

2 MHz Lock-In Amplifier

PRELIMINARY INFORMATION. Professional Signal Generation and Monitoring Options for RIFEforLIFE Research Equipment

DSP Laboratory: Analog to Digital and Digital to Analog Conversion *

Tablet Oscilloscope Quick Guide

Ultra 4K Tool Box. Version Release Note

Introduction to the oscilloscope and digital data acquisition

SRV02-Series. Rotary Pendulum. User Manual

Lab 2, Analysis and Design of PID

Experiment 9A: Magnetism/The Oscilloscope

University of Utah Electrical Engineering Department EE1050/1060 Oscilloscope. Name:, Lab TA:

Evolution Digital HD Set-Top Box Important Safety Instructions

Measuring with digital storage oscilloscopes

MAIN PCA TEST PROCEDURE DOCUMENT NUMBER:

Noise Detector ND-1 Operating Manual

Technical Reference. TDS 684A, TDS 744A, & TDS 784A Digitizing Oscilloscope Performance Verification and Specifications

REMOTE I/O R30 SERIES. PC CONFIGURATOR SOFTWARE Model: R30CFG Ver Users Manual

Procedures Guide. Tektronix. HDMI Sink Instruments Differential Impedance Measurement

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

Overview. Shipped in the Venue Vizion Package: Simplified Integration Process. Installation consists of 6 easy steps:

EAN-Performance and Latency

1CHDVRD1 USER MANUAL. These instructions apply to unit model 1CHDVRD1 only. Please read carefully before use.

4 MHz Lock-In Amplifier

GWL/ Power Group Technology Solutions Stay Powered for the Future

FREQUENCY COUNTERS TO 18 GHZ USING THE DATUM FREQUENCY STANDARD

PQ-Box 100 Quick Start Instructions

Experiment 13 Sampling and reconstruction

Table of Contents Introduction

THDB_ADA. High-Speed A/D and D/A Development Kit

User Manual. TDS3SDI 601 Digital Video Application Module

TDS 520B, TDS 540B, TDS 620B, TDS 644B, TDS 680B, TDS 684B, TDS 724A, TDS 744A, & TDS 784A

Electrical and Electronic Laboratory Faculty of Engineering Chulalongkorn University. Cathode-Ray Oscilloscope (CRO)

DPD80 Visible Datasheet

HD Digital Set-Top Box Quick Start Guide

Analyzing and Saving a Signal

EMS DATA ACQUISITION AND MANAGEMENT (LVDAM-EMS) MODEL 9062-C

DS-7200HVI/HFI-SH Series DVR Quick Operation Guide

DPD80 Infrared Datasheet

Features/Specifications

User Manual. TDS3VID Extended Video Application Module

imso-104 Manual Revised August 5, 2011

SigPlay User s Guide

Operating Instructions

Aurora Grid-Tie Installation Instructions (Model Number: PVI-3.0-OUTD-US-W) Revision 4.1

Video to DVI 1080p Scaler Box - ID# 796

Manual Supplement. This supplement contains information necessary to ensure the accuracy of the above manual.

Amplification. Most common signal conditioning

Reference. TDS7000 Series Digital Phosphor Oscilloscopes

IMPORTANT SAFETY INSTRUCTIONS

Activity P32: Variation of Light Intensity (Light Sensor)

SNG-2150C User s Guide

ORM0022 EHPC210 Universal Controller Operation Manual Revision 1. EHPC210 Universal Controller. Operation Manual

-SQA-SCOTTISH QUALIFICATIONS AUTHORITY HIGHER NATIONAL UNIT SPECIFICATION GENERAL INFORMATION

Overview. Know Your Oscilloscope. Front Panel. Rear Panel. Sharing Agilent s Resources with Engineering Educators

QUICK START GUIDE FOR DEMONSTRATION CIRCUIT /12/14 BIT 10 TO 65 MSPS DUAL ADC

imso-104 Manual Revised July 19, 2012

User Guide. Ultimatte Corporation, Plummer Street, Chatsworth, CA USA Ph. 818/ Fax 818/

Part No. ENC-LAB01 Users Manual Introduction EncoderLAB

What to look for when choosing an oscilloscope

Rack-Mount Receiver Analyzer 101

DMX48. User s instruction manual. 24 Channel DMX controller

Digital Signal Processing Laboratory 7: IIR Notch Filters Using the TMS320C6711

Operating Instructions

L, LTC, LTM, LT are registered trademarks of Linear Technology Corporation. Other product

TimeView Display. Operating Manual

Displays Open Frame Monitor Model Number: AND-TFT-150Bxx

Digital Effects Pedal Description Ross Jongeward 10 December 2014

Keysight Infiniium S-Series Oscilloscopes

User Manual. SDS1000X-E Series Digital oscilloscope UM0101X-E02B SIGLENT TECHNOLOGIES CO., LTD.

Choosing an Oscilloscope

Obtain Power Measurements of a DOCSIS Downstream Signal Using a Spectrum Analyzer

Transcription:

Lab 2: A/D, D/A, and Sampling Theorem Introduction The purpose of this lab is to explore the principles of analog-to-digital conversion, digital-to-analog conversion, and the sampling theorem. It will also serve as an introduction to the Q2 USB data acquisition system, which will be using for the remaining control labs. In-Lab Task #1: Introduction to Quanser Q2 USB Data Acquisition Device In our lab, we will use the Quanser Quarc Q2 USB data acquisition device to act as an interface between our computer and motor system. The Q2 board has two 16-bit count encoder inputs, two 12-bit analog inputs, two 12-bit analog outputs, and 8 digital I/O lines. It has an analog input/output range of 10V. Ground Bar Figure 1: Quanser Quarc Q2 USB Data Acquisition Board CAUTION: The Q2 boards are extremely sensitive to electrostatic discharge (ESD) and will be irrevocably damaged if subject to static shock. Consequently it is of critical importance you ground yourself before handling the boards. You can do this by touching the exposed metal ground bar on the board itself, as pictured above. RCA ends should be used to cover any unused analog I/O ports. When wiring devices to the Q2 board, make sure the Q2 board is the last thing you connect to. When disassembling your wiring, unplug RCA cables from Q2 boards first. Exposed wire ends that are connected to the analog I/O ports of the board are essentially direct lines for static electricity to enter the board. Task #2: Setting Up Simulink model to Work with the Quarc Q2 Board In order for MATLAB to communicate with the Q2 board, you need to take a few extra steps when setting up your Simulink model. These steps must be performed each time a Simulink model is built, both in this lab and future labs: 1. Create a new Simulink model and open the Simulink library browser. 2. Specify that you are using a Quarc Q2 board. This is done using the special Simulink block HIL Initialize. Within the Simulink library, navigate to QUARC Targets > Data Acquisition > Generic > Configuration, as pictured below, and drag-and-drop the HIL Initialize block into your Simulink model. Figure 2: Location of HIL Initialize Block in Simulink Library.

3. In the Simulink model, double-click the HIL initialize block and change the Board type: to q2_usb in the drop-down menu. 4. Next, navigate to the Simulation menu on the Simulink model toolbar and click on Model Configuration Parameters, as pictured below: Figure 3: Location of Simulation Menu. 5. In this configuration menu (shown below), set your simulation time by changing the Stop time value. For this lab a time of 20 seconds will work. In future labs it will be advantageous to set this to inf so it runs indefinitely. Next set your Fixed-step size (a.k.a. fundamental sample time) to.001 second. Next, select your solver type. For this lab we will use the discrete solver. Figure 4: Model Configuration Parameters Menu 6. Change the simulation mode from Internal to External using the drop-down menu on the Simulink model toolbar, as pictured below: Figure 5: Location of Simulation mode dropdown menu. 7. Keep this Simulink model open as we will use it in Task #3. Remember to save your file. Task #3: Analog-to-digital (A/D) Conversion In this section the principles of analog-to-digital conversion will be explored. This is accomplished by building and using a Simulink model that measures an external DC signal through one of the Q2 s analog-to-digital inputs. The DC power supply located at your station will be used to generate the signal. The steps are as follows: 1. Locate/open the Simulink model created in Task 2. If you do not have it, simply repeat the steps in Task 2 to setup a new Simulink model. 2. When using a Q2 board, special Simulink blocks provided by Quanser must be used to create inputs, outputs, and in future labs, encoder readings. The location of these blocks within the

Simulink library is pictured in Figure 6. Figure 6: Location of Quarc-specific I/O, Encoder Blocks. 3. Using the HIL Read Analog block from this library location along with a Display block, create the following block diagram (the HIL Initialize block is cropped out here): 4. Double-click on your HIL Read Analog block and confirm the channel listed is 0 (this sets it to ADC input 0 as opposed to ADC input 1 on the board). 5. Press the build model button in the Simulink model toolbar. 6. With the Simulink model setup, the DC power supply must now be wired to one of the analog inputs on the Q2 board. Remember to ground yourself and make sure the Q2 board is the last thing you connect to. Use the following steps: Step 1: Connect the Banana-Alligator wires to the DC power supply output terminals Step 2: Connect the Banana-Alligator wires to the RCA-tinned cable as shown in the diagram below. Do not connect the RCA-tinned cable to the Q2 ADC0 input yet. Step 3: Turn on the DC power supply and set the voltage to 10V. Step 4: After grounding yourself, connect the RCA end of the RCA-tinned wire to ADC 0 on the Q2 board. Remember that the Q2 board is very ESD sensitive. RCA Tinned Wire Banana to Alligator Wires 7. Return to your Simulink model. Press the Connect to Target Button on the Simulink toolbar, as pictured below:

8. Now press the play button located immediately to the right of the Connect to Target button on the Simulink toolbar. This will begin the simulation. 9. You will now see the power supply voltage being displayed in your Simulink model s Display block. Record this value for your lab report. If you want to end the simulation early, press the stop button on the Simulink toolbar. 10. Change the power supply voltage to 6V. Run the Simulink model again and record the voltage observed for your lab report. 11. Repeat step 10 for a power supply voltage of 2.5V, again recording the voltage. 12. Set the power supply voltage to -10V. Do this by first setting your output voltage to 10V. Then turn the power supply current knob all the way to zero. This in turn reduces the voltage to zero. Now switch the positive and negative leads at the power supply. Return the current knob to its original position. Run your simulink model, recording the voltage observed. 13. Repeat step 12 for a power supply voltage of -1.5V and record the voltage. 14. Turn off your power supply. Disassemble your wiring. Remember to ground yourself first and disconnect the the Q2 board before anything else. Task #4: Digital-to-Analog (D/A) Conversion: In this section, Simulink will be used to create a DC signal that is outputted through one of the Q2 s DAC outputs. This signal will then be measured using the oscilloscope (and/or multimeter) at your workstation. The steps are as follows: 1. Build the following block diagram. You can save setup time by reusing your Simulink model from Task 3. Simply delete the HIL Read Analog and Display blocks and add the following (the HIL Initialize block is cropped out here): 2. Double-click the Constant block and set its constant value to -5V. 3. Double-click the HIL Write Analog block and verify it is set to channel 0. 4. Press the Build button 5. Wire the oscilloscope to the DAC 0 output on the Q2 board using the diagram below (Remember to ground yourself and connect the Q2 board last). 1 of the 3 oscilloscope probes in your workstation s oscilloscope pack will have adjustable attenuation via a red switch on the side. Make sure this switch is set to 10x. 6. After turning on your oscilloscope, set it up to measure the voltage on channel 1. Do this by first pressing the Channel 1 button to make sure it is displayed (channel 1 will be yellow on screen while channel 2 will be blue). Press the Measure button. Select Ch 1 using the corresponding selection button located just right of the screen. This will open a submenu. Using the rotary knob, navigate to Maximum and press the rotary knob to select. Now press

the Menu On/Off button, located just off the bottom right edge of the screen, twice to exit the submenu and menu. You will now see the maximum signal voltage displayed in the lower lefthand side of the screen. 7. Return to your Simulink model. Press the connect to target button, and then run the model. Record the voltage observed on the oscilloscope for your lab report. You made need to use the Autoset button on the oscilloscope to bring the signal within range of the screen. 8. Repeat the procedure above for constant voltage values of -10V, 0V, 5V, and 10V. Record the oscilloscope readings for each. 9. You can leave your wiring intact as DAC 0 will still need to be connected to Channel 1 for the next task. Task #5: Demonstration of Sampling Theorem In this section we will demonstrate the principles of the sampling theorem. This will be accomplished by generating an analog signal using the function generator at your workstation and sending this signal to one of the analog inputs of your Q2 board. This signal will then be sampled by Simulink. This sampled signal will then be sent to your oscilloscope to be evaluated via one of the outputs on your Q2 board. The steps are as follows: 1. Create the following Simulink model. Again, you can save setup time by reusing your previous Simulink model and deleting/adding blocks as needed. 2. Make sure the HIL Read Analog block is set to ADC channel 0, while HIL Write Analog is set to DAC channel 0. 3. Set the simulation time to inf so it will run indefinitely until the stop button in the toolbar is clicked. 4. Check that your simulation step-size is still.001 (corresponding to a sample rate of 1000Hz) 5. Click Build button on Simulink model toolbar 6. Wire the oscilloscope, function generator, and Q2 board together by following the steps and diagram below. Your oscilloscope should still be connected to DAC 0 from the previous task. Again, ground yourself first and always connect the Q2 board last. Step 1: Connect a probe to channel 2 on the oscilloscope and another to the output of the function generator Step 2: Connect both of these probes to a single RCA-tinned cable. Do not connect this cable to the Q2 board yet. Step 3: Turn on the oscilloscope and function generator Step 4: Set your function generator to produce a sine wave with a frequency of 50 Hz and an amplitude of 1.5V RMS. You can use the oscilloscope s Measure button to display this RMS amplitude while you adjust it on the function generator. Step 5: Now connect the remaining RCA-tinned cable to the Q2 ADC 0 input.

7. Return to your Simulink model, connect to target, and run. 8. Using the oscilloscope, estimate the frequency of the signal outputted by the Q2 board. Record it in Table 1. If you want, you can save a screen capture of the oscilloscope readout using the Tektronix software on your computer. 9. Repeat step 8 for the remaining frequencies in Table 1 Table 1: Observed Frequency vs. Input Frequency 10. Turn off the function generator and oscilloscope. Disassemble your wiring. Remember to ground yourself first and disconnect the RCA cables from the Q2 board before anything else. Lab Report Answer following questions: 1. What is the resolution of an analog-to-digital converter with a word length of 12 bits and an analogue signal input range of 100V? Show work. 2. Consider an 8-bit (including sign bit) A/D converter with a voltage range of +/-1V. What is the resolution of the A/D converter? 3. A sensor gives a maximum analog output of 5V. What word length (i.e. the number of bits) is required for an analog-to-digital converter if there is to be a resolution of 10mV? Show work. 4. Consider the analog signal: Xa(t) = 3cos(300t). Determine the minimum sampling avoid aliasing. If this signal is sampled at 300 Hz, what is the frequency of the signal reconstructed from the sampled data points? If this signal is sampled at 200 Hz, what is the frequency of the signal reconstructed from the sampled data points? 5. Attach the results you have gotten in task #2, task #3, and the actual vs.observed frequency table that you created in task #4.