You are on page 1of 8

EXPERIMENT 11

CONSTRUCTION OF A COMPUTER-CONTROLLED CHOPPER


I.

Introduction

The primary goal of this experiment is to help you learn how to use LabVIEW to actively control
an instrument. This capability of LabVIEW can be highly useful to an analytical chemist since
many custom-built instruments used for research need to be placed under computer control in
order to automate a measurement or to ensure consistent data sampling. For this experiment, you
will use LabVIEW to control the frequency of revolution of an optical chopper.
A second purpose of this experiment is to allow you to gain experience putting together a
complex multi-component circuit. In building the computer-controlled chopper, you will use
several components you have already used earlier in the course, as well as some new components
(such as transistors, timing chips and DC motors) which will be introduced at the beginning of
this experiment. By working with a multi-component circuit, you will hopefully be better
prepared to design or troubleshoot your own circuits in the future.
II. Introduction to components used in the chopper circuit
A. Transistors Up to this point in the lab, you have primarily worked with integrated circuit

chips (ICs) as opposed to discrete semiconductor components such as transistors. Although


ICs usually offer many more capabilities than single transistors, there are still many
occasions when it is desirable to use a single transistor. In this lab, you will work with three
different types of transistors, each of which are introduced below.
1. Bipolar Junction Transistors (BJTs) are three-lead (base, collector, emitter)
semiconductor devices where a small current at the base can be used to control a much
larger collector current. Obtain a 2N3904 NPN transistor and look up its specifications.
Characterize the transistor as explained below.
The ELVIS station is equipped with a convenient automated program designed to
characterize NPN BJTs. Open the Three Wire Current-Voltage Analyzer from the ELVIS
launcher panel. Insert the 2N3904 transistor into the appropriate pins of the digital
breadboard. Set the base current to start at 0 A and to generate 4 curves with an increment
of 15 A. Set the collector voltage to go from 0-1V in 0.05V increments and run the
analyzer. What is the effect of increasing the base current on the maximum (saturation)
collector current? Why is this so? (Remember how a BJT works.) You can use the cursor
feature to explore the data points for each curve. Log the output of the analyzer, open it in
Excel and generate a plot of current versus voltage for the various base currents (put all of
the curves in the same plot). Print the plot and include it in your notebook.
2. Field Effect Transistors (FETs) are three-lead (gate, source, drain) semiconductor
devices where the voltage at the gate determines the drain-source impedance. Obtain an
IRF510A MOSFET and look up its specifications. Note that the package of this
transistor is larger than the 2N3904 BJT; this is not necessarily true of all FETs, it simply

