Вы находитесь на странице: 1из 14

AC 2012-5316: LOW-COST EDUCATIONAL LASER BASED VIBRATION MEASUREMENT SYSTEM WITH IMPROVED SIGNAL CONDITIONING, PYTHON AND MATLAB

Dr. Jonathan M. Hill, University of Hartford Jonathan Hill is an Associate Professor in electrical and computer engineering at the University of Hartford in Connecticut. He has a Ph.D. and M.S.E.E. from Worcester Polytechnic Inst. in Worcester, Mass., and he was previously a Project Engineer at Digital Equipment Corp. He instructs graduate and undergraduate computer engineering computer courses, directs graduate research, and performs research involving embedded microprocessor based systems. His current projects involve small system design, signal processing, and intelligent instrumentation. Dr. Devdas Shetty, University of Hartford Devdas Shetty is a professor of mechanical engineering and the Dean of Research at the University of Hartford, Conn. Previously, he held the position as Dean of Engineering at Lawrence Technological University, Michigan, and a faculty position at the Cooper Union for Advancement of Science and Art, N.Y. He is the author of more than 200 papers and three books on mechatronics and product design. Shettys eld of expertise involves mechatronics system design, innovative product design, laser instrumentation, laser material processing, unmanned aerial systems, guided projectiles, rehab system for gait and walking without fall, engineering education, and ABET accreditation.

c American Society for Engineering Education, 2012

Low Cost Educational Laser Based Vibration Measurement System with Improved Signal Conditioning, Python and M !L B
bstract This project involves a laser based vibration measurement system that has educational value and can be used in a student laboratory. The system must be small, inexpensive, and convenient to use, without extensive programming. The LabJack U3 ac uisition system was used with a laptop and a netbook computer. !ur use o" #ython and $%TL%& are suitable so"tware choices "or this system. The vibration measurement system provides cross'disciplinary educational opportunities with hands'on experimental activities. The ac uisition module provides an opportunity to study sampling and the sampling delay between successive channels. The input signal conditioning ampli"ier provides an opportunity to study simple operational ampli"ier circuits as well as study instrumentation principles such as the notion o" the common'mode and di""erential'mode with respect to signals. Introduction This project involves a laser based vibration measurement system that has educational value and can be used in a student laboratory. This project continues research reported by (hetty, )ondo, and *oriega+, which investigated the development o" the experimental apparatus used here. The experimental apparatus is used in the $,-./ capstone design project as well as the $,010 mechatronic system design course, taken by mechanical engineering students. !ne major challenge o" any concentration, such as mechatronics is the balance between topics. The "ocus o" our prior research led to a system use"ul to the mechanical engineering degree program. 2owever, today in industry multi'disciplinary teams are most o"ten "ound, consisting o" pro"essionals involved with hardware, so"tware, electronics, as well as mechanical hardware. %s such, our vibration measurement system must be more use"ul to other degree programs as well as multi'disciplinary teams o" students. This research is based on a new set o" design goals, to improve the use"ulness o" the vibration measurement system. 3hile our new system is compact and is less inexpensive than the prior system, in particular, it is more multi'disciplinary, providing entirely new educational value. The system allows students to more closely study principles involved in sampling and signal conditioning, as well as the opportunity to study data ac uisition so"tware, but without involving intensive programming. These goals were achieved with an inexpensive ac uisition system along with two so"tware tools, namely #ython and $%TL%&. The overall system comprises the experimental apparatus, signal conditioning electronics, a data ac uisition module, and a host computer. The experimental apparatus includes a laser, re"lective "ilm, and a position sensitive device 4#(56, arranged as in 7igure +. % change in position dy o" the re"lective "ilm causes a change in position dx o" the spot, o" the incident laser beam. The #(5 is like that illustrated in 7igure /. % #(5 is a photo'electric device with two output terminals, 8+ and 8/.

3hen the laser is incident at the center o" the #(5 device, the terminals 8+ and 8/ have the same 8oltage relative to ground. , uation 4+6 is used to determine the position o" the spot o" light, along the device axis.

