Top Banner
INF3410, fall 2018, mandatory labratory exercise 1: Operational Amplifier (deadline 24-Sep-2018, 12:00!) P. H¨ afliger & Henrik Klev Institute of Informatics University of Oslo e-mail: hafliger@ifi.uio.no September 5, 2018 Abstract This first lab task is meant to give a feeling for reading a datasheet of an operational amplifier and its basic properties. It will also introduce the students to work with electronic equipment in basic analog circuit testing. It will also illustrate the pitfalls of trusting too much into built-in automatic analysis of measurements that some instruments offer, whithout really knowing how the instument performs that analysis, and without some ’manual’ verification. It is the first in a series of three lab tasks that will be graded and will count 40% towards the final grade. The first lab, however, will only be ’pass’ or ’fail’. The students are required to pass this lab assignment. The deadline is September 24th, 10:00! It is a hard deadline! Do not miss it! Plan to submit well ahead of the deadline! 1 Safety in the lab Voltages over 40 Volt can in some cases be harmful, even though it usualy requires more than that. The lab equipment is thus not able to provide voltages higher than 36V. Do not use equipment other than that provided in the lab! If a part of the skin is covered with a conductive fluid or is pierced and exposed to such voltages, a current could bypass the “insolator” of the skin and run through the body. If this current passes through the heart it can cause fibrillations or even cardiac arrest. Even higher more extreme currents could also give rise to internal burns. If this happens to anybody or something else happens in the lab, seek medical help immediately: heart fibrillations can last and cause trouble long after the incident. Also notify the person in charge of the lab. 1
14

INF3410, fall 2018, mandatory labratory exercise 1 ...

Dec 18, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: INF3410, fall 2018, mandatory labratory exercise 1 ...

INF3410, fall 2018, mandatory labratory exercise

1: Operational Amplifier

(deadline 24-Sep-2018, 12:00!)

P. Hafliger & Henrik KlevInstitute of Informatics

University of Osloe-mail: [email protected]

September 5, 2018

Abstract

This first lab task is meant to give a feeling for reading a datasheetof an operational amplifier and its basic properties. It will also introducethe students to work with electronic equipment in basic analog circuittesting. It will also illustrate the pitfalls of trusting too much into built-inautomatic analysis of measurements that some instruments offer, whithoutreally knowing how the instument performs that analysis, and withoutsome ’manual’ verification.

It is the first in a series of three lab tasks that will be graded and willcount 40% towards the final grade. The first lab, however, will only be’pass’ or ’fail’. The students are required to pass this lab assignment. Thedeadline is September 24th, 10:00! It is a hard deadline! Do not miss it!Plan to submit well ahead of the deadline!

1 Safety in the lab

Voltages over 40 Volt can in some cases be harmful, even though it usualyrequires more than that. The lab equipment is thus not able to provide voltageshigher than 36V. Do not use equipment other than that provided in the lab! Ifa part of the skin is covered with a conductive fluid or is pierced and exposed tosuch voltages, a current could bypass the “insolator” of the skin and run throughthe body. If this current passes through the heart it can cause fibrillations oreven cardiac arrest. Even higher more extreme currents could also give rise tointernal burns. If this happens to anybody or something else happens in thelab, seek medical help immediately: heart fibrillations can last and cause troublelong after the incident. Also notify the person in charge of the lab.

1

Page 2: INF3410, fall 2018, mandatory labratory exercise 1 ...

Some electronic components can explode if they are exposed to high currents.This is important to remember when working with electrolytic capacitors. How-ever, none of the capacitors provided in the lab are electrolytic capacitors. Neverbring your own electronic components into the lab!

2 Lab Rules

Good routines are necessary to make the work in the lab effective and safe:

• Food and drinks are prohibited from every lab.

• In general everybody is responsible for keeping the lab tidy.

• Always turn off the power supply before you start adding and/or removingcomponents.

• Use an ESD protection wrist strap when handling ICs and other sensitivecomponents.(ESD: electrostatic discharge)

• Always clean up after using equipment and tools:

– Turn off all equipment, except for lab computer.

– Throw away cutoffs and vacuum clean the desk, chair, and floor ifnessesary.

– Place all components you have used back to their respective places.(Do this while you work, if you have a component you don’t useanymore, put it back.)

• When you leave; the desk should be clean and ready for the next group.

• Read the information posters in the lab describing what to do in case offire or medical emergency.

3 About Writting a Lab Report

You are required to execute the tasks and answer all the questions posed belowand to submit a report on your work. The report needs to be explaining clearlywhat you have done, how you have done it, what the results were and what youconclude from them. Make sure to answer all questions! Supply the report withdrawings of the circuits (including the values of the components and parametersyou used where appropriate, e.g. bias voltages/currents, component sizes etc.)and measurement setups, and show your measurements in graphs! Use labelsin the schematics that you draw, such as M1, M2 (M is often used fro labellingCMOS transistors), opamp1, I1, V1 etc. You should then use those labels inyour text, since it is much easier to write: ’transistor M1 in figure 1’ than ’thetransistor third from the top and second from the left in the righthand sidecircuit in figure 1’. Include a photograph of your PCB or bread bord setup intothe report! THIS IS MANDATORY!

2

Page 3: INF3410, fall 2018, mandatory labratory exercise 1 ...

4 Introduction

The operational amplifier is the fundamental building block in active analogcircuits. If you buy an OpAmp as a discrete component it comes with a datasheet specifying its properties. However, as with every integrated circuit the realproperties may vary and data sheets therfore specify certain tolerances aroundan expected parameter.

Each group must deliver a written lab report using Devilry before the dead-line and the lab assignment will be graded as passed/not passed.

Each question is graded indicating the weight when grading.

5 Tools

• The NI-ELVIS bord and plug-in bread bord

You shall use a bread bord to plug in cables and discrete componentsto compose your test circuits. The bread bord can be removed from thesocket in the ELVIS bord and each group can keep one for the durationof the course. Thus, once you are done for the day you can leave yourcomponents in place and lock your bord away or take it home with youuntil your next lab session. The ELVIS bord has some built in instrumentsthat are displayed on the computer at each work place. You shall use thoseinstruments to characterize your circuit.

An excellent description of the ELVIS bord and its use is provided in thecourse material of the course INF1411/IN1080 for labs 1 and 2. A copycan be either found on that courses homepage or also locally here: https://www.uio.no/studier/emner/matnat/ifi/INF3410/h18/materiale/in1080 lab1v2018 veiledning.pdf and https://www.uio.no/studier/emner/matnat/ifi/INF3410/h18/materiale/in1080 lab2 v2018 veiledning.pdf

Some general advice: plan your layout of components and cables on thebread bord before you start plugging them in and try to make thingscompact and organized.

• The NI ELVISmx Instrument Launcher

You may again refer to the IN1080 course description. It includes a de-scription of some of the instruments you are going to use for this lab, i.e.the digital multimeter, the variable power supply, the function generator.Here is the short ’to get started’ version and an added description for thebuilt in oscilloscope:

BEFORE you launch the NI ELVISmx Instrument Launcher you shouldswitch on the ELVIS board, such that the software (SW) recognizes thehardware (HW) correctly. Note that there are two power switches, oneon the right hand side on the back of the board and one on top of thboard also on the right near the back. You may launch the NI ELVISmx

3

Page 4: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 1: The NI ELVISmx Instrument Launcher

4

Page 5: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 2: The NI ELVISmx Oscilloscope Virtual Instrument

Instrument Launcher from the icon on your Windows desktop in the laband you will get a list of icons representing the various instruments thatare built in into the ELVIS board. See figure 1. Note that the interfacelooks now a bit more modern than in the description of IN1080.

• The NI ELVISmx Oscilloscope