means this particular transistor is designed to carry a larger amount of current than the
2N3904.
Since the three-wire current-voltage analyzer is not configured to characterize FETs, this
must be done manually. Connect the gate of the IRF510 to the positive variable power
supply on your ELVIS station, and the drain and source to CURRENT HI and CURRENT
LO, respectively. Open the digital multimeter VI and set the meter to measure resistance.
Beginning at 0V, increase the voltage in 0.5 V increments up to 6V and measure the drainsource resistance. Make a plot of resistance vs. voltage. What are the OFF and ON
impedances of the FET? Do they meet specifications (if given)? At what voltage (or over
what range of voltages) does the FET turn ON? If the FET were used as a switch, how
would it compare to the digital switch ICs you characterized in Lab 8? (Is the FET a true
ON/OFF device? How do its switching times compare?)
3. Phototransistors are a unique two-lead (collector, emitter) form of transistor where the
base is replaced by an optical element that responds to light. Light striking the
phototransistor causes a small base current to flow, which in turn controls the collector
current. Phototransistors usually respond most strongly to one particular wavelength of
light, which should be matched with the wavelength of the source. Phototransistors are
found in many locations; a common example would be inside your VCR, where they are
used to receive infrared signals from a remote control.
The phototransistor you will be using in this lab is the Ledtech LT189X-82-0125 (see
specification sheet http://www.jameco.com/wcsstore/Jameco/Products/ProdDS/112168.pdf).
It responds to infrared light, so we need an IR light source. This will be provided by an IR
LED, the Ligitek LVIR333X. In order to characterize the LED and phototransistor, set up
the circuit shown in Figure 1. Note that the LED and phototransistor look almost identical,
but a blue ring has been drawn around the bottom of the phototransistor to help you
distinguish them. Also note that the polarities of the LED and phototransistor are important;
you must be sure to connect the correct pins to the proper part of the circuit. Look at the
flattened part of the ring around the bottom of the transistors, as shown in figure 1, to
determine the correct orientation. Finally, make sure that the LED and phototransistor are
facing each other straight-on, so that the infrared light from the LED hits the light-sensitive
surface of the phototransistor.

+5V
220
+5V

IR LED

IR phototransistor

anode

emitter

cathode

collector

gap (~0.5cm)

100k

V out

Figure 1: IR LED + phototransistor sensor circuit


2

Once your circuit is set up, monitor Vout with an oscilloscope or a multimeter. What is the
voltage at Vout when the LED is on and directly facing the phototransistor? Place an opaque
object, such as piece of cardboard or multiple pieces of paper, in the gap between the LED
and the phototransistor. What happens to the output voltage? Why? Try blocking the gap
with a thin or partially transparent object, like a Kimwipe what happens to the output
voltage? Is the phototransistor sensitive only to IR light? What quick change to the circuit
could you make to test this? If you have the component you need to do so, try it!
B. 555 (and 556) timing chips Previously in this lab, you have worked with monostable

multivibrators, such as the 74121. These ICs provide a single pulse of a defined width given
an appropriate trigger. The 555 is an 8-pin multipurpose timing chip that, unlike the 74121,
also has the capability of operating in astable mode, where it produces an oscillating signal
whose frequency and duty cycle are determined by two resistors and a capacitor. The
LM556, which we will use in this lab, is a 14-pin chip which consists of two independent
555s on a single chip (only the Vcc and ground connections are shared). Look up the
specifications for the LM556 chip. It may also be useful to refer to the LM555 datasheet
because it provides additional explanation of how the various modes of the chip work.
A basic circuit used to operate one of the two timer circuits on a 556 chip in astable mode is
shown in Figure 2. For this circuit, the theoretical frequency and duty cycle (the % of the
time the output is HI) can be determined by the following equations:

Frequency =

1
0.693 (R1 + 2R2 ) C1

Duty cycle =

R1 + R2
R1 + 2R2

Construct the circuit shown in Figure 2 using a power supply voltage (Vcc) of +5V, R1 as a
1k resistor, R2 as the resistance substitution box, and C1 as an 0.1 F capacitor. Begin
with the resistance box set to 100k. Measure the output frequency and duty cycle using the
digital oscilloscope. Then decrease the resistance substitution box in steps (100k, 50k,
10k, etc.) down to 500, and measure the output frequency and duty cycle and record them
in a table in your notebook. How do the values you measured compare to the theoretical
values for frequency and duty cycle? Would it be possible to change the output frequency
without changing the duty cycle (or vice-versa)? If so, what would need to be changed?
What is the minimum duty cycle achievable with this circuit in this configuration?

Vcc

R1
1

14

13

12

C1

556

R2

11

10

Output

Figure 2: Astable-mode circuit for LM556 timer


C. DC Motors In chemical instrumentation it is often necessary to generate physical

movement of a component without manual intervention. To do so, motors must be used.


Many different types of motors exist, such as small DC motors, high-torque AC motors and
high-precision stepper motors. In this lab we will use a DC motor to convert electrical
energy into rotational motion to spin the blade of an optical chopper.
A DC motors shaft will rotate when a voltage is applied across its two terminals. There are
two principal methods of controlling the speed of rotation. The simplest is to vary the
voltage applied; the greater the voltage, the faster the motor will spin, up to the motors
maximum rated voltage. This method is often adequate, but it is limited because most
motors can only operate efficiently over a finite range of voltages (for example, 6-9V), thus
allowing only partial control over the motors speed.
A more robust method is to use a technique called Pulse Width Modulation (PWM) to
control the motor. In this technique, the full operating voltage of the motor is always
applied, but the voltage is switched on and off (pulsed) rapidly. By adjusting the width of the
ON and OFF pulses, the motors speed can be controlled. An example of PWM signals that
could be used to control a 5V DC motor are shown in Figure 3.

PWM: 75% duty cycle

PW M: 25% duty cycle


5V

5V

0V

0V

Figure 3: Hypothetical PWM signals for 5V motor control

III. Construction of an optical chopper control circuit

An optical chopper is an instrument designed to interrupt (or chop) a beam of light at a set
frequency. Choppers are commonly found in chemical instruments, often as part of a system
designed to reduce environmental noise. In this part of the experiment, you will construct a
circuit that controls a home-built optical chopper.
The circuit shown in Figure 4 generates a PWM signal whose duty cycle can be controlled by
adjusting Vin. The output of the PWM circuit drives a DC motor with a chopper blade attached,
and allows its speed of rotation to be varied. An IR LED/phototransistor combination is used to
measure the frequency of rotation of the blade. Study the circuit, then construct it and
characterize its operation. You will find that by testing each section of the circuit separately and
then combining the sections, it will be relatively simple to construct. Conversely, if you simply
put the entire circuit together at once, it may not work and it will be difficult to troubleshoot. A
recommended order of tasks for construction and characterization of the circuit is given below:
Optical chopper assembly
+5V
+15V

DC motor

Chopper blade

~220 uF
+

10k

10k
1

14

13

12

0.01 uF

556

1M

11

10

LED
anode

LED
cathode

Phototransistor
collector

Phototransistor
emitter

IRF510
CTR0_SO URCE
220

V out

+15V
+5V

100k

741
V in

(from variable
power supply)

Figure 4: Variable-speed chopper control circuit


1) Build and test the first timer circuit (556 pins 1-7 + 14).
a) What is the predicted frequency & duty cycle of the output, and how does it compare to
the actual output (at pin 5)?
b) Note that the standard output (pin 5) is not connected to the rest of the circuit; instead pin
6 is used. What does the output at this pin look like, and why? (note that you may have
to adjust the trigger level in order to see this signal on the oscilloscope)