7igure +9 ,xperimental apparatus dx =

7igure /9 :llustration o" #(5 V1V2 L V1+V2 / 4+6

The experimental apparatus is general purpose in nature, with suitable adjustments it can be adapted as a component in various projects. The sensitivity and calibration o" the experimental apparatus is dependent on the distance y o" the re"lective "ilm and the angle o" the laser beam, as shown in 7igure +. %part "rom the experimental apparatus, we implemented our own signal conditioning electronics, a LabJack0 model U3 data ac uisition module was used, and a laptop and a netbook computer each served as the host. The topics presented in this paper can be used in the classroom as well as with interdisciplinary projects involving electrical, computer, and mechanical engineering students. The intent o" a capstone project is "or students to demonstrate their design abilities in each o" their own corresponding disciplines. (uch a design involve real li"e constraints. :n the "ollowing we present our choices with regard to the host computer system, data ac uisition and so"tware. ,ducational opportunities and hands'on activities are presented. (tudents can examine the notion o" sampling and measure the delay between channels. (tudents can examine and construct signal conditioning electronics and study the nature o" the common'mode and di""erential'mode with regards to signals. % di""erential and common mode signal conditioning circuit is presented in detail, along with a test scenario. % practical example using a mass and spring apparatus is presented. "ost Computer System 3e chose #; type systems, as hosts they can run a modern operating system. 3hile very compact hand'held #; type systems exist, they can be expensive. The laptop computer and netbook used "or this research are each inexpensive and relatively small. $ore details regarding the operating system and selected so"tware are given below. :n selecting the host we did not consider a small microprocessor based embedded system "or use in the classroom, as most o"ten such things involve cross'plat"orm programming, which can be tedious and complicated. %t the opposite extreme, we did not select a prebuilt turn'key type system as the project itsel" is meant to provide educational value to a range o" students.

#ata c$uisition The LabJack model U3'L8 is a small and a""ordable data ac uisition module that connects to a computer using the universal serial bus 4U(&6. The "ollowing are some "eatures provided by the U3'L8. +< multi'purpose ports "or digital or analog input, or digital output %nalog to digital conversions produce +/ bit samples over 1 to /.- 8olt span 7ull resolution sampling is guaranteed "or sampling rates up to /.0k2=. (upports so"tware or hardware timed ac uisition / analog outputs, each with +1 bit resolution over 1 to 0 8olt span

3hile the U3 per"ormance is modest in comparison to other devices, it provides teaching opportunities. :n particular, in this application given the need "or matching samples, we consider the sampling delay between successive channels. 3e also designed a signal conditioning circuit to better match the #(5 range to the span o" the %5;. So%tware Choices The choice to use a #; type system and the LabJack U3 provides us with many options regarding the operating system and application so"tware. %s o" this writing, the LabJack U3 has two sets o" drivers that provide support "or three di""erent operating systems, namely 3indows, Linux, and $acintosh !( >. % search in the LabJack user "orums reveals some interest in the community "or developing applications with tablet #;s. &esides the lower level drivers, LabJack0 supports LabJack#ython which is a cross'plat"orm library which allows #ython< programmers to write applications "or LabJack hardware, using the 3indows, Linux, or the $acintosh operating systems. LabJack#ython works on 3indows using the LabJack U5 5river and on Linux and $acintosh !( > it uses the LabJack exodriver. 7or this research we per"ormed data ac uisition using scripts written in #ython and we later analy=ed the collected data using $%TL%&.. (imilar tool such as !ctave? or 7ree$at@ can also be used. 7or those less interested in data ac uisition and analysis so"tware, there are existing applications such as Lab8:,3+/ that supports LabJack as well. #ython is a power"ul and convenient scripting language "inding acceptance in the industry "or use in laboratory automation. LabJack0 as well as *ational :nstruments3,- both provide support "or the #ython language. $%TL%& is used "or technical computing and is well known "or its educational value. %ll undergraduate students enrolled in our college are re uired to learn $%TL%& and most learn it as "reshmen in ,(++0 ,ngineering ;omputer %pplications. (tudents less interested in data ac uisition so"tware can run #ython so"tware standalone, without being aware o" the actual language used. (tudents with only a modest interest can study the code given in %ppendix % which serves as a complete example. 7or others, 2ughes/ has a comprehensive text that supports the use o" #ython in an undergraduate setting. #ython provides ample opportunities "or "urther development. The (ci#y+1 and *um#y++ libraries provide #ython

