Computerized Measurement Systems (EEMN10)...

21
1 Computerized Measurement Systems (EEMN10) 2014 CHRISTIAN ANTFOLK & JOSEFIN STARKHAMMAR Course information 2014 Course administrators: Christian Antfolk ([email protected]) Josefin Starkhammar ([email protected]) Course webpage : http://bme.lth.se/course-pages/datorbaserade-maetsystem/ Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Transcript of Computerized Measurement Systems (EEMN10)...

1

Computerized MeasurementSystems (EEMN10) 2014CHRISTIAN ANTFOLK & JOSEFIN STARKHAMMAR

Course information 2014• Course administrators:

Christian Antfolk ([email protected])

Josefin Starkhammar ([email protected])

• Course webpage :

http://bme.lth.se/course-pages/datorbaserade-maetsystem/

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

2

Course information 2014

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

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 coursewebpage

• 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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

3

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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Course information 2014

• Project:

– Build a measurement system (room E:1309B)

– Choose project week 4 of the course

– Short project description and suggested approach tosolution Monday 01.12.2014

– Short oral presentation Friday 19.12.2014 + writtenreport

– Report hand-in Friday 19.12.2014

• Gear : PC with LabVIEW and Matlab

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

4

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)

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Schedule (subject to change)

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Academicweek Day Date Time Place

Lect no: Topic Lecturer Assignments

Labs (E:1309b) Project

1Tuesday 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

2

Tuesday 11.11.2014 13‐15 E:1328 3 LabVIEW II (subVI's, error wires, data flow control) :: Assgn 1 info JSAssgn 1: LabVIEW assignment (Deadline Monday 

17.11.2014)Friday 14.11.2014 13‐15 E:1328 4

Databuses and communications

CA

3

Tuesday 18.11.2014 13‐15 E:1328 5 Instrument control :: Lab1 and Assgn 2 info & prep JSAssgn 2: DAQ 

board assignment (Deadline 24.11.2014)

Lab1 : GPIB 

Friday 21.11.2014 13‐15 E:1328

NO LECTUREChoose project

4 Tuesday 25.11.2014 13‐15 E:1328 6

Data acquisition boards and USB‐DAQ :: Lab 2 and Assgn 3 info & prep

JSLab2: 

DAQ‐PAD

Project plan (deadline 

01.12.2014)

Friday 28.11.2014 13‐15 E:1328 7 Data acquisition using Matlab :: Assgn 3 info & prep JS

Project execution

5Tuesday 02.12.2014 13‐15 E:1328 8 Signal conditioning CA

Assgn 3: Home Lab assignment (Deadline 

16.12.2014)

Friday 05.12.2014 13‐15 ???? 9 LabVIEW in industry / Design patterns GUEST

6Tuesday 09.12.2014 13‐15 E:1328 10

Signal processing data presentation, questions and check‐upCA/GUEST

Friday 12.12.2014 13‐15 E:1328 11Software for measurement systems (LabCVI, Measurement Studio, HP‐VEE, Dasylab)

CA/GUEST

7Tuesday 16.12.2014 13‐15 E:1328 12 Project presensation / demonstrations CA

Friday 19.12.2014 13‐15 E:1328 NO LECTURE

8Wednesday 14.01.2015 8‐12 E:1328

EXAMINATIONReporthand‐in

5

Overview of the course content

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Computerized measurement system example

Physical quantity Measurement system

Signal processing

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Sensor

Physicalquantity, eg. soundwave

Signal conditioning, eg. filters & amplifiers

Instrument withdata bus

interface, eg. USB or PXI

Personal computer

6

Structure of a measurement system

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• pressure

• temperature

• speed

• angular velocity

• luminosity

• force

Physicalquantity

Measurementsystem

Presentation(and control)

• Signal conditioning

• DAQ-cards

• Bus control of instruments• GPIB (parallel)

• RS232 (serial)

• Bus systems with integrated and standardized instruments• VXI/PXI

• Real time controllers

• Field buses

• Graphical programming• LabVIEW

• Agilent VEE

• DASYlab

• Textual programming• LabWindows CVI

• Measurement Studio

• Visual Basic

• Visual C/C++

• Matlab

Structure of a measurement system

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• pressure

• temperature

• speed

• angular velocity

• luminosity

• force

Physicalquantity

Measurementsystem

Presentation(and control)

• Signal conditioning

• DAQ-cards

• Bus control of instruments• GPIB (parallel)

• RS232 (serial)

• Bus systems with integrated and standardized instruments• VXI/PXI

• Real time controllers

• Field buses

• Graphical programming• LabVIEW

• Agilent VEE

• DASYlab

