You are on page 1of 3

S&V OBSERVER

Using MATLAB for Vibration Measurements


Thorsten Beierle, Data Translation, Inc., Marlboro, Massachusetts
Vibration measurements are critical in
predictive maintenance and diagnostic fault
testing applications for quality assurance.
This article describes the following topics
that are important when choosing a vibration measurement solution:
Sensor Considerations
Hardware Considerations
Sigma-Delta A/D Converters
Simultaneous Inputs
AC Coupling
Software Considerations
Configuring External Hardware
Acquiring Data from Accelerometers
Reading Data into MATLAB
Generating Reports and Applications
Sensor Selection. Typical vibration applications use IEPE (Integrated Electronics
Piezo Electric) accelerometers to measure
vibration. An accelerometer consists of
a piezoelectric element in series with a
known mass (see Figure 1). When the accelerometer is mounted to a vibrating surface,
the mass applies force to the piezoelectric
element, generating an electrical charge
that is proportional to the acceleration of
the applied vibration.
A wide range of IEPE accelerometers are
available, including those that measure
along only one axis and those that measure
up to three axes simultaneously, called
triaxial accelerometers. Different mounting
options and measurement ranges are available to suit an application.
When choosing a vibration measurement
solution, ensure that your data acquisition
system supports direct connection of IEPE
inputs, and that the measurement range of
your sensor is within the input range of your
data acquisition system. For example, if
you want to measure a 6 V input signal, the
full-scale input range of your system should
exceed 6 V. In addition, if you are using a
triaxial accelerometer, ensure that your data
acquisition system simultaneously supports
up to three IEPE inputs so that you can correlate measurements on all three axes.
Most accelerometers require a current
source of 4 mA and a compliance voltage of
at least 18 V to drive their internal circuitry.
Other accelerometers require a 2 mA current
source, but have limitations in cable length
and bandwidth. Ensure that your data acquisition system supports the requirements
of your sensor.
Sigma-Delta A/Ds. Most vibration measurement applications require a data acquisition system with an anti-aliasing filter
in the A/D circuitry to eliminate unwanted
frequencies in the measurements. SigmaDelta A/Ds have anti-aliasing filters built-in.
Sigma-Delta converters offer the following
advantages, making them ideal for vibration
measurement applications:
Reduce noise and improve accuracy by


SOUND AND VIBRATION/MAY 2007

oversampling each input.


Eliminate errors that result from aliasing
and high frequency noise by using a builtin decimation filter.
Provide excellent low-level signal-tonoise performance, which improves dynamic accuracy on low-level signals.
Provide excellent differential linearity,
which ensures consistently accurate data
conversion across the full input range of
the signal.
For precise measurements, 24-bit SigmaDelta A/Ds are also desirable since they allow you to measure the full dynamic range
of the input sensors.
Simultaneous A/Ds. Simultaneous sampling increases the bandwidth of signals
that you can accurately measure, while
eliminating several sources of error, including time skew and cross-talk between
channels. One A/D converter per channel
increases the modules overall sampling
frequency (when compared to multiplexed
architectures) and increases the signal bandwidth that you can acquire. For example, if
your module provides a sampling frequency
of 100 kHz per channel, then according to
Nyquist, you can accurately measure up to
50 kHz on each channel when using a simultaneous A/D architecture. In contrast, in
multiplexed architectures, the usable signal
bandwidth decreases with every additional
channel you measure.
With a simultaneous A/D architecture, all
signal inputs are sampled at the exact same
instant in time, therefore, any channel skew,
cross-talk and settling time problems are
also virtually eliminated, allowing you to
produce highly accurate data at high speeds
(see Figure 2).
AC Coupling. To measure low frequency
signals accurately at the Nyquist sampling
rate, it is important that your anti-aliasing
filter supports a wide passband to eliminate
unwanted high-frequency components.
An ideal anti-aliasing filter passes all signals in the band of interest and blocks all
signals outside of that band. However, in
practice, the roll-off characteristics of the
anti-aliasing filter allow some signals to

0 dB

pass above the filters cutoff frequency. By


using AC coupling, you can eliminate any
DC that may pass through the anti-aliasing
filter, thereby, maintaining the integrity of
your signal. As shown in Figure 3, the low
frequency breakpoint of 0.5 Hz allows very
low frequency measurements.
Data Acquisition Software Considerations. When choosing software for data
acquisition and analysis, the following
considerations are important:
Support for a wide array of data acquisition hardware
Strong data analysis libraries
Scripting that is easy to read, modify,
and debug
Application development support
F= M xA
Mass (M)
Output
Piezoelectric
element