with extensive data analysis capability "or extremely large data sets. Likewise, there are several graphical libraries to choose "rom. 3e suggest the wx#ython library which is a cross'plat"orm graphical user inter"ace 4AU:6 toolkit built upon the wx3indows library. 7inally, "or this research we "irst used the Tiny;ore+3 Linux operating system running on a laptop computer and later used a 3indows . netbook. Aiven that our so"tware runs on Linux, 3indows, or $acintosh !( >, picking and an operating system is a modest choice. Tiny;ore is a very small Linux distribution, approximately +/$& in si=e, and is suitable "or embedded #; type systems. !ur laptop boots Tiny;ore Linux o"" a compact disk and runs entirely "rom B%$ so that the system runs applications uickly and has short latency times. % U(& memory stick provides persistent storage, allowing us to easily move data to other computer systems. Educational &pportunities and "ands'&n ctivities The vibration measurement system provides educational opportunities with hands'on experimental activities. To start, the ac uisition module provides an opportunity to study sampling and given the need in e uation 4+6 "or matching samples, we examine the sampling delay between successive channels. The input signal conditioning ampli"ier provides an opportunity to study simple operational ampli"ier circuits as well as study instrumentation principles such as the notion o" the common'mode and di""erential'mode with respect to signals. 7inally our use o" #ython and $%TL%& to per"orm the ac uisition and analysis o" data involves scienti"ic programming. Sampling #elay Between Successive Channels 3hile the LabJack U3 ac uires samples "rom up to +< analog inputs or channels, the device has only one analog to digital converter 4%5;6. The U3 actually ac uires samples "rom channels in rapid succession, so that the U3 is not capable o" sampling multiple channels at a single instance or in a single event. :t is educationally valuable "or students to investigate this phenomenon and veri"y that the delay between successive channels is small compared to the the sampling period. To examine the sampling delay between a pair o" channels, apply a triangle wave extending over the span o" the device and examine the sampled wave"orm. The ideal wave"orms are shown in 7igure 3 and the di""erence between the wave"orms is in 7igure -. The delay Td between channels is "ound using the triangle wave slope and the di""erence wave"orm.

7igure 39 Triangle wave"orm

7igure -9 5i""erence wave"orm

:n e uation 4/6, mr and mf are the rising and "alling slopes o" the triangle wave and in e uation 436, Td is the delay between channels.

mr =

Vpp Tr

mf =

Vpp Tf

4/6 436

Td

Vr Vf mr mf

To demonstrate the circuit, a +112= triangle wave was measured with the LabJack. The wave"orms sampled by the "irst two channels is in 7igure 0, both wave"orms appear to overlap. 2aving the wave"orms close in value causes the di""erence wave"orm to be reduced in resolution. 7igure < is the di""erence wave"orm produced by $%TL%&, which is comparable to the step'si=e Vs. The code is in %ppendix %. The approximate value o" the delay between successive samples Td is 3./C o" the sample period Ts or 1.+C o" the period T o" the sampled wave"orm. Vpp=+.@<8 T =+1ms ,Tr =0ms Vr 0m8 Vs =1.0?@0@m8 mr 3@/8 / Sec Td +/.?u(ec Ts =-11u(ec

