Computerized Measurement Systems (EEMN10) 2014 CHRISTIAN ANTFOLK & JOSEFIN STARKHAMMAR Course information 2014 Course administrators: Christian Antfolk (christian.antfolk@bme.lth.se) Josefin Starkhammar (josefin.starkhammar@bme.lth.se) Course webpage : http://bme.lth.se/course-pages/datorbaserade-maetsystem/ 1
Course information 2014 Course information 2014 Goal: to give an overview of systems and methods to collect measurement data with the help of a computer in test and industrial environments. To program such a system in eg. LabVIEW or Matlab in a logical and structured way in order to solve a measurement task. Lectures: Lectures in this room (E:1328), Tuesdays & Fridays Course litterature: Will be made available on the course webpage Grades: Passed assignments (handed in on time!), laboratory exercises and project = grade 3. Higher grades require taking the exam. If you decide NOT to follow the course please let us know 2
Course information 2014 3 Assignments Assgn 1: LabVIEW (Hand-in deadline Monday 17.11.2014) Assgn 2: DAQ Boards (Hand-in deadline Monday 24.11.2014) Assgn 3: Home Lab (Hand-in deadline Monday 16.12.2014) 2 Labs Lab 1: GPIB (Academic week 3, room E:1309b)» Wednesday 19.11.2014 8-12 or 13-17 or Thursday 20.11.2014 8-12 Lab 2: DAQ-PAD (Academic week 4, room E:1309b)» Wednesday 26.11.2014 8-12 or 13-17 or Thursday 27.11.2014 8-12 Course information 2014 Project: Build a measurement system (room E:1309B) Choose project week 4 of the course Short project description and suggested approach to solution Monday 01.12.2014 Short oral presentation Friday 19.12.2014 + written report Report hand-in Friday 19.12.2014 Gear : PC with LabVIEW and Matlab 3
Example projects FPGA/CompactRIO-based measurements (industry) Automated Voltage vs. Frequency measurement for an acoustophoresis setup (BME) Control of pneumatic actuators for stimulation in an fmri environment. (Radiation Physics / BME) Schedule (subject to change) Academic week Day Date Time Place Lect no: Topic Lecturer Assignments Labs (E:1309b) Project 1 2 3 Tuesday 04.11.2014 13 15 E:1328 1 Introduction to the course CA Friday 07.11.2014 13 15 E:1328 2 LabVIEW I (introduction, variables, structures etc) JS Tuesday 11.11.2014 13 15 E:1328 3 LabVIEW II (subvi's, error wires, data flow control) :: Assgn 1 info JS Friday 14.11.2014 13 15 E:1328 4 Databuses and communications Tuesday 18.11.2014 13 15 E:1328 5 Instrument control :: Lab1 and Assgn 2 info & prep JS Friday 21.11.2014 13 15 E:1328 NO LECTURE 4 Tuesday 25.11.2014 13 15 E:1328 6 Data acquisition boards and USB DAQ :: Lab 2 and Assgn 3 info & prep JS Friday 28.11.2014 13 15 E:1328 7 Data acquisition using Matlab :: Assgn 3 info & prep JS CA Assgn 1: LabVIEW assignment (Deadline Monday 17.11.2014) Assgn 2: DAQ board assignment (Deadline 24.11.2014) Lab1 : GPIB Choose project Project plan (deadline Lab2: 01.12.2014) DAQ PAD 5 6 Tuesday 02.12.2014 13 15 E:1328 8 Signal conditioning CA Friday 05.12.2014 13 15???? 9 LabVIEW in industry / Design patterns GUEST Tuesday 09.12.2014 13 15 E:1328 10 Signal processing data presentation, questions ST and check up CA/GUE Software for measurement systems (LabCVI, Measurement CA/GUE Friday 12.12.2014 13 15 E:1328 11 Studio, HP VEE, Dasylab) ST Assgn 3: Home Lab assignment (Deadline 16.12.2014) Project execution Tuesday 16.12.2014 13 15 E:1328 12 Project presensation / demonstrations CA 7 Friday 19.12.2014 13 15 E:1328 NO LECTURE Wednes 8 EXAMINATION Lund University day 14.01.2015 Faculty 8 12 of Engineering E:1328 Dept. of Biomedical Engineering Report hand in 4
Overview of the course content Computerized measurement system example Physical quantity Measurement system Signal processing Sensor Signal conditioning, eg. filters & amplifiers Instrument with data bus interface, eg. USB or PXI Personal computer Physical quantity, eg. soundwave 5
Structure of a measurement system Physical quantity pressure temperature speed angular velocity luminosity force Measurement system Signal conditioning DAQ-cards Bus control of GPIB (parallel) RS232 (serial) Bus systems with integrated and standardized VXI/PXI Real time controllers Field buses Presentation (and control) Graphical programming LabVIEW Agilent VEE DASYlab Textual programming LabWindows CVI Measurement Studio Visual Basic Visual C/C++ Matlab Structure of a measurement system Physical quantity pressure temperature speed angular velocity luminosity force Measurement system Signal conditioning DAQ-cards Bus control of GPIB (parallel) RS232 (serial) Bus systems with integrated and standardized VXI/PXI Real time controllers Field buses Presentation (and control) Graphical programming LabVIEW Agilent VEE DASYlab Textual programming LabWindows CVI Measurement Studio Visual Basic Visual C/C++ Matlab 6
Signal conditioning How does the sensor/transducer work? Change in resistance (strain gauge, Pt100) -> Wheatstone bridge Voltage (thermocouple, piezo transducer) Current (semi-conductors) -> generate known voltage drop over known R Filterering (50 Hz), isolation (opto), amplification? A/D conversion Adapt the signal to the working range of the A/D converter Dynamic range (Difference between the smallest and biggest measurable values) How many bits (resolution) does the measurement system has to have to meet the need for measurement accuracy? (8 bits = 2^8=256 signal levels across the measurement range) (+ 10 V => 78 mv per level. 16 bit => 0.3 mv per level) Structure of a measurement system Physical quantity pressure temperature speed angular velocity luminosity force Measurement system Signal conditioning DAQ-cards Bus control of GPIB (parallel) RS232 (serial) Bus systems with integrated and standardized VXI/PXI Real time controllers Field buses Presentation (and control) Graphical programming LabVIEW Agilent VEE DASYlab Textual programming LabWindows CVI Measurement Studio Visual Basic Visual C/C++ Matlab 7
Example of a DAQ card 16 Analog inputs 12-bit A/D converter 1 multiplexed A/D converter 110 khz sampling frequency Programmable range 2 x 12-bit Analog Outputs Internal or external trigger Structure of a measurement system Physical quantity pressure temperature speed angular velocity luminosity force Measurement system Signal conditioning DAQ-cards Bus control of GPIB (parallel) RS232 (serial) Bus systems with integrated and standardized VXI/PXI Real time controllers Field buses Presentation (and control) Graphical programming LabVIEW Agilent VEE DASYlab Textual programming LabWindows CVI Measurement Studio Visual Basic Visual C/C++ Matlab 8
General Purpose Interface Bus Introduced by HP 1965 1 MB/s Requires special cables and och plug-in cards Max 20 m total cable length and 15 Still very much used for instrument control in both industry and research environments, probably due to the rugged connectors General Purpose Interface Bus 9
Structure of a measurement system Physical quantity pressure temperature speed angular velocity luminosity force Measurement system Signal conditioning DAQ-cards Bus control of GPIB (parallel) RS232 (serial) Bus systems with integrated and standardized VXI/PXI Real time controllers Field buses Presentation (and control) Graphical programming LabVIEW Agilent VEE DASYlab Textual programming LabWindows CVI Measurement Studio Visual Basic Visual C/C++ Matlab Serial communications RS-232 Unbalanced (one ground wire + one active wire) Point-to-point Up to 19,2 kbit/s at 15 m cable RS-422 Balanced (both wires are active but in opposite phase) Point-to-point Up to 2 Mbit/s RS-485 Balanced (both wires are active but in opposite phase) Multiple units are connected in parallel, however the communication is serial (Multidrop) Up to 10 Mbit/s 10
Comparison RS232 RS422 1 Tx 0 GND RS232 Tx+ RS422/RS485 Tx- Serial communication USB, FireWire, Ethernet 5 m cable for USB, 5 Gbit/s (USB 3), FireWire 72 m cable 3.2 Gbit/s Ethernet 72 m cable 10 Gbit/s SATA 3 8 m cable Up to 6 Gbit/s Designed to send data quickly to harddrives 11
Example of USB based system Structure of a measurement system Physical quantity pressure temperature speed angular velocity luminosity force Measurement system Signal conditioning DAQ-cards Bus control of GPIB (parallel) RS232 (serial) Bus systems with integrated and standardized VXI/PXI Real time controllers Field buses Presentation (and control) Graphical LabVIEW LabCVI Measurement Studio Agilent VEE (DASYlab) Command LabWindows Visual Basic Visual C/C++ Matlab 12
What is a computer bus? A collection of wires which transfer digital data according to a specific protocol between separate units. There are several standards to allow seamless connectivity of from a number of different vendors. Example : PCI, USB, GPIB, Firewire, SATA, Ethernet, etc Example of entire systems with specific computer buses incorporated in each unit are fieldbuses, VXI-systems, PXI-systems, real-time controllers etc. The PCI bus in a PC The PCI-bus, 32 bits, 133 MB/s, 33 MHz Peripheral Component Interconnect The PCI-e bus, PCI-express, 64 bits, 256 MB/s per line (total of 20 lines), 2 GHZ Full duplex = to send and receive data at the same time => 512 MB/s 13
VXI VMEbus extensions for Instrumentation Faster and more compact than GPIB (40 MB/s with a 32 bit bus) Produced by 250 vendors Can be connected through MXI (Multisystem extension Interface), or GPIB if there are other more traditional in the system FireWire (IEEE-1394), USB, LAN etc PXI PCI extensions for Instrumentation Like VXI but with PCI bus More compact, cheaper Also PXIe for the faster PCI express bus 14
Real time controllers Basic idea: combine measurement tasks and signal generation with dedicated hardware Advantages: fast, robust Car industry, power industry, automation Plug in cards Stand alone module Industrial systems Fieldbuses Used to interconnect automation devices in a network Heavily used in industry 15
Fieldbuses Fieldbuses - example Cars (CAN-bus) More and more gadgets and driver aid systems has increased the total weight of the wiring in cars. (Engine control systems, ACC, ABS, ESP...) Gambro s AK100 Elevators Photo copy machines Toys 16
Why use fieldbuses Distributed intelligence gives: Less cabling, especially over long distances Measurement cells can be made self calibrating or be calibrated remotely through the bus Self diagnostic systems Flexible system when transducer units are exchanged Structure of a measurement system Physical entety pressure temperature speed angular velocity luminosity force Measurement system Signal conditioning DAQ-cards Bus control of GPIB (parallel) RS232 (serial) Bus systems with integrated and standardized VXI/PXI Real time controllers Field buses Presentation (and control) Graphical LabVIEW LabCVI Measurement Studio Agilent VEE DASYlab Command LabWindows Visual Basic Visual C/C++ Matlab 17
LabVIEW National Instruments Graphical Programming Language G Current version LabView 2014 Virtual Instruments Virtual Three mail building blocks: Data collection (software for communication with measurement device, e. g. ordinary instrument, DAQcard or through VXI/PXI) Analysis (statistics, filtering, spectral analysis...) Presenation (all settings can be handled through the program window which is designed for the specific measurement task, data presentation etc. Hence, the name Virtual Instrument) 18
Example of a LabVIEW program Front panel Example of a LabVIEW program Block diagram 19
Dataflow programming Execution determined by the structure of the program A poor example of a LabVIEW program 20
A better example of a LabVIEW program 21