Vibratory acceleration (A)


Accelerometer
output

Vibration

Figure 1. How accelerometers work.

Figure 2. The DT9837 and DT9841-VIB USB modules from Data Translation provide up to 8, 24-bit
Sigma-Delta converters for precise, simultaneous
analog input measurements. a) Simultaneous
sampling eliminates time skew between channels
and simplifies both time and frequency based
analysis techniques. b) Sequential (multiplexed)
sampling may require software correction for
detecting certain patterns.

3 dB single pole
6 dB per octave roll-off

3 dB @ 0.49 x sampling
frequency (eliminate
Nyquest aliases)

Wide-band pass

3 dB

Data
acquisition
system

Built-in digital filter


provides brick=wall
roll-off

Near 0 ripple in pass band


(Linear phase)

100 dB @ 0.55 x sampling


frequency
0.5 Hz

Frequency

25.8 kHz

Figure 3. Data Translations DT9837 and DT9841-VIB modules provide software-selectable AC and
DC coupling. When AC coupling is selected, the modules eliminate any DC that may pass through
the anti-aliasing filter. The excellent brick wall anti-alias filter eliminates unwanted high frequency
interference.

www.SandV.com

MATLAB
Data acquisition toolbox

Data Translations DAQ


adapter for MATLAB

Data Translations data


acquisition USB modules

IEPE sensors

Figure 4. While the Data Acquisition Toolbox is


collecting vibration data from the USB module,
MATLAB can analyze and visualize the data.

Report generation to share results


MATLAB is a well known interactive
software environment for data acquisition
and analysis, report generation and test
system development. MATLAB provides a
complete set of tools for acquiring and analyzing analog and digital I/O signals from
a variety of PC-compatible data acquisition
hardware. The MATLAB Data Acquisition
Toolbox lets you configure your external
hardware devices, read data into MATLAB
and Simulink for immediate analysis, and
send out data for controlling your system.
The diagram in Figure 4 depicts an example using MATLAB and the MATLAB Data
Acquisition Toolbox with Data Translations
DT9837 to acquire vibration data from
USB modules. Notice that Data Translation provides an interface layer, called the
DAQ Adaptor for MATLAB, which allows
the MATLAB Data Acquisition Toolbox to
communicate with Data Translations hardware. While the Data Acquisition Toolbox
is collecting data, MATLAB can analyze and
visualize the data.
The following sections describe in detail
how you can use MATLAB to measure vibration data from two triaxial accelerometers
using two Data Translation DT9837 USB
data acquisition modules, and display the
results as shown in Figure 5.
Configuring Your External Hardware.
To configure your external hardware, first
connect the X, Y and Z outputs of one accelerometer to analog input channels 0, 1 and
2 of the first DT9837 module. Then, connect
the X, Y, and Z outputs of the second accelerometer to analog input channels 0, 1 and
2 of the second DT9837 module.
If you want to start acquisition on both
modules simultaneously, connect a shared
external digital TTL trigger input to both
modules. A rising-edge on the external trigger input will start data acquisition on both
modules. In MATLAB, set up your script as
follows to finish configuring your system:
% Register Data Translations DAQ Adaptor
for MATLAB
www.SandV.com

Figure 5. This example uses the MATLAB Data Acquisition Toolbox with Data Translations USB modules
to measure and analyze vibration data in one integrated environment.

Figure 6. Data are acquired and plotted in MATLAB for immediate analysis.

daqregister ('dtol');

AI1.channel.Coupling = 'AC';

% Create an analog input object to communicate with each DT9837 module


(AI0 corresponds to the first module;
AI1corresponds to the second module)
AI0 = analoginput('dtol', 0);
AI1 = analoginput('dtol', 1);

% Configure the external digital trigger (rising edge) for each DT9837 module
set([AI0 AI1], 'TriggerType', 'HwDigital');
set([AI0 AI1], 'TriggerCondition',
'Rising');