7igure 09 (ampled triangle wave"orms

7igure <9 5i""erence wave"orm

:" the delay between successive channels is ever signi"icant, the data can be interpolated with $%TL%& to produce an estimate o" matching samples. To get a "eel "or the signi"icance o" Td, consider the measurement o" a sinusoidal wave"orm. :t is well known that the largest slope occurs at the =ero crossing so that "or a +112=, /.- 8olt pk'pk sinusoid, the slope is no larger than .0-.1 8D(ec, which corresponds to a worst'case error o" +1m8 between channels. Input Signal Conditioning The uality o" samples produced by an %5; is related to how well the corresponding signal is matched to the %5; span. :" the input spans hal" that o" the %5;, then one sample bit is e""ectively lost. Likewise, with the input spanning one' uarter that o" the %5; then two bits are e""ectively lost. This observation is important as we need to make the best possible use o" the +/ bit sampling provided by the U3. % signal conditioning circuit helps to make better use o" the span provided by the %5;, to keep the largest possible number o" e""ective bits.

:n considering e uation 4+6, the denominator is the sum o" 8+ and 8/, which is related to the common'mode 8oltage and the numerator is the corresponding di""erential mode 8oltage. Aiven the need "or the common'mode 8oltage, it is undesirable to use a conventional instrumentation ampli"ier, which produces only the di""erential mode. % "irst approach is to handle 8+ and 8/ separately as single'ended signals, using ampli"iers like that in 7igure .. 3ith 8+ and 8/ ranging "rom 1 to 1.< 8olts, and the %5; spanning 1 to /.- 8olts, a gain o" - is appropriate. :n cases where the %; component o" a signal is signi"icantly smaller than the 5; component, consider the circuit in 7igure ? which provides %; gain Avac that is larger than the 5; gain Avdc. ;apacitor ;+ is chosen "or the desired corner "re uency Fc. :n comparing these two ampli"iers, a pair o" ampli"iers like that in 7igure ? re uires "our additional components.

7igure .9 *on'inverting ampli"ier


Av =+ + R1 R2

7igure ?9 %mpli"ier with increased %; gain 4-6 Av dc =++ R3 R3 Av ac =++ R5 Rx 406

where Rx =

R4 R5 and R4+ R5 + Fc = / R4 C1

:n cases involving a di""erential signal with a 5; component and the di""erential'mode signal is smaller than that o" the common'mode, consider the circuit in 7igure @. This circuit does not use a capacitor in the signal path, allowing the circuit to work with 5; signals as well. The circuit is constructed by replicating the ampli"ier in 7igure . and inserting resistor B+1. % roll'o"" can be applied to reduce the gain "or inter"ering out o" band signals by inserting capacitors parallel to B< and B., respectively.

7igure @9 5i""erential and common mode gain circuit The circuit in 7igure @ is essentially the "irst stage o" a di""erential ampli"ier, but with B? and B@ it is modi"ied to provide additional common'mode gain. The common and di""erential mode 8oltages de"ined in e uations 4<6 are indicated with the subscripts c and d, respectively. Likewise, e uations 4.6 de"ine the common'mode and di""erential'mode gains. , uations 4?6 reverse e uations 4<6, producing the input and output 8oltages. Vic =1.0 ( Via +Vib ) Vid =Via Vib Avc = V c Vic V c =1.0 ( V a +V b) V d =V a V b Avd = V d Vid 4<a6 4<b6 4.6 4?a6 4?b6

Via =Vic +1.0 Vid Vib =Vic 1.0 Vid

V a =V c+ 1.0 V d V b=V c 1.0 V d

:nterpreting the sampled values is straight'"orward as e uations 4@6 provides the relationships needed to evaluate e uation 4+6 "or the #(5. , uation 4+16 gives the gain values, based on given resistor values. Via Vib = V a V b V a +V b and Via +Vib = Avd Avc R! R! and Avd =++ E where R" R# R" R1$ R# = / R" + R1$ 4@6 4+16

Avc =+ +

Constructing the Signal Conditioning Circuit The circuit can be constructed on a breadboard as we have done, or on a #; board. !ur test instruments project webpage+0 will have artwork and a list o" materials "or constructing a #; board. The L$30? operational ampli"ier is one possible choice "or this project. The L$30? is

designed "or low'power applications and is powered by the LabJack, which provides 0 8olt power. The L$30? device can pull itFs output close to the more negative rail 8oltage, which in this case is ground. The device can also swing itFs output positively, to approximately +.0 8olts below the positive rail or 3.0 8olts, which covers the %5; span o" /.- 8olts. 7or the U3, to produce correct conversions all the analog inputs must be in the range "rom '1.3 8olts to G3.< 8olts, but otherwise the ports can withstand slightly higher 8oltages. The "irst ? ports can withstand up to GDH +1 8olts and the rest can withstand up to GDH < 8olts continuously. :n a nutshell, the L$30? is sa"e and compatible "or use with the LabJack U3 device. 7igure +1 is the con"iguration used to test the ampli"ier in 7igure @. The 8oltage sources 8id and 8ix together model a signal generator with a 5; o""set. The signal "re uency was +112=. The "ollowing are the selected component values and the predicted gain values. The resistor Bx and capacitor ;x cause 8ib to appear to be approximately the 5; 8oltage 8ix. B< I B. I 3) B? I B@ I +) B+1 I +) B++ I B+/ I +11 Avc I Avd I +1 Bx I +11 ;x I +m7

