Computerized Measurement Systems (EEMN10) 2016 CHRISTIAN ANTFOLK & JOSEFIN STARKHAMMAR Course information 2016 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 2016 Course information 2016 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), Mondays & 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 2016 3 Assignments Assgn 1: LabVIEW (Hand-in deadline Sunday 13.11.2016) Assgn 2: DAQ Boards (Hand-in deadline Sunday 20.11.2016) Assgn 3: Home Lab (Hand-in deadline Sunday 16.12.2016) 2 Labs Lab 1: GPIB (Week 46, room E:1309b)» Wednesday 16.11.2016 at 8-12 or Thursday 17.11.2016 at 8-12 Lab 2: DAQ-PAD (Week 47, room E:1309b)» Wednesday 23.11.2016 at 8-12 or Thursday 24.11.2016 at 8-12 Course information 2016 Project: Build a measurement system (room E:1309B) Choose project week 3 of the course Short project description and suggested approach to solution Sunday 27.11.2016 Short oral presentation Monday 12.12.2016 + written report Report hand-in Friday 16.12.2016 Gear : PC with LabVIEW and Matlab 3
Example projects (previous years) 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) Preliminary schedule for EEMN10 2016 Week Day Date Time Place Lect no: Topic Lecturer Assignments Labs (E:1309b) Project 44 Monday 31.10.2016 10 12 E:1328 1 Introduction to the course CA Friday 04.11.2016 13 15 E:1328 2 LabVIEW I (introduction, variables, structures etc) JS LabVIEW II (subvi's, error wires, data flow control) :: Assgn 1 45 Monday 07.11.2016 10 12 E:1328 3 info JS Assgn 1: LabVIEW(Deadline Sunday 13.11.2016) Friday 11.11.2016 13 15 E:1328 4 Databuses and communications : Project suggestion list CA Monday 14.11.2016 10 12 E:1328 5 LabVIEW III :: Instrument control :: Lab1 and Assgn 2 info & prep JS Assgn 2: DAQ board 46 (Deadline Sunday Lab1 : GPIB Friday 18.11.2016 13 15 E:1328 6 LabVIEW in industry / Design patterns DVEL 20.11.2016) Choose project 47 Monday 21.11.2016 10 12 E:1328 7 Data acquisition boards and USB DAQ :: Lab 2 info & prep CA Project plan Lab2: DAQ (Deadline Sunday PAD Friday 25.11.2016 13 15 E:1328 8 Signal conditioning CA 27.11.2015) Monday 28.11.2016 10 12 E:1328 9 Signal processing data presentation, questions and check up CA 48 Software for measurement systems (LabCVI, Measurement Friday 02.12.2016 13 15 E:1145 10 Studio, HP VEE, Dasylab) CA Assgn 3: Home Lab assignment Data acquisition using Matlab :: Assgn 3 info & prep + LabVIEW (Deadline 16.12.2016) Project execution 49 Monday 05.12.2016 10 12 E:1328 11 @ Elmät JS/GUEST Friday 09.12.2016 13 15 E:1328 NO LECTURE 50 Monday 12.12.2016 10 12 E:1328 12 Project presentation / demonstrations CA/JS Friday 16.12.2016 13 15 E:1328 NO LECTURE Report hand in 2 Wednes day 10.01.2017 8 12 E:1328 EXAMINATION 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 2016 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 Download LabVIEW & Matlab LabVIEW Go tohttp://www.ni.com/academic/download.htm Download LabVIEW Student serial number : M79X96296 Matlab Go to http://program.ddg.lth.se/ Log in Follow the instructions 21