![]() |
|
![]() |
Using Labview for field applications: |
| The engineering school of ULB covers a
wide range of disciplines. Among these are MechanicalEngineering where
most of the heavy experimental facilities in mechanical testing are concentrated
in the Department of Applied Mechanics (SMA)
|
| Laborelec is the Research Center of the Belgian Utilities located in StGenesius Rode B-1630 LINKEBEEK BELGIUM. |
| Labview is widely recognized as a outstanding tool for prototyping
virtual instruments (vi's in short). That is why it is increasingly popular
with scientists and research engineers in the laboratory community. Besides,
National Instruments has supplied quite a variety of fancy tools and I/O
cards with advanced drivers and examples for their use, thus making life
very attractive for creative developers. If you browse the other related
web page of this site, remember that most virtual instruments were developed
by students and young researchers of the Free University of Brussels without
strong computer science background and with some coaching from more seasoned
programmers and electronics specialists. In fact it took more time and
effort to set up the test rigs to simulate defects in bearings, gear drives,
shaft lines, alignments, etc. than to develop vi's
Failing to transfer this lab knowledge to the field would be sad, especially for troubleshooting applications based on advanced data processing techniques so easy to design in Labview. Field applications also provides an invaluable feedback to further tune the vi tools validated on tests rigs. |
| One nice thing about vi's is that you can duplicate them on numerous
PCs. A single PC can accommodate lots of general and dedicated vi's that
can be recalled by the field engineer depending on the problem at hand.
No more cargoes of dedicated devices to carry around and a substantial
savings on the investment.
First, field applications may hold some surprises for beginners who want to let migrate their lab vi's and cards: noisy environment and ground loops are always lurking somewhere down the road. Not paying due notice to them may result in damaging not only the hardware (card, PC, etc.) but also the process they want to investigate. Merely connecting to signals vital to control loops without extra care may wreak havoc in them. We know of people who tripped nuclear units a few years ago (not with vi's at the time) for not heeding ground-loops. Second, one should try to identify a good I/O card with good support that could perform most the I/O tasks required by the vi's in the PC, especially with standard PC's with limited slots, IRQ's, etc. Why ordinary PCs? Simply to provide field engineers with a single device for both their office work and their instrumentation. So better to avoid cards that may be wonderful for data acquisition only but may lack good counter and trigger capabilities and/or DACs. This curtails their scope severely. This page basically tells how to strike a good compromise to fulfill most of these requirements for medium-to-fast signals in the vibration and vibroacoustic domain and any slower signals that can also be addressed by standard solutions often based on serial buses like RS232 or 485, although these save on wiring costs. Remember once again that one deals with field problems not warranting the same accuracy as in lab grade equipment. |
Card selection
| If one decides to work with Labview, better use the National Instruments
cards. They may turn out a little more expensive. However, Labview examples
illustrate how to use their drivers efficiently. Chances are that you can
start from them to write your application. Advanced applications involve
ADC, DAC, counter triggered and/or double-buffered data transfer to memory
or disc and many others. Experience has shown that the availability of
reliable drivers for costlier cards far outweighs their marginal price
increase.
The most popular series is the MIO family. You can find them at all prices and speeds for all sort of buses, from AT to PCI, PXI and even on cards with an independent processor running with a real-time OS. Their functions are (almost) alike for all of them. Well deserving hteir name they are really multiple input/output. They allow data acquisitions, counting, generating pulse trains, DAC, digital input/outputs, triggers of all kinds, etc., many of these acquisition or generation schemes being able to run concurrently even under Windows which is not particularly real-time. |
Again the versatility of MIO cards and the wonderful list of examples
how to use them outweighs a few drawbacks like:
|
|
With such a front-end module, all Labview applications of this site
are safe for field use with an additional triggering unit module featuring:
A fully Labview controlled trigger unit is being readied for the same module with an automatic setting of trigger levels. It also uses the resources of the MIO card. Ever tried to fight getting a proper trigger level for other tacho signals than TTL? |
Applications
| All applications of the present site qualify for this front end conditioning. However, it is best described by means of a digital recorder streaming transient signals directly onto the hard drive of a PC. Such a straightforward application is easy to understand without much background. |
| Wish List for aDigital Transient Recorder
Virtual Instrument.
What would one like as a device to record transients on multiple channels in a field application? Typically, one would wish not to bother about
|
| Example
Suppose you want to record volts and bars on channels1 and 2. All you know about your sensors are:
|
| Vi for data recording |
| Typically asks you where to store data and associated configuration
file
Original signal from scope vi with a sawtooth signal (green for volts
and red for bars) with large positive offset and small dynamic component.
The scope operates from the same MIO card after setting offsets and gain
for both channels at zero and one for both channels. The scope displays
inputs in volts.
|
| Now let us configure the digital recorder as follows.
Suppose one wants to record a transient over two channels at 4000 samples/sec. Buffer sizes for the MIO card and lengths of data to stream to disc per access can be defined not to lose data to memory overflow or due to other disc accesses in Windows. The file *.DAT where to store data is selected with a prompt.
|
| After hitting "SAVE", another vi panel comes up:
If you hit new configuration, the vi asks for the number of input channels you want to record (not shown). In this case, one specifies 2 channels. A configuration table with 2 rows appears. In each row you can specify the physical label of the physical unit,
the sensitivity of the sensor and the expected range expressed in physical
units and finally the sensor offset. Then you may select whether you want
a antialiasing filter and which type (more on this later) and eventually
the kind of coupling you wish AC/DC. An optional text zone helps later
identification of the record
|
Push on "save configuration". The signal conditioning unit gets
configured automatically and bargraphs appear telling how your actual signal
compares with the dynamic range computed from your configuration. In this
version they extend from zero to the min and max value. Better would be
a bargraph extending from min to max.
Fig.4. After seeting your channels, check overflows with current signals If there is saturation, press "not OK" otherwise "OK". In this case, recording starts. You stop it by pressing "stopping" button. |
| Action of the front-end signal conditioning |
Let us now have a look on the scope at the input signals after conditioning.
![]() Fig.5. Full scope display of previous oscillogram |
| Playing back the digital record |
After recording the volt/bar signals, one may wish to play it back.
One must then start another vi for playback: Display12.vi. In its prototype
version it enables to select the record file from a prompt. It associates
the data file with the corresponding configuration file. In this way, it
re-constructs the original signal for channel 1 (bar units) that was expanded
for better S/N by the front-end conditioning unit. Most popular buttons
of recorders and some others got implemented for easy use:
perform an FFT on any part of the time signal with(out) zooming. Better would be to implement time-frequency spectrograms in the future. In both cases and despite the tremendous speed of nowadays PCs and their RAM sizes, it is advisable not to select too lengthy time records to process. This is partiuclarly true when Joint-Time-Frequency methods are invoked to obtain spectrograms. |
Playing back the previous record typically looks like the Figure
below.
Fig.6 Original front panel of vi for playback. Channel zero is masked by the (optional) display of the configuration.
Label is in V. It is confined in the upper region of the [-10, 10] V region
as prescribed in the configuration.
|
Filter issues
| Background information
When using an ordinary tape recorder, signals are implicitly filtered according to the tape speed. The S/N may not be great at times (at least in FM mode at low speed). At any rate, one need other devices to perform FFTs and other frequency-related data processing. These devices are fit with antialiasing filters. Trouble with digital recorders is that they must eliminate aliasing first priot to digitizing signals. If that is the case, playing back the record and performing FFTs is a child's game in Labview. Since the AD of the MIO card are not supplied with antialiasing filters, one must supply them prior to recording in digital mode. The front-end conditioning provides such a filtering function with a cutoff frequency depending on the scan rate (data acquisition rate per channel). As mentioned earlier, it is set to 1/3 of this scan rate and could be somewhat lowered to 1/4 to make sure that the cutoff is complete at the Shannon frequency (half scan rate). The next example shows the action of these filters by feeding channels 1 and 2 with a square wave whose frequency is swept from almost zero Hz to 4000 Hz. The data acquisition rate is 4000 samples/sec. Channel 0 is unfiltered. Channel 1 is Buttterworth filtered at 1200 Hz cutoff frequency. One records both channels for about 60 sec and plays it back until
one reaches the point when the frequency of the square wave passes through
the Shannon frequency. The playback with Display12.vi is shown below with
the progressive attenuation of channel 1 by the 8-poles Butterworth filter
between 19 and 36 seconds into the recording.
|
| FFT on filtered signal
Let us then zoom on the start of this transient at about 19.2 sec into the recording phase and perform an FFT on channel 0 (filtered) and 1 unfiltered. At 19.25 sec approximately after strating the recorder, the fundamental of the square wave is shown in the frequency amplitude spectrum below obtained with Display12.vi by selecting the first trace as belonging to the channel 1 and pressing the "FFT(x)" button. It is at circa 900 Hz. |
| FFT on unfiltered signal
In contrast aliasing is severe on the frequency spectrum obtained
for the unfiltered square wave at the same instant (channel 0). The amplitude
of the fundamental is somewhat higher since there is no Butterworth filter
to attenuate channel 1.
|
| Butterworth vs. Bessel filters
When using switched-capacitance IIR filters mimicking analog filters, one must ask the question what the filters are for. Are these simply meant to clean high-frequency noise from time signals and to perform subsequent frequency analyses forgetting about the shape of the time signals? In the first case, better use Bessel while Butterworth filters are better choice for frequency analyses. This dilemma does not exist when using FIR filters as implemented in DSP. We'll see why later when discussing the transfer functions of the filters inside the front-end signal conditioning unit. Records of a square wave with Bessel and Butterworth filters A school case to compare Bessel and Butterworth filters is to feed
them both with the same square wave and see what happens. Again the responses
below were obtained with the digital recorder and playback vi's.
|
Transfer functions of the signal
conditioner antialiasing filters
Free multichannel Fourier analyzer with MIO cardsIn case one overlooks it, many intermediate and advanced MIO cards have two DAC channels. These can be used to generate pink noise to obtain transfer functions in the classical way through averaging of the auto- and cross- power spectra. Adapting some examples from Labview to the MIO card hardware, one managed to get a multi-channel Fourier analyzer. This was then applied to obtain the transfer functions of the Butterworth and Bessel antialiasing filters of the front-end conditioner. For the frequency bands of interest here (up to 20 KHz), the fact that the FET scanner of the MIO ADC are not provided with simultaneous S/H technology is no big drawback at least for the top MIO cards with tiny interchannel delays. The pahse shift this causes is negligible.This Fourier analyzer named FullDynamicAnalyzer.vi yields the following transfer functions for the Bessel and Butterworth filters with the 1200 Hz cutoff frequency of a digital recorder at a 4000 samples/sec scan rate. Before starting the process, one starts another vi called GeneratePulseTrains.vi with a control specifying the cutoff frequency. Once launched, this vi does not consume any processor time (seen from Profile). One assumes that the front-end conditioning unit was configured for either Butterworth or Bessel filtering with gain 1 and zero offset. |
| Bessel transfer function
Nice for cleaning time signal from HF noise because the phase shift
in linear in frequency in the bandpass region. This almost amounts to a
distortion-free time lag of the original signal like with FIR DSP-based
filters.
|
| Butterworth Transfer Function
Roll-off is much cleaner in the bandpass portion where the gain remains
close to unity, but the phase lag is not linear in frequency causing distortion
on the time signal, i.e. no constant group delay. Most FIR filters escape
this problem and even more interesting for FIR antialiasing filters is
the fact that the equivalent time lag amounts to half the number of taps
times the inverse of the scan rate. Bessel filters almost behaves with
a constant group delay, but they exhibit a progressive attenuation in the
bandpass region.
|
12- or 16-bits successive approximation ADC?
Background infoIn some people's mind, selecting a 16-bits successive approximation ADC (SA/ADC in short) is the panacea for forgetting about signal conditioning altogether. To some extent they are right but they may fream in other respects..First never infer from a fast SA/ADC spec with a FET scanner that its useful scan rate is merely the speed of the SA/ADC divided by the number of channels. This assumes that the preamps upstream from the sampling capacitance and often combined in a single chip are fast enough to ensure that their settling time ensures that the sampling capacitance is loaded within at least half one least significant bit of the SA/ADC. Therefore, serious manufacturers (National Instruments among others) often specify different guaranteed scan rates for such SA/ADC for one or more channels operations. Settling times are longer for high gains for preamps. The reason is that average levels for different channels may markedly differ and the scanner must switfly switch between these at high scan rates with a resulting loss of precision. The front end conditioner developed here doesn't dynamically switch channel gains at hte scan rate. Furthermore, the preamp gains are at their minimum value due to the automatic rescaling occurring in the conditioner as mentioned in the configuration file. Second, even if settling time is no issue, you face a more serious one for quasi DC tiny signals. Measurements are generally noisy and it takes some averaging to get an accurate value. That is plain theory of measurement. In that case manufacturers supply well-known solutions for such measurements as (intrinsically noisy from their physics) thermocouples, RTDs and other slow signals. There are the traditional single or double ramp integrators over a few line frequency periods or lately delta sigma converters with built-in low-pass filters to eliminate the line frequencies. All of them perform some implicit averaging (a low-pass filter is an alias thereof amounting to not quite an exponential average). Such averaging defeats the use of such converters for fast signals where either fast delta sigma or SA/ADC rule. The latter are more adequate than delta-sigma converters for fast signals beyond the audio range, provided one knows about the approximate frequency contents or controls it with proper antialiasing techniques. That is one reason among others why the present conditioning has been devised. It covers the whole spectrum of applications plus the ground-loop isolation for field applications. What about the small quasi DC signals if one uses a 12 bits SA/ADC converters. A partial and mostly adequate answer lies in the dithering technique of MIO 12-bits cards. It is used for precise autocalibration of the front-end conditioner. Let us a have a closer look at the Labview driver of the conditioner in case of a slow input signal close to zero. |
| Front conditioner driver and dithering
and autocalibration
Let us have a 12-bit MIO SA/ADC connected to the front end conditioner. The latter outputs a small quasi dc signal to the first channel of the FET scanner of the moi card. The signal is close to zero and varies due to drift within two offset values. Using the built-in dithering feature of this card, on can follow the drift between two successive approximation of the ADC by averaging the dithered input over four line periods. Successive reading of dc signal with and without dithering 1st reading
Why the difference? Presumably because the prototype of the conditioner was not properly shielded. In the first reading the SA/ADC happened to pick up the signal with some noise at the line frequency. This raised the sample by one step of the resolution of the ADC. Dithering is implemented for autocalibration purposes to get precise spline interpolations for gain and offset controls (DAC1 and DCA2). It consists of setting dithering on for the MIO card and averaging 80 samples over four line periods. This statistically eliminates common mode and enhances the 12-bits SA/ADC resolution. |
| Physical Layout of the conditioner
prototype
The results presented above were obtained with a two-channel prototype that helped devise the drivers and applications like the digital recorder and playback vi's. The front panel of the front-end conditioner would look like the design below and accommodate 16 inputs with isolated BNC plugs. Each plug-in card conditions two inputs with ground-loop isolation, filtering and enhanced S/N through floating gains and offsets. The enclosure is shielded for EMC. A few LEDS monitor the operation of the conditioner. Power supply is either 110-240 V ac or optionally from a 12 V battery with voltage stabilization. The rear panel has two sockets for the replication of the MIO card pin plus two isolated BNC plugs for DAC functions either ground loop isolated and thus not connected to the pin replicator or non isolated. This may be helpful for tests on machinery drives where groundloop issues might be crucial (for automatic control engineers). The empty left-hand side panel is reserved for advanced triggering units, where MIO cards and their drivers show some stamina).
The reason for a pin replicator is not to foreclose subsequent applications for such a versatile card as the MIO's, assuming that knowledgeable people are in command and avoid output conflicts with the conditioner. Also for routing the conditioned outputs to other devices (FFT, recorders, etc.) concurrently used with present and future vi's in Labview. |
| Temporary Specifications
Input ranges: -10 to 10 V with protection from transients (e.g. electrostatic discharge) and moderate differential levels. Ground-loop isolation: 1000 V peak. S/N ratio 72 dB (exploiting the full dynamics of switched capacitance
filters and isolation amplifiers)
Drift: being investigated with low-drift opamps and resistances. |
| For the reader of this web page.
We hope that this page amply demonstrates how versatile the MIO cards from National Instruments may be and how to extend their use to field applications. Then Labview which has been so good to enhance productivity in a lab environment stands a better chance to make inroads in the field where one can move the lab experience switfly and without dangers and without worries about ground-loops and without cergoes of devices to carry along. In a forthcoming page, we'll demonstrate how easy it is to perform synchronous sampling with MIO cards phase-locked with a phase reference generating one top/rev without loss of data, an hitherto difficult task reserved to costly devices and perhaps too demanding for delta-sigma converters. Synchronous sampling is almost mandatory for vibrations analysis of all sorts of rotating machinery. National Instruments markets a front-end conditioner to avoid ground loops. It lacks proper antialias filters, programmable floating gains and has no floating offsets. For more detail, click here. |