-
1
Computerized Measurement Systems (EEMN10) 2016CHRISTIAN ANTFOLK
& JOSEFIN STARKHAMMAR
Course information 2016• 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 2016
Lund University | Faculty of Engineering | Dept. of Biomedical
Engineering
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
Lund University | Faculty of Engineering | Dept. of Biomedical
Engineering
-
3
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
Lund University | Faculty of Engineering | Dept. of Biomedical
Engineering
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
Lund University | Faculty of Engineering | Dept. of Biomedical
Engineering
-
4
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)
Lund University | Faculty of Engineering | Dept. of Biomedical
Engineering
Schedule (subject to change)
Lund University | Faculty of Engineering | Dept. of Biomedical
Engineering
Preliminary schedule for EEMN10 2016
Week Day Date Time PlaceLect no: Topic Lecturer
Assignments
Labs (E:1309b) Project
44 Monday 31.10.2016 10‐12 E:1328
1Introduction to the course CA
Friday 04.11.2016 13‐15 E:1328 2
LabVIEW I (introduction, variables, structures etc)
JS
45 Monday 07.11.2016 10‐12 E:1328
3LabVIEW II (subVI's, error wires, data flow control) :: Assgn 1 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
46Monday 14.11.2016 10‐12 E:1328 5
LabVIEW III :: Instrument control :: Lab1 and Assgn
2 info & prep JS
Assgn 2: DAQ board
(Deadline Sunday 20.11.2016)
Lab1 : GPIB Friday 18.11.2016 13‐15 E:1328 6
LabVIEW in industry / Design patterns
DVEL
Choose project
47Monday 21.11.2016 10‐12 E:1328 7
Data acquisition boards and USB‐DAQ :: Lab 2 info & prep
CA Lab2: DAQ‐
PAD
Project plan (Deadline Sunday
27.11.2015)Friday 25.11.2016 13‐15 E:1328 8
Signal conditioning CA
48Monday 28.11.2016 10‐12 E:1328 9
Signal processing data presentation, questions and check‐up
CA
Assgn 3: Home Lab assignment (Deadline 16.12.2016)
Project execution
Friday 02.12.2016 13‐15 E:1145
10Software for measurement systems (LabCVI, Measurement Studio, HP‐VEE, Dasylab)
CA
49 Monday 05.12.2016 10‐12 E:1328
11Data acquisition using Matlab :: Assgn
3 info & prep + LabVIEW @ Elmät
JS/GUEST
Friday 09.12.2016 13‐15 E:1328 NO LECTURE
50 Monday 12.12.2016 10‐12 E:1328
12Project presentation / demonstrations CA/JS
Friday 16.12.2016 13‐15 E:1328 NO LECTURE
Report hand‐in
2 Wednesday 10.01.2017 8‐12 E:1328 EXAMINATION
-
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 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
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 2016• 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
Download LabVIEW & Matlab
• LabVIEW– Go to http://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
Lund University | Faculty of Engineering | Dept. of Biomedical
Engineering