When you open the Oscilloscope in the instrument launcher the virtualinstrument pops up like in figure 2. You’ll have two channels to observewaveforms on the oscilloscope that are conected to BNC ports labelledCH0 and CH1 on the ELVIS board, the upper left red circle in figure 3.Per default they should be connected with BNC cables to ports BNC1 andBNC2 such that you can connect them by plugging in wires into the breadboard to the right of the labels BNC 1 ± and BNC 2 ± (the lower redcircle). Note that you should connect the minus terminal to a GROUND.You can briefly check out its function by connecting the output of thefunction generator (output labelled FGEN on the breadboard, see thedescription in the IN1080 manual for the NI ELVISmx instrument panel)to one of the channels and play around with the various knobs. More help

5

Page 6: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 3: Connections on the ELVIS II bread board, with the oscilloscope con-nections highlighted.

6

Page 7: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 4: The NI ELVISmx 2-wire VI Analyzer Virtual Instrument

for the instrument is available if you press on the help button in the VIfront panel. That’s true for all instruments!

An important function/button is the ’write to log’ which will export thegraph in a text file that you can make readable by MATLAB with a fewsimple edits. Then you can create nice graphs for your report or do somemore adavanced analysis of the data in MATLAB.

• The NI ELVISmx 2-wire VI Analyzer

Another NI ELVISmx instrument i the 2-wire VI analyzer and when youclick it its front panel pops up and looks as depicted in figure 4. It let’syou sweep a voltage and measure a current accross a device/circuit. Theconnections on the bread board left hand side between which you need toplace your circuit under analysis are DUT+ and DUT- (see figure 3). Formore help, press the ’help’ button. Note that this instrument will executea series of measurements that you could have performed by hand. This isoften a good thing, but has some pitfalls: you should know in some detail

7

Page 8: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 5: The NI ELVISmx Bode Analyzer Virtual Instrument

how the results are obtained, because sometimes results of automatedmeasurements can be something else than what you think they should be,because they are not exactly obtained as you think they are ... In fact,this lab shall try to illustrate that with the next NI ELVISmx instrument!

• The NI ELVISmx Bode Analyzer

The Bode analyzer allows you to do an even more complex automatedmeasurement and analysis quickly, but the validity of the results is quitedependent on the parameters that you enter. Consequently, you shouldreally know how it computes the results and maybe do a couple of manualmeasurements to see what is really going on! This shall be illustrated inthis lab.

The Bode analyzer does exactly what its name says. It derives the trans-fer function of a circuit and depicts it in a Bode plot. The input of the

8

Page 9: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 6: The LabView VI Block Diagram editor

circuit in question should be connected both to the function generatorFGEN and the Oscilloscope CH1/BNC1, and the output to the oscillo-scope CH2/BNC2.

• The NI LabView 2018 (32-bit) Graphical Programming Lan-guage for Automated Measurements

If you want to automatize a series of measurements bayond what the stan-dard ELVISmx VIs already implement, you can do so using the NI Lab-View graphical programming language. However, you will not needthis at first and likely not at all for this first lab task so youdo not have to bother right now, if you are not particularly in-terested. You can start it by doubleclicking the icon on your lab PCsdesktop.

9

Page 10: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 7: The LabView VI Front Panel editor

When you launch LabView you should also turn on the ELVIS boardbeforehand such that it is properly recognized. A program in LabViewis called a virtual instrument (VI), actually the same as the instrumentsthat you see in the ELVISmx Instrument Launcher: they have themselvesbeen programmed in LabView.

When you start a new project and choose a new empty VI you’ll use twowindows to make your VI: 1) the front panel (figure 7) and 2) the blockdiagram (figure 6) . If only one of these opens up you can choose theother from the ’windows’ menue to see both. The front panel is the userinterface to the function/program that you define in your block diagram.It offers knobs and gauges and such to graphically exchange data with auser, just like a desktop instrument.

You can build programs/VI that use sub-programs/VIs (i.e. existing VIslike the ELVISmx VIs). You will find the ELVISmx VIs when editingthe block diagram: right click into that window and select ’measurementI/Os’. Within there there is an icon labelled ELVISmx. If you click onthat there will be icons for all ELVISmx VIs. Their inputs and outputswill be marked with colored arrows at the boarder where you can connectthings in your block diagram, for example inputs from your front-panelor constants and outputs to your front panel or other sub-VIs etc. Theexample in figure 6 contains two NI ELVISmx VIs, the variable powersources and the digital multimeter. It implements a for loop executingmultiple VI measurements using those two instruments, just like the 2-wire

