* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Laboratory Exercise 12 – Process Control Applications
Current source wikipedia , lookup
Control system wikipedia , lookup
Variable-frequency drive wikipedia , lookup
Electrical substation wikipedia , lookup
Power inverter wikipedia , lookup
Pulse-width modulation wikipedia , lookup
Alternating current wikipedia , lookup
Surge protector wikipedia , lookup
Stray voltage wikipedia , lookup
Integrating ADC wikipedia , lookup
Oscilloscope history wikipedia , lookup
Analog-to-digital converter wikipedia , lookup
Voltage optimisation wikipedia , lookup
Voltage regulator wikipedia , lookup
Resistive opto-isolator wikipedia , lookup
Power electronics wikipedia , lookup
Current mirror wikipedia , lookup
Buck converter wikipedia , lookup
Schmitt trigger wikipedia , lookup
Mains electricity wikipedia , lookup
Laboratory Exercise 13 – Digital to Analog Conversion Hopefully we’ll have talked about this in class before you get to this lab, but one widely used type of computer interface that our PMD (personal measurement device) offers is Digital to Analog Conversion, a.k.a., DAC or D/A (pronounced D to A.) In this type of communication, an adjustable voltage is generated by the computer for use in the outside world. Since the computer “thinks” in digital, but the voltage that goes out to the real world can take a wide range of values (almost analog) this name makes some sense. With the DAC, you will be using a VI to output a number to the interface that it will turn into an output voltage that is proportional to the size of the number. In order to finish this discussion, we have to invoke the idea of a range; for argument’s sake, let’s say that the range of the digital side is 0 to 4095 and the range of the analog side is 0 to 1 volt. The most obvious way to link the two ranges together logically is to say that digital 0 equals 0 V and digital 4095 equals 1 V analog. You can then “map” any digital number over onto an analog equivalent. (Think about what functional form that mapping takes for this hypothetical case.) There are a number of uses that we can make of this ability to output a controllable, reasonably continuous voltage to the outside world, some of which we’ll demonstrate here. Control Applications Many types of control applications are simplified greatly by using the computer as an intelligent controller. Sometimes it is necessary for the computer to communicate an analog level, that is, a variable amount of voltage. An example might be the desired trigger level for a comparator circuit. Think back to the discussion in lecture about how the temperature controller in a GC works, or to the temperature controller circuit that you constructed in the Logic Applications Lab (Lab 10) if you did this lab. In this circuit, you have to establish a reference voltage, which is fed to one input of a comparator. If we were going to make a manually adjustable voltage to feed to a comparator, we’d probably use a simple voltage divider circuit starting with an appropriately large voltage. The DAC can replace the voltage divider and give us the ability to automate the operation of the circuit, and hence the device it is controlling. Concept Question 1 Describe how you would team a comparator used in a temperature controller circuit with the Digital to Analog converter to use the computer to control temperature in an open loop control application. How would you be able to easily “close the loop” and allow the computer to interface with the temperature control circuit in a closed loop control application? How would you go about building a GC-type circuit; that provides a temperature ramp in time, using one of the above circuits? Practical Consideration: As in many digital applications, the signal that the digital to analog converter (D/A) board is able to generate has a fairly low current capacity and is easy to load. Therefore this current would not be used, for instance, to control how fast a heater heated up (an application that consumes a fair amount of power.) In this exercise, we’ll look first at the rudimentary ability of the D/A to generate a computer controlled output voltage and then we’ll see how this can be used in some experiments. We’ll also demonstrate that it can not be used very well in other unsuitable applications. Simple Digital to Analog Conversion To first illustrate how the D/A conversion is accomplished with the PMD interfaces, we will simply measure the voltage levels produced by the board when the D/A conversion function is used. The PMD has two individually addressable channels of 12 bit D/A with a unipolar 4.096 V output range. What that means is that you can write two separate numbers to the two different channels and get two different voltages out simultaneously. The output voltages of each can vary from 0 volts to ~ 4 volts corresponding to the digital range 0 to 212-1. Nicer boards sometimes allow for more than one voltage output range, usually selected by the software and sometimes independently selectable for each channel. That means you could be writing a high resolution number between 0 and 100 mV on one channel and a coarse number between –10 and +10 volts on a different channel. These nicer boards often offer higher digital resolution too, typically 16 bits. Our interfaces have many different features (D/A, A/D, Digital I/O, a counter) to give you wide exposure, without any of the “bells and whistles” to maintain low cost. Concept Question 2 What is the voltage resolution (the smallest difference between two voltages) for the DAC on the PMD? How much better would a 16 bit board be with the same output voltage range? How much better could a 12 bit D/A be, if the output range could be changed to 0 to 100 mV? Which of the two choices (more bits or selectable range) makes the bigger difference in resolution? Circuit Exercise 1 – First we’ll just measure the output voltage of the D/A channels of the PMD directly with the DMM. Set up the DMM with the red lead connected to the first Analog Out (number 0) on terminal 13 and the black lead to the nearest Analog GND on terminal 12. Try to make your life easier by having the screw terminals hold these connections and use the stand on the DMM to position the output where you can see it. Download the Labview AnalogOutLoop VI and run it. Type in a new digital input value and hit enter. Verify that the output voltage responds accordingly. What are the two measured extremes of the voltage range (when the digital outputs are 0 and 4095)? What happens if you try a value bigger than 4095? Can you see (on the DMM) a difference of one unit, say between 4091 and 4092? If not, can you suggest why not? Would it be easier to see the difference between 10 and 11? Why? When you are done, click the STOP button and close the VI. Although the computer is really writing to the device several times every second, what we apparently see is a real-time change in the output. This works, but it means the computer is spending a lot of its time doing this operation. The next program works similarly, but only writes the data out to the output once each time you run it, leaving the computer free to do other things in the mean-time. Try running the program AnalogOut and see how this output mode is different. Run the program a couple of times with different inputs selected to see how things change. The output will latch, that is stay where you put it, until you tell it to change, or turn off the computer. This brings up an interesting point: what is the state of these outputs when you turn on the computer? Usually the boards are supposed to power up with all of the outputs in the off (zero volts) position. The specs should say what the power-up state is for all of the outputs. The point here is that we can get analog voltages out of the computer pretty easily. And that allows us to exercise control over circuitry in the external world that takes a range of analog voltage values. The Variable Trigger/ Adjustable LED One use that we make of the D/A in my research lab is to produce a computer controlled trigger for our ring-down experiment. By analogy to what a trigger does on the oscilloscope, we can guess that a trigger is a comparator circuit where one of the voltages being compared is a reference voltage and the other is the input signal. The trick here is to use the D/A to produce that reference voltage, which can then be controlled from the computer. Circuit Exercise 2 – We’re going to set up a variable trigger circuit which is driven by the function generator and triggered by the D/A output and use that to produce a variable brightness LED. This circuit is actually similar to the dimmer switches that some people have on the lights in their house. The principle here is that part of the AC waveform is rejected, so that power is only delivered part of the time. Since our eyes are slow and the variation is about 60 Hz, we see this as a continuous source that is less bright, rather than a light that is flickering more than normal. When this is used in your house, it is the 110 VAC line power that is being switched on and off, so you need a really beefy switch called a triac. Set up a comparator circuit like the ones that you used in Lab 5 and Lab 9. Either use an op amp, like a 741 or 3140, or a comparator, like the 311, as the heart of the circuit. Feed the function generator to the inverting input of the comparator and the output of the D/A to the non-inverting input, first connecting the ground of your breadboard to the analog ground of the PMD (pin 12.) Set the D/A to produce about + 2.5 volts. Observe the output of the comparator on the scope. At what part of the cycle of the function generator is the output of the comparator ON? How much of a duty cycle (time ON/all time) does this result in? Change the D/A setting, using the AnalogOut VI. What is the largest duty cycle you can produce? What is the smallest? Now hook up the output of the comparator to one of the LEDs (remember, always through a current limiting resistor like a 1 K) and then to ground. Set your system (the D/A) to a low duty cycle setting from before and see what the output of the LED looks like. Then try investigating the range of duty cycle to see qualitatively how the circuit behaves. What is the minimum duty cycle where you can see the LED glowing? Do you see any indication (from the LED) that it is cycling on and off? Real World Question and Example People usually come up with the “great” idea of using the DAC to provide a controllable waveform (i.e., as an arbitrary function generator.) This is great concept, but really doesn’t work well. Try to suggest a problem with this approach. If you are drawing a blank and want to see how this works out, hook up the scope to the DAC output 0 on terminal 13 (and to the analog ground on terminal 3) and download and run the fungen VI. This VI is supposed to create a triangle wave by writing a series of increasing and decreasing numbers to the D/A. You won’t be able to stop the VI once you start it, but it only runs for a minute or so. You can run it again, if it takes you a while to get the scope set up, but don’t run it in continuous mode, since this will almost certainly cause the operating system to hang. If you can’t figure out what you’re seeing, ask the instructor.