Download Measure Temperature using a RTD, myDAQ, and

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Immunity-aware programming wikipedia , lookup

Thermal runaway wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Signal-flow graph wikipedia , lookup

Multidimensional empirical mode decomposition wikipedia , lookup

Metadyne wikipedia , lookup

Two-port network wikipedia , lookup

Control system wikipedia , lookup

Opto-isolator wikipedia , lookup

Lumped element model wikipedia , lookup

Transcript
APLICAȚIA NR. 10
Measure Temperature using a RTD, myDAQ, and LabVIEW
Overview
This document explains using a Platinum RTD to measure temperature with your National
Instruments myDAQ in LabVIEW. The data will be acquired using the DAQ Assistant that is
installed into LabVIEW with the NI DAQmx driver and converted to a temperature using basic
programming in LabVIEW.
Table of Contents
1.
2.
3.
4.
5.
6.
7.
8.
9.
Objective:
Background:
What You Need:
Wiring Instructions:
LabVIEW User Interface:
Coding Strategy:
How It Works:
Tips and Tricks
Related Links
Objective:
Use a platinum based RTD to take a basic temperature measurement with the myDAQ DMM
terminal and LabVIEW.
Background:
A RTD is a thermal sensing device constructed from a metal, in this case platinum, that varies
linearly with temperature in a certain range. There are a multitude of these RTDs that can accept
a wide range of temperatures. In this application, we will focus on a Pt-RTD 3750. There is a
basic equation used to calculate temperature from resistance, similar to the document that
involves using myDAQ with a thermistor. Due to the high value of platinum, the sensors are not
necessarily low-cost, but they are commonly used in a variety of applications.
Figure 1: Omega Precision 3-Wire Platinum RTD
1
What You Need:
1.
2.
3.
4.
5.
NI myDAQ
LabVIEW
Any Pt-3750 RTD
Wire (DMM Banana cables with clips are recommended)
Breadboard (optional)
Wiring Instructions:
The Pt-RTD is wired in a circuit as a resistor. It requires a positive input on one side and a
negative input on the other side; the orientation does not matter. Depending on the type of RTD
(2-Wire, 3-Wire, or 4-Wire), certain external connections or modifications need to be made.
Essentially, we will have to short the excitation and voltage input positive signals together, and
the negative signals shorted together as well. This is because the DMM terminals on the NI
myDAQ are configured for a 2-wire resistance measurement, where the excitation current comes
from the Voltage input terminals. Below, a 4-Wire RTD is used in 2-Wire mode by shorting the
positive signals together and the negative signals together. This is explained in the referenced
document at the end of this example.
Figure 2: Wiring Diagram
2
LabVIEW User Interface:
The user interface we created both shows the current temperature measurement taken as well as
plotting the values over time on a waveform chart. Temperature Chart stores previous values so
that you can see the change in values over time.
Figure 3: LabVIEW Front Panel
Coding Strategy:
In LabVIEW we need to measure the resistance signal coming from the Pt-RTD from 100Ω to
10kΩ. This value is the converted to a temperature using the polynomial equation from the
RTD specifications for the respective sensor, and the Callendar-Van Dusen equation. Finally,
we will output the result to a numeric indicator and a temperature chart on the front panel.
Figure 4: The Callendar-Van Dusen Equation
3
Figure 5: Coding Block Diagram
The LabVIEW block diagram looks very similar to the coding block diagram
Figure 6: LabVIEW 2009 Block Diagram
(The attached LabVIEW code snippet can be dragged-and-dropped to a LabVIEW block
diagram, use attached PNG file. After locating the PNG file, just drag the file icon onto a blank
block diagram, as if you were dragging the file onto your desktop.)
How It Works:
Inside the while loop on the left is the DAQ Assistant. It’s configured to read a single value
from the myDAQ DMM terminals each time it executes. Once a value is read it is passed into
the formula node. The resistance is then further converted into a temperature in Kelvin using the
supplied polynomial equation and constants from the sensor specifications sheet. Finally, the
temperature is displayed on the Temp (C) and Temperature Chart indicators on the front panel.
All of the code inside the While Loop continues to run until the Stop button is pressed on the
front panel. The Wait VI (top right) delays execution of the while loop to every 500ms.
Therefore the sampling rate is 2 samples per second, or 2 Hz.
In this VI the DAQ Assistant is configured for on-demand sampling of the analog input channel.
The following steps walk through the configuration of the DAQ Assistant from scratch:
1. Be sure your myDAQ is plugged in
2. Press Ctrl-Space to bring up the Quick Drop Window (takes a full minute to load on the
first use)
4
3. Search for DAQ Assistant and double click on it when it appears in the list
4. Drop it on the Block diagram (white window)
5. When the Create a New Express Task configuration pane appears, select
a. Acquire Signals
b. Analog Input
c. Resistance
d. Dev 1 (NI myDAQ) *Note: If you have other NI hardware installed, the myDAQ
will not be Dev1.
e. dmm
f. Finish
6. Change the Resistance input Setup to the correct Signal Input Range
a. Max: 10k
b. Min: 100
7. Configure Excitation
a. Internal
b. 1 mA
8. Change Timing Settings to
a. 1 Sample (On Demand)
9. Press OK
Figure 7: DAQ Assistance Resistance Configuration
*Note that sample time is set by the Wait VI and is set to sample 2 times per second (every
500ms) in this VI
5
Tips and Tricks




You can modify the VI to log the data to file using a ‘Write To Spreadsheet File.vi’
express VI if you wish to save the data. Be sure to place it in the loop and be sure to
append new data to the spreadsheet file.
Use LabVIEW mathematical functions to replace the formula node in the block diagram
Use ‘From DDT’ to turn the blue Dynamic Data Type wire into an orange double
precision number. This allows the data from the DAQ Assistant to be used with standard
LabVIEW VIs.
Use this document in conjunction with the Connect a LED to NI myDAQ document to
display a light when a certain temperature threshold is met. You can use a comparison
operation to output a true or false if a value is greater than another number.
6