7igure +19 Test ;ircuit "or signal conditioning ampli"ier The applied 8oltages in 4++6 can be produced with commonly used lab instruments. The common'mode and di""erential mode 8oltages are in 4+/6, and the outputs are in 4+36. Via =1.+0 cos ( % )+1.3 Vib =1.3 Vic =1.1.0 cos ( % )+1.3 Vid = 1.+0cos ( % ) V a =+.10 cos ( % )++./ V b=1.-0 cos ( % )++./ V c= 1.31 cos ( % )++./ V d =+.0 cos ( % ) 4++6 4+/6 4+36

7igure ++ is the corresponding output. *ote that as expected, while the amplitudes di""er, the output appears to have the correct di""erential'mode and common'mode 8oltages.

7igure ++9 $easured wave"orms "rom signal conditioning ampli"ier Mechanical !est The apparatus used in the vibration measurement system is general in concept. 7igure +/ is an example system using a mass and spring apparatus. Three o" the "our vertical brackets suspending the mass by wire are visible in the "igure. The suspended mass moves "reely up and down in reaction to a "orce applied by a voice coil. The laser and #(5 are above the mass. The LabJackU3 is centered in the "oreground, the breadboard just to the le"t has the signal conditioning circuit. The ampli"ier used to drive the voice coil is in a case just above the breadboard. The suspended mass is above the ampli"ier case.

7igure +/9 $ass and spring apparatus % sinusoidal signal was applied to the voice coil and the "re uency was adjusted "or the resonant "re uency, which was approximately 3.3 2=, by watching "or the maximum excursion. 7igure +/ shows the calculated relative position where the laser beam is incident on the #(5 and 7igure +3 is the corresponding spectrum magnitude wave"orm.

7igure +/9 Belative position on #(5

