Fjkldfnks PDF
Fjkldfnks PDF
Bekkeng, 11.3.2013
Overview
• Overview of Data acquisition
• DAQ signals
• Signal conditioning
• Sampling concepts
• DAQ hardware
– PXI
• Device drivers
• Software development for PC-based DAQ (using LabVIEW)
• Hardware timing
• A few other examples (including VISION)
Data acquisition (DAQ)
• Data acquisition involves measuring signals (from a real-world
physical system) from different sensors, and digitizing the
signals for storage, analysis and presentation.
NI SC DAQ
Overview of Data acquisition (DAQ)
Vin
I=V/Z
Signal Source Categories
Grounded Floating
+ +
Vs Vs
_ _
Grounded Signal Source
– Signal is referenced to
Grounded a system ground
• earth ground
• building ground
+
– Examples:
Vs
_ • Power supplies
• Signal Generators
• Anything that plugs into
an outlet ground
Floating Signal Source
RSE NRSE
Ground loop illustration
The blue connection to ground must not be added, since it creates a ground loop
RSE
Ig
ΔVg
Rg
Ground loop!
Differential signals
• Two signal wires for each input signal (input and return signals)
• The measurement is the voltage difference between the two wires
• Recommended for the following conditions:
– Low-level signals (less than 1 V)
– Long cables
– The input signal requires a separate ground-reference point or return signal
– The signal leads go through a noisy environment
• DAQ devices with instrumentation amplifiers can be configured as differential
measurement systems
• Any voltage present at the instrumentation amplifier inputs with respect to the
amplifier ground is called a common-mode voltage
• The instrumentation amplifier rejects common-mode voltage and common-mode
noise
Input signal
Return signal
Options for Grounded Signal Sources
Options for Floating Signal Sources
Signal conditioning
• Signal conversion
– E.g. current-voltage converter
• Amplification
• Attenuation
– Voltage divider
• Filtering
– Anti-aliasing
• Isolation
Current-to-voltage converter
10 mV
+ 10V
_ 1000 ADC
Lead Wires
• Voltage divider
• A circuit that produces an
output voltage (Vout) that is a
fraction of its input voltage
(Vin)
• Can be needed to get a
high-level signal down to the
acceptable DAQ-card range
Input Coupling
C
Isolation amplifiers
• Isolation electrically separates two parts of a measurement device
• Protects from high voltages
• Prevents ground loops
– when two connected points are at a different ground potential, creating a current flow in the
interconnection, which produces an offset error
• Separate ground planes of data acquisition device and sensor
• Isolation techniques: Optical, Capacitive, Inductive Coupling
8.5 V
7V
• Before we look at hardware filtering, lets
have a look at sampling concepts ….
Sampling Considerations
– An analog signal is continuous
Adequately
Sampled
Signal
Signal
Aliased
Signal
Sampling & Nyquist’s Theorem
• Nyquist’s Theorem
– You must sample at greater than 2 times the
maximum frequency component of your signal to
accurately represent the frequency of your signal
Aliased Signal
Adequately Sampled
for Frequency Only
(Same # of cycles)
Adequately Sampled
for Frequency and
Shape
100Hz Sine Wave Sampled at 1kHz
Hardware Filtering
• Filtering
– To remove unwanted signals from the signal that you are trying to
measure
Frequency Domain:
Analog filters
• Filter types: LP, HP, BP, BS, Notch
• Passive filters:
– RC, LCR
– (often inductors L are avoided, but they
are needed for high Q-factor)
• Active filters
– opamp + R and C
– (can avoid L)
LP HP
Switched-Capacitor Filter
• Can be suitable as an ADC anti-aliasing filter if you build your
own electronics
• Be aware of possible clock noise (add RC-filters before and after)
• The corner frequency (cut-off) fc is “programmable” using an
external clock
• Example:
– MAX7400 8th-order,lowpass, elliptic filter
– MAX7400 has a transition ratio (fs/fc) of 1.5 and a typical stop band
rejection of 82dB
Importance of LP-filter selection for
DAQ bandwidth
• fc = cut-off frequency
• fs = sampling frequency
• BW = bandwidth
M (dB)
BW
0
-3
Mstop
f (Hz)
fc’ fc
fstop
fs = 2*fc fs = 2*fstop
• Multiplexed
• Simultaneous
sampling
ADC resolution
• The number of bits used to represent an analog signal determines the
resolution of the ADC
• Larger resolution = more precise representation of your signal
• The resolution determine the smallest detectable change in the input
signal, referred to as code width or LSB (least significant bit)
Your Signal
DAQ Device
Computer
Cable
Terminal Block
– Controller
– Peripheral modules
PXI chassis
• The PXI chassis contains the backplane for the plug-in DAQ
cards
• The chassis provides power, cooling, and communication
buses for the PXI controller and modules.
• Chassis are available both with PCI and PCI Express
• 4 – 18 slots chassis are common
PXI controllers
• PXI Embedded Controller
DMA transfer
Data acquisition card RAM (in the PC)
FIFO PC Application
Data ADC Data
buffer buffer memory
From sensor sclk To PC buffer
DAQ data overwrite and overflow
• An overwrite error indicates that information is lost and occurs
when the software program does not read data from the PC
buffer quickly enough. Samples that are written to the circular
PC buffer are overwritten before they are read into the
application memory.
– Solution: use Producer-Consumer architecture.
• An overflow error indicate that information has been lost
earlier in the data acquisition process. Overflow errors indicate
that the First In First Out (FIFO) memory buffer onboard the
data acquisition card has reached its maximum capacity for
storing acquired samples and can no longer accept new
samples. An overflow error is symptomatic of a bus transfer
rate that falls short of the requested data input rate.
– Solution: use a Direct Memory Access (DMA) transfer mechanism.
How Is Buffer Size Determined in
LabVIEW DAQmx ?
• If the acquisition is continuous (sample mode in DAQmx Timing.vi
set to Continuous Samples), NI-DAQmx allocates a PC buffer equal
in size to the value of the samples per channel (gives the number
of samples to acquire) property, unless that value is less than the
value listed in the following table. If the value of the samples per
channel property is less than the value in the table below, NI-
DAQmx uses the value in the table.
Sample Rate PC Buffer Size
No rate specified 10 kS
0–100 S/s 1 kS
101–10,000 S/s 10 kS
10,001–1,000,000 S/s 100 kS
>1,000,000 S/s 1 MS
• You can override the default buffer size using the function DAQmx
Configure Input Buffer.vi
Solve the DAQ related
High-speed DAQ problems listed on the
next slide!
Consumer loop
Timed Loop II
File - VI Properties»Execution:
Software Timing
𝑡 = 𝑡0 + ∆𝑡
1
∆𝑡 =
𝑓𝑠
• If the data samples are not deterministic (regular), e.g. video
frames from a camera, each data point/video frame must
include a timestamp
Signal based vs. time-based
synchronization
• Signal-based synchronization involves sharing signals such
as clocks and triggers directly (wires) between nodes that need
to be synchronized.
• Time-based synchronization involves nodes independently
synchronizing their individual clocks based on some time
source, or time reference.
• There are advantages and disadvantages to both methods of
device synchronization.
Synchronization Basics
Signal-based synchronization
• In systems where the devices are near each other, sharing a
common timing signal is generally the easiest and most
accurate method of synchronization.
http://zone.ni.com/devzone/
cda/tut/p/id/11805
Postrun analysis / Quicklook tool
• Usually not sufficient to only look at the data in “real-time” (live)
Example: VISION
• Example: Configuration of a GigE Airbag deployment test
Vision camera
• Use MAX and the camera manual
to find the commands to configure
the camera
Vision time stamping example
Question: How to accurately time
GE680C – Visual camera (205 fps) stamp each image from a camera to
GPS time, without any delay added
from the software loop?
sync out
Loop time stamp is
not equal to image
sample time!
Image ref.
Can timestamp the rising edge of
the signal using e.g. the NI PXI 6682
card (GPS, IEEE 1588 and IRIG-B)