100
PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

PHYS 231 Lab Manual

Department of Physics

Simon Fraser University

Last updated: November 8, 2005

Page 2: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

2

Page 3: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Contents

0 The Big Picture 5

1 Introduction to Computer-aided Data Acquisition 9

1.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

1.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.4 “Postlab” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 DC Impedances and Measurements 15

2.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3 Probability Distributions 21

3.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

3.4 Appendix A: Table for Experiment 1 . . . . . . . . . . . . . . . . . . . . . . 39

4 Radioactive Decay and Interval Distributions 41

4.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

4.2.1 The Radioactive Decay Curve . . . . . . . . . . . . . . . . . . . . . . 42

4.2.2 The Interval Distribution . . . . . . . . . . . . . . . . . . . . . . . . . 43

4.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5 AC Circuits I 49

5.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

3

Page 4: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

4 CONTENTS

6 AC Circuits II 556.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 556.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

7 Mechanical Resonance (2 Weeks) 617.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617.2 Prelab Questions: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

8 Bug 1: System Calibration 678.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68

9 Bug 2: Temperature Control 779.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

10 Bug 3: RC Decay 8310.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8310.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8310.3 Experiments: C by RC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

11 Bug 4: All together now 8911.1 Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.2 Prelab Questions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8911.3 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9011.4 Requiem for a Bug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

12 Epilog 95

13 Appendix: Programming Concepts 99

Page 5: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 0

The Big Picture

Before we jump into the details of this and that lab, it is worthwhile to try to give the bigpicture of what we are trying to do. Broadly speaking, we can say that the goal of this courseis to deepen your understanding of what it means to learn something from Nature. This canget very philosophical, but in the context of science, there are two aspects: How do we makean experiment to measure things about the world? Once we have done the experiment, howdo we learn something from – i.e., analyze – the results?

As you will see, this is a “how-to” course. In particular, one focus will be on how to usethe computer to accomplish our two goals of doing experiments and analyzing the results.The computer is just a tool that can speed up tedious measurements. Everything can alsobe done by hand – and often, that’s the way we’ll start – but adding a computer can befun and can allow one to take more data than one would normally have patience to do. Inaddition, in our course, we’ll also learn things about electronic circuits and about mechanicalresonance, and so on, but the real focus will be on how to do experiments and analyze resultsfrom them using a computer.

All experiments have several common features. We illustrate them in the diagram below.

Let’s take a look at these various elements. We’ll introduce them briefly here. Don’tworry too much about the details for now. In the lab, you will become familiar with themas the term progresses.

• Physical System: This is the object of your study. In general, the goal of an experimentis to measure some property of this physical system. Typically, one actually wants tomeasure how a physical property changes when some control parameter changes, whileholding all other physical parameters as constant as possible. For example, we willdo a lab at the end of the term where the physical system is a particular kind ofcapacitor. We wish to measure its capacitance (the physical property) as a functionof temperature (the control parameter). We try to hold all other physical parameters,such as the voltage used in the test circuit constant. We will also control, or regulate,the temperature so that it goes to its desired value and stays there while we do ourmeasurement.

5

Page 6: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

6 CHAPTER 0. THE BIG PICTURE

Physical System

Anti Aliasing

Computer

Signal Conditioning

A/D

Power Amp D/A Actuator

Sensor

Figure 1: Elements of an experiment using a computer for control and data acquisition froma physical system.

• Sensor : This is the device used to convert a physical property into a more measurablequantity. In this course, the sensor will almost always convert the physical propertyinto an electrical property. For example, we will use a thermistor, a kind of temperaturesensor that is a resistor whose resistance is a strong function of temperature. We putthe resistor in a voltage-divider circuit, whose output depends on the resistance (andtherefore the temperature). The result is a sensor that converts temperature changesto voltage changes.