2) Build the part of the circuit containing the 741 op amp and connect the input from the 556.
Note: the op amp is not powered with the usual +/-15V. V+ is connected +15V as usual but
V- is connected to ground. This makes the output range of the op-amp from 0 to 15 volts.
a) What is the op amp used for in this circuit?
b) What does the output look like? What effect does varying the input voltage have on the
output?
c) What is the useful range of input voltages? (where the PWM is between 0% and 100%)
3) Build the second timer circuit (556 pins 8-13). This part of the circuit acts as a pulse
follower to provide enough power to control the FET. How does its output (pin 9) compare
to the input from the op amp?
4) Connect the FET. Why is it necessary to use a FET (why cant the 556 be connected to the
motor directly?
5) When you are certain the rest of the circuit is working properly, obtain an optical chopper
assembly. In addition to the motor and chopper blade, this assembly contains the same LED
and phototransistor pair you characterized earlier, pre-mounted beneath the chopper blade so
that you dont have to worry about alignment. Wire the motor and the LED/phototransistor
circuit as shown. Note that the phototransistor emitter is connected to the CTR0_SOURCE
pin instead of +5V. This is because the +5V supply may become somewhat noisy when
the motor runs due to the motors high current draw. The CTR0_SOURCE input provides a
cleaner +5V signal which allows the frequency of rotation of the chopper to be measured
more accurately.
a) Try controlling your chopper by varying the input voltage. Observe the output signal at
Vout for several different values of Vin and acquire a sample of it using the digital
oscilloscope. Include a printout of this in your notebook.
b) What sort of waveform does the output at Vout look like? How clean are the
transitions in this signal? What determines the frequency of this signal?
Once you understand the operation of the various components of the circuit, draw a timing
diagram that shows the signal (voltage vs. time) at relevant points on the circuit. Include the
timing diagram in your notebook.
IV. Using LabVIEW to control your optical chopper