• Textual programming• LabWindows CVI

• Measurement Studio

• Visual Basic

• Visual C/C++

• Matlab

7

Signal conditioning

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• 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 biggestmeasurable values)

• How many bits (resolution) does the measurement system has tohave 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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• pressure

• temperature

• speed

• angular velocity

• luminosity

• force

Physicalquantity

Measurementsystem

Presentation(and control)

• Signal conditioning

• DAQ-cards

• Bus control of instruments• GPIB (parallel)

• RS232 (serial)

• Bus systems with integrated and standardized instruments• VXI/PXI

• Real time controllers

• Field buses

• Graphical programming• LabVIEW

• Agilent VEE

• DASYlab

• Textual programming• LabWindows CVI

• Measurement Studio

• Visual Basic

• Visual C/C++

• Matlab

8

Example of a DAQ card

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• Programmable range

• 2 x 12-bit Analog Outputs

• Internal or external trigger

• 16 Analog inputs• 12-bit A/D converter• 1 multiplexed A/D converter• 110 kHz sampling frequency

Structure of a measurement system

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• pressure

• temperature

• speed

• angular velocity

• luminosity

• force

Physicalquantity

Measurementsystem

Presentation(and control)

• Signal conditioning

• DAQ-cards

• Bus control of instruments• GPIB (parallel)

• RS232 (serial)

• Bus systems with integrated and standardized instruments• VXI/PXI

• Real time controllers

• Field buses

• Graphical programming• LabVIEW

• Agilent VEE

• DASYlab

• Textual programming• LabWindows CVI

• Measurement Studio

• Visual Basic

• Visual C/C++

• Matlab

9

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 instruments

• Still very much used for instrument control in both industry and research environments, probably due to the rugged connectors

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

General Purpose Interface Bus

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

10

Structure of a measurement system

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• pressure

• temperature

• speed

• angular velocity

• luminosity

• force

Physicalquantity

Measurementsystem

Presentation(and control)

• Signal conditioning

• DAQ-cards

• Bus control of instruments• GPIB (parallel)

• RS232 (serial)

• Bus systems with integrated and standardized instruments• VXI/PXI

• Real time controllers

• Field buses

• 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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

11

Comparison RS232 – RS422

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Tx

GNDRS232

Tx-

Tx+

RS422/RS485

0

1

Serial communication

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• 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

12

Example of USB based system

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Structure of a measurement system

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• pressure

• temperature

• speed

• angular velocity

• luminosity

• force

Physicalquantity

Measurementsystem

Presentation(and control)

• Signal conditioning

• DAQ-cards

• Bus control of instruments• GPIB (parallel)

• RS232 (serial)

• Bus systems with integrated and standardized instruments• VXI/PXI

• Real time controllers

• Field buses

• Graphical• LabVIEW

• LabCVI

• Measurement Studio

• Agilent VEE

• (DASYlab)

• Command• LabWindows

• Visual Basic

• Visual C/C++

• Matlab

13

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 instruments 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.

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

14

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 eXtensionInterface), or GPIB if there are other more traditional instruments in the system

• FireWire (IEEE-1394), USB, LAN etc…

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

PXI – PCI eXtensions for Instrumentation

• Like VXI but with PCI bus

• More compact, ”cheaper”

• Also PXIe for the faster PCI express bus

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

15

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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Fieldbuses

• Used to interconnect automation devices in a network

• Heavily used in industry

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

16

Fieldbuses

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

17

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

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Structure of a measurement system

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

• pressure

• temperature

• speed

• angular velocity

• luminosity

• force

Physicalentety

Measurementsystem

Presentation(and control)

• Signal conditioning

• DAQ-cards

• Bus control of instruments• GPIB (parallel)

• RS232 (serial)

• Bus systems with integrated and standardized instruments• VXI/PXI

• Real time controllers

• Field buses

• Graphical• LabVIEW

• LabCVI

• Measurement Studio

• Agilent VEE

• DASYlab

• Command• LabWindows

• Visual Basic

• Visual C/C++

• Matlab

18

LabVIEW

• National Instruments

• Graphical Programming Language

• ”G”

• Current version LabView 2014

• Virtual Instruments

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Virtual instruments

• Three mail building blocks:

• Data collection (software for communication with measurement device, e. g. ordinary instrument, DAQ-card 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)

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

19

Example of a LabVIEW program• Front panel

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

Example of a LabVIEW program• Block diagram

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

20

Dataflow programming

• Execution determined by the structure of the program

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

A poor example of a LabVIEW program

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering

21

A better example of a LabVIEWprogram

Lund University | Faculty of Engineering | Dept. of Biomedical Engineering