Escolar Documentos
Profissional Documentos
Cultura Documentos
Two-sided means that the mathematical implementation of the forward and inverse Fourier
transform considers all negative and positive frequencies and time of the signal. Single-sided
means that the mathematical implementation of the transforms considers only the positive
frequencies and time history of the signal.
A Fourier transform pair consists of the signal representation in both the time and frequency
domain. The following relationship commonly denotes a Fourier transform pair.
where Sxx represents the output sequence Power Spectrum, and n is the number of samples in the
input sequence X.
When the number of samples, n, in the input sequence X is a valid power of 2
n = 2m
for m = 1, 2, 3, , 23,
the Power Spectrum VI computes the fast Fourier transform of a real-valued sequence using the a
fast radix-2 FFT algorithm and efficiently scales the magnitude square. The largest Power
Spectrum the VI can compute using the FFT is 223 (8,388,608 or 8M).
When the number of samples in the input sequence X is not a valid power of 2 but is factorable
as the product of small prime numbers, the Power Spectrum VI computes the discrete Fourier
transform of a real-valued sequence using an efficient DFT algorithm and scales the magnitude
square. The largest Power Spectrum the VI can compute using the fast DFT is 222 1(4,194,303
or 4M 1).
Let Y be the Fourier transform of the input sequence X and n be the number of samples in it. You
can show that
|Yn i|2 = |Yi2|.
You can interpret the power in the (n 1)th element of Y as the power in the ith element of the
sequence, which represents the power in the ith harmonic. You can find the total power for the ith
harmonic (DC and Nyquist component not included) using
Power in the ith harmonic = 2|Yi|2 = |Yi|2 + |Yn 1|2 0 < i < n/2
The total power in the DC and Nyquist components are |Y0|2 and |Yn/2|2 respectively.
If n is even, let
. The following table shows the format of the output sequence Sxx
corresponding to the Power Spectrum.
Array Element
Sxx0
Sxx1 = Sxx(n 1)
Sxx2 = Sxx(n 2)
Sxx3 = Sxx(n 3)
Interpretation
Power in DC component
Power at frequency f
Power at frequency 2 f
Power at frequency 3 f
Sxx(k 2) = Sxxn (k 2)
Sxx(k 1) = Sxxn (k 1)
Sxxk
Power at frequency (k 2) f
Power at frequency (k 1) f
Power in Nyquist harmonic
Notice that the power spectrum is symmetric about the Nyquist frequency as the following
illustration shows.
If n is odd, let
. The following table shows the format of the output sequence Sxx
corresponding to the Power Spectrum.
Array Element
Sxx0
Sxx1 = Sxx(n 1)
Sxx2 = Sxx(n 2)
Sxx3 = Sxx(n 3)
Interpretation
Power in DC component
Power at frequency f
Power at frequency 2 f
Power at frequency 3 f
Sxx(k 2) = Sxxn (k 2)
Sxx(k 1) = Sxxn (k 1)
Sxxk = Sxxn k
Power at frequency (k 2) f
Power at frequency (k 1) f
Power at frequency k f
The following illustration shows that when n is odd, the power spectrum is symmetric about the
Nyquist frequency, but the Nyquist frequency does not fall on a frequency bin.
The format described in the preceding tables is an accepted standard in digital signal processing
applications.
Examples
Refer to the following VIs for examples of using the Power Spectrum VI:
Auto-Correlation
Auto-correlation is the correlation of a time series with itself. You can use the auto-correlation
method to capture periodic components in a univariate time series without other reference time
series. The auto-correlation operation preserves the frequency and amplitude information of
periodic components but does not preserve the phase information.
The following figure shows two noise-contaminated, phase-jittered time series and the resulting
auto-correlation plots. In the Auto-Correlation 1 and Auto-Correlation 2 graphs, you can see that
auto-correlation greatly attenuates the noise in the original time series, thereby potentially
improving the accuracy and reliability of subsequent frequency or periodicity estimates
calculated for the time series.
As the previous figure shows, though the time series in the Time Series 1 and Time Series 2 have
a difference in phase, the auto-correlations are close to each other. Therefore, auto-correlation
does not preserve the phase information, which can be a beneficial property in applications such
as feature extraction.
When performing auto-correlation of a time series, you can choose either biased or unbiased
weighting. Biased weighting is helpful when you perform spectral analysis with the Fourier
transform, because biased weighting can reduce spectral leakage, bias, and variance in the
resulting power spectrum. Unbiased weighting is suitable for periodicity detection in the time
domain. If you use unbiased weighting, the amplitudes of the auto-correlation values do not
decrease as the lag increases.
The following figure shows a time series of a sinusoidal pattern.
The following figure shows the estimated biased and unbiased auto-correlation of the sinusoidal
pattern, respectively.
Cross-Correlation
Cross-correlation measures the similarity between two time series. You can find the features of
an unknown time series by computing the cross-correlation between the unknown time series and
a known time series. For example, if you know the frequency of a sinusoid time series but do not
know the amplitude and phase, you can derive the amplitude and phase of the time series with
the cross-correlations. The following figure shows the flowchart of obtaining the magnitude
response and phase response of a physical system with the cross-correlation method.
In this flowchart, a sinusoid stimulus signal x(t) = sin(0t) at a specified frequency 0 is applied
to the physical system. The system then generates the response signal y(t) = A(0)sin(0t +
(0)). A(0) and (0) define the magnitude response and phase response of the physical system
at 0, respectively. The term 1/2Asin(0) is obtained by performing cross-correlation between the
stimulus signal x(t) and the response signal y(t) at = 0, where denotes the lag. The term
1/2Acos(0) is obtained by performing cross-correlation between the phase-delayed stimulus
signal x(t) = cos(0t) and the response signal y(t) at = 0. You can obtain the magnitude response
A(0) from the square root of (1/2Asin(0))2 + (1/2Acos(0))2. You can obtain the phase response
(0) from the inverse tangent of the quotient of 1/2Asin(0) divided by 1/2Acos(0). If you
change the frequency of the stimulus signal, you can obtain the response of the system at other
frequencies.
Use the TSA Cross-Correlation Function VI to perform cross-correlation on two time series.
Table of Contents
1. Definition
2. Background - The Fast Fourier Transform (FFT)
Windowing is a technique used to shape the time portion of your measurement data, to minimize
edge effects that result in spectral leakage in the FFT spectrum. By using Window Functions
correctly, the spectral resolution of your frequency-domain result will increase.
2. Background - The Fast Fourier Transform (FFT)
The FFT, or Fast Fourier Transform, implements a Fourier transform at a discrete set of
frequencies and from a time-domain waveform sampled at discrete times over a finite interval of
time. Because of the finite interval, the FFT tends not to be very frequency-selective.
The FFT behaves as though it was a bank of narrow-band filters followed by a bank of
corresponding detectors that calculate the vector sum of all the signal components that each filter
passes. In the case of the power spectrum, the result is scalar instead of vector data, and the
detector just indicates the total energy passed by each filter. Again, because of the finite duration
of the source data, the filters tend not to be especially selective. There is quite a bit of overlap
from bin to bin, as can be seen on figure 1.
As figure 1 also shows, while the main lobe of the filter is reasonably narrow, the sideband
response of the filter extends out objectionably. The application of a window function reduces
the side lobe responses, at the expense of the width of the main lobe, as can be seen on the figure
5.
Figure 1. The black curve shows the frequency response of FFT bin 3, blue is bin 4, etc. Not very
good rejection of adjacent frequencies.
When you use the FFT to measure the frequency content of data, you will have to base the
analysis on a finite set of data. The FFT transform assumes that the finite data set is one period of
a periodic signal. For the FFT, both the time domain and the frequency domain are circular
topologies, so the two endpoints of the time waveform are interpreted as though they were
connected together. Therefore, the finiteness of the sampling record may result in a truncated
waveform with different spectral characteristics from the original continuous-time signal, and the
finiteness can introduce sharp transition changes into the measured data. The sharp transitions
are discontinuities. To minimize this effect, we can apply a Window Function to the measured
signal in the time domain. This will make the endpoints of the waveform meet and therefore
result in a continuous waveform without sharp transitions.
Let's take a look at different cases of finite waveforms.
Integer Number of Periods:
When the signal is periodic and an integer number of periods fill the acquisition time interval,
the FFT turns out fine.
Figure 3. Measuring a non-integer number of periods adds spectral leakage to the FFT
Windowing a Non-Integer of Periods:
Applying a window function to the acquisition that connects the waveform endpoints in a
smoother fashion before computing the FFT, will result in better spectral resolution. This
technique is also referred to as 'applying a window' or simply 'windowing'.
Figure 5. A window (4-term Blackman-Harris) reduces the side lobes in the frequency-domain
Figure 6 shows the time-domain plot of some common windows. Most windows begin and end
at zero and rise to unity in the middle. The narrowest windows in the time domain have the
widest main lobes in the frequency domain, and vice-versa.
Because of the high side lobes, using the FFT with a rectangular window function (or no window
function) is normally not recommended.
The Hann (also called "Hanning") window function is useful for noise measurements where
better frequency resolution than some of the other windows is desired but moderate side lobes do
not present a problem.
The 4-term Blackman-Harris window function is a good general purpose window, having side
lobe rejection in the high 90s dB and having a moderately wide main lobe.
The 7-term Blackman-Harris window function has all the dynamic range you should ever need,
but it comes with a wide main lobe.
The Kaiser-Bessel window function has a variable parameter, beta, which trades off side lobes for
main lobe. It compares roughly to the Blackman-Harris window functions, but for the same main
lobe width, the near side lobes tend to be higher, but the further-out side sidelobes are lower.
As computers get faster and come with more memory, tolerable FFT sizes grow accordingly.
Even back in 2000, large FFTs could be computed fast enough that the 7-term Blackman-Harris
window provided quite good frequency resolution and, of course, extremely good dynamic range.
Future computing horsepower will favor the windows with the highest dynamic range.
If the signal contains strong interfering frequency components distant from the frequency of
interest, choose a smoothing window with a high side lobe roll-off rate.
If the signal contains strong interfering signals near the frequency of interest, choose a window
function with a low maximum side lobe level.
If the frequency of interest contains two or more signals very near to each other, spectral
resolution is important. In this case, it is best to choose a smoothing window with a very narrow
main lobe.
If the amplitude accuracy of a single frequency component is more important than the exact
location of the component in a given frequency bin, choose a window with a wide main lobe.
If the signal spectrum is rather flat or broadband in frequency content, use the uniform window,
or no window.
In general, the Hanning window is satisfactory in 95% of cases. It has good frequency resolution
and reduced spectral leakage. If you do not know the nature of the signal but you want to apply a
smoothing window, start with the Hanning window.
To get an overview of the what window function to choose with certain signal types and
applications, refer to the list in figure 8.
Type of Signal
Window
Transients whose duration is shorter than the length of the window Rectangular
Transients whose duration is longer than the length of the window Exponential, Hanning
General-purpose applications
Hanning
Kaiser-Bessel
Rectangular
Flat top
Hanning
Flat top
Hanning
Uniform
Uniform, Hamming
Force
Response signals
Exponential
Unknown content
Hanning
Figure 8. Recommendations for different window types
5. Windowing in LabVIEW
In LabVIEW Graphical Development software*, windows are available in several frequencydomain functions. For example, the Spectral Measurements Express VI lets you choose between
9 different window types, for your spectral measurements. Since it's an Express VI, you will
immediately see an example of the selected window in the time-domain for an easy visual
description.
Many other VIs includes the option to select your window type. There is even a Windows palette
with window function VIs so you can create you own customized analysis application.
NI CompactRIO platform provides all data acquisition, processing, and control functions in a
low-cost, high-speed deterministic control system.
"Coupled with National Instruments strong reputation for solid-performing technology and high
value-to-the-dollar ratio, the CompactRIO platform emerged as the most cost-effective solution
for the application."
- Greg Sussman, Process Automation
The Challenge:
Providing our customer, Penn Engineering, with a means of acquiring high-speed analog data on
multiple channels, running custom processing algorithms, and providing deterministic control to
operate their new verifiable fastener installation (VFI) tool.
The Solution:
Using National Instruments CompactRIO platform to provide all of the data acquisition,
processing, and control functions of the system.
Author(s):
Greg Sussman - Process Automation
At Process Automation Corporation, our customer, Penn Engineering, asked us to create an application
that acquires high-speed analog data on multiple channels, runs custom processing algorithms, and
provides deterministic control to operate their new verificable fastener installation tool (VFI).
If we failed to terminate the installation process at the correct point, we would reduce the holding power
of the fastener due to incomplete seating or damage due to excessive force. Therefore, we had to calculate
the proper stopping point in real time, during the acquisition, as torque and displacement values varied
when fastening to materials of different density and thickness. We installed one of the VFI tool
applications on the end of a robotic arm in a vehicle manufacturing plant. As a result of the requirements
of this application, we sought out a platform that provided a robust, industrial-grade chassis with low
weight, high reliability, and a small footprint.
We chose the NI CompactRIO platform to provide all of the data acquisition, processing, and control
functions of the system. A short beta test of a preproduction CompactRIO unit provided proof-positive
testing that this platform would meet all the project requirements.
CompactRIO Increases Speed for Data Acquisition and Processing
The largest benefit Process Automation has seen with CompactRIO is its ability to acquire and process
data from system sensors at speeds normally reserved for data acquisition cards running on a PC platform,
or on very high-cost, custom hardware solutions. Because of the small footprint and embedded system
operation, Process Automation could develop stand-alone, embedded applications for hardware control
with a much shorter and less expensive development cycle.
When migrating to the CompactRIO system, Process Automation could use the majority of their existing
code and ported it to the NI LabVIEW Real-Time and FPGA platforms. In addition to the quick
integration cycle, CompactRIO hardware costs approximately $4,500 less per system to implement than
the previous data acquisition technology running on a standard computer. During the development cycle,
Process Automation also discovered that CompactRIO provided enough processing horsepower so
multiple fastener installation tools could operate off a single CompactRIO system. In their previous
system, each tool required a separate computer and acquisition card. In addition to the cost savings, the
real-time processing and data storage capability of the system made it possible for the VFI tool to not only
install the fastener, but also to log critical parameters regarding the installation process. These parameters
provided traceability of each fastener installation and tool maintenance data.
Coupled with National Instruments strong reputation for solid-performing technology and high value-tothe-dollar ratio, the CompactRIO platform emerged as the most cost-effective solution for the application.
Author Information:
Greg Sussman
Process Automation ,36 Sleepy Hollow Lane,Belle Mead, NJ 08502
United StatesTel: (267) 685-1249.
gsussman@processauto.com
pressure and temperature of various reaction zones as specified in the recipe, and display and
record all the process variables of interest in real time.
We used LabVIEW and PXI Express hardware from NI for our solution. Components and
accessories on the vacuum reactor are typically electrical and electromechanical devices that can
be turned on and off by completing an electrical circuit. Some of these devices take a setpoint in
the form of a DC signal and return a DC signal as the actual value of the control variable. We use
digital I/O cards to switch some of the components on and off. This is done through a relay in
some cases. We use signals from the analog I/O module to control some of the other instruments.
Using a DAQ device, we capture the return DC voltage signal from the instruments and feed the
signal into the analog input ports to display and log the reaction variables in situ.
A graphical system design approach helped us create a user-intuitive interface that makes it easy
for even a new user to start operating the program, capturing the status of the experiment, or
noting any anomalies by looking at the graphical monitor showing the progress of the reaction.
This approach also significantly reduced program development time because all the needed
controls are available as icons and program errors are shown by the compiler, making them much
easier to trace.
Controlling a gaseous reaction is relevant to all experimental sciences, but its an inevitable part
of chemistry and materials science. Precisely controlling the process parameters and carefully
analyzing the recorded data points helps the experimenter reach the desired sweet-spot, hence the
need for a precise and reliable control scheme.
A reaction involves many experimental variables, and most variables need to be controlled, or at
least monitored, to get a desired outcome. Each process variable is dictated by an instrument that
has a proprietary control. Using a separate controller for each instrument would be very
expensive, occupy a lot of space, and would also lack communication between instruments
making it very cumbersome, and in some cases impossible, for the operator to run a reaction in a
desired fashion. Looking at these limitations, its absolutely necessary to have one control
platform that can talk to different devices in real time and simultaneously control the devices to
run any desired sequence of reactions.
The stand-alone reactor shown in Figure 1 is representative of systems used for chemical/thermal
vapor deposition processes. We have a hollow chamber and a substrate pedestal equipped with a
heating coil, a pump to create a vacuum, and a showerhead where different gaseous species are
mixed before entering the chamber.
Various electromechanical devices are hooked up to the chamber to control the reaction and log
variables of interest. These devices include pneumatic and electronic valves to switch gas flow
on and off, mass flow controllers (MFCs) for flow control and measurement, and pressure
transducers and capacitance manometers. We have additional components for liquid delivery
including an ampoule coupled with a liquid flow meter-vaporizer-carry gas assembly to very
finely control liquid precursors.
System Configuration
Our system consists of a reaction chamber connected to a vacuum pump to pump down the
chamber, a throttle valve that governs the pumping rate, an isolation valve to isolate/connect the
pump to the chamber, and pressure sensors (capacitance manometers) to measure the vacuum
level. The reaction chamber has a pedestal, is fitted with a heater and a thermocouple, and
maintains the substrate temperature at a given value.
A typical reaction of interest introduces chemicals into the reaction chamber at a fixed rate for a
fixed time. Gaseous species, available in pressurized cylinders, are connected to the chamber via
hollow lines and are routed through an MFC for molar flow control, and a pneumatic valve to
quickly switch the entry of gas into the chamber on or off. Several of these lines are fitted with
heating tapes and thermocouples to heat the gas. The different chemicals are mixed inside a
showerhead before entering the reaction chamber.
Many precursors used in these reactions exist in a liquid or solid state at room temperature but
can be heated to get an appreciable vapor pressure. One popular method, vapor draw, uses a
container (bubbler) where the liquid/solid is heated to a temperature high enough to get sufficient
vapor pressure; these vapors are then driven into the reaction chamber due to the pressure
gradient. Though this method is easy to implement, it has some serious limitations. You cant
precisely control the rate at which precursors are drawn into the chamber, which makes this
method unusable for reactions of stoichiometric importance where accurately controlling the
precursor quantity is required. Also, the large pressure difference requires drawing a large
precursor quantity, so this method is not suited for expensive precursors and it is not advised to
use when dealing with toxic chemicals.
To overcome the limitations of the vapor draw method, we used a liquid delivery system (LDS)
in our reactor. An LDS keeps the liquid in an ampoule that is fitted with two hollow gas lines and
is wrapped with heating tape and a thermocouple. Liquid in the ampoule is pressurized by an
inert push gas that forces the liquid to rise in the adjacent line. This line is connected with a
liquid flow meter (LFM) that controls and releases only the specified amount of liquid. Liquid
leaving the LFM reaches an injection valve (vaporizer) that is maintained at a temperature high
enough to completely vaporize the liquid. A separate line carrying hot inert gas meets the vapor
carrying line from the LFM at the injector valve and pushes these vapors into the reaction
chamber. Using hot surfaces at the injector valve and hot carry gas rules out any possibility of
clogging the line because of liquid/solid condensation.
Implementing Controls
We need digital output signals for binary control functions such as switching system components
and instruments on and off. Additionally, we need analog output signals to control devices such
as the LFM and MFC so we can control gas/liquid flows. The LabVIEW program we developed
communicates with analog and digital I/O devices that send voltage signals to the
electromechanical and electronic components, which results in the desired control. It also
receives return signals from these devices on the data acquisition input channels. The overall
control scheme is depicted in Figure 3.
Various features of the control system are described in detail below.
(I) Switching Gas Flow On/Off: As instructed by the recipe, the program writes a high/low
voltage signal on the digital output ports of the PXI cards. The high signal activates a mechanical
relay and connects 24 V of DC power to the electronic valve on the pneumatic manifold. Thus, a
supply of clean, dry air is driven to the pneumatic valve that opens and allows the precursor gas
in the line to enter the chamber. A reverse mechanism closes the valve and cuts off the gas supply
corresponding to a digital low signal sent by the digital output port.
(II) Temperature Control: The temperature of various components such as the gas lines, gas
heaters, and injector valves needs to be maintained at user-specified setpoints. Thermocouples
connected to these parts send a voltage signal that is captured at differential configuration ports
on the analog input device. This signal voltage is converted to a temperature value using built-in
LabVIEW functions. The actual temperature is compared with the setpoint and depending on
whether it is lower or higher than the specified value, the program sends a digital high or digital
low signal, respectively switching the solid state relay (SSR) on or off. The power supply to the
heating tapes is routed through the SSR and heating starts or stops as the SSR is switched on or
off. This simple on/off control action has several limitations including a very high overshoot and
lack of ramp rate control. These limitations were overcome using a proportional-integralderivative (PID) controller subVI for LabVIEW that offers much more precise temperature
control.
(III) Pressure Control: Pressure has a large role in semiconductor processes because it dictates
the mean free path and diffusion length of the molecules. The pressure inside the chamber is
accurately measured by a capacitance manometer, which sends a voltage signal that is interpreted
as pressure by the program using an appropriate scaling factor. The recorded pressure is
continuously displayed to monitor the progress of the reaction. The program can take pressure
readings from the capacitance manometer and throttles the opening between the chamber and
pump by controlling the stepper motor equipped with the throttle valve and maintains a desired
pressure using this feedback loop.
(IV) Gas Flow Control: MFCs are used to control flow and record the actual flow of a gaseous
species with molar accuracy. An MFC can control gas flow using the analog output voltage
because there is a linear relation between the voltage supplied to the MFC (0 V to 5 V) and the
gas flow through the device. Corresponding to the actual flow, the MFC again sends a return
voltage of 0 V to 5 V that is acquired with analog input ports and is interpreted in the flow value
using an appropriate scaling factor by the program.
(V) Flow Control of Liquid Precursors: The flow of liquids is controlled by the collective action
of the LFM, the injector valve, and the gas heater coupled with an MFC for carrying the gas. An
analog output signal to the LFM dictates the amount of liquid that is released to the injector
valve, heated into vapors, and pushed through. The program is designed to ensure coordination
between all these devices so there is an uninterrupted flow.
(VI) Reaction Recipes: Processes conducted in the vacuum reactor involve numerous cycles.
Each cycle consists of several steps of exposures to different reactants. These recipes can be
created in the program and run per the specifications. A typical recipe involves a sequence of
reactants and corresponding time intervals for each reactant, as specified by the user. The recipes
can be saved, edited, and loaded again, which saves a lot of time for the user.
(VII) Data Logging and Analysis: Our program can log process variables of interest as a .txt file
or a Technical Data Management Streaming (TDMS) file. The user can specify the sampling rate
to record the data to be as small as a millisecond. Data being recorded is displayed graphically
and numerically on a program screen. The recorded data can also be analyzed within the
program. The program, which is capable of handling a very large file, can zoom into the graph to
reach a time window of interest and can plot very neat graphs.
(VIII) Safety Features: Because such reactions involve toxic chemicals, high temperatures, and
day-long reaction lengths, sufficient safety interlocks for the software and hardware are provided
in the control scheme. Instruments such as the gas heater and injector valve draw very high
electrical power and are heated to high temperatures. A temperature PID control in our program
ensures the overshoot on power draw is minimal. To potentially account for a situation where the
communication between the program and the hardware fails, controls to switch on these parts are
routed through a temperature switch. The temperature switch is a component fixed to the device
that changes from a normally closed to a normally open configuration and disconnects the
power being fed to the instrument, preventing any further heating.
Simple safety arrangements are provided in the program as well. For instance, input values to
variouscontrol variables are changed to the maximum allowable limit in case of an erroneous
input from the user.We have successfully tested the reliability, consistency, and safety features of
these programs in more than 200 experiments so far.
(IX) Intuitive Interface: We developed an interface similar to a supervisory control and data
acquisition (SCADA) system. It makes use of icons for each component to show the system
configuration and assigns control to each of these components in the schematic (Figure 5). The
user can click an icon and enable, disable, or control an instrument or a process parameter.
The Benefits of Using the LabVIEW Graphical System Design Approach
Compared to traditional controls, we find LabVIEW faster, more versatile, and easier to program
with. To further elaborate, in our subVI for temperature control, we easily included a PID control
using sample VIs and resources available for LabVIEW. Additionally, we changed and recorded
signals in millisecond intervals, making this code useable for nuclear reactions or atomic layer
deposition experiments where the response time for a control system has to be extremely small.
Other available programs such as ANSI C++ or control schemes using programmable logic
controller (PLC) cards are not easy to learn and implement. Also, given the complexity of our
program, it would have been very difficult and consumed a lot of our time and resources to
include all these features if we used another platform. Even the auxiliary features of LabVIEW
are great. We used one such feature to plot 100,000 data points, something Microsoft Excel failed
to plot.
Overall, the benefits of using NI products include the following:
Compact control panel that reduced the space used for control units by 70 percent
Intuitive user interface that enables even a novice to operate the system right away
We are satisfied with what we achieved in such a short time using LabVIEW. LabVIEW has
wide-ranging compatibility, and, with a few modifications, it can easily be used for similar
systems across various industries.
We would like to thank the NI sales team and field engineer Mithilesh Pradhan who introduced
me to the capabilities of LabVIEW and helped me with the necessary support to make it my
preferred control system software.
Author Information:
Vibhas Singh
Applied Materials
Unit 4 and 5,Ground Floor Inventor, International Technology Park, Whitefield Road
Bangalore 560 066
India
Tel: (91) 80 66283000
5.6 NI MyDAQ
Acquiring Audio Signals
This tutorial shows you how to use LabVIEW with an NI myDAQ. You will learn how to build a
VI in LabVIEW to create an audio loopback, which means that the source plugged into the
AUDIO IN channel will be heard in the AUDIO OUT channel. Imagine you had an mp3 player
to connect to the AUDIO IN input of the NI myDAQ and speakers you can connect to the
AUDIO OUT output, like in the following picture. A similar program to the one below allows the
source from the mp3 player to be heard from the speakers. To simplify things, the following
tutorial has you simulate a signal for the NI myDAQ to generate.
This tutorial assumes that you have the NI myDAQ software installed, the NI myDAQ hardware
available and have learned the concepts in the LabVIEW Basics tutorials.
1. From the Getting Started
Window, select FileNew
VI.
2. Press <Ctrl-E> to switch to
the block diagram.
4. The image below shows the Configure Simulate Signal dialog box, which allows you to
configure the settings of the signal you want to create. Click Automatic to remove the
checkmark. Change the Number of samples to 10000. Click OK.
5. Select Measurement
I/ODAQmx - Data
Aquisition on the Functions
palette. This palette contains
VIs and functions that you
need when working with the
NI myDAQ. Add the DAQ
Assistant Express VI to the
block diagram to the right of
the Simulate Signal Express
VI.
13. Select
ProgrammingStructures
While Loop on the Functions
palette. From the upper left
corner of the block diagram,
click and drag the While
Loop around all of the code.
14. Notice that the Run button for
your VI is currently broken.
You can click the broken Run
button to see what the
problem is. Anytime you use
a loop, you must tell the
program when to stop
running. To do this, rightclick the Conditional
Terminal and select
CreateControl from the
shortcut menu. Now, the
program knows to stop when
you press the stop button on
your front panel.
Congratulations! You have completed the second tutorial for the NI myDAQ. This tutorial used
materials that are readily avaliable, but what can you connect to the NI myDAQ for a more
realistic video game controller? Check out this video on ni.com to watch how an engineer used
the NI myDAQ to create a homemade racing wheel video game controller. As a challenge, try it
out yourself!
Table of Contents
1. Signal Conditioning for Thermocouple Sensors
2. NI-Compatible Thermocouples
3. Platforms for Measuring Thermocouples
Thermocouple output signals are typically in the millivolt range, and generally have a very low
temperature to voltage sensitivity, which means that you must pay careful attention to the sources
of errors that can impact your measurement accuracy. The primary sources of error for
thermocouple measurements are:
Noise errors
Thermocouple errors
CJC Errors
CJC errors represent the difference between the actual temperature at the point where the
thermocouple is connected to the measurement device (the cold-junction temperature) and the
measured temperature by the device. The CJC error is roughly a 1:1 contributor to the accuracy
of the temperature measurement of the thermocouple, and it is often one of the largest single
contributors to the overall accuracy. The overall CJC error includes the error from the CJC
temperature sensor (often a thermistor) used to sense the cold-junction temperature, the error
from the device measuring the CJC sensor, and the temperature gradient between the cold
junction and the CJC sensor. Of these three errors, the temperature gradient between the cold
junction and the CJC sensor is generally the largest, and it typically has the largest variation. The
error from the CJC sensor can be a large contributor in many devices; however, high-accuracy
thermistors or resistance temperature detectors (RTDs) with small errors are common in many
high-end thermocouple measurement devices.
The error from the temperature gradient between the cold junction and the CJC sensor is where
you generally have the most control. A well-designed thermocouple device can often minimize
this error considerably; however, the magnitude of this error still often depends on the
environment in which the thermocouple device is used. Because the error comes from the
temperature difference between the cold junction and the CJC sensor, anything that can introduce
a temperature gradient in a thermocouple device influences this error. Maintaining your
thermocouple device in a stable environment with minimal temperature variation and low air
flow is the best way to improve CJC accuracy. Adjacent heat sources, such as other instruments,
can also affect CJC accuracy. Some devices have a single CJC sensor for many channels, while
others may have multiple CJC sensors. As a general rule, devices with a low ratio of channels to
CJC sensors are less susceptible to errors from temperature gradients. Refer to the device
documentation for specifics about CJC accuracy and other recommendations for improving
overall CJC accuracy.
Because thermocouples often output signals very close to 0 V and have a full input range that is
measured in millivolts, offset errors from the measurement device can be a large contributor to
overall accuracy. Many devices support a built-in autozero function that measures the internal
offset of the circuit automatically. If a device supports built-in autozero, this is often the best way
to compensate for offset errors and offset drift in the measurement device. Read the device
documentation to determine if autozero is supported. If autozero is not supported, pay careful
attention to the contribution of the offset error specification to the overall accuracy of the
measurement device, and ensure that the device is regularly calibrated.
Gain errors are proportional to the input voltage, so they generally have the largest impact when
thermocouples are measuring temperatures at the edge of their supported ranges.
Noise Errors
Thermocouple output signals are typically in the millivolt range, making them susceptible to
noise. Noise can be introduced either by the external environment or by the measurement device.
Lowpass filters are commonly used in thermocouple DAQ systems to effectively eliminate highfrequency noise in thermocouple measurements. For instance, lowpass filters are useful for
removing the 50 Hz and 60 Hz power line noise that is prevalent in many laboratory and
manufacturing settings.
For measurement devices with a large input range, you can also improve the noise performance
of your system by amplifying the low-level thermocouple voltages near the signal source
(measurement point) to match the output range of the thermocouples. Because thermocouple
output voltage levels are very low, you should choose a gain or input range for the device that
optimizes the input limits of the analog-to-digital converter (ADC). The output range of all
thermocouple types falls between -10 mV and 80 mV.
Another source of noise is caused by thermocouples being mounted or soldered directly to a
conductive material such as steel or being submerged in conductive liquids such as water. When
connected to a conductive material, thermocouples are particularly susceptible to common-mode
noise and ground loops. Isolation helps prevent ground loops from occurring, and can
dramatically improve the rejection of common-mode noise. With conductive materials that have
a large common-mode voltage, isolation is required because nonisolated amplifiers cannot
measure signals with large common-mode voltages.
Thermocouple Errors
These errors are introduced by the thermocouple. The voltage generated by the thermocouple is
proportional to the temperature difference between the point where the temperature is measured
and the point where the thermocouple connects to the device. Temperature gradients across the
thermocouple wire can introduce errors due to impurities in the metals, which can be large
relative to most measurement devices. Refer to the thermocouple documentation to understand
its accuracy impact on the overall measurement.
2. NI-Compatible Thermocouples
Ready-Made
Field-Cuttable
Benchtop or Field
Measurements
Embedded Data-Logging
Measurements
An NI CompactDAQ system
NI CompactDAQ stand-alone NI CompactRIO is a
consists of a chassis, NI C Series chassis offer a highreconfigurable embedded
I/O modules, and software.
performance platform for
control and acquisition system.
Chassis can connect to a host
embedded measurements and The CompactRIO hardware
computer over USB, Ethernet, or data logging. The 8-slot chassis architecture includes a
802.11 WiFi or operate stand- feature an integrated computer reconfigurable FPGA chassis
alone with a built-in controller. and nonvolatile storage, so that and an embedded controller.
With over 50 measurementNI CompactDAQ can be
You can use CompactRIO in a
specific modules and 1-, 4-, and deployed without an external variety of embedded control
8-slot chassis, NI CompactDAQ computer.
and monitoring applications.
provides a flexible, expandable
Includes Intel multicore
A variety of
platform to meet the needs of
processing, 32 GB
reconfigurable chassis
any electrical or sensor
measurement system.
What Is NI CompactDAQ?
Simultaneously stream
continuous measurements
with sample rates up to 1
MS/s per channel
What Is NI CompactDAQ?
Open embedded
architecture with small
size and extreme
ruggedness
What Is NI CompactRIO?
C Series I/O Modules With Integrated Signal Conditioning for Temperature With Thermocouples
NI 9214
The PXI platform offers a variety of chassis, controller, and module options so you can create a
measurement system to meet your specific application needs. The NI SC Express strain modules
can provide up to 0.02 percent accuracy at up to 102.4 kS/s. PXI can scale to thousands of strain
and bridge-based measurement channels for large applications, and provides both wired and
wireless synchronization options.
More than 1,500 PXI modules available, including CAN, vision, motion, and GPS
PXI I/O Modules With Integrated Signal Conditioning for Measuring Thermocouples
The NI SC Express family features PXI Express DAQ modules with integrated signal
conditioning for sensor measurements, such as thermocouples and other temperature transducers.
NI PXIe-4353
32-Channel, 24-Bit, Thermocouple Input Module
The NI PXIe-4353 thermocouple input module provides integrated DAQ and signal conditioning
for temperature measurements. This module includes increased accuracy and synchronization
features for scalable measurement systems from low- to high-channel counts.
The NI PXIe-4353 features 32 channels with three 24-bit analog-to-digital converters (ADCs)
and operates with high-speed (90 S/s per channel) and high-resolution (1 S/s per channel) modes.
It is designed to be highly accurate with 0.3 C typical accuracy for the module and terminal
block. The module has two autozero channels for offset compensation as well as open
thermocouple detection to identify disconnected thermocouples.
The high accuracy is attributed to the NI TB-4353 isothermal terminal block that includes eight
CJC channels. It has a unique design that optimizes thermal conductivity between the
thermocouple terminals and the CJCs for an isothermal error as low as 0.25 C. The TB-4353 is a
front mount terminal block with screw terminal connectivity.
SC Express Thermocouple Measurement System
NI InstantDAQ Technology
The NI USB-TC01 thermocouple measurement device features
NI InstantDAQ technology so you can instantly take temperature
measurements with your PC. Just plug it in and built-in software
for viewing and logging data automatically loads. No driver
installation is necessary. Connect to any USB port to use your
PC as a display and monitor data in real time. The USB-TC01,
which is compatible with J, K, R, S, T, N, and B thermocouples,
uses a standard miniplug for easy thermocouple connection.
NI USB-TC01
Table of Contents
1. RTD Overview
2. How to Make an RTD Measurement
3. Recommended Hardware and Software
4. RTD Webcasts, Tutorials, and Other How-To Resources
1. RTD Overview
A platinum resistance temperature detector (RTD) is a device
with a typical resistance of 100 at 0 C. It consists of a thin
film of platinum on a plastic film. Its resistance varies with
temperature and it can typically measure temperatures up to
850 C. Passing current through an RTD generates a voltage
across the RTD. By measuring this voltage, you can determine
its resistance and, thus, its temperature. The relationship
between resistance and temperature is relatively linear.
R0 = nominal resistance
a, b, and c = constants used to scale the RTD
The resistance/temperature curve for a 100 platinum RTD, commonly referred to as Pt100, is
shown in Figure 2.
The most common RTD is the platinum thin-film with an a of 0.385%/C and is specified per
DIN EN 60751. The a value depends on the grade of platinum used, and also commonly include
0.3911%/C and 0.3926%/C. The a value defines the sensitivity of the metallic element, but is
normally used to distinguish between resistance/temperature curves of various RTDs.
Table 1. Callendar-Van Dusen Coefficients Corresponding to Common RTDs
Standard
Temperature
Coefficient (a)
DIN 43760
0.003850
American
0.003911
ITS-90
0.003926
All RTDs usually come in a red and black or red and white wire-color combination. The red wire
is the excitation wire and the black or white wires are ground wires. If you are not sure which
wires are connected to which side of the resistive element, you can use a digital multimeter
(DMM) to measure the resistance between the leads. If there is close to 0 resistance, then the
leads are attached to the same node. If the resistance is close to the nominal gage resistance (100
is a common RTD nominal gage resistance), then the wires you are measuring are on the
opposite side of the resistive element. In addition, reference the RTD specification to find the
excitation level for that particular device.
Most instruments offer similar pin configurations for RTD measurements. The following
example demonstrates an RTD measurement using an NI CompactDAQ chassis and the NI 9217
RTD module (see Figure 3). National Instruments provides many options to measure
temperature from 1 to 1,000+ channels.
The four-wire method has the advantage of not being affected by the lead resistances because
they are on a high-impedance path going through the device that is performing the voltage
measurement; therefore, you get a much more accurate measurement of the voltage across the
RTD.
Because thermistors are resistive devices, you must supply them with an excitation source and
then read the voltage across their terminals. This source must be constant and precise.
Figure 5. NI 9215 Connection Diagrams for Thermistors with External Excitation from a
(a) Current Source IEX and (b) Voltage Source VEX
The voltage difference across the resistor is read as a temperature. The relationship between
voltage across a resistor and temperature is not perfectly linear. The NI-DAQmx driver scales the
resistance of a thermistor to a temperature using the Steinhart-Hart thermistor third-order
approximation:
where T is the temperature in Kelvin, R is the measured resistance, and A, B, and C are constants
provided by the thermistor manufacturer.
To provide excitation, you can use external sources such as a C Series voltage output module or
current output module. Because the nominal resistance of a thermistor is very high, you need a
source that can output low currents accurately. You can use the NI 9265 C Series analog output
module as an excitation current source for the thermistor and place it in the same NI cDAQ-9172
chassis as the C Series module acquiring the thermistor reading. The NI 9265 has a 0 to 20 mA
output range with 16-bit resolution. This particular output module also has the same channel
count as the input module described for the temperature readings. The pinouts for the current
output C Series module are displayed in Figure 6.
Application software is divided into three main categories: configuration, prototype, and
application development environment (ADE). Figure 2 illustrates the motion control system
programming process and the corresponding National Instruments product designed for the
process:
Figure 3. NI MAX is an interactive tool for configuring and tuning your motion control system.
Application Notes
Understanding Servo Tune
Using the 1D Interactive Environment to Test Motor Functionality
Axis Configuration for Motion Controllers
Axis Settings for Motion Controllers
Encoder Settings for Motion Controllers
Reference Settings for Motion Controllers
Digital I/O Settings for Motion Controllers
Prototyping
When you have configured your system, you can start prototyping and developing your
application. In this phase, you create your motion control profiles and test them on your system
to make sure they are what you intended. For prototyping, National Instruments offers an
interactive tool called the NI Motion Assistant, which you can use to configure moves using a
point-and-click environment and generate NI LabVIEW code based on the moves you configure.
The key benefit of the NI Motion Assistant lies in the difference between configurable and
programmable environments. With configurable environments, you can start your development
without programming. You can think of the tasks in the NI Motion Assistant as prewritten blocks
of code that you simply configure to meet your needs. Programmable environments, on the other
hand, require you to use standard programming languages such as LabVIEW, C, or Visual Basic
to accomplish your tasks. Unfortunately, many configurable environments may be limited in
functionality or in the ability to integrate with other I/O outside motion. The NI Motion Assistant
bridges the gap between programmable and configurable environments by offering all
configurable system features as well as LabVIEW code generation.
Figure 4. The NI Motion Assistant helps you quickly prototype your application and then convert
your project into LabVIEW VIs or C code for further development.
Evaluation Software
Development
After the prototyping phase, the next step is to develop the final application code. For this, you
use driver-level software in an ADE such as LabVIEW, C, or Visual Basic. For a National
Instruments motion controller, you use NI-Motion driver software.
The NI-Motion driver software contains functions you can use to communicate with NI motion
controllers in the Windows or LabVIEW Real-Time OS. NI-Motion also includes MAX to help
you easily configure and tune your motion system.
For non-Windows systems, you can develop your own driver using the NI Motion Control
Hardware DDK manual. It explains how to communicate on a low level with NI motion
controllers. If you do not have the expertise or time to develop your own driver, National
Instruments Alliance Partner Sensing Systems offers a Linux and VxWorks driver, and can create
drivers for other OSs, such as Mac OS X or RTX.
Application Notes
Understanding Input and Return Vectors in Onboard Programming
Understanding Loop and Conditional Structures in Onboard Programming
Understanding Variable Arithmetic in Onboard Programming
Advanced Object Management in Onboard Programming
Controlling an X-Y Stage with a Joystick
3. Motion Controller
A motion controller acts as the brain of the motion control system and calculates each
commanded move trajectory. Because this task is vital, it often takes place on a digital signal
processor (DSP) on the board itself to prevent host-computer interference (you would not want
your motion to stop because your antivirus software starts running). The motion controller uses
the trajectories it calculates to determine the proper torque command to send to the motor
amplifier and actually cause motion.
The motion controller must also close the PID control loop. Because this requires a high level of
determinism and is vital to consistent operation, the control loop typically closes on the board
itself. Along with closing the control loop, the motion controller manages supervisory control by
monitoring the limits and emergency stops to ensure safe operation. Directing each of these
operations to occur on the board or in a real-time system ensures the high reliability,
determinism, stability, and safety necessary to create a working motion control system.
Learn more about the FlexMotion architecture of National Instruments DSP-based motion
controllers.
Calculating the Trajectory
The motion trajectory describes the motion controller board control or command signal output to
the driver/amplifier, resulting in a motor/motion action that follows the profile. The typical
motion controller calculates the motion profile trajectory segments based on the parameter values
you program. The motion controller uses the desired target position, maximum target velocity,
and acceleration values you give it to determine how much time it spends in the three primary
move segments (which include acceleration, constant velocity, and deceleration).
For the acceleration segment of a typical trapezoidal profile, motion begins from a stopped
position or previous move and follows a prescribed acceleration ramp until the speed reaches the
target velocity for the move.
NI 734x series is the mid-range series that offers up to four axes of both stepper and servo
control, as well as some higher-performance features such as contouring and electronic gearing.
The NI 735x series is the most advanced series that offers up to eight axes of stepper and servo
control, extra I/O, and many powerful features including sinusoidal commutation for brushless
motors and 4 MHz periodic breakpoints (or position triggers) for high-speed integration.
Selection Guides
View the Complete Motion Control Product Selection Guide
The motor amplifier or drive is the part of the system that takes commands from the motion
controller in the form of analog voltage signals with low current and converts them into signals
with high current to drive the motor. Motor drives come in many different varieties and are
matched to the specific type of motor they drive. For example, a stepper motor drive connects to
stepper motors and not servo motors. Along with matching the motor technology, the drive must
provide the correct peak current, continuous current, and voltage to drive the motor. If your drive
supplies too much current, you risk damaging your motor. If your drive supplies too little current,
your motor does not reach full torque capacity. If your voltage is too low, your motor cannot run
at its full speed.
You should also consider how to connect your amplifier to your controller. Some motor
companies sell drives that easily connect to the motors they offer. National Instruments offers
drives for both two-phase stepper motors and DC brushed servo motors. These drives have screw
terminals with which you can connect to many different motors. Table 1 describes the difference
between NI motor drives.
For connecting to third-party drives and amplifiers, National Instruments offers the universal
motion interface (UMI) the standard UMI-7764 with screw terminal connectivity and the
industrial UMI-7774 with 24 V logic digital I/O and D-Sub connectivity.
Selection Guides
NI Drive Selection Chart
Application Notes
Simple Servo Amplifiers
DC Servo Amplifiers
Changing the Voltage Output on a FlexMotion Controller for Drives That Do Not Accept 10 V
How to Connect the NI 73xx Inhibit and Command Signal Outputs to Third-Party Drives
6. Motors and Mechanical Elements
Motor selection and mechanical design is a critical part of designing your motion control system.
Many motor companies offer assistance in choosing the right motor, but it is helpful to know
some basics about motors before you start looking. Table 1 describes different motor
technologies.
Pros
Cons
Applications
Positioning, micromovement
Stepper Motors
After determining which technology you want to use, you need to determine the torque and
inertia at the motor shaft. For more information on calculating system torque, read the Motor
Fundamentals article at zone.ni.com.
Something else to consider when selecting your motor and other mechanics is whether an offthe-shelf actuator (such as a stage) might work for your application. Stages offer the power
transmission to obtain useful rotary or linear motion without designing it yourself.
Selection Guides
Selecting the Correct Servo Motor for Your Application
Selecting the Correct Stepper Motor for Your Application
Selecting the Correct Stage for Your Application
Application Notes
Motor Fundamentals
Servo Motor Basics
Servo Motor Applications
Stepper Motor Basics
Stepper Motor Types
Linear Stepper Motors
Stepper Motor Applications
Stepper Motor Switching Sequence
7. Feedback Devices and Motion I/O
Feedback Devices
Feedback devices help the motion controller know the motor location. The most common
position feedback device is the quadrature encoder, which gives positions relative to the starting
point. Most motion controllers are designed to work with these types of encoders. Other
feedback devices include potentiometers that give analog position feedback, tachometers that
provide velocity feedback, absolute encoders for absolute position measurements, and resolvers
that also give absolute position measurements. When using National Instruments motion
controllers, you can use quadrature encoders and potentiometers.
Motion I/O
Other I/O that is important in motion control includes limit switches, home switches, position
triggers, and position capture inputs. Limit switches provide information about the end of travel
to help you avoid damaging your system. When a motion system hits a limit switch, it typically
stops moving. Home switches, on the other hand, indicate the system home position to help you
define a reference point. This is important for applications such as pick-and-place.
Triggers such as position trigger outputs or position capture inputs help when integrating with
other devices. With position trigger outputs (also called breakpoints and position compare), you
can set up a trigger that executes at a prescribed position. This type of action is useful in
operations such as scanning, where you might want to trigger a system to take measurements at a
series of prescribed positions. Position capture inputs, on the other hand, cause the motion
controller to immediately capture an event occurrence position and store it in memory. This is
useful if you have an external trigger and would like to know the position at which it occurs in
your system.
*************************************END************************************