% Add A/D channels 0, 1 and 2 one channel for each axis of the accelerometer to
each analog input object
addchannel(AI0, 0:2);
addchannel(AI1, 0:2);
%For each DT9837 module, configure A/D
channels 0, 1 and 2 for IEPE inputs; each
channel uses a 4 mA current source and
AC coupling
AI0.channel.ExcitationCurrentSource =
'Internal';
AI0.channel.Coupling = 'AC';
AI1.channel.ExcitationCurrentSource =
'Internal';

% When a trigger is detected, continuously


acquire data until a stop function is issued or until an error occurs
set([AI0 AI1], 'SamplesPerTrigger', inf);
% Configure the clock for the each DT9837
module, setting the clock rate to the
maximum clock rate supported
maxRate = daqhwinfo(AI0,
MaxSampleRate);
set([AI0 AI1], 'SampleRate', maxRate);
% Allocate memory to store the data
set([AI0 AI1], 'BufferingConfig', [1000 5]);
% Define the number of samples (10000, in
this case) to acquire for each channel
set([AI0 AI1], 'SamplesAcquiredFcnCount',
10000);
SOUND AND VIBRATION/MAY 2007

% When 10000 samples have been acquired


for each channel, define the function to
call to plot the data
set(AI0, 'SamplesAcquiredFcn',
{@plotData0});
set(AI1, 'SamplesAcquiredFcn',
{@plotData1});
Acquiring Data from Two Triaxial Accelerometers. Once you have wired your
external hardware and configured it in
MATLAB, start the analog input objects using
the following script in MATLAB:
% Start the analog input objects on both
modules
start([AI0 AI1]);
When a rising edge of the shared digital
trigger is detected by each module, data
acquisition begins. The data are acquired
from all six IEPE inputs at the maximum
clock rate of the device, and the data are
stored in the memory you allocated.
Reading Data into MATLAB for Immediate Analysis. When 10,000 samples are
acquired by each input channel, the callback functions you referenced previously
(plotData0 and plotData1) are called. These
functions read the data into MATLAB and
plot it for immediate analysis.
Callback functions plotData0 and plotData1 are defined as follows:
% G et the acquired data from the first

SOUND AND VIBRATION/MAY 2007

DT9837 module into MATLAB and plot all


three channels separately.
function plotData0(Obj, event)
AI0 = Obj;
data = getdata (AI0, 10000);
ch0a_data = data(:,1);
subplot(3,2,1); plot(ch0a_data)
ch1a_data = data(:,2);
subplot(3,2,3); plot(ch1a_data)
ch2a_data = data(:,3);
subplot(3,2,5); plot(ch2a_data)
end
% Get the data from the second DT9837
module into M ATLAB and plot all
three channels separately.
function plotData1(Obj, event)
AI1 = Obj;
data = getdata (AI1, 10000);
ch0b_data = data(:,1);
subplot(3,2,2); plot(ch0b_data)
ch1b_data = data(:,1);
subplot(3,2,4); plot(ch1b_data)
ch2b_data = data(:,1);
subplot(3,2,6); plot(ch2b_data)
end
Generating Reports and Applications. A
report can be automatically generated from
the MATLAB script if it is written using the
MATLAB Editor. To generate a report, press
the Publish to HTML button in the editor.
(Other formats are available.) Pressing this
button will execute the MATLAB script and
embed the scripts contents along with all

plots generated in a single HTML file that


can be viewed and shared as shown in
Figure 6.
MATLAB provides a GUI development
tool called GUIDE that allows you to incorporate the MATLAB script in a graphical
application. Press the GUIDE button in
MATLAB to launch this tool.
Conclusion. When choosing a solution
to measure vibration, consider the IEPE
sensors you need and their requirements,
the capabilities of your USB data acquisition hardware and the analysis software
youll need to accomplish your goals. This
article described an example that used the
MATLAB Data Acquisition Toolbox with
Data Translations DT9837 USB modules
1. Using DT9837 hardware: www.datx.com/products_hardware/prod_dt9837-series.htm.
2. Using MATLAB: www.mathworks.com/products/matlab.
3. Using the MATLAB Data Acquisition Toolbox:
www.mathworks.com/products/daq.
4. Using the DAQ Adaptor for MATLAB: www.
datatranslation.com/products_software/dtmatlab-interface-tools.htm.
For additional information on Data Translation
products, please visit: www.datatranslation.
com.
MATLAB is a registered trademark of The MathWorks, Inc., www.mathworks.com.
The author can be contacted at: tbeierle@datx.
com.

www.SandV.com

You might also like