10

Page 11: INF3410, fall 2018, mandatory labratory exercise 1 ...

VI analyzer, but will require different connections on the bread board. Itdoes not quite work correctly though, as the application of the voltageand measurement happens simultaneously, so the voltage has not alwayssettled when the measurement is taken.

An obvious use of LabView would be a automated series of measurementswith your ELVISmx VIs, i.e. a for-loop. There is a tutorial on how to im-plement a for-loop from NI at this URL: http://www.ni.com/white-paper/7588/en/

• Operational AmplifiersThe chip ICL7621 contains two operational amplifiers. The data sheet isavailable on the courses home page.

• ResistorsYou might need resistors for some tasks. A good selection is available inthe cupboard in the lab. At the inside of the door there is a descriptionof the colour code that indicates the resistance. You’ll also find it in theINF1411 lab1 instructions: http://www.uio.no/studier/emner/matnat/ifi/INF1411/v16/labovelser/lab1/inf1411 lab1 v2016 veiledning.pdf

• MATLABWe will be using MATLAB for some excersises and it’s the best toolfor plotting all of your results as nice graphs. Also if tou need to controlequipment other than the ELVIS bord via the GPIB interface (not for thislab), you will need to use the correct functions in matlab for this. Thus,you should bring a working knowledge of MATLAB to this course. If youhave none, get a crash course from a fellow student who has used it! It isa powerful mathematics tool with a command line interface. One usefulfunction is ‘help’. ‘help <command name>’ will display an explanationon how to use ‘<command name>’. Another help function that helps youfind functions that you do not know the exact name of is ‘lookfor’. Type‘help lookfor’ to learn more.

Always clean up the lab after your time slot, such that the next group canuse the equipment!

6 General Advice

• Draw a schematic before you start assembling components on the PCB!Label pins on the PCB and in the schematics (!) clearly in order to keepyour overview. Debuging will be much, much easier that way!

• Come to the lab with a work plan: Read the entire lab task beforehandand make a plan how to proceed. Put yourself a goal for a lab session.Read the relevant book chapters in order to understand the entire lab. Beready with questions already before the lab if there are still things unclear.

11

Page 12: INF3410, fall 2018, mandatory labratory exercise 1 ...

Figure 8: Experimental setup for task 1

7 Operational Amplifier Characteristics

Task 1 (2p) Derive the gain of an OpAmp: Now take a ICL7621 IC andplug it into the bread bord. Check the data sheet for the pin assignment ofthe IC and make sure to power it correctly. Use the variable power supplyNIELVISmx VI to apply a positive supply Vdd and a negative supply-Vss, where your signal ground reference Gnd is in the middle betweenthem. You will also want Gnd as reference that you apply to the minusterminal of the OpAmp on the IC that you use for your measurement.

Make a plot of its input/output characteristics by supplying an input tothe plus terminal over the entire range of Vss to Vdd. Use the functiongenerator to do that: let it supply a triangular wave or ramp at a lowfrequency, e.g. 10Hz. Keep in mind here that the function generatoroutput comes from a digital to analog converter (DAC), which means theoutput is not perfectly analog but will actually be ’stepped’, i.e. whatlookls like a nice linear slope of a triangular wave will look like a stairsif you zoom in. The steps of these stairs need to be really small, if wewant to characterize the high gain that the amplifier has. Can you explainwhy? What might happen if these steps are too large?

In order to make thse steps smaller than the function generator can in factprovide them, we’ll use a trick. We will let the function generator providea relatively large signal around Gnd but will use a resistive divider todampen that signal, i.e. multiply it with a factor smaller than 1. Seefigure 8 for the experimental setup. Use a total resistance (i.e. R1 + R2)of about 10-50kΩ and an appropriate ratio between the two to make theinput signal to the opamp small enough. Thus, also the minimum stepsthat the function generator uses are made smaller. Try to find out if thesteps are small enough for you to get a reliable measurement on the slope