You now have a working optical chopper, but it is controlled by manually adjusting an input
voltage. It would be ideal to be able to set the chopper to a desired frequency and have the
voltage adjusted automatically to whatever value is necessary to give the set frequency. In order
to do this, some sort of feedback method is necessary. A basic flow diagram for a feedback
method to control the optical chopper is shown in Figure 5 below.

START
Measure actual frequency of chopped light

Compare actual to set


frequency (>, <, or = ?)

Set
frequency

YES

Increase control voltage

Is
actual < set?

NO
YES
Decrease control voltage
Is
actual > set?

NO

Figure 5: Flow diagram for feedback control of optical chopper


Fortunately, LabVIEW makes programming a feedback routine quite easy to accomplish. First,
we need a method of measuring the frequency of the chopper numerically. A VI which can
accomplish this is MeasureAIfreqency.vi (located on Blackboard in the folder for Experiment
11.) In order to use this VI, you must make the following connections to your circuit:
-

Disconnect Vin from the variable power supply and connect it to DAC0
Connect Vout to ACH0+; connect ACH0- to ground.
Connect CTR0_OUT (on right side of board) to TRIGGER (on left side of board)

Now you can place MeasureAIfrequency as a SubVI within another VI. To do so, use the
Select A VI button under the All Functions menu of the functions palette. The only
connection you need to worry about is the Frequency output, which will give the measured
frequency of the signal being produced by your optical chopper.
The VI shown in Figure 6 is a very simple starting point. This VI uses MeasureAIFrequency.vi

Figure 6: Simple chopper control VI

as a SubVI to measure the frequency of the chopper, and allows the user to change the control
voltage by sending the selected value to the DAC0 port using the AO update channel VI
(under FunctionsAll FunctionsNI MeasurementsData AcquisitionAnalog Output).
Note that there is no automatic feedback in this VI yet. Your task is to modify this VI so that the
user inputs a frequency (instead of a voltage) and the computer adjusts the DAC0 voltage up or
down (or holds it steady) as necessary to cause the frequency of the chopper to match the set
frequency. Note that there is no right or wrong solution, as long as the VI works as
expected. Below are some hints for programming your VI:
Hints for feedback chopper control VI:
1) Case structures can be helpful in programming a feedback routine. Another approach would
be to use a formula node.
2) Remember that only a certain range of voltages were useful for controlling the PWM (see
section III, question 2b). It would make sense to put limits on the control voltage so the
computer doesnt try to change the voltage above or below this range. Remember the
absolute limits of the DAC are 0 to +10V.
3) Once you have feedback working, you will find that increasing or decreasing the voltage by a
fixed value every time the loop runs is not effective if the increment is set too large it will
cause the frequency to oscillate dramatically around the set frequency, and if it is set too
small it will take too long for the frequency to reach the desired value. A better solution
would be to change the voltage by a larger amount when the actual frequency is far away
from the set frequency, and to change the voltage by a lesser amount (or not at all) once the
actual frequency gets closer to the set frequency.
4) Note that the chopper wont necessarily stop moving when your program stops the DAC
holds the last voltage it was set at indefinitely. You may want to write your program to set
the control voltage to 0 when the program stops.
5) If you have difficulty getting started on the feedback VI, ask a TA for assistance.
Once you have a working feedback VI, perform the following checks to see how well your VI
works, and record the results in your notebook:
1) What are the minimum and maximum frequencies that the chopper can achieve and maintain
with relatively good stability (i.e., without too much frequency drift)?
2) How precise control of frequency can you achieve? (i.e., can your chopper reliably maintain
a set frequency +/-10Hz? +/- 1Hz? +/- 0.1 Hz?)
3) Time how long it takes for the chopper to transition from stable rotation at 100 Hz to stable
rotation at 400 Hz
Try modifying your VI to improve its performance on these checks. Is it possible to create a
perfect feedback control program for this chopper? If not, what characteristics of the chopper
prevent this from being possible? Once you are satisfied with your VI, print a copy of its front
panel and block diagram and include them in your notebook.

You might also like