7igure +39 $agnitude (pectrum

(ignal uality can be an issue, especially with a breadboard. % good ground is re uired and students must watch "or the tell'tale sign o" a peak in the spectrum near the "re uency o" the %; main. :t was also "ound that having the laptop operating o"" its battery improves the uality o" the measured signals. 7inally, to reduce nuisance out band signals, we applied a roll'o"" to the gain near +112=, by inserting 1.-.u7 capacitors in parallel with B< and B., respectively Conclusion This project involved a laser based vibration measurement system with educational value. The system we developed is meant "or cross disciplinary use, is small, inexpensive, and convenient, without extensive programming. The LabJack U3 ac uisition system was "irst used with a laptop computer running the Tiny;ore Linux operating system and later with a netbook running 3indows .. 3e used #ython and $%TL%& "or our application so"tware. The system provides educational opportunities with hands'on experimental activities, in particular, the ac uisition module provides an opportunity to study sampling and the sampling delay between successive channels. The input signal conditioning ampli"ier provides an opportunity to study simple operational ampli"ier circuits as well as study instrumentation principles such as the notion o" the common'mode and di""erential'mode with respect to signals. !ur actual use o" the system to measure vibration provided ample opportunities "or student projects. ppendi( , E(ample with Python and M !L B 2ere we present the code we used to examine the sampling delay between successive channels. Listing + contains the stream1<.py #ython script. The sample period "or each channel is /.0k2= and the sample values produced are written to a simple text "ile. Listing / is the corresponding $%TL%& script. :n stream1<.py, samples are ac uired "rom the "irst two channels, 7:!1 and 7:!+. The LabJack U3 is capable o" hardware or so"tware timing, here we use a hardware timer to ac uire the samples. The U3 itsel" stores samples in a bu""er, which the host reads. 2ence, to avoid losing samples the host must read the bu""ered samples in a timely "ashion. %n important "eature o" the #ython language is that line indentation is an element o" the syntax. :n the listing, based on the indentation, lines /1 and -1 mark the top and bottom o" a loop.

Likewise, lines /+ and 3? mark the i" and else parts o" a test structure. The "ollowing is an outline o" the code9 lines 13, 1lines 10 to 1. lines +1, +3 lines +< to +? line /1 line /+ lines //, /3 lines /- to 31 lines 3+ to 30 line 3< lines 3?, 3@ lines -1 to -. H user de"ined constants H open LabJack library and device, report device name H con"igure the device H initiali=e variables, start sampling, open output "ile H top o" loop, read a packet H veri"y reception o" a valid packet, else go to line 3? H check "or exit condition H check "or errors, over"low, and missed samples H write samples to "ile and report averages H increment counter value, go to line /1 to repeat loop H with an invalid packet report a timeout, go to line /1 to repeat loop H close "ile, stop sampling, close device, produce "inal report

The code was executed on the "ollowing two hosts, a laptop computer running Tiny;ore Linux as well as a netbook running 3indows .. &oth computers execute the same script using LabJack#ython, which is aware o" the underlying operating system and calls the appropriate LabJack driver code. Toshiba (atellite Laptop model %+30 with :ntel T/1?1 dual core ;#U J +..3A2=, / A&yte B%$, Tiny;ore Linux version -.1/, Linux kernel 3.13, #ython /.../, exodriver labjackusb version /.1.-, LabJack#ython'?'/<'/1++ Toshiba netbook model *&310 with :ntel %tom *-00 ;#U J +.<<A2=, / A&yte B%$, 3indows . starter edition service pack +, %ctive (tate #ython /.<.< 43/ bit version6, U5 driver version 3./0

:n running the stream1<.py script on the laptop, there were no missed samples. :n running the script on the netbook, missed samples were observed but only rarely. :t was also "ound that running the script on the netbook in the :dle development system "or #ython slows execution such that samples are regularly missedE this aspect was not tested "or on the laptop. The $%TL%& code is straight"orward. The code in Listing / is used to produce 7igures 0 and <. 7ollowing the comments, the code in lines 13 to 1< read in the sampled data, compute the di""erence wave"orm, as well as the sample period Ts, and the corresponding sample times. Lines 1? to ++ plot the sampled data and lines +- to +< plot the di""erence wave"orm. The given code in Listing / was executed with $%TL%& ..+/.1, !ctave 3./.- and Anu#lot "or 3indows, as well as 7reemat -.+ "or 3indows.

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48

# stream06.py - Derived from streamTest.py example i !a"#a$%&yt'o # T'is a$()ire t*o streami + $'a els from a !a"#a$% ,3 -./0123,24T4 5 50 # t'e )m"er of pa$%ets to read. 67!208.-2 5 94ys.$(06.dat9 # ame of file prod)$ed import )3 # ope )3 li"rary d 5 )3.,3:; # ope a d report t'e devi$e pri t d.$o fi+,3:;<=Devi$e8ame=> # "itmap represe ti + $'a els? *it' 67@0 "ei + t'e ls" d.$o fi+7@:67@. alo+ 5 0x03; # 6or si +le e ded $'a els? mat$' ea$' *it' 8A'a el 31 d.streamAo fi+: 8)mA'a els 5 2? &A'a els 5 < 0?1>?B 8A'a els 5 < 31?31>? 1esol)tio 5 3?B 4ample6re()e $y 5 2500 ; missed 5 0C dataAo) t 5 0 d.stream4tart:; myfile 5 ope :67!208.-2?9*9; for r i d.streamData:;D if r is ot 8o eD if dataAo) t E5 -./0123,24T4D # T'e stop $o ditio "rea% if r<=errors=> F5 0D pri t 9--- 2rrorD Gs C 9 G r<=errors=> if r<= )m&a$%ets=> F5 d.pa$%ets&er1e()estD pri t 9--- , derflo* D Gs D 9 G r<= )m&a$%ets=> if r<=missed=> F5 0D missed H5 r<=missed=> pri t 9--- -issed 9? r<=missed=> 5 le : r<=.780=> ; for ii i ra +e: ;D myfile.*rite: 9Gf GfB 9 G:r<=.780=><ii>?r<=.781=><ii>;; pri t 9.v+19? ?9readsD G.4f9 G :s)m:r<=.780=>;I ;?B 9.v+29? ?9readsD G.4f9 G :s)m:r<=.781=>;I ; dataAo) t H5 1 elseD # ,4J timeo)t ex$eeded? approx. 1 se$. pri t 98o data - timeo)t9 myfile.$lose:; d.stream4top:; d.$lose:; total 5 dataAo) tKd.pa$%ets&er1e()estKd.stream4amples&er&a$%et-missed pri t 9Gs re()ests? Gs pa$%ets per re()est? Gs samples per pa$%et9 GB :dataAo) t? d.pa$%ets&er1e()est? d.stream4amples&er&a$%et; pri t 9Gs samples missed? Gs samples a$()ired9 G :missed?total; # e d of stream06.py

Listing +9 ,xample #ython code

01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18

G timediff06.m - #o at'a Lill G read samples from *aveforms a d plot differe $e sd 5 load:=sd0100'M0tria +le.dat=;C tdiff 5 sd:D?1; - sd:D?2;C Ts 5 1I2500 x 5 :0D124;KTsC fi+)re:1; plot:<x= x=>?sd:1D125?D;?=%=; xla"el:=Time - 4e$.=; yla"el:=Nolta+e=; fi+)re:2; plot:x=?tdiff:1D125;?=%=; xla"el:=Time - 4e$.=; yla"el:=Nolta+e=; G e d of timediff06.m

Listing /9 ,xample $%TL%& code

)e%erences
+. 5. (hetty, J. )ondo, and (. *oriega, K*on ;ontact 8ibration %nalysis Using :nnovative Laser &ased $ethodology,L %(,, *ational ;onvention, /11< ' /<+@. /. John $. 2ughes, Beal 3orld :nstrumentation with #ython9 %utomated 5ata %c uisition and ;ontrol (ystems, copyright /1++ by John $. 2ughes, published by !FBeilly 3. *ational :nstruments, K;alling #ython ;ode "rom Lab8:,3,L modi"ied Jan. /+, /1+1, https9DDdecibel.ni.comDcontentDdocsD5!;'?@@0 -. *ational :nstruments, KUsing #ython "or Bapid #rototyping,L modi"ied (ep. +0, /1++, https9DDdecibel.ni.comDcontentDdocsD5!;'+</0+ 0. LabJack ;orp., http9DDwww.labjack.comD <. #ython o""icial website, http9DDwww.python.orgD .. $ath3orks $%TL%&, http9DDwww.mathworks.comD ?. !ctave, http9DDwww.gnu.orgDso"twareDoctaveD @. 7ree$at, http9DD"reemat.source"orge.netD +1. (ci#y (cienti"ic Tools "or #ython, http9DDwww.scipy.orgD ++. *um#y *umeric Tools "or #ython, http9DDnumpy.scipy.orgD +/. *ational :nstruments, http9DDwww.ni.comD +3. Tiny;ore Linux, www.tinycorelinux.comD +-. wx#ython library, http9DDwww.wxpython.org +0. Test :nstruments #roject, http9DDuhaweb.hart"ord.eduDjmhillDprojectsDtestinstD

Вам также может понравиться