12

Page 13: INF3410, fall 2018, mandatory labratory exercise 1 ...

in the linear range (!) of the opamp.

To observe the signals, use the oscilloscope. With it you can observe boththe input and the output of the opamp. Also the oscilloscope is limitedin resolution, this time by its ADC. Thus it is better to observe the inputsignal to the opamp BEFORE the resistive divider and rather computewhat the real input is at the input terminal to the opamp. Thus you get abetter resolution of the signal. Now observe wghat happens at the outputand look at the slope of the output signal in the linear range. Make a plot!From the slope of the output vs the slope of the input, compute the gainand compare it to the data sheet of the opamp. Does your measurementmatch the data sheet’s specification?

Task 2 (2p) Explain how to measure bandwidth: Measuring the bandwidthof the open loop configuration would be challenging because of the highgain. Ideally you would provide a small AC test signal (i.e. a sine wave)to the input, such that the output signal stays in the linear range of theamplifier. However, with a high gain this might be a smaller input signalthan your function generator can provide and a resistive divider wouldprobably be necessary here too, to downscale the signal. From the gainthat you measured in Task 1, how small would the input signal amplitudeneed to be? Can you briefly measure and show in a plot, what happensto the output if the AC input signal is too large and the output does notremain in the linear range? Adapt your measurement setup and connectthe OpAmp+ input to the function generator via pin FGEN either com-pletely without any resistive divider or a divider that does not shrink thesignal quite enough. Illustrate what happens to the output and why yourmeasurment of the transfer function would not be accurate.

Provided you could supply a small enough AC signal you would thenuse a range of frequencies and measure the output amplitude. A nextchallenge here could be that your function generator might not be able toprovide high enough frequencies to reach beyond the cutoff frequency ofthe OpAmp.

Question: the data sheet gives the ’unity gain bandwidth’. Can you derivewhat the open loop -3dB bandwidth should be from this number? Whatother OpAmp-parameter would you need to know? Can you give a numberfor this particular OpAmp?

But before you do a measurement: describe again in a few sentences howyou would actually do such a Bode analysis of the transfer function man-ually, in other words, if you would do the exact same thing as the Bodeanalyzer. With the help of the ’help’ button in the Bode analyzer, payspecial attention on what the parameter ’Peak Amplitude’ (which is thepeak amplitude of the input signal used in the analysis) changes in thisprocess and explain it!

Task 3 (4p) Measure Bandwidth OK, but you’ll do something more simplethan measuring the BW of the open loop OpAmp, i.e. you’ll measure the

13

Page 14: INF3410, fall 2018, mandatory labratory exercise 1 ...

BW of a particular closed loop circuit instead: the voltage follower. Seelecture notes or the book on how to configure an OpAmp as a voltagefollower. Rearange your OpAmp circuit to implement a follower connectedbetween FGEN/CH1/BNC1 and CH2/BNC2 to be analyzed by the Bodeanalyzer. If you have connected your follower correctly, it’s a simple matterof pushing the start button, but beware: you shall repeat the analysis atleast twice with different settings of the parameter ’Peak Amplitude’ andyou should get quite different results. Plot two such results! Be careful toindicate which parammeters you used for each plot!

The reason why you should see very different results is not that youroutput is outside the linear range (i.e. clipping) this time, since the gainof the follower is 1 and the output is no bigger than the input. There is anOpAmp property called the slew rate that interferes with a proper Bodeanalysis in this situation, dependent on the input ’Peak Amplitude’ usedfor the analysis. Can you explain this? Can you illustrate the effect thisslew rate has for particular input amplitudes and frequencies by doinga manual reading of the input and output in such a situation on theoscilloscope? Show at least one example where you see the influence ofthe slew rate and one where you do not. Be careful again to report theparameters used for each plot! Can you derive an equation/formula thatshows the relation of the output amplitude, the frequency and whetherthe slew rate has an effect or not?

14