• Signal Conditioner The sensor converts a physical property into (usually) a voltage.We then need to measure this voltage. In your first-year lab course, you did this usinga voltmeter, either analog or digital. In this course, we focus on using a computer tomeasure the voltage. The computer will have a data acquisition device (DAQ) (eithera card that goes into a bus slot or, as in our case, an external device that plugs into thecomputer via, e.g., the USB bus). Data acquisition devices use analog-digital (A/D)converters (see below) to convert a physical voltage into a digital number availableto the computer. (Recall that the physical voltage is a continuous quantity – a realnumber – while the digital number in a computer is a series of digits (0-9, or, in itsinternal representation, 0 and 1.) The A/D converters have a standardized voltagerange (often 0-10 or ±10 volts). The voltage given out by the sensor may be muchsmaller. For this – and other reasons we shall discuss later – one usually needs somekind of electric circuit (an amplifier or buffer) that makes the signal appropriate to bemeasured by the A/D converter.

• Anti-Aliasing Filter : Another subtlety of getting data into a computer is that a physicalvoltage V (t) is a continuous function of time, but the computer can only measure a

Page 7: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

7

discrete sequence of voltages. Thus, the continuous voltage is sampled. The anti-aliasing filter is a necessary step in this sampling (again to be discussed later)

• A/D converter : This is the analog-to-digital converter mentioned above. Our data-acquisition card has up to 8 channels that are multiplexed together. (“Multiplexed”means that there is a switch that chooses one of the eight inputs to measure.) TheA/D converter has a resolution of 14 bits (more on this later) and can sample a signalcollectively at 48,000 samples/sec (48 kHz). Because the channels are multiplexed, youcan read one signal at 48 kHz, two signals alternately at 24 kHz, ... , down to eightsignals at 6 kHz. We won’t have to read more than two signals at a time.

• Computer : The above elements all serve to get information about the physical systeminto the computer. For example, if we are interested in the temperature of a system, theresult would be a series of numbers V (t1), V (t2), ... that correspond to the temperatureof the system (well, actually of the sensor) at times t1, t2, ... One function of thecomputer would be to record the raw data coming in. Usually, you would want thecomputer to convert the voltages to temperatures using some kind of previously donecalibration. Then the computer could be used to plot automatically the temperatureon a graph. However, the computer will typically be used for more, too. As wediscuss below, the computer can change the physical system (e.g., by controlling aheater that will change the temperature). This means that the program can actuallyrun the experiment by first setting the temperature, waiting until it stabilizes at thedesired value, and then taking the measurement. Then the program can change thetemperature to the next desired value, etc. To do all of these things, the computer needsto be programmed. We will use two different programs in this course. For controllingand running the experiment and for data acquisition, we will use the program Labview(which uses a graphical metaphor for programming). For analyzing the data we collect,we will use the program Igor Pro (a kind of “spreadsheet on steroids”).

• D/A converter : Digital-to-analog converter. This is the counterpart to the A/D con-verter. It takes a digital number from the computer and converts it into an analogsignal.

• Power amplifier : This is the counterpart to the signal conditioner. It takes the voltagefrom the D/A converter and applies it to the actuator (see below). Because it generallytakes more power to change something in a system than to sense the changes, theamplifier that is used is usually heftier than that used in the signal conditioner.

• Actuator : This is the element that changes the system – the “muscle.” For example,if one wants to control the temperature, the actuator could be a heater (or some kindof refrigerator for cooling). To control a flow of a fluid, the actuator could be a valvethat opens up a flow line. To control light intensity, the actuator could be some kindof lamp or LED. And so on....

Page 8: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

8 CHAPTER 0. THE BIG PICTURE

Now that we’ve listed the basic elements in order, go back and reread the above to get afeeling for how they fit together. Indeed, as we go through the course, you may find it usefulto come back to this introduction to remind yourself about what’s going on at a conceptuallevel.

You should also think back to the labs you did in your first-year lab course. There,you didn’t use a computer, but the same basic elements are still present. For example,you probably investigated Ohm’s law for electric circuits: the voltage V across a resistor isV = IR, where I is the current through the resistor and R is its resistance. You did this byfirst setting a current I. In doing so, you were the actuator – you turned the potentiometerthat set the output of the current source, etc. Then, in reading the needle of the voltmeter(your sensor), you did the “signal conditioning” necessary to get its value into your computer(i.e., your head). Thus, the various elements really were there all the time. We’re just makingthem more explicit here, as we must if we want to automate the whole process. But we’llbe constantly going back and forth between the two modes. Thus, for any experiment, it isessential to do a few measurements by hand to see, at least qualitatively, the effects you aretrying to measure. Then, once you know everything is working properly, you bring in theautomation.

At the end of this Lab Manual is another “Big Picture” chapter, the Epilog, where welist in some detail what we hope you will learn in this course. Feel free to look at it now,but a lot of it will make more sense once we’ve covered those topics during the course.

Page 9: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 1

Introduction to Computer-aided DataAcquisition

1.1 Goals

Goals: Introduction to LabVIEW, Igor, and A/D concepts. By the end of this lab, youshould understand how to input a simple signal such as a sine wave into the computer anddisplay the result. You should understand the origins and sizes of quantization and samplingerrors.

• LabVIEW

– Basic metaphors (front panel, block diagrams)

– VI to read in data from function generator, display, store

• Igor

– Basic metaphors (command generation, waves)

– Read in data from a file and display

– Use cursors to extract basic measurements

• A/D

– Basic notions of A/D

– Quantization errors

– Sampling (simple notions of aliasing)

References

• “Getting Started with LabVIEW” tutorial

• Igor Online Guided Tour 1

9

Page 10: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

10 CHAPTER 1. INTRODUCTION TO COMPUTER-AIDED DATA ACQUISITION

1.2 Prelab Questions

There are no prelab questions for the first week, but there will be for future labs. Pleasehand them in on a separate sheet of paper before the start of the lab. For this lab only, wewill have “Postlab Questions” (see below).

1.3 Experiments

Note. You are expected to note your observations in your lab notebook. For the computerexercises, print out relevant things and tape into your lab book. For LabVIEW, this willinclude a representative front panel. For Igor, this will include printing out graphs. In futureexercises, you will be asked to email to the TA your LabVIEW and Igor code files.

1. Connect the function generator to the oscilloscope. Adjust the frequency and amplitudeknobs of the function generator in order to display a 1 kHz, 1 V p-p (peak-to-peak) sinewave properly. (Use the oscilloscope to estimate amplitude and frequency.) For thispart, we will not worry about estimating the uncertainties of frequency and amplitude.

2. (Done as a group.) Write a LabVIEW VI (“virtual instrument”) to input data anddisplay on computer.

• Do first with a simulated source. (LabVIEW has this as a standard block.)

• Then do with a real source. (Configure as differential input. See Fig. 1.1 and thefootnote.1)

• Add save feature to VI.

3. (Done as a group.) Introduction to IGOR

• Read in data from disk. (Use the Data/ Load Waves/ Load General Text...menu item.)

• Display graph. (Use Windows/New Graph...)

1Single vs. differential inputs: The inputs to the A/D converter can be connected in two different ways.In the single-input method, the positive output of the circuit is connected to the analog input of the A/D.The signal is measured with respect to the ground of the A/D, which is set to the computer, which is setto the power supply. In the differential-input method, you connect two wires from your circuit to the A/D.The signal wire (positive output to positive input) is connected as before. But now you also connect theground of the circuit you are measuring to the corresponding negative input to the DAQ. The A/D converterthen measures the difference between the positive and negative inputs. Obviously, you need to do this if youwant to measure the voltage difference between two points that are each at a non-zero voltage with respectto the A/D ground. Less obviously, the ground of your circuit is slightly different from the ground of theA/D because there is a very long path between them and thus a small resistance. So any current flowingwill lead to a shift in grounds. For these and other reasons, we will use differential inputs routinely in thecourse. Note that the USB-6009 has eight inputs when configured for single-ended operation but only fourwhen configured for differential input.

Page 11: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

1.3. EXPERIMENTS 11

• Use cursors (Graph/ Show Info) to measure amplitude and period. You can alsodrag the waveform to get an offset. Convert the measured period into a frequencyfor the waveform. Compare the values you observe with your intended settings.Use the WaveStats operation to get amplitude, too.

In the next two exercises, set the DAQ to the convenient sampling rate of 10 kHzand have it read in 100 points (and store them to a file). (Usually, we will sampleat the maximum rate, 48 kHz, but using 10 kHz will make these exercises easier tounderstand.) Connect the function generator to both the DAQ and the oscilloscope,so that you can compare the two.

4. Explore quantization errors. Set the function generator to a 2 V peak-to-peak (pp)sine wave. (Note that “2 V pp” means that the sine wave goes from +1 V to −1V.) Setthe sine wave frequency to 1 kHz. Start at 2 V p-p and then reduce the amplitude tothe lowest value the function generator will go. Compare what you see in the computerwith what you see on the oscilloscope. Interpret your observations. (See the problembelow.) Record data from the 2 V pp and from the minimum voltage the functiongenerator gives. Notice how the jumps in data (use Igor’s cursors to see the differencein levels easily) occur in “quantized” steps. (You may also want to use the “Cityscape”type of trace. Double-click on the trace to change the trace type. See the first problem,below, for hints on how to account for these steps. How does noise affect the digitizedsignal? How does it affect the analog signal on the oscilloscope?

5. Explore sampling errors. Set the amplitude again to 2 V pp. Progressively increasethe frequency of your sine wave, starting from a low value (say 100 Hz) and recordthe frequency of the sine wave measured by the DAQ. Compare what you see in thecomputer with what you see on the oscilloscope. Interpret your observations. (See theproblem below.) The “sine wave” does not look much like a sine wave for frequenciesthat are greater than about 2 kHz. Why? What does the “sine wave” look like at5 kHz? Why? Why does the waveform at 9 kHz again look pretty close to a sinewave? What happens as you go to frequencies above 10 kHz? Include some waveforms(either Igor plots or hand sketches) in your lab book. Record to disk waveforms of thefollowing frequencies: 100, 1000, 5000, 5000+/-, 10000, 10000+/-, 20000+/-. Here,“5000” means you should try to get as close as you can to that frequency (withinreason), while “5000+/-”means that you should set the frequency close to, but notexactly equal to 5000 Hz. (“Close” is perhaps between 5010 and 5100 Hz.) Try tounderstand, in as quantitative a way as you can, the shapes of these waveforms. Seethe “aliasing” question in the problems, below, for more guidance. Print out graphs ofthese waveforms (as a “Layout” in Igor) and tape or staple them into your lab book.Label them (e.g., “a”, “b”, etc.) and explain them in the lab book.

Page 12: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

12 CHAPTER 1. INTRODUCTION TO COMPUTER-AIDED DATA ACQUISITION

Circuit Out + A/D in +

Single-ended

Circuit Out + A/D in +

Circuit Out - A/D in -

Differential

(a)

(b)

Figure 1.1: Schematic of single and differential input methods.

1.4 “Postlab”

These questions are due Friday, along with your lab notebook that you used for this lab. Dothem in your lab notebook, too. (In the future, we’ll just have prelabs, which will be due atthe start of the lab session, on a separate sheet of paper.)

1. Your data acquisition device (USB-6009) claims a 14-bit resolution on an input signal.If the full range of the A/D input is set at ±20V , what is the voltage step correspondingto a 1-bit change? This is the smallest voltage difference that can be resolved with asingle measurement (on that range). Please show your work in calculating this.

2. The phenomenon known as aliasing occurs when a high-frequency sine wave is sampledat a frequency that is too low, or, alternatively, for a given sampling rate, aliasing occurswhen you try to measure a sine wave whose frequency is too high. In our lab, with afixed sampling frequency, we encounter the latter situation.

Any sine wave is characterized by just three quantities: its frequency, amplitude, andphase. The first two are fundamental, while the third quantity only makes sense rela-tive to some external time reference. To “measure” a sine wave, then, is to determineits amplitude and frequency correctly.2 (We’ll ignore the phase here, which can be im-portant in some cases.) Our goal here is to understand what happens when you sampleat a rate fs a sine wave whose frequency and amplitude are f and A, respectively. Inparticular, if f < fs/2 (the “Nyquist frequency”), one can infer f and A correctly, butif f > fs/2, the frequency one infers will be incorrect.

Towards that end, think of a few situations. First, if f fs, it is pretty clear thatthe representation will be accurate. On the other hand, if f = fs, then clearly you

2Why do we focus on sine waves? As we shall see later, any signal (function of time) V (t) can berepresented as a sum of sine waves. If we know what happens when we measure a sine wave of arbitraryfrequency, we can understand what will be the effect on an arbitrary signal V (t).

Page 13: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

1.4. “POSTLAB” 13

sample the waveform at the same phase each time and will get a constant result (DC,or zero frequency). If f ≈ fs, the result will look like a low-frequency wave. Using thiskind of reasoning, aided by some hand or computer sketches, plot the function fm vs.f , where fm is the frequency of the sine wave you infer and f is the actual frequency.Label the f -axis in units of fs/2 – i.e., fs/2, fs, 3fs/2, etc.

One subtle point is that the frequency should be inferred from the fast oscillations ofthe wave and not from any slow beatings in amplitude you may observe. The reasonfor this is that you know that the original wave is a sine wave. Thus, if you pick afrequency (for example, a bit different from fs/2) where you get beats in the amplitude,you can infer that you have a sine wave whose amplitude is the maximum amplitudeof the beats. Of course, you have to sample a long-enough signal that you see thelongest period of any beating that may occur. You might worry that if your sine wavefrequency is rationally related to fs (i.e., equal to fs, fs/2, etc.) that you won’t see thefull amplitude. This is true; however, this is in some sense an artificial situation. Inreal life, there is no general relation between the signals you measure and your samplingrate. (One has to do with what’s out there in Nature; the other with how you set upyour DAQ.) Thus, if you pick a frequency at random, there is essentially no chancethat it will have a rational relationship with fs.

To summarize, in this problem, you should

(a) explain why the maximum frequency that may be measured accurately is fs/2.

(b) plot fm vs. f .

(c) as a practical matter, if you want your measured (or “sampled” waveform) to looklike a reasonable approximation to the original sine wave – i.e., correct frequency,no major beating effects – what should its maximum frequency be relative to fs?(In our boards, the maximum fs is 48 kHz.)

Thus, we conclude that for a given sampling rate fs, there are three regimes: the “low-frequency” regime, where the measured waveform closely resembles the analog signal;the intermediate-frequency” regime, where the measured waveform looks complicatedbut you can work out what the original amplitude and frequency are; and the “high-frequency” regime, where you will get the wrong answer for the frequency. This latterregime is the one where aliasing occurs. Aliasing occurs above a specific frequency(“Nyquist frequency,” =fs/2), while the boundary between the low- and intermediate-frequency regimes is more subjective. (You are supposed to come up with a criterionas part of this problem.)

3. Learning LabVIEW and Igor. In this course, we will be using two different softwarepackages extensively, LabVIEW for data acquisition and Igor for data analysis. Whilethis is not a programming course per se, you will have to become a bit familiar with ba-sic programming concepts in both packages. Both of these packages may be purchased,in a student version, for about $100. We’ve tried to design the course so that you won’t

Page 14: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

14 CHAPTER 1. INTRODUCTION TO COMPUTER-AIDED DATA ACQUISITION

need to do this. One thing that you can do for free is to download demo versions ofeach program from the company websites (www.ni.com and www.wavemetrics.com).While both demo programs are crippled in different ways (no saving, expiration, etc.),both also allow you to play around with essentially all of the features of the programs.So, with this in mind,

(a) Download the LabVIEW demo and also the “Getting Started with LabVIEW”tutorial. Much of what we do is actually Chapter 4, so you should work quicklythrough Chapters 1-4 to get a broader overview of LabVIEW. Eventually, youshould know all the material in the tutorial.

(b) Download the IgorPro demo and start working your way through their Tutorial.Open Igor and select Help / Manual. In the manual, start going through Vol. I,”Getting Started” (aren’t these names original!). Work through I-1, “Introductionto Igor Pro” and, if you have time, you can start going through I-2, “Guided Tourof Igor Pro.”

As we go through the course, you should come back to these two tutorials to learn theprogram better. Of course, both programs have full context-dependent on-line helpavailable, too. Use it for specific problems that come up.

Page 15: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 2

DC Impedances and Measurements

2.1 Goals

• Review DC impedance, voltage dividers.

• Notion of Thevenin equivalent circuit.

• Measure input impedance to analog-to-digital converter (A/D) of the data acquisitiondevice (DAQ).

• Signal Conditioning: Use of a “buffer” to solve impedance problems.

In this lab, we begin by reviewing some notions of resistance, or “DC impedance.” Seethe lab manual for more discussion. We then explore the idea that every voltage source –and, indeed, every circuit – can be viewed as being an ideal source in series with an internal(“Thevenin equivalent”) resistance. The same notion applies to voltmeters, in particularto the voltage input to our DAQ. We use a voltage-divider circuit to measure this “inputimpedance.” This gives a worrying result: because the input impedance to our DAQ turnsout to be rather low, we will get incorrect values when measuring voltages in circuits withquite ordinary equivalent resistances. We explore how a buffer can solve this problem. Bythe end of this lab, you should understand the basic requirements – signal conditioning,sampling rate, and quantization depth – for using an A/D converter to accurately capturean analog signal into a computer.

2.2 Prelab Questions

1. Show that the voltage output Vout of a voltage divider circuit (Fig. 2.1) is given by

Vout = VinR2

R1 + R2

. (2.1)

Plot Vout vs. R1 for fixed Vin, R2.

15

Page 16: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

16 CHAPTER 2. DC IMPEDANCES AND MEASUREMENTS

Power

Supply

Vin+

Vin-

Vmeas+

Vmeas-

R1

R2

Figure 2.1: Voltage-divider circuit. The measured voltage is Vout = Vmeas+ − Vmeas−

2. Find the Thevenin equivalent of the circuit in Fig. 2.2.

Vout

33 k

22 k

DCpowersupply12 V

+

-

10 k

Figure 2.2: Another voltage-divider circuit.

3. You are to measure the voltage at the output of a circuit whose Thevenin equivalentresistance is RTh using a voltmeter whose input impedance is Rinp. See Fig. 2.3. Showthat what you will measure should be described by

Vout = Vin1

1 + RTh

Rinp

. (2.2)

In other words, the finite input impedance biases the measurement of the voltage.What happens when Rinp RTh?

2.3 Experiments

1. Using a nominal 100 Ω resistor, test Ohm’s Law. Use the DC power supply (and itsmeter) to set a current and the digital multimeter (DMM) to measure the resultingvoltage across the resistor. Record your measured V − I pairs in Igor and display as agraph. Using the cursors (or by printing and measuring by hand), estimate the slopeand compare to the nominal value you used.

Page 17: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

2.3. EXPERIMENTS 17

+in +

!in !

RinpVTh

RThV

differential

Input of A/D

Figure 2.3: Measuring input impedance. Here, V is the voltage measured by the analog-to-digital converter, which has an input impedance Rinp. The three dots denote a wireconnection that you are expected to make.

2. LabVIEW programming task: Display a continuous series of voltages, with a settableupdate rate. In effect, we want our DAQ to act like the voltmeter we used in thefirst experiment above. We can do this with a VI only slightly more complicated thanlast time. Starting from your VI from the first lab, reconfigure the DAQassistant tomake just a single measurement (on demand). Then add an overall While loop, witha suitable time delay. (This will be covered in the lecture.) Instead of writing thevoltage to a file, send it to an indicator. The numerical one is the most useful, but youcan add a meter or gauge, too. (There’s no real need for a waveform graph.)

3. Wire up a voltage divider, using R2 = 100 Ω. Follow the schema in Fig. 2.1, connectingthe outputs to the plus and minus input of the DAQ. Use the VI you just wrote todisplay the voltage. You can record the voltage measurements by hand in your lab book.For R1, use the following nominal values: 10, 20, 50, 100, 200, 500, 1000 Ω. MeasureVout vs. R1 for fixed Vin. In Igor, plot your data and the function corresponding towhat you expect based on Vin, R1, and the expected theoretical relationship (Eq. 2.1).(See the Igor tutorial on how to define a function.)

4. The goal of this next part is to see the effects of a finite input impedance on voltagemeasurements. Any time you measure a voltage, you do so on a circuit that can beviewed as an ideal voltage source and some Thevenin equivalent resistance in series. Onthe other hand, the voltmeter used to make the measurement (here the A/D converter)also may be viewed as a finite impedance in parallel with an ideal voltmeter. Thecombined situation is shown in Fig. 2.3. (Cf. the prelab questions, too.) Here, we shallmeasure Rinp by making a connection with a variable RTh. To do this, use the powersupply as a voltage source and put another resistor R1 on the output. (The powersupply’s own internal resistance will be in series with this R1, but we will be lookingat R1 values that are much larger. Measure VA/D vs. R1 for a variety of resistors.(Make sure that the resistances you pick for R1 are large enough to see an effect!)Plot Vout vs. R1 in Igor. Plot the theoretical relation (see Eq. 2.2) in Igor. Try thislast plot for different values of R1. Choose the value of R∗

1 that makes the theoreticalcurve “fit” the experimental data the best. Show the plot corresponding to your best

Page 18: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

18 CHAPTER 2. DC IMPEDANCES AND MEASUREMENTS

value. Estimate a reasonable uncertainty by exploring how much you can vary R1

before you see that the fit is clearly worse than your best value. If that variation is δR,overlay your theoretical curves on the same graph for R∗

1 − δR and R∗1 + δR. (Thus,

you should have a graph that has data points, shown as individual markers, a solidline corresponding to your best fit, and two dashed lines, one on either side, that show“confidence intervals” where you think the correct value of R1 really lies.) To showthat the “problem” lies with the use of the A/D converter as a voltmeter, record yourmeasurements of Vout vs. R1, also using the DMM (which has a much higher inputimpedance) in place of the DAQ and the same values of R1. (You can do this at thesame time as the signal goes into the DAQ, to save time.)

5. It’s beginning to look like our DAQ, the USB-6009, may be problematic for measur-ing voltages. It has analog inputs, but when you connect up to circuits of ordinaryimpedances (∼ 10 kΩ), there are already significant errors. When we use a better volt-meter (the DMM) with much higher impedance, everything is ok, but we would likethe voltages we measure using a computer to be trustworthy, too. What to do? Theanswer is to use a special electronic device, called a buffer. It is an active circuit (i.e., itrequires external power to work) that is wired up as in Fig. 2.4. The integrated circuitis known as an op amp. We won’t go into exactly how it works in this course (that’s asubject for your third-year electronics lab); however, it solves our impedance problemas follows: The input to the buffer has a very high source impedance (roughly 10 MΩ),which is now much higher than the Thevenin impedance of our circuit. The output ofthe buffer has a voltage that “follows” that of the input; however, its impedance is verylow (about 20 Ω). Thus, we now are in the comfortable position of presenting a veryhigh input impedance to the output of our circuit but a very low output impedance tothe input of our A/D converter. The buffer is one example of a signal conditioner.1

In detail, the op amp should be wired up as shown below in Fig. 2.5. The positivesupply voltage VCC+ should be between 12 and 15 V; the negative supply VCC− shouldbe grounded. 2 Note that there are two separate buffer circuits; each has two IN (IN+and IN−) and one OUT pins. To make the op amp perform as a buffer, connect theoutput of your circuit back to the negative input (OUT to IN−). Make sure thatyou use pins from only one of the circuits. Then the output of your circuit should beconnected to IN+ and the output of the buffer (OUT ) to the analog input of the DAQ.

1Another common requirement of signal conditioners is to amplify and offset the voltage level of thesignal you are measuring so that the voltage presented to the A/D best matches the dynamic range of theA/D, so as not to cause quantization errors. In other words, if your A/D converter has a range of −20 to+20 V, you want your signal to have its minimum value near −20 and its maximum value near +20. If thevoltages are smaller, it is better to choose a lower range. See the data sheet on the USB-6009 to know whatranges it offers. In this lab, our voltages will always be positive. Some DAQs have unipolar ranges – e.g., 0to 20 V. Ours is only bipolar – e.g., −20 V to +20 V.

2The output voltage of the buffer can go from about 0.1 V to about VCC+ − 1.5 V. The most convenientthing is to make sure that the buffer’s power supply (VCC+) is higher than anything the function generatorcan produce. 12V is fine. (The maximum safe power-supply voltage is 36 V.)

Page 19: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

2.3. EXPERIMENTS 19

Now repeat the measurements you did in Part 4, above, and show that your measuredvoltages are now independent of R1. To make the point in an especially dramatic way,plot your measured Vout on the same graph you used above.

Thus, using a buffer can reduce measurement errors associated with a low inputimpedance of the voltmeter or A/D converter. We carefully chose for you a DAQwith an input impedance low enough that this problem was easily seen.3

Circuit Out +A/D in +

Circuit Out - A/D in -

Buffer

Vin+!

Vout

Figure 2.4: Using a buffer to measure voltages.TL3472HIGH-SLEW-RATE, SINGLE-SUPPLY OPERATIONAL AMPLIFIER

SLOS200G – OCTOBER 1997 – REVISED JULY 2003

1POST OFFICE BOX 655303 • DALLAS, TEXAS 75265

Wide Gain-Bandwidth Product . . . 4 MHz

High Slew Rate . . . 13 V/µs

Fast Settling Time . . . 1.1 µs to 0.1%

Wide-Range Single-SupplyOperation . . . 4 V to 36 V

Wide Input Common-Mode Range IncludesGround (VCC–)

Low Total Harmonic Distortion . . . 0.02%

Large-Capacitance DriveCapability . . . 10,000 pF

Output Short-Circuit Protection

description/ordering information

Quality, low-cost, bipolar fabrication with innovative design concepts is employed for the TL3472 operationalamplifier. This device offers 4 MHz of gain-bandwidth product, 13-V/µs slew rate, and fast settling time, withoutthe use of JFET device technology. Although the TL3472 can be operated from split supplies, it is particularlysuited for single-supply operation because the common-mode input voltage range includes ground potential(VCC–). With a Darlington transistor input stage, this device exhibits high input resistance, low input offsetvoltage, and high gain. The all-npn output stage, characterized by no dead-band crossover distortion and largeoutput voltage swing, provides high-capacitance drive capability, excellent phase and gain margins, lowopen-loop high-frequency output impedance, and symmetrical source/sink ac frequency response. Thislow-cost amplifier is an alternative to the MC33072 and the MC34072 operational amplifiers.

ORDERING INFORMATION

TA PACKAGE† ORDERABLE

PART NUMBER

TOP-SIDE

MARKING

PDIP (P) Tube of 25 TL3472CP TL3472CP

0°C to 70°CSOIC (D)

Tube of 50 TL3472CD3472CSOIC (D)

Reel of 2500 TL3472CDR3472C

PDIP (P) Tube of 25 TL3472IP TL3472IP

–40°C to 105°CSOIC (D)

Tube of 50 TL3472IDZ3472SOIC (D)

Reel of 2500 TL3472IDRZ3472

† Package drawings, standard packing quantities, thermal data, symbolization, and PCB design

guidelines are available at www.ti.com/sc/package.

PRODUCTION DATA information is current as of publication date.Products conform to specifications per the terms of Texas Instrumentsstandard warranty. Production processing does not necessarily includetesting of all parameters.

Copyright ! 2003, Texas Instruments Incorporated

Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of

Texas Instruments semiconductor products and disclaimers thereto appears at the end of this data sheet.

1

2

3

4

8

7

6

5

1OUT

1IN–

1IN+

VCC–/GND

VCC+

2OUT

2IN–

2IN+

D OR P PACKAGE

(TOP VIEW)

Figure 2.5: Pinout of the TL3472 opamp. Note the little indent on the top that shows youhow to orient the chip to identify which pin is which.

3You might guess another reason for our choice. See the title of the data sheet on the USB-6009!

Page 20: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

20 CHAPTER 2. DC IMPEDANCES AND MEASUREMENTS

Page 21: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 3

Probability Distributions

3.1 Goals

• Learn the elements of probability theory

• Binomial and Poisson distributions and their applications

• Use of DAQ for counting

• Understand a basic counting experiment (radioactivity)

References

1. Unit 28 on radioactivity (see web site) Make sure you read this!

2. J. R. Taylor, An Introduction to Error Analysis (University Science Books, 1997).

3. P. R. Bevington and D. K. Robinson, Data Reduction and Error Analysis for thePhysical Sciences (McGraw Hill, 1992).

3.2 Prelab Questions

Read the labscript and do Problems 1 — 9.

Introduction

Probability distributions describe the probability of observing a particular event. Threedistributions play a fundamental role in the analysis of experimental data: the binomialdistribution, the Poisson distribution and the Gaussian Distribution. In this lab we willexplore the binomial and Poisson distributions first by using coins and dice and then bymeasuring the decay of a radioactive sample.

21

Page 22: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

22 CHAPTER 3. PROBABILITY DISTRIBUTIONS

Probability

In order to understand the statistical methods of dealing with random processes and howsome predictability can be garnered from such chance events, we will examine some sim-ple cases involving coin tosses and dice. First we introduce three important properties ofprobability:

1. If you consider two possible events A and B which are mutually exclusive (that is, ifA happens B cannot happen and vice versa) then the probability of either A or Bhappening is the sum of the probabilities of A and B: P (A or B) = P (A)+P (B). Anexample of two such events would be a coin toss where there are two possible events,A =heads or B =tails.

2. The sum of the probabilities of all possible mutually exclusive events of a trial is unity,because one of the events must happen in every trial: P (A) + P (B) + P (C) + ... = 1.In our coin toss example, the coin must turn up either heads or tails.

3. The probability that two independent events will both happen is the product of theprobabilities of the two single events: P (A and B) = P (A) ·P (B). An example of twoindependent events would be two coin tosses.

From these rules we can draw the following conclusions:

• If a trial has n and only n possible different outcomes, and if you know that all ofthe outcomes have equal a priori probabilities of happening, then the probability of agiven outcome must be equal to 1/n.

• If you classify the outcomes of a trial into different classes, and if the number of eventsbelonging to one class is m, the probability that an event belonging to that class willhappen is m/n.

We have to bear in mind that the concept of “equal probability” of events has to bederived from experience. Once we have classified by experience all the possible different andmutually exclusive events in such a manner that they have equal a priori probability, we canapply the rules of probabilities for detailed calculations. The key problem, therefore, is toidentify which events have equal a priori probability. It requires considerable care to avoidmistakes. For example, if you toss two coins, you might argue that there are three possibleoutcomes: two heads, two tails, or one head and one tail. If you assume that each of theseprobabilities are equally likely then the predicted probability would be 1/3 each. Experienceshows this to be wrong. The mistake is in having assumed two different events are only oneevent: heads followed by tails, and tails followed by heads. This nuance will be clarified byworking out in detail the case of tossing four coins.

Page 23: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.2. PRELAB QUESTIONS 23

Example 1: Four coins

Toss four coins. Each coin has a 50% probability of turning up heads and a 50% probabilityof turning up tails. (This seems logical, but it is an assumption that should be justified byexperience.) Let p represent the probability of heads and q = 1 − p that of tails: p = 0.5,q = 0.5.

The probability of no heads in a toss is the probability that all four coins turn up tailssimultaneously:

(probability coin A is tails and coin B is tails and coin C is tails and coin D istails) = (probability coin A is tails) x (probability coin B is tails) x (probabilitycoin C is tails) x (probability coin D is tails).

There are 16 different ways the toss can turn out if we can distinguish which coin iswhich. Each of the 16 ways is equally likely and only 1 of those sixteen ways is all tails. LetPo represent the probability of none of the four coins turning up heads.

Po = q4

= 0.5× 0.5× 0.5× 0.5

= 1/16

There are four ways that one coin can turn up heads. Coin A can be heads, coin Bcould be heads, coin C could be heads or coin D could be heads. Each one of these has aprobability of p q3 = 1/16. Thus there are four chances out of 16 for one head if we don’tcare which coin is heads:

P1 = p q3 + qpq2 + q2pq + q3p

= 4× (1/16)

= 1/4

The probability that both coins of a specific pair are heads and the other two are tailsis p2q2. To calculate the probability that any two coins be heads we have to figure out howmany different pairs there are. How many different ways can the four coins turn up twoheads and two tails? Consider choosing the two coins that are to be heads. There are fourways of choosing the first coin and three ways of choosing the second so that there are 4× 3or 12 ways of choosing two from four (“four choose two or 4C2”). But half of these 12 arereally the same two coins that have been chosen in a different order. For example if we labelthe coins ABCD we can choose two in the following possible ways:

Page 24: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

24 CHAPTER 3. PROBABILITY DISTRIBUTIONS

ABACADBA (same as AB)BCBDCA (same as AC)CB (same as BC)CDDA (same as AD)DB (same as BD)DC (same as CD)

Those cases where the same two coins have been chosen but in a different order must beeliminated from the count. The ways of choosing two different coins from among four areshown in Fig. 3.1.

Figure 3.1: Choosing two coins from four.

Thus you can see that the total number is 4×32

= 6 .You should be able to convince yourself that the number of different ways r things can

be chosen from m, when the order is unimportant, is

m!

(m− r)!r!

The logic in this formula is as follows: the number of ways one can choose r from m withoutregard to duplication is m(m− 1)(m− 2)...(m− r + 1) which is m!

(m−r)!. This quantity must

be divided by r! to account for duplicates consisting of the same coins chosen in a differentorder. This is the number of different possible combinations of m items taken r at a time.

Now we are ready to write down an expression for the probability distribution thatdescribes the likelihood of r events (e.g. heads) occurring in a total of m events (e.g. coinflips) where the probability of an r-event occurring is p while the probability of it notoccurring is (1 − p). Since the individual events occur independently, the probability of asubset of r events amongst many m is the product of individual probabilities. If r occur,then m−r don’t and the probability is pr(1−p)m−r. For the total probability of a particularevent occurring (e.g. 2 heads), we multiply the probability that the event occurs by thenumber of ways that event can occur. The complete formula for the probability distribution

Page 25: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.2. PRELAB QUESTIONS 25

is then given by

Pr =m!

(m− r)!r!(1− p)m−rpr . (3.1)

This distribution is called the binomial distribution. It describes the probability that r eventsoccur among a total of m independent events. Note that it is a discrete distribution; it isdefined only at integral values of the variable r.

We can now use Eq. 3.1 to calculate the probability of getting two heads among fourcoins. Remember, for the coin toss, the number of events is r = 2 out of a total of m = 4coins and the probability of each event is p = 1/2. Then

P2 =4!

2!2!

(1− 1

2

)2 (1

2

)2

=3

8.

The other values of Pr can be obtained similarly.

Problem 1: Use Eq. 3.1 to complete column 2 of the following table. Plot the histogramof values.

r Pr rPr (r − r)2Pr

01234sum

Recall that the total probability of all possible events must sum to unity:

4∑r=0

Pr = 1 . (3.2)

Problem 2: Verify that this sum does work out to unity. Sum the entries of the secondcolumn and write your result in the last row of the table.

The third column of the table allows you to work out the average number of heads in agiven toss. Given the probabilities Pr for each different outcome, the average of r can becalculated using the following simple formula:

r =m∑

r=0

rPr . (3.3)

Using this definition and Eq. 3.1 we expect that, for a binomial distribution, r = m p.Problem 3: Fill in the third column and add up the terms. Is the average reasonable?

Page 26: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

26 CHAPTER 3. PROBABILITY DISTRIBUTIONS

The fourth column allows you to work out the variance. Given the probabilities Pr foreach different outcome, the variance can be calculated using the following simple formula:

σ2 =m∑

r=0

(r − r)2Pr . (3.4)

For a binomial distribution, σ2 = m p (1− p).Problem 4: Fill in column 4. Is the variance reasonable?

Note: If one expands (p+q)4 one gets p4+4p3q+6p2q2+4pq3+q4. Each term of this expansion corresponds to oneof the probabilities in Table I. This “binomial expansion”was described by Newton. The factors of each term canbe figured out using “Pascal’s Triangle” that was pro-mulgated by Pascal. The sides of Pascal’s triangle are1’s. Interior numbers are obtained by summing the twonumbers to the left and right above its position.

11 1

1 2 11 3 3 1

1 4 6 4 1

Example 2: Twelve six-sided dice

Here we will let twelve six-sided dice represent twelve total events. After a roll of the dice,a die that turns up a “snake eye,”

,

can be our choice of event that we want to keep track of. The probability of this eventoccurring is p = 1/6. (Why?)

Problem 5: Work out the probability of rolling r = 0 ... 12 snake eyes and complete a tablesimilar to the one you used in Problem 2. Plot a histogram of values. Also verify that thesum of the probabilities is unity, and that the average number of decays and the varianceare reasonable.

Example 3: Sixteen eight-sided dice

The event of interest is again rolling a “snake eye.”

Problem 6: What is m and p for this example? Work out Pr for r = 0 ... 16 and completea table similar to that used in Problem 2. Plot a histogram of values. Also verify that thesum of the probabilities is unity, and that the average number of decays and the varianceare reasonable.

Page 27: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.2. PRELAB QUESTIONS 27

Example 4: The limit of a large number of atoms each having a small probabilityof decay

The decay of radioactive atoms provides another convenient source of random events tohelp us explore how we can use statistics to deal with randomness. A sample of radioactivematerial contains a large number of atoms. Many of these atoms are unstable and willtransform to another element or isotope by emitting a photon, electron or alpha particle.We will assume that, once an unstable ”parent” decays, the resulting ”daughter” is stableand can emit no more particles. In more complicated cases, the daughter might be unstableas well but we will not deal with that situation now.

Even though the time at which any particular atom will decay is unknown, there is someregularity in the process that we can discover by looking at the average behavior of a largenumber of atoms over a long time. For example, the fraction of unstable atoms that decaysin a certain time period, for example one second, fluctuates around a well-defined averagevalue.

Two characteristics are important in understanding radioactive decay. First, the proba-bility per unit time that an undecayed atom will decay within an infinitesimal time interval∆t is a constant:

Probability of decay in ∆t

∆t→ a as ∆t → 0

where a is the probability per unit time of observing a decay. Second, the atoms are inde-pendent; the state of any atom does not affect another.

We can use the concepts developed in the previous sections to describe the probability ofradioactive decay occurring in a number of unstable atoms by realizing that each radioactiveatom is equivalent to a coin or die, that the passing of a one-second time interval is equivalentto each toss of four coins or twelve dice, and decay of an atom is equivalent to a coin turningup heads or a die turning up a ’snake eye’.

The case of radioactive decay is of course different from that of the coin and dice exper-iments we have been discussing. In a real radioactive sample there are a huge number ofatoms, but each one has a small probability of decay, i.e. m →∞, p → 0, but their productremains finite. In this case it is possible to make some approximations that simplify Eq. 3.1.

1. for r m

m!

(m− r)!= m(m− 1)...(m− r + 1)

' mr

Problem 7: Work out how much difference this approximation makes for 100!/95!.

2. for small p

(1− p) ' e−p

Page 28: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

28 CHAPTER 3. PROBABILITY DISTRIBUTIONS

This comes from the Taylor expansion of the exponential function. When p is much lessthan unity, the squared, cubic and higher order terms of the expansion are negligible.Thus

(1− p)m−r ' e−p(m−r)

= e−pmepr

' e−pm · 1= e−pm .

Problem 8: Work out how much percentage difference this approximation makes forp = 0.1, m = 100, and r = 5.

Substituting these results into Eq. 3.1, we find

Pr =mre−pmpr

r!. (3.5)

Now define µ = pm , the average number of radioactive decays in each time interval. Inthis limit, the binomial distribution reduces to the following form:

Pr ' µr

r!e−µ . (3.6)

This distribution is called the Poisson distribution. Recall that Pr is the probability of rcounts per time interval and µ is the average number of counts per time interval. We havejust shown that the Poisson distribution is the limit of the binomial distribution in caseswhere m is large and p is small. This is the case in most radioactive samples. Therefore, thePoisson distribution is a good approximation for analyzing counts from a radioactive sample.

For a series of events described by the Poisson distribution, the average expected valuecalculated from Eq. 3.3 is r = µ and the variance, calculated from Eq. 3.4, is σ2 = µ.

Problem 9: As an exercise, it is interesting to see how closely the Poisson distributionapproximates the binomial distribution for the case of 16 eight-sided dice being rolled witha decay probability of 1/8 each time. Copy the following table and fill it in.

Page 29: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.2. PRELAB QUESTIONS 29

r Pr (binomial) Pr (Poisson)012345678910111213141516sum

The similarity between the Poisson and binomial distributions, even in this case which isfar from the limit where the Poisson distribution strictly applies, underlines why it will bedifficult to distinguish the three boxes in the group experiment you will do (Expt. 1). Therandomness of the finite set of results in each case masks the small distinctions among thedistributions.

Note: Both µr and r! are large even though their ratio might be relatively small.In general, if you wish to evaluate such expressions numerically, it is better tofind a form that does not involve the ratio of two large numbers that evaluates toa small number. Thus, one further approximation is useful. For µ 1, one canshow that the Poisson distribution approaches a Gaussian distribution of meanµ and standard deviation

√µ. (See the µ = 10 curves on Fig. 3.2.) Thus, in this

limit,

Pr ' 1√2πµ

e−(r−µ)2

2µ (3.7)

Page 30: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

30 CHAPTER 3. PROBABILITY DISTRIBUTIONS

0.4

0.3

0.2

0.1

0.0

Pro

babili

ty, P

r

20151050

Observed counts, r

µ=1

µ=3 µ=10 Gaussian

Figure 3.2: For µ 1, the Poisson distribution approaches a Gaussian distribution of meanµ and standard deviation

õ.

3.3 Experiments

These experiments are heavily based on the prelab discussion and exercises. Make sure thatyou have done those before class!

1. Identifying Parent Distributions from Data (Group Experiment)

The problem of discerning the parent distribution behind experimental results is keyin many scientific experiments; testing the effectiveness of medical treatments is oneexample. It is useful to illustrate the difficulties in this type of analysis with simplecases involving dice and radioactive decay before tackling the much more complexproblems that arise in other situations.

We will generate three histograms by shaking three boxes of dice or coins and countingthe number of events. One box has four coins, another has 12 six-sided dice and thethird has 16 eight-sided dice.1 The class leader will shake each box and announcehow many events (heads for the coins and snake-eyes for the dice) there are in eachbox. This will be repeated 10 times. Each student will keep track of the number ofcounts on a histogram by marking an X in the appropriate column as the number isannounced. You can use the tables in the Appendix (3.4) of this labscript and thenput the page into your notebook. You will not be told what each box contains. Afterthe histograms are complete, you will analyze the histograms and guess which parentpopulation generated each histogram. Think of this as making your case (to the reader)that Box A has the coins, B has the 6-sided dice, and C the eight-sided (or whateveryou conclude for A, B, and C). You make your case by presenting evidence, which canconsist of measured histograms, estimates of the average and standard deviations, and

1In practice, we will just use one box and separate out the coins and different dice.

Page 31: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.3. EXPERIMENTS 31

the comparison of these with your expectations, based on the binomial distribution.As part of your analysis, you will plot the expected frequency as a function of numberof decays on each histogram. The expected frequency is ten times the probabilitycalculated from the binomial distribution as entered in the tables you prepared forExamples 1-3. (Why?)

Page 32: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

32 CHAPTER 3. PROBABILITY DISTRIBUTIONS

2. Programming Exercise (LabVIEW, individual): Write a LabVIEW program to readthe number of counts in a user-settable time interval T . The basic idea is a simplemodification of the VI you wrote last week. Here, instead of reading an analog voltage,we read the timer. Do the following:

(a) Go into the DAQ assistant and reconfigure your DAQ to read the counter (“ondemand” and using the falling edge).

(b) Add a “Write LabVIEW measurement” Express VI to the output of the DAQmeasurement. (Keep the numerical indicator you already have.) Configure theExpress VI to append the measurement to the previously created file. You mayalso want to make the file name a control, rather than something set in theconfiguration dialog, so that you can give each experiment a different file name.(Otherwise, you have to delete the file each time. Why?)

(c) As written, the program will loop until you press the stop button. There is anotherkind of loop, the “For loop,” which executes a set number of times. Change yourWhile loop into a For loop. (Right-clicking the While loop graphic gives a quickway to do this. Or you can delete the loop and replace it with a new one.) Attacha control to N , the number of times the loop executes.

(d) Test the program by having the function generator output a square wave (say of1 kHz frequency). You will use the counter input of the DAQ to record the data.This is a digital input: a signal near 0 V is recorded directly as a “0” and a signalnear 5 V is recorded directly as a “1”. These inputs are qualitatively differentfrom the analog inputs we have explored in previous labs. Because the counterwants a “TTL” signal, an event should go roughly from 0 to 5 V. Therefore,adjust your peak-to-peak amplitude of the square wave to be about 5 V and usethe offset to make sure it goes from 0 to 5 V. Remember to connect the functiongenerator signal into the counter input (PFI0 and Ground – pins 29 and 32) andNOT to an analog input!

Note any anomalies in the counts you measure. What happens at different fre-quencies (e.g., 100 Hz and 10 kHz?)

(e) Note that the first interval you measure will be incorrect, because the first timeyou write to file you have to create the file, which takes some time. Thus, youshould always ignore this interval.

3. Programming Exercise (Igor, group): The LabVIEW VI you just wrote writes to diskthe total counts as measured at (approximately) equal time intervals. We are interestedin the number of counts in the time interval. Thus, it is necessary to calculate thedifference in the total counts as measured at the end and at the beginning of a timeinterval. In class, we will go over a very simple Igor function to do this. (Later on, youwill have to write some simple programs of your own.)

Page 33: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.3. EXPERIMENTS 33

4. Radioactive Decay Counting

In this experiment, you will use the Radiation Alert Monitor 4 Geiger counter tomeasure the number of counts from the radioactive source issued to you. The sampleemits particles in all directions. Only a fraction of the emitted particles are detectedbecause of the finite size of the detector’s window and its distance from the sample.Therefore, when you do these experiments, you must be sure that the sample anddetector are always at the same distance from each other and have the same relativeorientation.

The Geiger counter puts out “TTL” pulses that go from 0V to 5V for a duration τ ofseveral nanoseconds (10−9s, abbreviated as “ns”). See Fig. 3.3. The pulses arrive atirregular intervals, with a separation in time of T1, T2, etc. The idea is to get the DAQto count how many pulses occur in a given time interval T .

0 V

5 V

!

T1

T2

Figure 3.3: Schematic of a TTL pulse of duration τ with time intervals of T1, T2, etc. betweensuccessive pulses.

• Read the safety notice on handling radioactive sources.

• Connect the Radiation Monitor to the counter input of the DAQ.

• Turn the detector on so that it emits an audible click as it detects particles.

• Adjust the sample-detector distance and orientation so that 20 to 50 counts arereceived each second.

• Record the number of counts obtained in a one-second interval using the VI youjust wrote. (Set the Loop number, N , to 3. As explained above, the first intervalis bad. Just calculate the difference in the second interval by hand or with acalculator.) Write that number in a table similar to the one below in your labbook.

• Try to determine if a piece of paper absorbs any of the radiation emitted. Fold apiece of paper (use ordinary laser-printer paper) so that you can stand it up withone thickness between the sample and the detector. Again record the number ofcounts obtained in a one-second interval.

Page 34: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

34 CHAPTER 3. PROBABILITY DISTRIBUTIONS

• Is the number of counts changed by having inserted the paper? If the secondnumber is smaller than the first, is it due to the paper, or is it just a fluke causedby a different random number of detections in the second measured? If it is larger,discuss whether the paper could have enhanced the detection.

• Maintain your sample/detector difference for the next experiment.

Number of counts without paper:Number of counts with paper:

Page 35: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.3. EXPERIMENTS 35

5. Analyzing histograms of counts with a Poisson distribution

In order to determine whether the paper made any difference in the last experimentwe must consider the number of counts to be an imperfect estimator of an unknownquantity that we will call the detection rate. The detection rate is Na where N is thetotal number of radioactive atoms and a is the probability per unit time that one ofthose atoms will decay. Each measurement of the detection rate will be different, buttheir values will cluster around a mean, or central, value. Statisticians like to say thateach measurement of such an unknown quantity comes from a “parent distribution”.This parent distribution is fixed: it is a description of the variability observed inindividual measurements. Two important characteristics of any parent distributionare its mean and its width (or standard deviation). In our experiments, we collecta sample of this parent distribution and calculate sample mean and sample standarddeviation.

In comparing data from two different experiments, we would like to know whether themeans of the two parent distributions are different for the two cases. For example,this is how we might determine whether or not the actual detection rate is affectedby inserting a piece of paper. But as we can only estimate the sample means (with afinite amount of data), we need a method to judge the significance of any measureddifference. We can do this by comparing the magnitude of the difference between thesample means with the (estimated) widths of the two sample distributions.

In this experiment, you will repeat your measure of the number of counts many timesand make a histogram of the results in order to get some inkling of what the parentdistribution looks like and to find a way of quantifying its width. We will record theseries of counts to disk using the LabVIEW VI you have written and then make ahistogram in Igor.

Use the same detector/source geometry as used in the previous experiment.

• Record counts for 102 one-second intervals to disk. (This is to get 100 validinterval measurements.)

• Open in Igor, and use the function provided to make a wave of the counts in eachinterval. Delete by hand the two bad data points at the start. (In a Table, selectthe points and Cut [Cntrl-x].)

• Use Igor’s Wavestats command (see the Analysis menu) to calculate the mean andstandard deviation of the data. Also plot a histogram (Analysis/ Histogram...).

• Find the range of count rates around the average that includes 68 of the events,34 below the mean, and 34 above. This will be your “68% confidence interval” fora single measurement. This implies that an interval of this size around the resultsof one trial, such as those in the table you recorded for Experiment 2, has a 68%chance of including the mean of the parent distribution. Compare this range withthe standard deviation, i.e., check that the range [x− s, x + s] on the histogram

Page 36: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

36 CHAPTER 3. PROBABILITY DISTRIBUTIONS

includes roughly 68 of the 100 counting events. This interval is a reasonablecandidate for the error bar on any one of the one-second measurements. Forexample, it could serve as the error bar for the Number of Counts found above.By comparing the differences in the measurements with the size of the error barsone has a rough criterion to decide whether any difference is real or is a statisticalartifact.

Note: Why do we ask for the 68% confidence interval? The width ofa distribution is usually characterized by its standard deviation. Thestandard deviation can be estimated from the data using the formula

s =

√√√√ 1

N − 1

N∑i=1

(xi − x)2 (3.8)

where there are N data points xi and x is their average. The 68% con-fidence interval corresponds roughly to the interval from one standarddeviation below the mean to one standard deviation above the mean.

But we can do much better than this. We can use the mean of the sample of 100trials as a better estimator of the mean count rate then any single measurementand the standard deviation of the mean, or standard error of the mean, as anestimate of our experimental uncertainty.

• Calculate the standard error of the sample mean, sm, for your 100-trial sample.

• Repeat the above experiment with a piece of paper between the sample and thedetector. Record the data from both experiments in a table in your lab notebook.See the sample table below for an example of how your table should look.

100 one-second intervals with paper without paper differenceaverage count rate (per second)standard deviation of the sample(68% confidence interval for asingle measurement)standard deviation of the mean(68% confidence interval forobtaining this mean value)

• Transfer your data to disk and open in Igor. Plot both histograms. Now normal-ize them by the number of measurements (to form an estimate of the probabilitydistribution) and superimpose the Poisson distributions that correspond to theaverages you found. (In Igor, there is a built-in function “factorial(x)” that sim-plifies this. Look it up in the Help. Note that the factorial function is definedonly at integer values. Your wave for the values of the Poisson distribution shouldbe defined only on integers, as well.) On each histogram, show the mean, thestandard deviation, and the standard deviation of the mean. Centre the latter

Page 37: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.3. EXPERIMENTS 37

two quantities about the sample mean for each histogram. Note that for a Poissondistribution, we should find σ ≈ √

µ, where µ is the average count rate. Is thistrue for your data?

In Experiment 2, where the counts in a single one-second interval were accumu-lated, it was difficult to decide whether the paper made any real difference or not.Now, armed with histograms and your new knowledge of statistics, you should bein a much better position to decide whether the piece of paper actually makes adifference to the mean count rate.

• Measure the difference between the estimators of the means and compare thisto the magnitude of the respective standard errors. Are the means of the twodistributions more than one standard error apart? Estimate a lower bound onthe probability that the paper has an effect on the mean count rate. Justify yourestimate using your data.

By spending a little more time taking data, we can improve the resolution betweenthe two cases. In the next part of the experiment, we will accumulate data inten-second intervals in order to decrease the spread of each distribution.

• With enough data, one does not have to use all of these fancy concepts fromstatistics. Repeat the steps of the previous experiment with and without paper,but this time accumulate data for 100 ten-second intervals instead of 100 one-second intervals. Plot the number histograms, as before, and show that thereis now an obvious separation between the two measurements. Show, too, thatthere is an obvious difference between the means, as judged against the standarddeviations. (Remember that you need 102 measurements to get 100 intervals.)NOTE: This part takes 20 min. Be sure to start it early enough to finishby the end of class!

How do the mean count rates, standard deviations, and standard errors change?If you find that the standard deviation or standard error has decreased, explainwhy this is the case in spite of the fact that, strictly speaking, the number ofmeasurements has not changed (there are still 100 measurements per trial). Canyou explain any changes between the one-second interval histograms and the ten-second interval histograms from the theory?

UG21998-1 - Created NA2003-3 - Revised BJF2005-3 - Revised JB

Page 38: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

38 CHAPTER 3. PROBABILITY DISTRIBUTIONS

(This page intentionally left blank.)

Page 39: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

3.4. APPENDIX A: TABLE FOR EXPERIMENT 1 39

3.4 Appendix A: Table for Experiment 1

Box 1

Number of Decays

Frequency

0 5 10 15 20

0

5

10

Average

Identity

Box 2

Number of Decays

Frequency

0 5 10 15 20

0

5

10

Average

Identity

Box 3

Number of Decays

Frequency

0 5 10 15 20

0

5

10

Average

Identity

Page 40: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

40 CHAPTER 3. PROBABILITY DISTRIBUTIONS

Page 41: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 4

Radioactive Decay and IntervalDistributions

4.1 Goals

• Explore radioactive decay.

• Understand interval distribution for a Poisson process.

• Use of DAQ for timing intervals.

References

1. Unit 28 on radioactivity (see web site) Make sure you read this!

2. J. R. Taylor, An Introduction to Error Analysis (University Science Books, 1997).

3. P. R. Bevington and D. K. Robinson, Data Reduction and Error Analysis for thePhysical Sciences (McGraw Hill, 1992).

4.2 Prelab Questions

Read the labscript and do Problems 1 and 2.

Introduction

These experiments continue our work with probability distributions initiated in the previouslab. We will look at the radioactive decay curve and the distribution of intervals betweenevents using both dice experiments and the decay of two different radioactive sources.

41

Page 42: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

42 CHAPTER 4. RADIOACTIVE DECAY AND INTERVAL DISTRIBUTIONS

4.2.1 The Radioactive Decay Curve

Last week, we looked at fluctuations in the count rate of a radioactive source by measuring,repeatedly, the number of counts in a given time interval (one second, ten seconds, etc.).One assumption that we made implicitly is that the average count rate did not change whilewe did our measurements. Strictly speaking, this cannot be right. The atoms that decayare “removed” from the supply of potential atoms, so that the number of potential decays isalways decreasing. Since the probability for a single atom to decay is constant, the numberof decays per time must always decrease. But if the number of atoms is large (> 1020 forour source that we used in the previous lab), we can ignore the depletion produced by thesmall number of decays we measured. This is what we did last week.

This, week, by contrast, we will look at situations where the number of decays is signifi-cant relative to the number of atoms in the sample. In particular, we will obtain a short-liveddaughter product of radon decay. We will then use this sample to study radioactive decay.

As in the previous lab, we will also model radioactive decay by a series of dice throws.We will repeatedly roll a set of dice. Every time we get a “snake eye” (a one), we will saythat that die has “decayed” and will remove it from the sample. We then count how manydice are left after each round. Before we start, you should be familiar with the followingintroduction to the math of radioactive decay, as described here and in the Unit 28 referencelisted at the beginning of this Chapter.

The Math of Radioactive Decay

Let’s start with No dice and ask how many are left, on average, after a number of throws.The probability of decay at each throw is p. The probability of no decay after one throw is(1− p). Therefore there are, on average, No(1− p) atoms left after one throw. Consider 12six-sided dice where all snake eyes are removed after each throw. After one throw, the average

number left is 12(1− 1

6

)= 10. After two throws, it’s 10

(1− 1

6

)= 12

(1− 1

6

)2= 8.33.

In general, the average number left after t throws is

N(t) = No (1− p)t . (4.1)

Normally, since p is fairly small compared to one and pt is larger than one, we may approx-

imate (1− p)t ∼= (1− p)1p

pt ∼= e−pt. Thus, neglecting the approximation sign,

N(t) = No e−pt , (4.2)

and the number of dice remaining decays exponentially.The number of throws it takes to deplete to half the initial number is called the half-life,

t1/2. In our analogy, each throw represents a time interval, so the half-life normally has unitsof time. The half-life can be expressed in terms of the probability per unit time of decay.Since

N(t1/2)

No

=1

2= e−pt1/2

Page 43: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

4.2. PRELAB QUESTIONS 43

t1/2 = − ln(1/2)

p=

0.694

p(4.3)

So, for the six-sided dice example above, the approximate half-life is 0.693/p = 4.1 throws(recall p = 1/6).

Problem 1

The approximation in Eq. 4.3 assumes p 1. Calculate the exact half-life in the six-sided-dice example given above.

4.2.2 The Interval Distribution

Do you know the story of Schrodinger’s Cat? Erwin Schrodinger, one of the founders ofquantum mechanics, proposed putting a cat in a box in which there was a device that wouldkill the cat upon the detection of a single radioactive decay event. There was a great deal ofceremony about the method of potential execution. The cat would first be put in the box andthe lid fastened securely. Then the electronics would be turned on for a predetermined timeinterval, over which there would be exactly a 50% chance of detecting a radioactive decayevent. Now, before an observer unfastened the lid and peered in, would the cat be alive ordead? (If you think the answer is obvious, then you have yet to be introduced to the subtlephilosophical conundrums of quantum mechanics. And if you think this example proves thecruel inhumanity of physicists, well, all of this is really only intended to be hypothetical – a“Gedanken” experiment.)

Quantum mechanics teaches us that there is no way, even in principle, of determiningwhether a particular cat is alive or dead before making the observation, but we can easilydetermine the probability that the cat lives t seconds after the insertion of the radioactivesample. To do so requires determining the probability distribution of the time intervalsbetween the detection of radioactive decay events.

Imagine that we have a radioactive sample, a detector, and some stopwatches. Over aperiod of time, we detect a series of pulses, each representing one detected event. We cancharacterize the pulse series by the time intervals between events. When a decay is observed,we will start a stopwatch and stop it when the next decay is observed. We will repeat thismany times and plot a histogram of the measured time intervals.

We can derive the expected distribution for the case where the decays occur randomly.Let the decay rate be a (decays per unit time), assumed to be constant with time. Then,if we start observing at t = 0, what is the probability that no decays have occurred before

Page 44: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

44 CHAPTER 4. RADIOACTIVE DECAY AND INTERVAL DISTRIBUTIONS

a later time td? If we slice the time into intervals of ∆t each, then there will be td/∆tintervals before time td. The probability of measuring a decay in each time slice is a∆t. Ifwe assume that the events during any time slice ∆t occur indendently of other events, thenthe probability that a decay has not been measured up to a time td is

Pno decay(t < td) = (1 − a ∆t)td∆t → e−atd ,

as ∆t → 0.The probability that no decay occurs during the time interval from 0 to td and that, in

the time slice ∆t immediately after td, a decay does occur is

p(td)∆t = (e−atd) (a∆t) = ae−atd∆t . (4.4)

The function

p(t; a) = ae−at for t > 0 , (4.5)

= 0 for t ≤ 0 ,

is thus the probability distribution function associated with an interval of time t, given thatevents occur at a rate of a per unit time. Eq. 4.5 is known as an exponential distribution.It is a probability density function and has units of probability per unit time. Where doesthe condition p > 0 come from? Well, implicitly, we have been assuming t > 0, since a zeroor negative decay time is not physically possible. Note that Eq. 4.5 is properly normalized:∫∞−∞ p(t; a)dt =

∫∞0 ae−atdt = 1. This means that the probability that the decay time ranges

between 0 and infinity is 1, as it must be.

Note: Recall that the binomial and Poisson distributions were discrete – we canonly have an integral number of “successes” or of counts. In contrast, the intervaldistribution is continuous because t can take on any value.

Some Properties of Probability Density Functions:

Any probability density p(x) must be normalized to unity (this may require multiplying bya suitable constant): ∫ ∞

−∞p(x) dx = 1 .

Note that we have implicitly assumed that x may take on all values (−∞ to +∞). In general,the integral’s limits should be restricted to the range of allowed values of x.

Assuming a normalized probability density function, we can calculate the mean of acontinuous variable x as

〈x〉 =∫ ∞

−∞x p(x) dx .

The variance of the distribution can be calculated as

σ2 = 〈(x− 〈x〉)2〉 = 〈x2〉 − 〈x2〉 =∫ ∞

−∞x2 p(x) dx −

[ ∫ ∞

−∞x p(x) dx

]2.

Problem 2: Calculate the mean and variance of the interval distribution (Eq. 4.5).

Page 45: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

4.3. EXPERIMENTS 45

4.3 Experiments

These experiments will not make sense unless you have read the prelab sections and donethe prelab exercises.

Experiment 1: Decay Experiment Using Dice (Group Experiment)

Repeatedly throw a bunch of six-sided dice; remove the snake eyes after each throw; andkeep track of how many are left each time. The resulting data can be plotted versus thenumber of throws (representing time) to give the decay curve.

• Estimate the half-life of the curve from the graph and use it to estimate p.

• Fit by eye a straight line to ln N(t) vs t and estimate values for No and p and uncer-tainties in these parameters.

(We will return to the analysis of the data from this experiment and the ones below in Week8, after we have discussed curve fits.)

Experiment 2: Radon Decay (Group Experiment)

Because this part of the experiment will take up the whole class, it will be done as a groupexperiment. Afterwards, you will each analyze the data individually.

Procedure

1. Our “radioactive dust collector” is a vacuum cleaner (shop vac) with a piece of gauzetaped over the intake.

2. At the beginning of class, we start the vacuum cleaner in the basement of the PhysicsDepartment (radon gas seeps from the earth and, being heavy, collects in low basementareas). We will collect dust for the duration of the lecture (≈ 50 min.). At the sametime, we will also do a “control experiment,” where we set up another shop vac onthe 9000 level (next to our room). If the radioactivity we are seeing is produced bysomething associated with gas seeping from the earth into our building, we wouldexpect to see fewer counts in the dust collected from higher floors.

3. We set up two Geiger counters without any source and start logging, also at thebeginning of the lecture. We will set the counter to run continuously (i.e., using aWhile loop rather than a For loop), with a count interval of 1 minute, using the VIfrom last week. Since each DAQ has only one counter, we will connect two DAQs to asingle computer. Because each DAQ is identified by an individual serial number whenit’s configured, LabVIEW can run each one independently, at the same time.

Page 46: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

46 CHAPTER 4. RADIOACTIVE DECAY AND INTERVAL DISTRIBUTIONS

4. After the lecture, we retrieve the gauze from the vacuum cleaners, fold them over acouple of times, and tape them over the detector on the Geiger counters. We willproject the data as it comes in onto the screen so everyone can see. We’ll continueto collect data overnight, to make sure that the radioactivity levels decay to theirbackground values. The next morning, we will email the data to you so that you cananalyze it.

For the analysis, input the data into Igor and use the count diff function from last weekto convert the total counts into counts per time interval. Estimate the background countsand subtract this number from your data. Display the log of the corrected data vs. time. Youshould see a roughly straight line (with growing fluctuations for times with fewer counts).Let us then make the hypothesis that we are observing a single substance, with some half-lifethat we would like to estimate from our data. Using our “curve-fitting by hand” methods,estimate the best slope and hence estimate the half-life of the unknown substance that isproducing the radioactivity.

You may find that some of your “corrected” data are negative. Think about why thishappens and figure out a reasonable way to proceed in your data analysis. In your labnotebook, explain and justify the procedure you use. (Later on, when we return to the dataanalysis of this lab, we will see that subtracting the background isn’t really the right thingto do, and the problem of what to do with the negative numbers is just a symptom of this.But it’s good enough for now.)

Throughout your analysis, please record all intermediate and final data in your lab note-book either in a table or as a histogram. (You can print out tables, if needed, from Igor.)Label each such data record and explain the steps used to obtain it from the previous one.

Compare your experimental results with the known half-lives of Radon-222 and its daugh-ters Polonium-218, Lead-214, and Bismuth-214. Can you determine which of these materialsproduced the decays you observed? (Hint: something tricky is going on. Be careful! We willreturn to the data analysis in a few weeks, once we have discussed how to do real curve fits.)

Experiment 3: Measuring the Interval Distribution for Radioactive Decay

In this experiment, you will examine the interval distribution for a radioactive source. Wewill use one of the longer-lived sources like the ones you used in the previous lab. Tomeasure intervals, we need to modify our data collection procedure to measure the elapsedtime between successive pulses from the Geiger counter. To do this with the USB-6009requires some trickiness. Our strategy will be to use the VI we wrote previously, but now weread the counter as quickly as possible so that we typically get either 0 or 1 counts occurringin that interval. We record to disk as before. It is probably more convenient here to convertthe For loop back to a While loop and just stop the VI manually when you get “enough”counts. (You should both play around empirically and also think about how many countsare “enough.” In your lab book, discuss your choice of the number of counts.)

Our tests show that a loop time of 20 ms is about as fast as one can go and havereasonably reliable timing, using the LabVIEW write file VI inside the loop (as we did last

Page 47: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

4.3. EXPERIMENTS 47

time). A better but more complicated technique, which we won’t use here, would be to storethe counts in an array and write them only at the end of the experiment. In any case, here,you should set your time per loop to be 20 ms and keep the file writing within the loop(using append). This means that to avoid having many intervals where two or more countsare recorded, we have to avoid high count rates. An average count rate of about 10 Hz,(measured using the VI you wrote last week) is reasonable. (After doing the lab, you shouldbe able to comment as to why 10 Hz is reasonable but 50 Hz – which would correspond tohaving on average 1 count per loop – is not.)

To make sure that everything is correct, note that for your data, in most periods, therewill be no counts, and the total will be the same as the previous period. Occasionally, therewill be a single count (and even more rarely two counts). Thus, the data will be a columnof numbers that looks like ... 137, 137, 137, 138, 138, 139, 139, 139, 139, 141, 141, ... wherethe numbers are the total number of counts recorded up to that time interval.

• Read the supplied data file into Igor. Since we haven’t done much Igor programmingyet, we will go over in class a function (“counts2intervals”) that takes the series ofcounts and converts it into a series of intervals.

• Make a histogram of the interval times.

• Use Eqn. 4.5 to obtain two estimates of a, the probability per unit time of measuringan event. The first estimate – call it a1 – is the intercept on the log plot. The secondestimate – call it a2 – is the slope on the log plot.

Are the two estimates a1 and a2 consistent within uncertainties? Be careful in your choiceof uncertainties. (Make sure you understand why the two values of a should be the same.Discuss any discrepancies.)

Here’s one subtle effect to think about. The Igor analysis program, “counts2intervals”,which we discussed in class, works by finding the places where the count increment function“passes through” a value of 1. This is the right thing to do when the count increments byone, but it is not quite the right thing to do when the count increments by 2 and is definitelythe WRONG thing to do when the count increments by more than 2. Why? What are theimplications of this for the interval histogram you have accumulated? There are a number ofways to work around this problem. Some involve how you collect the data and some involvehow you process the data. Whichever way you decide to proceed, discuss and justify yourchoice in your lab book. (To see whether you have this problem, just graph the wave thatrecords counts/interval.)

Here’s another subtle effect: When you look at your interval histogram, the short timeintervals will have many more counts than the long time intervals. Now the value of ahistogram bin is itself a random variable. (Each time we do the experiment, we’ll get adifferent result.) Because the data points come randomly, the process of building up ahistogram is also a Poisson process. This means that if a bin has a value of N counts,we expect that the standard deviation is

√N . This means that the relative uncertainty is

Page 48: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

48 CHAPTER 4. RADIOACTIVE DECAY AND INTERVAL DISTRIBUTIONS

(error/count) =√

N/N = 1/√

N and, thus, that the relative error is smaller for bins withlarger counts. As a result, when you look for your best curve through the interval distributionhistogram, you should put more weight on the bins with larger numbers of counts. Thatis, you should make sure that your curve passes near those points, while if there are binswith a small number of counts (0, 1, 2, etc.), you should not worry as much how close thecurve passes to them. Later in the course, we’ll see how to be more systematic about howto “weight” points according to their uncertainty in a curve fit.

1998-1 - Created NA; 2003-3 - Revised BJF; 2005-3 - Revised JB

Page 49: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 5

AC Circuits I: RC low-pass filter

5.1 Goals

• Explore the properties of an RC low-pass filter

• Notion of Bode plot

• Notion of filtering (applications to noise removal)

• Progamming: Write a program to measure input and output of the circuit using amanually specified input.

• Data Processing: Use and understand program to estimate the frequency of a capturedperiodic waveform. Algorithm is based on measurement of zero-crossing intervals.

References

• PHYS 231 Reference Manual - Electronic Notes

5.2 Prelab Questions

1. (a) Calculate log10(n) for n=0,1,2,...,10 and plot by hand log10(n) vs n.

(b) Compare the following quantities: log10(2 + 4), log10(2 · 4), log10(2), log10(1/2),1

log10(2), log10

(√2), log10

(1√2

).

2. For an RC low-pass filter such as the one depicted in Fig. 5.1, derive general expressions(in terms of an arbitrary resistance R and capacitance C) for

(a) The attenuation of the circuit, |Vout||Vin| .

49

Page 50: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

50 CHAPTER 5. AC CIRCUITS I

(b) The phase shift between Vout and Vin. To be precise, we define this to be the phaseof Vout relative to that of Vin. Define a phase lead to be positive and a phase lagto be negative.

(c) The −3dB frequency.1 This is the frequency where |Vout||Vin| = 1√

2.

3. Show that the filter attenuation∣∣∣Vout

Vin

∣∣∣ is 6 dB/octave at high frequencies.2

4. Make a Bode plot of the frequency response of the filter shown in Fig. 5.1. A Bodeplot is a convenient way of visualizing the frequency response of the filter. It consistsof two graphs:

(a) A log-log graph of the amplitude response. Plot log (to the base 10) of∣∣∣Vout

Vin

∣∣∣vs. the log10 of the frequency. To get a good feel for the behaviour of the filter,you should start your frequencies two decades below the −3dB frequency andfinish two decades above. Thus, you will need to span four decades in frequency.(We plot the log of the frequency in order to see the behaviour of the circuit oversuch a wide range of frequencies.)

(b) A linear-log graph of the phase response. Plot the phase of the response – it willbe less than zero – on a linear scale but use the same log10 frequency scale usedfor the amplitude plot.

Save this plot on your computer so that you may add the data you collect in theexperiments on it.

5.3 Experiments

Record your experimental method, observations, and results in your lab note-book.

1. RC Low-pass Filter (by hand). Construct the circuit shown in Fig. 5.1. Drive itwith a sine wave and measure both the attenuation and the phase shift between theinput and output voltages as a function of the frequency. Do this by hand, recordingvalues off the oscilloscope. To speed up the measurement, first find the −3dB point,then choose a few frequencies above and below to give you a reasonable representationof the response of the circuit. (If you choose the frequencies with care, five or sixmeasurements should suffice.)

1The decibel scale is defined in terms of power ratios: dB=10 log10(Pout/Pin). Since the electrical powerP is proportional to the square of the voltage V , this definition is equivalent to dB=20 log10(Vout/Vin).Furthermore, 10 log10(1/2) ≈ −3, hence the name “−3dB frequency” for the frequency at which the powerdrops by a factor of 2 (or amplitude by

√2). This is also called the “cutoff frequency,” or “bandwidth” of

the filter.2An octave is a factor of two in frequency.

Page 51: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

5.3. EXPERIMENTS 51

100 k!

~10 nF

Vin

Vout

Figure 5.1: RC low-pass filter

Measure the resistor’s value and use the −3dB point to calculate capacitance. Comparethe measured value to its nominal value.3

Don’t forget to plot the data as you take it (either by hand or using Igor)! First plotthe data using linear axes; then make a Bode plot (log-log for attenuation, lin-log graphfor phase). You should superimpose your measured values on the same graphs thatyou used for the homework so that you can compare them.

From your data, you should be able to:

(a) Compare the −3dB frequency determined from the attenuation data and fromthe phase data. Which is more accurate?

(b) Check to see if the filter attenuates 6 dB/octave (20 dB/decade) for frequencieswell above the −3dB point.

2. Computer-assisted measurement. Even the few measurements you did above mayhave convinced you that measuring frequency responses can quickly become tedious.Here, we will begin a process of learning how to use our data acquisition device (DAQ)to help speed up the process. Before we begin, we repeat that doing a few measure-ments – and thinking about them – is an essential first step. Computerizing the dataacquisition can relieve tedium, but it cannot replace thought!4

In this first AC lab, we will content ourselves to using the computer to measure thesignal going in to the circuit and the signal coming out. We will then add a very simplecontrol to manually set the frequency of the input signal. Next week, we will completethe program by using the computer to “sweep through” a series of inputs, recordingthe output for each frequency onto disk for analysis afterwards.

3You may need to use the x10 scope probes for measurements on your circuits. Probes increase the inputimpedance of the oscilloscope so that measurements can be made without changing the circuit too much.They act like the buffers we have used for the inputs to the DAQ. They also allow you to compensate forthe stray capacitance of the oscilloscope.

4Remember the expression “Garbage in, garbage out”: if you do not know what you are doing when youset up your computer program, the results will be worthless.

Page 52: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

52 CHAPTER 5. AC CIRCUITS I

Here, the basic goal is to write a LabVIEW VI to alternately read in the voltage beingsent to the circuit’s input from the function generator Vin and the voltage coming fromthe output of the circuit (Vout). Remember to use a buffer for the A/D conversions.(You will need the buffer for the circuit output, since the impedance is high but not forthe input, since the function generator can source enough current.) In your LabVIEWVI, put in controls to set the sampling interval and number of points sampled. Sendthe data to a front-panel display graph (both channels on one display). Put in anoption to save the data to disk.

In collecting data, set the sampling interval to its minimum value. Recall that theDAQ will collect alternately one sample from the input and one from the output andthat this will affect how fast it can read. What effect will this have on the apparentphase shift between the two signals? (Hint: you can always measure this by sendingthe same signal to each input.)

In this lab, the input and output signals are sine waves. Open up the data you savedin Igor and display the two waveforms on one graph. Use cursors to measure theamplitude of each waveform, the period (and hence frequency), and the relative phaseshift between the two sine waves.

As a last programming step (for this lab), add a knob control (and numerical indicator)to set one of the analog outputs. Wire up this output to the voltage-controlled input ofthe function generator. Use the sequence structure to force LabVIEW to set the analogout voltage before it reads in the two voltages. (We will discuss this in class.) Thiswill give you a way of setting the function generator’s frequency from the computer.

Now go and repeat your measurements of the frequency response of the low-pass circuit.You should be able to take examine more frequencies with your “computer assist.”Again, plot the relative amplitudes and phases for the different frequencies on topof your calculated Bode plot, which should also have the data from the oscilloscopemeasurements. Use different marker symbols for the two data sets.

3. Data Analysis We will do one programming exercise to assist your analysis. Thiswill also introduce the notion of an Igor function – essentially a program that returnsa numerical value as a result. Our goal is to use (and understand) a program that willestimate the frequency of a sine wave that has been sampled and stored on disk (andloaded into an Igor wave, call it w). For example, you can generate a wave with fakedata by executing

Make /n=1000 w

SetScale/I x 0,100,"", w

w = cos(2*pi*1.1*x)

(The first two commands may be generated using the pull-down menus for Data /

Make Waves and Data / Change Wave Scaling in Igor.) This creates a wave w offrequency 1.1 Hz, with 1000 points and sets its scale to go from 0 to 100. (If the units

Page 53: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

5.3. EXPERIMENTS 53

are seconds, this means that each point is 0.1 s after the previous one and that thesampling rate is then 10 Hz.)

To evaluate its frequency, we simply count how many times the function crosses zeroover the whole interval (0 to 100) and divide by twice the time between the first andlast crossings. (Why twice?) Fortunately, Igor has a built-in function, FindLevels, thatfinds level crossings (here, zero is our level). (In your code, you will need to modifyyour function to work with an offset sine wave, since our signals are always positive,on account of the range of the buffer circuit we are using.)

The function get freq0(w) implements the above algorithm (see website). As anexercise to make sure you understand how well it works and what is going on, try it forfrequencies ranging from 1 to 20 Hz, using the test wave above. Explain the output.

Now you can use this function to measure the frequency output by the function gen-erator for your data. One thing you need to do for get freq0() is make sure thatthe wave that you give it has its x-values scaled correctly. The default for Igor is tojust have the x-values be the points. You need to make sure that they are times. Goto Change Wave Scaling and, under Set Scale Mode use Start and Delta. Thenselect the starting time (0) and the time increment per point. (For 20 kHz, this wouldbe 50 µs, which is written 5e-5.)

You will still have to measure amplitudes and phases by hand (in Igor) from the graph.(In the next lab, we will introduce better ways to do these tasks, too.) For now, youcan use the cursors to measure amplitude. For phase differences, you can either usethe cursors or use the drag feature (click down on a graph for about a second and youcan drag it, with the offset in x and y shown as you drag). To measure the phase shift,you can also use the difference between crossings of the average values.

4. Optional. Set the signal generator to a single square wave frequency and measure(using the oscilloscope) the risetime response of the low pass filter from 10% to 90%of maximum.5 Compare with the theoretical relation

trise =0.35

f3dB

.

For your information: What’s a low-pass filter good for?

Low-pass filters like the RC-filter we have been looking at (and other, more complicatedcircuits) have many uses. Perhaps the most important is to separate a signal from noise thatcontaminates it. Loosely speaking, noise is mostly made up of high-frequency components(that make the sharp features characteristic of noise). The low-pass filter will attenuatethese, while letting the signal through. Of course, the frequency of your signal should be less

5If you look closely, you will see markings on the scope scale labelled from 0% to 100%. In particular thelines for 10% and 90% are present expressly for measuring risetimes.

Page 54: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

54 CHAPTER 5. AC CIRCUITS I

than the −3dB frequency of the low-pass filter. The action of a low-pass filter is illustratedin Fig. 5.2.

One place where low-pass filtering is needed is to prevent the aliasing problem we dis-cussed in Ch. 1. If you try to read a signal into a computer, high-frequency noise can distortthe signal you measure. One prevents this by using a low-pass filter whose −3dB frequency is5-10 times less than the sampling frequency of the A/D converter. This is the “anti-aliasing”filter mentioned in Ch. 0 and is an essential part of a computerized data-acquisition setup.

+ =

! =

Signal Noise Noisy Signal

Noisy Signal Filtered SignalLow-pass filter

Figure 5.2: A low-pass filter may be used to remove noise. Top: sine-wave signal is contam-inated by noise. Bottom: Passing a noisy signal through a low-pass filter circuit reduces thenoise.

Page 55: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 6

AC Circuits II: RC, RL, and LCRcircuits

6.1 Goals

• Explore the properties of different AC circuits, including RC high pass, LR high pass,and LRC serial circuits.

• More applications of filtering: (AC coupling, tuners).

• Data collection: Automate the data-collection process by adding an overall loop.

• Data analysis: Use (and understand) an Igor function to measure the relative phasebetween two sine waves. Use (and understand) an Igor function to load in the datasaved in LabVIEW. Write an Igor function to estimate the number of points per cyclein a digitized sine wave.

6.2 Prelab Questions

1. Derive the analytic form of Bode plots for the RC, LR, and LRC circuits shown inFigs. 6.1, 6.2, and 6.3. Plot these for the values shown in those circuits. In the lab, beprepared to redo these plots based on your measurements of the actual R, and C forthe components you use. (We don’t have a direct way of measuring L, alas, but youcan adjust your value to fit your data...)

2. In this lab, we will need to generate a list of frequencies that are evenly spaced on alog plot. Come up with a function that, when given a set of integers from 0 to Nmax,outputs equally spaced – in log – voltages for the DAQ that range from 0.01 to 5 Volts.We will later use this function in a LabVIEW program.

55

Page 56: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

56 CHAPTER 6. AC CIRCUITS II

3. One task that we will have to do repeatedly in this lab is to measure the relative phaseof the two waves corresponding to the sinusoidal input to the circuit and the sinusoidaloutput. Explicitly, these waveforms are given by

Vin(t) = V0 cos(ωt− ϕ0) (6.1)

Vout(t) = V1 cos(ωt− ϕ1) , (6.2)

where ω = 2πf , f is the frequency, and ϕ0,1 is the phase of each wave. Last time, wedid this by hand, using cursor controls on graphs where the two functions were bothplotted. This is a bit slow....

In this lab, we will use an Igor function that fits a sine wave to each curve, returningthe phase of each curve, and then calculating the phase difference between the two.(We will be discussing curve fits in a couple of weeks...) The one input that the curvefit needs is an estimate of the number of points per cycle in the data.) For class, writean Igor function Cycles(w) that takes a wave w (holding a sampled sine wave) andreturns an integer that is the approximate number of points of data per cycle of sinewave. This function will be quite similar to the get freq(w) function of Lab 5. Makesure that it works with a sine wave that has an offset.

6.3 Experiments

We have set this lab up so that you do NOT need to use the buffer for voltage measure-ments. In some cases, there may be small effects linked to the resistance (input impedance)associated with your voltage measurement. This may cause “non-ideal effects”....

1. Programming. We begin with some data acquisition programming tasks that willspeed up the rest of the lab (and several others, too) quite a bit. Last time, wewrote a program that could set an analog output voltage that was sent to the functiongenerator and determined the frequency of its output. We then input two waveformscorresponding to the input and the output of the circuit. Now we take things a fewsteps further.

First, add an outside loop to your program. The loop should do the following:

(a) Set the analog voltage out (i.e., set the function generator frequency). Use afunction node (see example VI) to output evenly spaced log frequencies, as dis-cussed in the pre-lab exercise. This function (fed by the For loop you have added)replaces the knob control of the previous experiment.

(b) Acquire the two analog signals (20 kHz sampling rate).

(c) Save the data to disk (use append, as before). The Igor data loader program willexpect all of the data to be sequentially in ONE file. It will be convenient not tosave the time data – just the two voltages.

Page 57: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

6.3. EXPERIMENTS 57

Note that the frequency set by the analog voltage of the DAQ will depend on howthe function generator is set up. (The function generator’s lowest frequency is set bythe dial. You should manually set this to the frequency you want to start at. Thefrequency then increases linearly with voltage, so that at 10V, it is at the maximumof the range it is set on. Remember, though, that our analog out is limited to +5V.)

2. Calibration One systematic error that you should deal with is that the two waves youacquire are not sampled at the same time. Measure the time delay between measure-ments by sending the same sine wave to both inputs on the DAQ and measuring thephase difference. Do for some different frequencies to see whether it is a phase delayor a time delay that occurs. Later on, correct your phase measurements according toyour findings here.

3. Measurements. Once you have finished your program and dealt with the issue of thedelay between channels, measure the frequency response of the three circuits shownbelow (RC high-pass, LR high-pass, LRC series). Make sure that, at each frequency,you have enough data points to see at least one complete cycle. You should use the Bodeplots you calculated in the prelab to guide your choice of frequencies to scan. As usual,it is a good idea to do a quick scan of the frequency using the oscilloscope to displaythe input and output voltages. Don’t forget to note these preliminary measurementsin your lab book! Later, you should check whether your computer-aided measurementsare consistent with your quick hand measurements.

1.2 k!

0.82 !F

Vin V

out

Figure 6.1: RC high-pass filter.

4. Data Processing. Now you should have lots of data on your hard drive! The first stepwill be to get the data into Igor. We have provided an Igor function, extractor(Ndat,Nseg,Sfreq,v1,v2) that will do the job. You call it by typing it in the commandline, with Ndata the number of frequencies you have measured, Nseg the numberof points measured per frequency, Sfreq the sampling frequency, and v1 and v2 thenames of the two waves you have put the data in. (Each of these waves will haveNdat ∗ Nseg points.) Note that the extractor function begins by calling a utilityfunction, kill graphs and tables(), which prevents “screen clutter.” You can callthis function separately yourself, too, by typing its name in the command line.

Page 58: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

58 CHAPTER 6. AC CIRCUITS II

Vin

Vout

L = 7H

R = 600 !

R = 3.3 k!

Figure 6.2: LR high-pass filter. The resistance and inductance are shown in a shaded boxbecause the inductors we use, made of wire wrapped around an iron core, have considerableresistance. Make sure you check these values!

C = 0.1 !F

Vin

Vout

L = 7H

R = 600 !

Figure 6.3: LRC series circuit. Note that all the resistance is coming from the inductor.

For each data set, you need to extract the frequency of the waveform, the amplitude ofeach wave, and the relative phase between the two sinusoids. We already introducedan Igor function to extract the frequency in the last lab. The next step is to figure outhow to extract the relative amplitudes and phases so that your data can be plotted ontop of your computed Bode plots. Explicitly, let us say that the input and output toeach circuit is given by Eqs. 6.2. Your task, for each frequency f , is to find the relativeamplitude V1/V0 and phase shift ϕ = ϕ1 − ϕ0. You may notice that sometimes theinput voltage is not exactly constant. Why is this? In your data analysis for the Bodemagnitude plot, remember that the function you plot is the ratio of output to inputmagnitude.

(a) The first task is relatively straightforward, with a number of possible approaches.One is to look for the maximum and minimum. In Igor, this is simple: justexecute the operation WaveStats, which returns the variables V max and V min,

Page 59: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

6.3. EXPERIMENTS 59

the maximum and minimum of the waveform, respectively. This is simple, butif there is much noise on the curve, not very accurate. Why? Another approachis to use the RMS (root-mean-square) voltage, also available through WaveStats.What is the relation between the RMS amplitude and the peak-to-peak amplitudefor a sine wave? Why might the RMS be better? (Compare the two, and alsocompare with a direct plot for at least a test case, in order to check which methodis better.) Using these ideas, create a function get amp(w) that, when given awave w that is sinuosoidal, returns its amplitude.

(b) For the phase difference ϕ, use the supplied Igor function, get phase(w1, w2)

supplemented with your utility function that estimates the number of data pointsper cycle of sine wave.

(c) If you are ambitious, you may want to integrate these functions (get freq,

get amp, and get phase) into the main loop of the extractor Igor function(above). To do so, you would define waves to hold the values for each dataset and then set the elements during the For loop. In any case, when you aretesting things, first execute these functions by hand, individually on each pair ofsine waves, to make sure they are giving sensible answers. Then you can thinkabout integrating them into your loop.

5. Analysis. At this point, you should have experimental Bode plots for the three circuitsyou have measured. (Of course, you will have plotted these on top of your Bode plotsthat you calculated using nominal R, L, and C values. For each one, see how wellthe experimental points match the calculated curves. Discuss the discrepancies. (Wehave already mentioned one – that our inductor has a considerable resistance that iseffectively in series with its inductance.) In some cases, you may be able to accountfor the discrepancy if the nominal values of R, L, and C that you used to calculatethe Bode plots are in error. You can measure R and C using the DMM and try tocorrect your Bode plots accordingly. (Unfortunately, the DMM we use has no ready-made measurement of L). You can also manually tweak the values of these constants(particularly L, since you did not measure it independently). You may also find otherdiscrepancies. Comment on these... (In particular, why might one of the two high-passresponses be less ideal than the other?)

For the LRC series circuit, compare your data to the expected curve on a Bode plotand comment on any differences. Try adjusting L if the expected curve does not passthrough the data points. We will study this kind of response in much more detail inthe following two labs on mechanical resonance.

For your information: What’s a high-pass filter good for?

In this lab, we considered a high-pass filter. As you will have seen, it attenuates low fre-quencies and lets high frequencies pass. One application of high-pass filters is to do “AC

Page 60: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

60 CHAPTER 6. AC CIRCUITS II

coupling,” an option found on all oscilloscopes. Very often, you have a small signal of in-terest that is sitting on a large offset. This can make it hard to measure the signal you areinterested in. If you knew the value of the offset, you could subtract that voltage and thenamplify the difference. But you might not know the offset value to subtract. Worse, it mightslowly vary over time. In such circumstances, a high-pass filter is very useful, as it blocksthe constant (or slowly varying offset) while letting through the signal of interest. One canthen amplify the small signal. This is how the AC coupling of an oscilloscope works.

Page 61: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 7

Mechanical Resonance (2 Weeks)

7.1 Goals

• Investigate motion of a hacksaw blade (damping, resonance)

• Introduce curve fits

Introduction:

In this experiment, you will investigate the mechanical resonance of a hacksaw blade.Using this setup, you will investigate damped harmonic motion and the amplitude and phaseresonance curves for forced harmonic motion. You may notice that the structure of this labis in many ways very similar to that of the AC circuits we investigated before. There, weconstructed electrical circuits where we give an input (a sine wave) and measure the output(another sine wave). Here, we have a mechanical system, where we give an input (either aconstant as an initial condition or a sine wave) and we measure a response (velocity of thehacksaw blade). Both experiments supply an input and measure an output. Indeed, theLabView programs we developed for the AC circuit will, with small modification, be usedhere, as well.

The similarities are even deeper when we notice that the equations of motion that describea damped, driven harmonic oscillator are the same as those used to describe an RLC circuit.Thus, everything we have learned about RLC circuits can be applied to the present case.All we have to do is make appropriate substitutions (mass for capacitance, etc.).

Before starting the lab please read:

1. C. C. Jones, Am. J. Phys. 63, 232 (1995). This is an American Journal of Physicsarticle about the hacksaw-blade experiment.

2. Sections on Damped Harmonic Motion and Driven Harmonic Motion in your first-yearor PHYS-211 textbook.

3. PHYS 231 Reference Manual – section on Electrical Resonance

61

Page 62: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

62 CHAPTER 7. MECHANICAL RESONANCE (2 WEEKS)

7.2 Prelab Questions:

1. Week 1: Derive and solve the differential equation for the forced, damped oscillator,and make sure that you understand the solutions. In particular, make sure that youunderstand the implications of measuring the velocity of the motion rather than theamplitude. Make sure you understand the notion of resonance and the differencebetween the natural and forcing frequencies.

2. Week 2: One of the goals of this course is to teach curve fitting, as it is both a wayof testing whether your model of an experiment is reasonable and, if so, of extractingfrom data the “best” parameters for that model. In particular, it is a key step inhow we learn something from an experiment. In the first part of the course, we did anumber of experiments where we tried to estimate a best fit “by eye.” Now that weknow how to do proper curve fits, we will go back and do some of the analysis thatgoes with those experiments.

Re-examine your data from the radon-decay experiment of Ch. 4. Do a curve fit tothe data with one exponential on a constant background. (Use Igor’s built-in function,exp, in the curve-fit dialogue.) Note the handout, which shows that the sum of twoPoisson processes (e.g., background and signal) is again a Poisson process, with meanthe sum of the means of the background and signal. This means that you should usethe square root of the number of counts as your error bar and weight for the fit. Youshould be able to show that you get a statistically good fit. (Recall from our discussion– c.f., Taylor, Ch. 12, too – that χ2 should be roughly Gaussian, with mean equal tothe number of “degrees of freedom” N – the number of data points minus the numberof free fit parameters – and standard deviation equal to

√2N . This approximation is

accurate when N √

2N , which, in practice, occurs for N > 10, roughly.) It turnsout that the data analysis of the induced-radioactivity decay experiment is subtle, andthe story is an interesting one. Above, you should have found that the fit was good:i.e., that χ2 is within a standard deviation of the expected value. But this is notthe end of the story. Show that the half-life that you find does not match ANY ofthe materials in the unit on radioactivity that describes the products of radon decay(which, we hypothesize, is ultimately responsible for the radioactivity we see). Thus,even though our curve fit is a good one, the result is suspicious.

The radioactivity background material we assigned suggests what’s going on: Let usmake the hypothesis that we observe the decays of both Lead-214 and Bismuth-214.The subtle point is that these decays are sequential and not independent. Lead decaysto bismuth, which then decays into polonium (and then to a different isotope of lead).We would see decays from both of these.

Show that the decays should obey the set of ordinary differential equations,

NL = −λLNL (7.1)

NB = −λBNB − NL ,

Page 63: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

7.2. PRELAB QUESTIONS: 63

where NL is the number of lead atoms, NB the number of bismuth, λL the decay rateof the lead, and λB the decay rate of the bismuth. What physical assumptions are wemaking when write Eqs. 7.2? Try to come up with a plausible scenario that leads tothese equations. You should ask yourself what it is actually going on when we usedthe shop-vac and air filter (e.g., radon is a gas, and you would not expect gas to betrapped by an air filter). Think about what happens when you have a material with avery long or a very short half life. What defines long and short?

To solve Eqs. 7.2, we note that the first equation depends only on NL, and is henceeasy to solve. Its expression can then be subtituted into the second equation.

Show that the expected count rate, |NL|+ |NB|, is of the form,

NB = Ae−λLt −Be−λBt , (7.2)

where the amplitudes have OPPOSITE signs. (The expressions for A and B in termsof NB(0) and NL(0) are a bit complicated. If you have trouble deriving them, don’tworry: in the fit, we will just use A and B, without worrying about how to go backto the initial conditions.) Intuitively, this happens because the decay of lead “feeds”the number of bismuth atoms, stretching out their decay. Note that, mathematically,one can find the particular solution to a first-order, inhomogeneous equation by tryinga solution of the form, NBp(t) = u(t) e−λBt, where you find u(t) after substitutinginto the differential equation for NB(t). The general solution is then the sum of theparticular solution and the general solution to the homogeneous equation.

All of this is to motivate another functional form for the curve fit, Eq. 7.2 with aconstant background. Use Igor’s built-in dblexp function. (Be sure to use the graph

now feature to check that your initial conditions are close enough. Remember to freezeall but the two amplitudes. Measure the background separately, using WaveStats on aportion of the data (last part) and just fit to the decaying part. VERY IMPORTANT:set the known decay rates to be fixed parameters in the fit.

If you do everything correctly, you should find a fit that is equally good as the singleexponential fit. It thus might appear that we have two equally good fits and that onemight prefer the single exponential to the double because it is “simpler.” But there ismore to the story. In the first case, we have to conclude that we have found a newmaterial with radioactivity that is unconnected to the radon-decay cycle lurking in thebasement. In the second case, we used the known half lives from materials expected tobe present in the decay of radon gas. Thus, the situation is NOT the same. Even thoughthe two fits are equally good, we prefer the one that is consistent with a pre-existingscenario supported by independent observations. This kind of “prior knowledge” turnsout to be essential in making inferences about theories.

Page 64: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

64 CHAPTER 7. MECHANICAL RESONANCE (2 WEEKS)

7.3 Experiments

There are two experiments to do here and two weeks to do them in. If you finish withexperiment 1 in the first week and have extra time, by all means make a start on the second.You will turn in your lab book when both experiments are done.

Experiment 1: Free Oscillations

1. Mount the hacksaw blade and pick-up coil so that the blade extends beyond the brick.Test the natural oscillation frequency of the blade/coil combination. Is there morethan one? Focus on oscillations perpendicular to the flat part of the blade.

2. Use a pick-up coil and a magnet to detect the vibration of the hacksaw blade. Observethe signal on an oscilloscope. Explain what is being detected. Check the oscillationfrequency and adjust the blade length extending beyond the brick until the oscillationfrequency is about 12 Hz.

3. Investigate the amplitude of the signal detected as a function of the distance the coilsits within the magnet. Explain why this changes. Which configuration is best? Whatis a typical voltage amplitude for the signal?

4. Investigate the damping of the oscillation with and without an aluminum plate mountedon the pick-up coil as a function of the position of the coil in the magnet. Adjust thedamping for a suitable decay of the oscillations.

5. Hook up the pick-up coil to the DAQ. You can use the internal gain of the DAQ analoginputs to compensate. This is an amplifier that is internal to the DAQ. See the manualfor more details. (This amplifier is another example of signal conditioning. See Ch. 0.)

6. Record the natural vibration of the system.

7. Plot the data. Determine the natural oscillation frequency and the damping constantby fitting model functions to the data. To fit the data, use Igor to do a nonlinear curvefit. You will need to define your own fit functions for this and then guess initial valuesof the parameters in order to minimize χ2. Be sure to use the graphing function inIgor’s Curve-fit panel to see whether these initial values are reasonably close, or yourfit will fail.

8. Record the estimates of the parameters you have measured and their uncertainties.

Make sure that you finish the analysis of this part of the experiment before you go on tothe second part.

Page 65: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

7.3. EXPERIMENTS 65

Experiment 2: Forced Oscillations

1. Go back and quickly redo a measurement of the free oscillation, to make sure thatyour estimate of the free-oscillation frequency has not changed. (Why might it havechanged?) Use the aluminum plate for damping. If you start this section in Week 1and are returning to it in Week 2, make sure you retake a full set of data where youlook at both free and forced oscillations.

2. Drive the system with the Pasco driver poking the hacksaw blade. (This is our “actu-ator.”) Note the cautions in the AJP article regarding the position and amplitude ofthe driving force. Make sure that the response of the system exhibits clean, sinusoidalbehavior.

3. Drive the blade-coil system at a series of frequencies around resonance.

4. Do a frequency sweep to record input and output data at frequencies centred on theresonance. Try to start at least a factor of 10 below the resonant frequency andfinish a factor of 10 above resonance. (Use the program developed for getting thefrequency response of AC circuits. You will have to reset various parameter values tobe appropriate for the mechanical case. You may also want to think about how manyfrequencies to take, whether a log or linear frequency scan is better, etc.) Hint: thinkabout transients and what to do about them.... Another issue: if you have significantnoise on the response measurement, you can use a capacitor to reduce it. Take thelargest capacitor you have and connect it across the DAQ input for the response. Lookon the oscilloscope to see whether this helps.

5. Analyze the data at different frequencies for relative amplitude and phase by fittingthe data using Igor.

6. Plot the amplitude and phase response of the system as a function of frequency. Deter-mine Q from the resonance curve. Compare to Q calculated from the decay constantfor your current set up. Fit the resonance curve and the phase curve to determine thenatural resonance frequency and the damping constant. Estimate the uncertainties inthe parameters you have measured. Compare the results from the experiments for freeand driven oscillations.

BJF/2002-3 JB/2005-2

Page 66: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

66 CHAPTER 7. MECHANICAL RESONANCE (2 WEEKS)

Page 67: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 8

The “Bug,” Part 1: Measurement andCalibration

8.1 Goals

• Overview of the Bug: Measure C(T ) “by hand”

• Use of thermistor as temperature sensor

• Notions of calibration, secondary and primary standards

• Notions of averaging and filtering; noise vs. drift

8.2 Prelab Questions

1. The resistance of the thermistors we use is related to temperature (in C), as follows:

T (R) =

(A1 + B1 ln

R

Rref

+ C1 ln2 R

Rref

+ D1 ln3 R

Rref

)−1

− 273.15 , (8.1)

where A1 = 3.354016 × 10−3, B1 = 2.569355 × 10−4 K−1, C1 = 2.626311 × 10−6 K−2,D1 = 0.675278 × 10−7 K−3, and Rref ≈ 10 KΩ is the resistance of the resistor at25 C. Plot this for temperatures ranging from 10 to 90 C (using Rref = 10 KΩ).Note that you are plotting temperature vs. resistance, so you will have to adjust yourminimum and maximum resistances so that the temperature spans the desired values.Make a printout of your T (R) graph with gridlines. (See Ticks & Grids in the ModifyAxes dialogue of Igor.) What resistance corresponds to 80 C? To do this problem, itwill be useful to define an Igor function in the Procedure Window. Define a functionr2t(r) that takes a resistance r and returns a temperature. Then define a wave calledTemperature. Go to Change Wave Scaling and set its x values to range between theminimum and maximum resistance you expect to see. (You may have to play around

67

Page 68: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

68 CHAPTER 8. BUG 1: SYSTEM CALIBRATION

to get the right values – they are chosen so that your range goes from 10 to 90 C, asdescribed above.) Then simply evaluate in the command line, Temperature = r2t(x)

and Igor will go through an implicit loop and assign to every x value of the waveTemperature the result of the function r2t.

2. We will measure the resistance using a voltage divider circuit such as Fig. 2.1, wherewe have a “normal” resistor R1 that is far from the heater (and not very temperaturesensitive) and the thermistor R2. Given that we want to explore a temperature rangeof about 20 to 80 C and given a T (R) curve as in Quest. 1, what value of resistanceshould you choose for R1 and why?

3. Combine the voltage divider and resistance-temperature function into a single function.Make a table of 100 V -T pairs given nominal values of the thermistor’s referenceresistance and of the series resistor. Have the temperature values span 10 to 90 C(so that we cover slightly more than the range we care about, 20 to 80 C). In class,you will evaluate this function using measured values of the resistances and save theresulting wave to disk. We will then import the data pairs into LabVIEW as a lookuptable, so that our input values are reported in C. Make a similar function for theoutput power in terms of the voltage output on the DAQ for the heater resistance ofthe Bug. We will also use this to have our output in Watts. (Again, just have thefunction ready – you will need the measured value of the resistor you actually use.)

8.3 Experiments

Introduction

The last four labs in our course are a linked exercise. The nominal goal is to investigate thephysical properties of a seemingly simple device, the ceramic capacitor, which hides somesurprising features. The deeper goal is to get you to the level where you can conduct acomputer-controlled experiment that has all the features of the diagram in Fig. 1 of Ch. 0.The processes we follow and the kinds of instrumentation and programs and data processingwe use are standard for technical measurements, both in the physics lab and in industry.

We begin by presenting the “Bug” (Fig. 8.2), named for its winsome resemblance to some-thing you’d probably prefer to step on.1 PLEASE DON’T STEP ON THE BUG! The ideais to glue together the capacitor we would like to study, a heater to change its temperature,and a temperature sensor, to be able to measure the temperature. Roughly speaking, theexperiment will consist in setting the temperature to some desired value, waiting for thingsto stabilize, recording data that will allow us to determine the capacitance, and then movingon to the next temperature. After analyzing the data from our “temperature sweep,” wewill have measurements of C(T ), the temperature dependence of the capacitance.

1The Bug was developed – and named – by Paul Dixon, at the California State University of SanBernadino, USA. We are grateful for his entomological contributions to Physics Education.

Page 69: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

8.3. EXPERIMENTS 69

Caring for the Bug: The Bug is a fragile fellow. It doesn’t need much in the way of food,but it does need some care to survive. As the glue can be very fragile, we’ve pre-installed itfor you on the breadboard. Please leave it as is, as putting it in and taking it out are timeswhen it can easily come apart. Also, please do not clamp any connectors directly onto theleads. Use wires to bring the connections somewhere else.

Figure 8.1: Meet the Bug! From left to right: thermistor, power resistor, and capacitor.

1. Preliminary hand measurements. Before we embark on our four-week odyssey tomeasure C(T ) by an elaborate, computer-controlled experiment, we will do a quick,crude “hand measurement.” Do this as follows:

(a) Hook up one voltmeter to measure the resistance of the thermistor. Hook up theother to measure the capacitance. Hook the power resistor to the power supply.

(b) Measure a first value of Rth (thermistor resistance) and C. Convert Rth to tem-perature (T ) using the graph you made for the prelab question.

(c) Set a small voltage on the power supply to begin supplying a current through thepower resistor. Measure Rth, C, and convert from Rth (ohms) to T (C).

(d) Repeat for a few voltages going from 0 to 10 V, or so. To protect the thermistorand the glue (not to mention your fingers), DON’T GO ABOVE 80 C. Note thatyou will get to this temperature somewhere around 10 V,2 but your power supplycan put out 60V. This means that if you turn up the voltage too far, you will frythe bug. (If you smell something weird, it’s probably the glue or plastic melting– turn down the voltage at once!) PLEASE DON’T FRY THE BUG! Hopefully,

2If, at 10V, the Bug does not reach 80 C, there may be a bad thermal contact between heater andthermistor. Ask your instructor whether you have a “bad Bug” that needs to be replaced.

Page 70: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

70 CHAPTER 8. BUG 1: SYSTEM CALIBRATION

you will see your capacitance first go up as the temperature increases and thengo down as it further increases. Plot your deduced C(T ).

That’s it! So why, if you can do this experiment in half an hour (we hope!), should wetake 4 weeks to repeat it using a computer? Well, the computer will be able to makemany more measurements much more quickly. If you had a thousand Bugs to test, youwould not want to do them all by hand. Second, the measurements we get will be moreprecise, allowing a better quantitative analysis of the data. Of course, once you are anexpert at designing this kind of experiment, the next one will take far less than fourweeks to develop. Finally, as we have stated repeatedly, if you want to automate anexperiment, a necessary first step is a “quick and dirty” manual measurement, to makesure that the effect you are trying to measure actually exists and to give a referenceagainst which to compare your results from the automated version of the experiment.

2. Calibrating the thermistor temperature. We begin by focusing on the small resis-tor in the Bug known as a “thermistor.” The thermistor is made from a semiconductormaterial that has a very strong decrease of resistance with temperature. This makesis well-suited to be a temperature sensor. Other resistors, such as the middle one weuse as a heater, have R’s that vary much less with temperature.

Using a resistor whose value is close to the R1 that you decided on in the PrelabQuestions, construct a voltage-divider circuit. For power, you can use the 5 Volt outon your DAQ (see its pinout). Check its actual voltage with the DMM, and also seewhether your circuit loads the power supply appreciably (by checking voltage of thesupply with and without your circuit). For this part, measure the output of the voltagedivider with the DMM. Use the relations in Ch. 2 to convert the output of the voltagedivider to a resistance for the thermistor.

An important step in the use of any sensor is calibration. We measure a resistance butwant to know the temperature. Thus, we need to calibrate the sensor by setting it toa known temperature and measuring its resistance. In principle, we should do this atenough temperatures that we can fit a calibration curve through the R(T ) data pointsand then use that function to convert R(T ). That would take a long time...

Fortunately, there is a shortcut. Thermistors are very common, and many people havestudied their properties. They find that they can be reasonably accurately modeled(near room temperature) by an equation of the form of Eq. 8.1. The coefficients A1,B1, C1, and D1 depend only on the material used for the semiconductor and thus canbe measured once and for all (by someone else!). All that is left to do is a “one-point”calibration. This is just a fancy term for saying that we have to fix one term, Rref forthe particular thermistor we choose. Because of manufacturing variations, the actualresistance of the nominal 10 KΩ (at T = 25 C) thermistor we use will vary slightlyfrom thermistor to thermistor. Thus, we can improve the accuracy of our temperaturereading by measuring this resistance at T = 25 C. One catch is that we don’t reallyhave a simple way of fixing the temperature to be 25 C. After all, our goal is to be

Page 71: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

8.3. EXPERIMENTS 71

able (next week) to set the temperature to some desired value! Here is a simple wayof doing our calibration:

We take as our calibration standard a mercury thermometer. At the appropriate pointin the class, when everyone has set up their voltage divider and can measure resistance,your instructor will shout out the temperature of this thermometer. At that time, youwill record the output of your voltage divider (and hence its resistance). Then youwill know the resistance of your thermistor at whatever the temperature of the roomwas at the moment the instructor shouted out the reference value. Then you adjustyour value of Rref so that the temperature given by Eq. 8.1 matches the thermometer’stemperature.3

After you have found the value of Rref , you can use that value and the measured valueof your voltage-divider R to generate the final version of the look-up table. It shouldhave 100 points and span the range from 10 to 90 C. (This should be basically thesame as what you generated for the pre-lab.) Save the data in tab-delimited form to atext file. Then, in LabVIEW, make a new VI and use the DAQ assistant to create ananalog input for voltage. In the configuration dialog, you will see a “Custom scaling”pull-down tab. Create a new scale, using a table, and import the table you just created.Be sure to label the “pre-scaled” units as volts and the scaled units as degC. Note thatyou should then set the input range to be between 10 and 90. (There will be an errorif you allow values outside the range of the look-up table.)

3. Calibrating the heater power. In the above section, we calibrated the sensor input.In other words, we converted the voltage signal from the thermistor into a temperaturereading. In this section, we do the analagous to the actuator output: we convert thevoltage sent to the resistor heater into the equivalent power. Recall that the powerdissipated through a resistor R is P = V 2/R. For the Xantrex power supplies, there isa gain of 6 between the voltage at the remote-control input (from the analog out of theDAQ) and the voltage set at its output. Take this into account! Measure the nominalresistance of the resistor with a DMM, and use its value to generate a look-up table forthe analog out of the DAQ. Use another DAQ assistant node to create an analog-out

3You may wonder, “Who calibrated the mercury thermometer?” And how did they do that? Well, clearlyit was the manufacturer who printed a scale on the glass thermometer that converted a length of a columnof mercury to a temperature. Presumably that was done by using some other temperature standard. Buthow was that calibrated? You may worry that there is an infinite regression, but the answer is that thethermistor, the thermometer, etc. are all secondary temperature standards that we define with referenceto some ultimate primary temperature standard that is calibrated against the physical systems that definethe Celsius temperature scale. Making primary standards is the job of national laboratories, such as theInstitute for National Measurement Standards (INMS) in Canada and the National Institute for Science andTechnology (NIST) in the US. They use internationally adopted temperature definitions related to physicalproperties of materials, such as the triple point (where solid, liquid, and vapour all coexist). For example,the triple point of water defines the temperature 0.01 C. The convention that defines this is known asthe International Temperature Scale of 1990, or “ITS-90” to its friends. You can read more about it athttp://inms-ienm.nrc-cnrc.gc.ca/en/research/international temperature scale e.php.

Page 72: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

72 CHAPTER 8. BUG 1: SYSTEM CALIBRATION

task and repeat the procedure used above. You should find that the maximum poweris around 1.6 W.

Now that you have calibrated both the thermistor input and the heater output, youwill have schematically the setup illustrated below.

Controller

T(R(V))

V(P) D/A

A/D

Computer DAQ System

heater

thermistor

P out

TinT in

Pout

Voltage

Divider

Power

Supply

Vin

Vout

Figure 8.2: Schematic of the “Bug” with calibration of thermistor and power output. The“controller” will be implemented in the next lab.

4. LabVIEW Programming. Write a VI that can set the heater output and plot on achart the thermistor temperature, as follows:

(a) Configure the analog input (1 sample, on demand). Make sure you use the customscaling to convert to temperature.

(b) Output to a Waveform Chart.

(c) Add an analog output, configured in W. Recall that you need to use a separateDAQ assistant node. Make sure to configure the upper limit (around 1.6W) tocorrespond to a voltage at or just below about 10 V (what you need to get abit above 80 C). Put in a knob control for the analog out. To be extra safe, inthe knob control properties, configure the data range to be between 0 and yourupper limit. You can then set the scale to go between those limits, too.

(d) Put the Analog Out and then Analog In code in a Sequence structure. Put thesequence structure in a While loop.

(e) You should now have a program that will let you set the power using the knobcontrol and will measure the temperature and display it in a chart. Test this byDISCONNECTING THE OUTPUT of the heater’s power supply and runningthe VI. You should see the temperature around room temperature. Run the knobfrom zero through its maximum value. You should see the power supply’s voltagego from 0 to about 10 V. If not, consult with an instructor or TA before proceedingfurther – we don’t want to have a meltdown!

Page 73: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

8.3. EXPERIMENTS 73

(f) Once you are satisfied that your VI is working, reconnect the power supply tothe heater and run the VI, initially setting the heater at 0W. Again, you shouldsee a temperature around room temperature. When you increase the heater, thetemperature should rise rapidly. When you cut the heater power, it should alsodrop rapidly. If everything works correctly, at maximum power, it should justmake it to 80 C.

Note that you need a special cable to control the Xantrex power supply. In the rear,it has a 25-pin connector for remote control. We have supplied a suitable cable, witha couple of jumpered inputs (needed to tell the power supply that we use a voltagesignal to control its voltage) and with two long wires coming out. Connect the redwire to the positive terminal of your analogue out and the black wire to the negativeterminal.

5. Characterizing the heater-thermistor system Now that we have our sensor signalin degrees C and our heater signal in Watts, we can investigate the thermal character-istics of our combined thermistor-heater system. To do this, we shall apply a constantvoltage to the heater and measure the temperature at which the system settles.

Plot T (P ). For comparison, plot T (V ), as well, where V is the voltage of the analogueout. (You can just take the voltage out reading from the power supply; great precisionis not required.) Compare these last two curves. A simple model predicts that thethermistor temperature should be proportional to the heater’s power. How do your datacompare? In such cases, one can define a “thermal resistance” between the thermistorand the surrounding room air as the slope of the T (P ) curve (in C/W). What is yourmeasured thermal resistance?

All the above analysis has been at DC – we set a constant heater power and read the(approximately) constant temperature that results. A fuller characterization wouldinvolve looking at the frequency response just as we did for the AC circuits of theprevious labs. You would simply apply a sinusoidal heater signal (offset from zerobecause you can’t apply negative power with a heater!) and then measure the sinusoidaltemperature signal – all as a function of frequency. Using the resulting frequencycurve, you could figure out an equivalent “thermal circuit” – an electrical circuit whosefrequency response would mimic what you measure in the thermal system. We won’tdo this here.

You may also be wondering why it matters to have the input and outputs in real units.Why not just stick with volts in both cases? For the thermistor, it’s clear that wewant to know the signal in C, as we want to measure capacitance as a function oftemperature. But why is it important to know the heater output in Watts? Well, asyou saw above (we hope), the temperature varies linearly (or close to it) with heateroutput. It turns out that systems whose output varies linearly with their input areeasier to control than nonlinear ones. Next week, we will be adding an automatic

Page 74: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

74 CHAPTER 8. BUG 1: SYSTEM CALIBRATION

control loop to control temperature. Since T (P ) is roughly linear, our task will be thatmuch easier than it would be otherwise.

6. Minimizing the error in your temperature measurement. Now that we have away of reading in the temperature, it is time to think about ways we can improve theaccuracy of our measurement. As we have learned, averaging repeated measurementscan reduce errors. Recall that the standard deviation of N repeated measurements isσ0/

√N , where σ0 is the standard deviation of a single measurement. Thus, it would

seem that we can reduce the error in our measurements by averaging N separatemeasurements. But what should we choose for N? At first glance, you might say, themore the merrier, but if you think about it some more, that cannot be right. If weaverage over too long a time – if N is too big – the temperature in the room will driftand change the average that we are trying to compute. If we were to average, say,over a few hours, the room temperature would be changing and the standard deviationwould be set by how much the room temperature was changing and not by the noise inmeasurement. So, clearly, while some averaging is good, too much averaging is bad.4

In this section, we will explore the effects of averaging our signal N times each measure-ment. Our goal will, first, be to modify our VI to report the average of N measurements(taken at the maximum rate of 48 kHz) rather than a single reading. Our ultimategoal will be to choose an appropriate value of N .

(a) LabVIEW programming. Modify the VI you wrote above to average N mea-surements (but keep the original VI!). We could do this in Igor, but it will beconvenient to use LabVIEW’s analysis tools in this case. In detail,

i. Modify the Analog In DAQ assistant to read N = 10 samples at 48 kHz.

ii. Output those values to a Statistics Express VI (in the Analysis functions).Configure the Express VI to report the arithmetic mean.

iii. Display the mean in a waveform chart and also to a Write LabVIEW Measurement

File Express VI, where you append to a file. (Store the time values, too.)

iv. Optional: It will be convenient (but not absolutely necessary) to add a toggleswitch to your LabVIEW VI (see front panel controls). When it’s on, wewould like to save to disk; when it’s off, we would like to stop recording todisk. This is nice because we can see whether everything is ok before we recordto disk. In class, we will go over a sample LabVIEW VI that introduces aCase Structure that allows one to do this.

(b) Run the above VI, recording about 30s of data to disk. Make sure the heater isoff (and the Bug at room temperature) before recording your data.

4There are other, more fundamental reasons for drifts. It turns out that even if the temperature wereperfectly constant, your measurement would show similar kinds of drifts. This phenomenon, called “1/f”noise, occurs in an amazing number of places in Nature, from resistors to traffic flow to music to the floodlevels of the Nile river! See http://www.nslij-genetics.org/wli/1fnoise/ to learn more.

Page 75: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

8.3. EXPERIMENTS 75

(c) Make a histogram of the temperature measurements (over a sub-range smallenough that you don’t see any obvious variation of the temperature beyond thepoint-to-point variation produced by your measurement noise). How consistent isyour histogram with a Gaussian distribution?

(d) Repeat the run, with N set to 100, 1000, 10000, and 100000. In Igor, plot thedata sets for different N on a single graph. (No need to do histograms for these.Also, you may want to offset the plots so that they don’t overlap each other.)You should see in the time series that the greater the amount of averaging, thesmaller the statistical variations from measurement to measurement.

(e) For each time series, choose a small portion that shows only statistical variationsand use WaveStats to compute the standard deviation. Plot, in Igor, the measuredstandard deviation vs. N . Does it have the expected form? You may find forlarge N that it’s tough to avoid non-statistical variations. Why? Do the best youcan to compensate.

(f) Choosing N . You might think that you should choose N so that the averagingtime is comparable to the time scale for the temperature variations you haveobserved. However, there is another kind of temperature variation that we haveto worry about measuring – that due to the heater. If you think about it, thisvariation has to be faster than the natural variations. (If not, how could yourheater change the temperature?) With this in mind,

i. Reset N to an intermediate value (e.g., 1000).

ii. Record a time series. This time, start with the heater off. Then briefly turnit on full for a couple of seconds; then turn it off. Keep recording until itcools back to around room temperature.

iii. In Igor, examine your time series and estimate the largest slope (C/s). Thisis the fastest temperature variation you can possibly measure.

iv. Plot the sigma’s you measured above vs. the total averaging time (N∆t). Onthe same graph, plot temperature vs. time for a line with slope equal to themaximum slope you measured above.

v. One can argue that the intersection of these two curves gives a lower boundto N . Why? What time does this give? How many samples N does thatcorrespond to?

vi. From your time series averaging over different N ’s, what would be the largestpossible N you should choose? Why? We thus have a range of reasonableN ’s. For next week’s lab, we’ll settle on an intermediate value.

(g) Finally, try fitting an exponential to the portion of the time series showing thedecay back to room temperature. What time constant do you get? (Think aboutthe details of the fit: what should you use for the sigma’s in the chi-square statis-tic? Is your fit good in the statistical sense we defined in previous labs? If not, isit “good enough”? If so, what does that mean?)

Page 76: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

76 CHAPTER 8. BUG 1: SYSTEM CALIBRATION

Page 77: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 9

The “Bug,” Part 2: Introduction toTemperature Control

9.1 Goals

• Notions of control theory (PID regulation)

• Play the control “game” (manual control and P, PI, PID versions)

• Programming: Add LabVIEW knob to control temperature. Add PID module forautomatic control.

References

• Control Theory chapter in Reference Manual.

• “LabVIEW in 6 hours” tutorial (on course website)

9.2 Prelab Questions

None. For programming, you should take a look at the “LabVIEW in 6 hours” tutorialavailable from the course website. It gives a more in-depth introduction to LabVIEW. Wewill be building up to using some more advanced concepts of LabVIEW programming inLabs 10 and 11, and it will be good to get a start on reading things. The only thing relevantthis week is that we introduce the case structure (LabVIEW’s analog of the If-Then-Else

construction of normal programming languages) in a very simple way (toggle switch to turnthe feedback loop on and off). Look in particular at the Powerpoint presentation, slide 72.

77

Page 78: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

78 CHAPTER 9. BUG 2: TEMPERATURE CONTROL

9.3 Experiments

1. Introducing the Control Game. We begin by explaining how to play the “controlgame.” The object of the game is to regulate the temperature about some desired “setpoint.” We’ll arbitrarily fix our set point at 40 C. Now go back to the circuit youmade last week for measuring the temperature of the Bug.

2. LabVIEW programming: Use an overall While loop with a 100 ms execution time.(Use a Wait until next ms multiple node.) This time will be needed for the mea-surement of the temperature, for the computations in the control loop, and, in the finallab, for the RC-decay measurement. By using the Wait until next ms multiple

node, we will make the program wait for a full 100 ms, regardless of how long the op-erations inside the loop actually take. This will ensure that the loop interval stays thesame, despite any changes in the computer load, etc. Now, inside the While loop, placea Sequence structure with four separate frames. (Right-click the Sequence structurebox to add another frame.) These frames ensure proper sequential execution of theprogram.

(a) In Frame 1, read temperature for 20 ms, acquiring at 48 kHz, and compute theaverage using a Statistics node. Empirically, this amount of averaging N gavegood results on our test Bug. It’s possible yours will be better off with a differentvalue. But start with this one. This will be our raw signal. From last time, whatdo you expect the standard deviation about this average value to be (in C)?What is it for a single measurement? This average value will be the temperaturereading we use for our control loop. As before, output your temperature signalinto a chart. Have the chart record the last 30s of data. (On the front panel,right-click the chart and see Chart History Length.) One other subtlety is thatit will be better to convert the data structure coming out of the DAQ assistantVI (which has the temperature data, the time stamp, etc.) to a simple double-precision real number (without time data). Use a conversion node (DBL) to dothis. (See All functions – Numeric, etc.) There is no need for a WriteLVM node;we won’t be saving the time series to disk for this lab.

(b) In Frame 2, place the supplied PID sub-VI and wire up the needed controls (Kp,Ki, Kd, set point). You can get the time interval (100 ms) from the control forthe loop time. You also need to let the sub-VI know the lower and upper limits ofthe output (0 and 1.6 V). Since these won’t be changing, you just use constantsto set them.

(c) In Frame 3, put in a select node, controlled by a flip switch. Use this switch toselect the output. Wire the output of the PID sub-VI to the “true” branch. Wirea knob control to the false branch. Take the output of the select node to theinput of the DAQ assistant controlling the analog out to the heater.

(d) In the last frame (number 4), compute statistics relating to the quality of the

Page 79: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

9.3. EXPERIMENTS 79

temperature control. Make a property node of the chart that contains its accu-mulated data (up to 30s worth) and use another Statistics node to computethe range (maximum − minimum), as computed over the last 30s. This will beour measure of how much the temperature is fluctuating.1

3. No control. Having created a program to control the temperature, we will start byfirst establishing a benchmark for control. First, record a typical range of fluctuationsaround 40 C by setting the power to a constant value. (In other words, you don’tput on any control at all. Call the range over 30 s. Jno control. Hopefully, temperaturecontrol will lead to a smaller J !

4. Manual control. Disconnect temporarily the analog programming input to the powersupply and repeat as above, except that this time, adjust the temperature by hand tostabilize the temperature and try to reduce J . See how low you can get Jm knob.

5. Computer-knob control. Replace the 25-pin connector in its slot on the rear of theXantrex power supply, to allow its output to be “programmed” by the analog out ofthe DAQ. Repeat the control game, this time controlling the output by controlling theknob on the computer. (Have the toggle switch down, so the output comes from theknob. Call your best score Jc knob. Is it higher (worse) than Jm knob? If so, why do youthink that is?

6. Proportional Control (P). Next, flip the toggle switch to engage the feedback loop.Make sure the set point is 40 . We begin with proportional control. Because we wantto be able to turn off the integral and derivative terms, we use the parametrization Kp,Ki, and Kd. Still stabilizing about a set point of 40 C, choose a small initial valueof Kp (try 0.1), while keeping Ki = Kd = 0. See what J is. Now put a small tubeover the bug to shield it from direct air currents. Now what is the J? Investigate theeffects of different choices for Kp. For each Kp, record the J statistic. Also record itsTavg. Plot Tavg vs. Kp. Does it have the form predicted by Eq. 4.8 of the referencemanual? (Try a curve fit with the proper form.) Plot Jp vs. Kp. Is there an optimumvalue of Kp? You should find that there is an instability of the temperature for someK∗

p . Don’t let the temperature “run away” too much! Estimate the period τ of thetemperature oscillations for Kp ≈ K∗

p .

7. Proportional-Integral Control (PI). Now we consider the effects of an integralterm. Reduce Kp to about 0.5K∗

p . Slowly increase Ki. (Its value will be numericallyrather smaller than K∗

p .) What is the asymptotic error (setpoint minus the actualtemperature) now? Record Jpi as a function of Ki, fixing Kp. Then vary both Kp and

1This is a conservative measure. People sometimes use the standard deviation of the points about theiraverage. Obviously this gives a smaller number. If all you care about is the typical distance from the stablevalue, this is reasonable. Our criterion keeps track of the worst case over 30s. The choice of a time period of30s is also somewhat arbitrary. We will need stability over roughly this time period for our measurements.Also, if we choose something longer than 30 s, then the lab will be slow!

Page 80: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

80 CHAPTER 9. BUG 2: TEMPERATURE CONTROL

Ki to try to get the best value of Jpi. To see what increasing Ki does, let the systemstabilize with values of Kp and Ki. Now increase Ki. Look at the transient response.Repeat for increasing values of Ki.

8. Proportional-Integral-Derivative Control (PID). Lastly, we consider the effectsof the derivative term. Start to increase the Kd term from zero. As you do so, youshould find that eventually you can increase Kp well beyond the K∗

p value. Once youget a good balance between Kp and Kd, try nudging both up together and see howbig you can go. What happens when Kd is too big? Use Jpid as your figure of meritfor quality. (Strictly speaking, the amount of averaging N is also a parameter andone could also imagine varying that, as well. That gives a four-parameter space toexplore!)

9. Playing around. Now that things are working pretty well, play around some. Trychanging the set point up and down. What is the response look like? Why are theydifferent? Get a sense of how the PID loop responds to perturbations by blowing, etc.,on it and seeing what happens. Try covering the Bug in different ways to protect frombreezes and other such perturbations.

10. OPTIONAL (Step response of a P-controller): Another way of characterizing adynamical system (fancy words for the system you are controlling) is to look at its stepresponse. Make a small increase to the heater output in the open-loop system (i.e.,without the controller), and record how the temperature rises to its new steady-statevalue. This is the open-loop response of the system. Now make a slight decrease. Doyou get the same result? The closed-loop response is obtained in a similar way, exceptthat now you make the change in the setpoint and your response is measured with thefeedback loop on. Look at the closed-loop step response for a proportional controller,for various values of Kp. Describe what is happening as you increase Kp. (Hint: you’veseen a similar dynamical response in a previous lab....)

And the winner is...

At this point, you will have played the control game six ways and come up with a score foreach: Jno control, Jm knob, Jc knob, Jp, Jpi, and Jpid. Comment on their rank (which is best,next best, etc.) and try to explain the differences.

Everything we have done so far has been at T = 40 C, but we will be interested intemperatures from room temperature to 80 C. With your best choice for Kp, Ki, and Kd,measure J for set points of 25 and 70 C. Try to get the system to regulate at 22 C. Whydoes this not work so well?

Epilog

The “control game” that we have been playing in this chapter has a more formal name:“optimal control.” The idea is that if you can formulate a function that assigns a number

Page 81: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

9.3. EXPERIMENTS 81

to the control loop – in our case, the function was the RMS deviations averaged over atime interval of one minute – then you can look for the “best,” or “optimal” values ofthe parameters in your control loop. These are just the ones that minimize your “penaltyfunction.” Optimal control is a field unto itself. The rough idea is that if you can characterizeyour system and the effects of any feedback loops mathematically and evaluate the penaltyfunction J(Kp, Ki, Kd), then you can find the optimal values of any parameters (such asKp, Ki, and Kd) by taking derivatives: ∂J/∂Kp = ∂J/∂Ki = ∂J/∂Kd = 0. Of course, youhave to make sure you have indeed found a minimum. Here, we let you manually search thePID parameter space (Kp, Ki, Kd), with some guidelines given. But you can imagine thata recipe to give the best values would be helpful. This is where measuring the frequencyresponse of the physical system (i.e., its transfer function) is helpful. This allows one tocreate a model of the system and then to analyze – on a computer – the effects of differentparameters and to search for the best combination.

The PID control law turns out to be the right form of control law to choose if thedynamical system that is being controlled has an open-loop response that looks first-order(“RC-like”) or second-order (“LCR-like). Real systems – including the Bug – have morecomplicated dynamics. (They are like a big network of resistors and capacitors wired togetherin a complex way.) As a result, one can do better if one allows the control algorithm to bemore complicated than the PID form we use here. But, as you will have seen, even on acomplex system, the PID algorithm can do pretty well, and for this reason, it is universallyfound in general-purpose controllers, both in the lab and in industry.

Page 82: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

82 CHAPTER 9. BUG 2: TEMPERATURE CONTROL

Page 83: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 10

The “Bug,” Part 3: Measuring C byRC Decay

10.1 Goals

• Measure capacitance by RC time dependence.

• Data acquisition: Notions of triggering, averaging.

• Data acquisition: Basic notions about state machines

References

10.2 Prelab Questions

1. Show that the time dependence of the voltage across a capacitor is given by

(a) V (t) = Vo exp (−t/τ) (discharging)

(b) V (t) = Vo [1− exp (−t/τ)] (charging)

where the time constant is given by τ = R C.

2. Study the supplied state-machine example from the 6-hour LabVIEW tutorial availablefrom the course website. (Powerpoint presentation, Section X, slides 80-85.) Whenyou’ve understood the examples there, download the “Lab 10, Starting VI” from thecourse website. Trace through the logic and make sure you understand what’s goingon. Ask us for help if not!

3. Write an Igor function to automatically fit multiple RC-decay data sets. The functionshould take a series of Ndat data sets of Nseg points, extract the V (t) curve into awave, fit an exponential through each curve, and record the decay time into a wave.At the end of the loop over data sets, compute the average of the decay times and the

83

Page 84: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

84 CHAPTER 10. BUG 3: RC DECAY

standard deviation of the decay-time mean and then print those numbers. See the file“Lab10data” on the course website for an example data set. You should find a decaytime of ∼1.1 ms, with a standard deviation of less than 1 µs. The file format we shalluse has two columns of numbers (time and voltage).

To do this exercise, you can start from the extractor function of Lab 6 and makeappropriate modifications. One big simplification is that we don’t really need to makea wave for each decay segment. Rather, we can simply let the curve-fit operation acton a sub-range of the single wave that has all of the voltage data from the differentruns. To save you time rummaging around the help file for the curve-fit operation,here’s that command, with the needed options:

CurveFit/G/Q/N exp XOffset vwave[pstart,pend] /X=twave

The N flag suppresses the window showing updates during the run. The Q flag sup-presses printing to history. The G flag means that you will supply the initial guessesfor the fit. (Igor can do an auto-guess, but I found that it does not always work for alldecays.) Those guesses are supplied through system variables K0, K1, and K2, whichshould be defined as

K0+K1*exp(-(x-W fitConstants[0])/K2)

The exp XOffset function has the advantage of being able to specify an x offset. (It’snot a fit parameter because it is not independent with respect to the amplitude param-eter.) This means that if we adjust the starting time to be that of each data segment,the auto-guess feature will work, so that we don’t have to worry about the initial guessfor the curve fit. To set the x offset, create a single-element wave called W fitConstantsand set its element to the first time element of the decay. (W fitConstants will changeas you go through your loop, but you should be able to use the same K0, K1, andK2.)

In addition, it is important to define and set a variable called V FitOptions as follows:

Variable V FitOptions = 4

This variable suppresses the dialog box that asks you to confirm that the fit is ok. Thecumulative effect of these flags is to suppress all actions except finding the coefficients.That’s what we want for this function whose sole purpose is to extract the decay time(and an estimate of its statistical error).

One subtle point in estimating the mean of the decay times is that they can vary for twoseparate reasons. As illustrated in Fig. 10.1, there are both measurement errors (noise inthe voltage readings) and physical fluctuations in the decay time (capacitance) itself. The

Page 85: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

10.3. EXPERIMENTS: C BY RC 85

latter can arise, for example, because the temperature control is not perfect. (In this lab,there is no temperature control, so it’s even more of a factor. In the next, there will be, butit won’t be perfect, as you saw last week.) Thus, there are two reasons for the decay timesto vary from measurement to measurement. Estimate which effect is likely to dominate. Todo this, you will need to know that C changes by a factor ∼2 over about 50 C. Hopefully,you’ll see this in next week’s lab! For voltage noise, use a typical figure from your previousexperience with the DAQ. In any case, as long as both noise types average to zero, bymaking more and more measurements, we expect to determine the intrinsic value of C moreand more accurate (as expressed by the standard deviation of the mean). In the case wheretemperature fluctuations mostly cause the variations in C, it will be important to recordthose, as well, so that one ends up with an average temperature (which will be different fromyour set point) and average decay time (capacitance).

V(t)+

+

!m

!p Vout(t)

Figure 10.1: Measuring a quantity that has random variations (of standard deviation σp)and random measurement noise (of standard deviation σm). When σp σm, the variationsin Vout(t) are mostly real variations of the quantity V (t) itself. The reverse is true whenσm σp.

10.3 Experiments: C by RC

1. Hand measurements. This week, we will focus on measuring the capacitance C ofthe Bug. There are many ways to do this, including using the capacitance functionof the DMM, but that will be cheating here! (More to the point, we want a way tomeasure the time constant automatically – not by hand.) Our strategy will be to lookat the time-dependent charging and discharging of the capacitor in an RC circuit. Asalways, however, we start by doing this roughly “by hand.” Wire up a series RC circuit,using the Bug and an external resistor. Choose R so that the nominal value of C givesa time constant on the order of 1 ms. Connect the input to the circuit to the functiongenerator, and output a 0 to 5 V square wave. Choose a frequency of just under 50Hz. (This will be important for next week.) From the oscilloscope, estimate the decayconstant and, from that, see whether this is compatible with your expectation, givena measurement of R. (You can use the DMM to get a better value of R.) For all ofthe labs this week, do not connect the Bug’s heater (i.e., your measurement of C willbe at room temperature, whatever that is).

Page 86: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

86 CHAPTER 10. BUG 3: RC DECAY

2. Single-pass experiment. Now, we want to automate this. Our goal will be to getan accurate record of the discharge curve onto disk. We will proceed in two stages:

(a) Data acquisition. We will use a slightly different technique to acquire our data. Inmeasuring frequency-response curves, we measured simultaneously the input andthe output and made relative phase measurements. We could do the same thinghere, recording the square wave as input and the voltage across the capacitoras output, but we’ll use a different approach. We aren’t really interested in thesquare wave waveform in itself. We really just want to know when the capacitorstarts to charge or discharge, as a way to know when to begin our data acquisition.This leads to the notion of triggered data acquisition, where the DAQ starts thedata acquisition on receipt of a trigger signal, which is supposed to be the risingor falling edge of a square wave (5 Volt, TTL signal, i.e. 0 is low and 5V is high).(Since our “Synch Out” signal on our function generators does not conform toTTL standards – it’s ±1 V, not 0 and 5 V, we make our input to the RC circuita 0-5 V square wave. That way, we can also use it to trigger the DAQ.)

The timing sequence is

i. Wait for the trigger (falling edge of TTL signal).

ii. Upon trigger, acquire Nseg samples at interval ∆t.

iii. Save to disk.

Triggering on the falling edge, we record only the discharge signal. Implement theabove, and use it to record some charge and discharge curves to disk. They shouldmatch what you saw on the oscilloscope. (The oscilloscope also uses triggering tostart its sweep, so you are already familiar with this notion.)

trigger

input signal

RC-decay signal

time

Figure 10.2: Timing schematic showing data captured from a triggered RC decay.

(b) Data analysis. Now that you have acquired a discharge curve, you can analyze itby doing a curve fit to extract the time constant RC. With that and the valueof R you previously measured (with the DMM), you can extract C. Because we

Page 87: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

10.3. EXPERIMENTS: C BY RC 87

want to do a good job in measuring C, we will focus on details of how the curvefits are done. This part should be done in Igor. You should explore the following.

3. Multipass experiment. The preceding gives us a curve that we could analyze.However, as we have emphasized in previous labs, it is important to estimate statisticalerrors by doing repeat measurements. You might be tempted to use the curve-fit errors,but this might be misleading in that they assess the statistical error from the voltagesmeasured in a single decay. Since we will be measuring temperature effects and thetemperature may fluctuate a bit over time, it is better to acquire several decay curves,fit to the decay time, and then average those decay times. The standard deviation ofthe mean is then a more realistic assessment of the measurement error. Fortunately,in a computer-controlled experiment, all of this is straightforward.

(a) Data acquisition.

i. For-loop: The obvious way to take multiple data sets is to use a For loop,as we have done previously. Write such a loop and use it to save 10 RCmeasurements to disk. Check the data with the analysis routine, below.

ii. State machine: We introduce a more complicated way to do this, using “state-machine” concepts. The complication will pay off next week when we haveto integrate the temperature control routines of the previous weeks with theRC-decay data acquisition. The basic idea of a state machine is to set upa repetitive loop (While loop) that evaluates a logic condition each passthrough the loop in order to decide what to do. The very simplest exam-ple is the While loop itself. In the loop, you keep executing until someonehits the Stop button. In a more general example, you loop through at somepredetermined rate (using a timer). Each time through the loop, you executecode depending on various conditions. For example, you can do somethingN times in response to a trigger stimulus.

iii. Write a VI that will save N RC decays – computed on N passes throughthe loop – after you hit a button. The starting VI will show you more orless what to do. Put a timer on the loop and set it to 100 ms/loop. Addthe acquisition and modify appropriately the saving part. Next week, we willreplace the manual button with a signal that states that the temperature issufficiently stable and close to the desired set point to begin acquiring thedata. Use your program to acquire 10 RC measurements to disk. The resultshould be similar to what you got with the For loop, above.

(b) Data Analysis. Now that you have saved your multiple decay curves to disk, loadthe data into Igor and analyze using the function you wrote for the prelab. Youshould be able to extract the average and standard deviation of the decay timesfor the N curves in each data set. Check your Igor function by fitting one or twoof the curves “manually” (i.e., using the menu-driven curve fit in the Igor dialog)to check that your program is giving reasonable numbers.

Page 88: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

88 CHAPTER 10. BUG 3: RC DECAY

Page 89: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 11

The “Bug,” Part 4: Putting it alltogether – Temperature Dependenceof a Capacitor

11.1 Goals

• Measure C(T ).

• Data acquisition: Combine temperature control, RC-decay measurements; sweep T .

• Data analysis: Estimate Tc. Compare results with classmates.

References

• M. Kahn, “Multilayer ceramic capacitors – materials and manufacture,” technical re-port from AVX Corp., Myrtle Beach, SC (USA). (See course website.)

• M. Trainer, “Ferroelectrics and the Curie-Weiss law,” Eur. J. Phys. 21, 459 (2000).

11.2 Prelab Questions

1. Make a rough logic diagram for the control logic to be used in this week’s lab. Specif-ically, implement the three conditions listed below in the experiment in a flow-chart-like diagram. It doesn’t have to use official LabVIEW symbols, but it should indicateclearly the logical decisions that will be needed in the VI.

2. The second part of the data analysis in Igor will require a function that does thefollowing: for a wave that has Ntemp×Ndat temperatures, with Ndat measurementsof a supposedly constant temperature at Ntemp different temperatures, compute theaverage and standard deviation of the mean of each temperature cluster. The result

89

Page 90: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

90 CHAPTER 11. BUG 4: ALL TOGETHER NOW

should be to create two waves, each with Ntemp elements. One will have the averages,the other the errors for each point. Have your function do the same for a second wavecontaining a series of decay times. Applying your function to the sample data in thefiles “Lab11data1” (RC decays) and “Lab11data2” (temperature), make a plot of theaverage waves (decay time vs. temperature), with x and y error bars. The data setshave 6 temperatures, 10 averages, and 480 points per RC decay. Append to your grapha plot of the two original decay and temperature waves. The result should be two plotsthat at first glance look the same. However, if you look at an enlargement around asingle point, you will see the average with its error bars surrounded by a “cloud” ofthe original points. Show this blown-up graph, too.

11.3 Experiments

1. Data acquisition: At long last, we are ready to tackle our problem of measuringC(T ) for the Bug. To start, you should have separate working LabVIEW programsto control the temperature T and to measure the capacitance C by triggered signalacquisition of the decay of a series RC circuit. Your next task is to put these together.As usual, do this in two steps:

(a) Single temperature. Combine the two VIs so that you can both regulate Tand measure the RC response at the same time. As a guide, look at the timingdiagram (Fig. 11.1.) The basic idea is that every cycle you do three things: readthe temperature, compute (using PID) the heater output, and record a triggereddata acquisition of an RC decay. Then there is a fourth, logic-control step, whereyou decide whether to save the data to disk (Use one WriteLVM node to savethe RC-decay data, as you did last week. Use a separate WriteLVM node to savethe temperature, as taken from the PID sub-VI.) Before saving the data, threeconditions must be met:

i. The temperature must be stable enough. We measure stability, as in Week9, via the total range of the previous 30s. You should decide a reasonablecriterion (0.1 C, 0.01 C, or whatever). (You will find that, because it isharder to regulate about room temperature, that you need to have a loosercriterion near ambient. Since the peak is somewhere near room temperature,it is important to get data in that temperature range.)

ii. The temperature must be close enough to the desired set point. This isnecessary to take care of the following case: the moment you change your setpoint, the temperature will be stable but still far from what it (now) shouldbe.

iii. The number of RC decays already saved should be less than the desirednumber. You had a condition like this last week.

These conditions are implemented with logic elements that are similar to, but

Page 91: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

11.3. EXPERIMENTS 91

more complicated than, the ones used last week to make a state machine forrecording multiple RC decays. For this part, use a loop time of 100 ms. Checkthat everything is executing in the proper time (for example, by looking at thetime stamp on data that are recorded to disk or by using a timer and shift register).If there is a consistent problem, you can try lengthening a little the cycle time.

(b) Temperature sweep. The last step is to add control logic to implement thetemperature sweep. The general idea is that you start with a control that sets theminimum temperature (Tmin). You also should have controls for the temperatureincrement (dTemp) and the maximum temperature (Tmax ). After the counter forthe RCdecays has decreased to zero, you reset it. In the same place, increment thetemperature set point, as well, and test whether it is greater than the maximumvalue. If so, stop; if not, continue. In general, we want to sweep from as close toroom temperature as possible (probably about 25 C to 70 C, with an adjustabletemperature increment. (1 C is probably reasonable.) You might have to do theruns near room temperature with different settling criteria, as the feedback loopsdon’t work as well there.

(c) Finishing up. A very important last step is to make sure the heater is off eitherwhen the user aborts or when the sweep is finished. In general, in LabVIEW,one has an overall Sequence structure of three frames. The left (first) one hasthe initialization routines; the middle the major While loop; and the right (last)one has the finishing-up routines. Use such a structure and make sure that yououtput a 0-V signal to the heater.

2. Data analysis.

(a) Now, starting from the Igor analysis routine you used from last week, write aprogram to batch analyze your decay curves and come up with a final C(T ) curve.You can use the program from last week as a first step. The only difference isthat now there will be N = Ntemp ∗ Ndat decay curves to analyze. You canjust enter that number when you execute, or, more elegantly, add another inputvariable and have Igor do the multiplication for you. The output of that programwill be a wave that has N decay constants. You should similarly have a separatefile (that can be loaded into an Igor wave) of temperatures recorded at the timeof each decay. So, a first step is to just graph those two waves together. This willgive a series of “blobs” about each T − C pair with Ndat points scattered in atight cluster. You should then use the Igor function you wrote for the prelab tocompute the average and standard deviation of the average for each point. Theresult should be graphed as a curve with error bars in both x (temperature) and ycapacitance. Is the C(T ) curve consistent with the preliminary one you measured4 weeks ago?

(b) The peak you (should) see is obviously an interesting feature. (The peak is verynear room temperature. If you don’t see it, try getting data at lower tempera-

Page 92: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

92 CHAPTER 11. BUG 4: ALL TOGETHER NOW

tures.) From your data, make your best estimate of its value. You may want to tryfitting a function with a maximum near the peak to extract the peak temperature.Can you find a reasonable functional form?

(c) Compare the C(T ) curves you measure with those obtained by your fellow stu-dents. Do the curves agree to within statistical errors? If not, can you think ofreasons why?

(d) If you were a manufacturer selling these capacitors, what would be a reasonableway of characterizing them? Think about how to characterize not only theirindividual C(T ) but also the variation from capacitor to capacitor. How do youtell a potential customer for these capacitors what to expect – without givingthem a full technical report!

Total loop time (100 ms)

Acquire Temp.

(20 ms) PID

(<5 ms)Triggered Acquisition of RC decay (20-60 ms)

Control logic

& save to disk

(<15 ms)

Extra time

Figure 11.1: Schematic of the timing in the individual loop. The logic steps must determinewhether the temperature is stable, whether one still needs to take more RC decay curves,whether the set point is below the maximum value, etc.

11.4 Requiem for a Bug

The big peak in the C(T ) comes because the material in the capacitor is ferroelectric andwe have crossed a special temperature for ferroelectrics known as the Curie temperature, Tc.A ferroelectric material is the electrical equivalent of a magnet (the “ferro” in ferroelectrichas nothing to do with iron but is coined as an analogy to ferromagnet). The molecules thatmake up the material all have permanent electric dipoles attached to them that can changetheir orientation. The microscopic state of the material is summarized in Fig. 11.2. In (a), athigh temperatures, disorder (entropy) dominates and the dipoles have random direction frompoint to point. In (c), at low temperatures, energy considerations dominate, and the dipolesalign. However, because the material is a polycrystal, there will be small domains, with the

Page 93: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

11.4. REQUIEM FOR A BUG 93

orientation in each domain varying from domain to doman. In (b), at a special temperatureknown as the Curie temperature, Tc, there is an intermediate situation bordering betweenorder and disorder. Here, the molecules like to align but they still have some freedom toreorient. The result is large groups of molecules that temporarily align in one direction, andthen another, and another, ... , following a kind of collective motion. The Curie temperatureTc is known as a “phase-transition” temperature, between the disordered “para-electric”phase of high temperature, with no dipole alignment, and the ordered “ferroelectric” phaseat low temperature, with local electric dipole ordering.

Electric field

(a) (b) (c)

T < TcT ~ TcT > Tc

Figure 11.2: Ferroelectric material in a vertical applied electric field. (a) At high temper-atures (> Tc), the dipoles fluctuate freely, with little interaction with their neighbours andshow little aligning effect from the field. (b) Near the Curie temperature Tc, the spins areon the verge of ordering and are very susceptible to being aligned by the field. (c) At lowtemperatures (< Tc), in the ferroelectric phase, the domains with aligned spins block eachother from reorienting.

What does all of this have to do with capacitance? Well, recall that the charge Q on acapacitor is Q = CV , so that we can think of C as being the amount of charge induced pervoltage (or electric field) applied. In Fig. 11.2(a), an applied E-field will have little effectbecause thermal disorder will fight any ordering effects of the field. In Fig. 11.2(c), theordering of dipoles will also not change much because each crystal grain is locked in placeby all the others. However, in Fig. 11.2(b), at the special Curie temperature, a small fieldcan lead to a significant reordering. We are at the “tipping point” where the molecules arejust about to order, and thus it takes only a small perturbation to decide what that orderingdirection will be. Since a large amount of ordering implies a large charge to the surface, weconclude that at (or near) Tc, we expect the capacitance to become large.

In a very pure ferroelectric material, the expected C(T ) resembles the form sketched inFig. 11.3(a). In an impure material, where the impurities are incorporated into the solid’scrystal lattice, the effect is to have Tc temperatures that are locally shifted by the randomeffect of the nearest impurity molecules. Thus, one can think of the overall response of thecapacitor as the sum of a lot of different response curves, each shifted by a small amount

Page 94: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

94 CHAPTER 11. BUG 4: ALL TOGETHER NOW

up or down from the “pure” state. The situation is roughly as depicted in Fig. 11.3(b).Summing all those contributions up gives the observed response curve Fig. 11.3(c).

An overview of ferroelectric materials, their physics, and their uses may be found at http://www.sou.edu/physics/ferro/nsf wht.htm. The capacitors we use have a dielectric thatis a mix of materials known, to its friends, as “Z5U.” The main ingredient is Barium Titanate(Ba Ti O3). You can read more about it in the article mentioned in the reference (see coursewebsite).

(a) (b) (c)T

C

Figure 11.3: Capacitance of a ferroelectric material vs. temperature. (a) Response of asingle-crystal. Peak is at the Curie temperature Tc. (b) Individual contributions fromdifferent crystal grains to the capacitance of a polycrystalline material. (c) Overall measuredcapacitance of a polycrystalline ferroelectric material. Overall peak is still at Tc, but theindividual contributions broaden the curve and make its shape more like a Gaussian.

As we mentioned at the start, the Bug experiment has all the features of a modern,computer-controlled experiment, including measurement and control of the crucial dependentvariable (T ), signal averaging, automated sweep, recording to disk, automated data analysis,etc. These are found both in research laboratories and in industrial testing. If you’ve madeit this far, you are in good shape for working in either university or industry labs.

Page 95: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 12

Epilog

Now that the course is done, here again is the “Big Picture” of what we hope you will havelearned. We can schematize the work of an experimentalist by the Figure below.1

Model for experimental investigation While we were working on the goals for our laboratory courses, Steve and I thought that it would be useful to think about how we go about doing experiments, as we hope students will learn how to do experiments during these courses. Then goals at each level can be based on the level of sophistication we expect as students develop these abilities. Here is a simple schematic of what we think of as being standard practice. Please let us know if you know of an official reference for this sort of picture!

Formation of hypothesis

Observation of phenomena

Experimentation

Synthesis of results

Communication of results

Represent data Document

Execute

Design

Analyze

Figure 12.1: Schematic of the experimental process.

1We should say this summarizes the work in an ideal world. In most cases, all of this coexists with themessy reality of everyday life, where we juggle different classes, friends and partner, going to the pub, etc.Somewhere in all of that, experiments do get done!

95

Page 96: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

96 CHAPTER 12. EPILOG

In more detail, what we are hoping you will have acquired at this level is summarizedbelow:

Stage 1: Motivating the experiment based on a hypothesis or observations

• Hypothesis

– Not expected at this level

• Observations

– Able to use standard scientific apparatus (voltmeter, multimeters, oscilloscopes)to measure quantities that are not directly observable (e.g., voltage, current, tem-perature)

Stage 2: Experimentation

• General

– Able to follow instructions for use of scientific equipment

– Able to take a condensed set of instructions and fill in the details with someindependence

• Design

– Able to formulate a plan in advance of the lab period and carry it out flexiblywhen faced with setbacks

– Able to verify that preliminary results are reasonable

– Develops skill at using preliminary results to further refine a measurement

– Understands how to use descriptive statistics (mean, standard deviation, fullwidth at half maximum, rms, etc) to assign a measurement value and assessits uncertainty, and their role experimental design

– Recognizes the basic probability distributions (binomial, Poisson, Gaussian, etc.)and their role in experimental design and scientific inference (measurement ofphysical quantities and their uncertainties)

– Able to use the computer to model functional relationships

• Execution

– Able to choose the best method of measurement given two possibilities

– Most data acquisition elements treated as black boxes

– Familiarity with voltmeters, multimeters, oscilloscopes, function generators, powersupplies

Page 97: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

97

– Sensors

∗ Understands role of sensors in converting a physical effect into a voltage

∗ Understands need for calibration and is familiar with basic associated con-cepts

∗ Familiar with basic sensors for temperature (thermocouple), sound (micro-phone), velocity (inductive coupling),

– Analog-to-Digital conversion (A/D)

∗ Able to set appropriate sampling frequency

∗ Signal conditioning able to condition signal to use full dynamic range of A/Dand limit the effects of quantization

∗ Anti-aliasing use of passive filters to limit bandwidth, some Fourier analysis

– Computer

∗ Able to use data acquisition program

∗ Able to transfer data from one format to another

– Digital-to-analog conversion (D/A)

∗ Familiar with use of voltage to control actuator

∗ Power Amp use of Power Amp to provide power for actuator

– Actuators familiar with basic actuators (voltage-controlled frequency generator,heater, etc.)

∗ Representation

– Able to use 2D scatter plots to assess relationships among measured quantities,especially linear, exponential and powerlaw

– Recognizes the role of such relationships in determining physical parameters

– Able to use computer for simple data visualization

– Able to use computer to generate publication quality figures

• Documentation

– Recognizes the value of documenting progress in the experiment in a timely man-ner

• Analysis

– Propagates experimental uncertainties using chain rule

– Brief exposure to the role of matrix algebra in experimental uncertainties

– Understands the role of statistics in quantifying ones knowledge of such relation-ships

Page 98: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

98 CHAPTER 12. EPILOG

∗ Use linear least squares to find parameters and uncertainties

∗ Understand how to use residuals to assess the model, and improve it if nec-essary

∗ Preliminary exposure to the role of matrix algebra in linear least squares

– Able to use standard analysis package to visualize data, compute least squaresfits and related statistics

Stage 3: External communication

• Preparation of formal report based on standard physics paper structure

This is a long list and one you will no doubt come back to in other lab courses (in moresophisticated ways). But we hope that by trying to be explicit in what we hope you willlearn, we will make it easier for you to focus on any gaps you may have.

Page 99: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

Chapter 13

Appendix: Programming Concepts

While this is not a programming course, we do end up doing a certain amount of program-ming. In its current incarnation, we are using LabVIEW for data acquisition and Igor fordata analysis. In what follows, we summarize, for reference, the programming concepts etc.that are introduced each week. Numbers refer to the week in the lab course (1-12).

1. LabVIEW : basic metaphors (front panel, block diagrams). Simulate Signal, DAQ

Assistant, Waveform Graph, Write LabVIEW expressVI.

Igor : basic metaphors (experiment, wave, history). Graph cursors. Wavestats.

2. LabVIEW : While loop. Stop button. Numerical indicators and controls (includingmeters, etc.). Millisecond timer.

Igor : Defining and plotting a simple numerical function. (Three steps: make a wave;define its x-scaling; and evaluate it for your functional form. The first two are in theData menu (Make Waves and Change Wave Scaling). Use of the Graph options to setrange of axes, change plot type, etc. (You can also doubleclick on axes or traces to dothese.)

3. LabVIEW : For loop. Subtleties of Write LVM expressVI (file append, file naming,etc.). Use of DAQ Assistant for counter.

Igor : Functions as programs. Numpnts function. Make operation. Implicit loops withpoint index. Histograms. Monte Carlo: gnoise, pnoise, (and enoise).

4. LabVIEW : timing issue subtleties. (Min. loop ∼ 20 ms.)

Igor : More on functions. Local declarations of waves. FindLevels, DeletePoints,Duplicate operations. ‘=’ vs. ‘:=’ in wave assignments. Saving graphs / graphmacros.

5. LabVIEW : Flat Sequence structure. DAQ Assistant for analog out. Knob control.

99

Page 100: PHYS 231 Lab Manual 041-061/053/Lab Manual.pdf · 2005. 11. 16. · PHYS 231 Lab Manual Department of Physics Simon Fraser University Last updated: November 8, 2005

100 CHAPTER 13. APPENDIX: PROGRAMMING CONCEPTS

6. LabVIEW : Function node. Passing values in and out of loops.

Igor : Curve fits to pre-defined functions.

7. Continuation of previous week’s lab.

8. Igor : Curve fits to user-defined functions.

9. LabVIEW : Calibration of input and output voltages (including look-up table). Case

structure, data tunnels. Statistics Express VI (for mean, standard deviation, etc.).

10. LabVIEW : Property nodes. Sub-VIs. Low-level function node. Shift registers. Data-type conversion (e.g., double → dynamic). Select node.

11. LabVIEW : Use of constants (numeric, Boolean). Local variables (read/write). Booleancomparison (AND, OR, >, etc.). Decrementing variables. Introduction to state-machineconcepts.

Igor : Need to understand (and modify) extractor function from Lab 6. This includesa number of programming concepts.

12. LabVIEW : Absolute value function. AND gate with multiple inputs.