36
III ME 241 Spring 2014

Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

III

ME 241 Spring 2014

Page 2: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Calibration

Connecting to the world

Building a calibration VI

ME 241 Spring 2014

Page 3: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 4: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Basic idea is to measure the output of a sensor for known input values.

Input value is an independent variable Sensor output is a dependent variable

Determine functional relationship between these

two (“Calibration curve” - generally use a straight line).

Then, during actual measurement, can determine the input value from the sensor output.

ME 241 Spring 2014

Page 5: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Calibration Measurement

ME 241 Spring 2014

Set known pressure by adjusting height of water in tank “Input”

Read voltage from sensor “Output”

sensor

Read voltage from sensor, determine pressure in pipe using calibration curve.

Page 6: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Calibration Measurement

ME 241 Spring 2014

Pressure

Voltage

Apply (known) pressure, measure voltage

Pressure

Voltage

Measure voltage, determine (unknown) pressure

Page 7: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Can use LabVIEW to collect the data necessary to build a calibration curve.

Will use this as an example of how you can use LabVIEW to collect experimental data

For classroom use we will simulate the voltage output from the sensor using a power supply.

ME 241 Spring 2014

Page 8: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 10: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Pressure gage USB6009 DAQ

hardware software

1

ME 241 Spring 2014

Page 11: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Differential vs. referenced single end (RSE) (channel 0, for example)

signal

+

-

AI0

AI4

differential

signal

AI0

GND

RSE

+

-

Look at your ADC (the USB 6009)

Your USB 6009 has been prewired for you in differential mode.

ME 241 Spring 2014

Page 12: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

You should all have a NI USB 6009. Make sure you are looking at the correct side.

For RSE (includes ground)

For differential

ME 241 Spring 2014

Page 13: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

In order for the DAQ Assistant to configure properly, it must be able to look at your ADC.

Plug the 6009 into your computer using the USB.

ME 241 Spring 2014

Page 14: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Pressure gage USB6009 DAQ

hardware software

1 2

ME 241 Spring 2014

Page 15: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 16: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

1) Control to input the pressure value In the real world this will be known pressures (from

height of water in tank). Here we will give you the values.

2) DAQ Assistant to input the voltage from the sensor In the real world this will be output from the pressure

sensor. Here they will be from a power supply.

3) Indicator so we can see the data as we collect it.

4) Write to Measurement File - a way to output the data to a file so we can save it.

ME 241 Spring 2014

Page 17: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Add DAQ Assistant to Block Diagram ◦ Functions Palette Express

Input

Needs to be configured based on the input device and the type of data we collect.

A dialogue box will automatically open when we place the DAQ Assistant ◦ can also double click on icon

later to set-up or change

Configuring the DAQ will add appropriate terminals etc. on the block diagram

ME 241 Spring 2014

Page 18: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Choose Acquire signals

Analog input

Voltage

ME 241 Spring 2014

Page 19: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Choose a0

ME 241 Spring 2014

Page 20: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

one channel

one sample

ME 241 Spring 2014

Page 21: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Add a Write to Measurement File to Block Diagram ◦ Functions Palette File I/O

Also needs to be configured.

A dialogue box will automatically open when we place the Write to Measurement File ◦ can also double click on

icon later to set-up or change

ME 241 Spring 2014

Page 22: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

adds each data pair

to the file

ME 241 Spring 2014

Page 23: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Numerical control to enter the value of the independent variable

Text (file path) control to designate the file where the data will be written

Button control to turn data collection on and off

Two numerical indicators to display the values of the independent variable (as a double check on entry) and dependent variable (to make sure data is being acquired)

Add a text label if you’d like

ME 241 Spring 2014

Page 24: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Merge signals: under Express, Sig Manip

Try creating the file name and enable controls by right clicking over the Write to Measurements terminal and using create

Page 25: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Pressure gage USB6009 DAQ

hardware software

1 2 3

ME 241 Spring 2014

Page 26: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Finally need to connect the output of the measuring device to the desired channel on the 6009 ADC.

We are using differential channel 0 (AI0, AI4), so we want to connect our two wires there.

For the workshop: ◦ Have already connected wires to AI0, AI4 channel 0.

[may also be wired for channel 2 (AI4, AI6)] ◦ Just connect the matching BNC connector to “A” on the

desktop (this will connect the two wires into the power source or signal generator at the front of the classroom)

ME 241 Spring 2014

Page 27: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

1) Set a value of the independent variable (e.g. by pouring the correct level of water into a tank to set the pressure.)

2) Enter the value of the independent variable on the front of your VI.

3) Make sure the Enable button is pressed. (Write to file is active.)

4) Press the run key. 5) The VI collects the values of the independent variable

(you entered on the front panel) and the dependent variable (voltage from the measurement system). These are displayed on the front panel and sent to the file.

6) Repeat. Each time one new set of data (x, y) is added to the data file.

ME 241 Spring 2014

Page 28: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

C-drive —> Users —> YourName —> MyDocuments > LabVIEW Data

Where is it??

ME 241 Spring 2014

Page 29: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 30: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 31: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 32: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 33: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

ME 241 Spring 2014

Page 34: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

y = 1.0006x - 0.0224

R² = 0.9999 0

2

4

6

8

10

0 5 10

ind

ependent

vari

ab

le

(un

its)

dependent variable (units)

Does it matter which axis is which in the plot?

ME 241 Spring 2014

Page 35: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

Your calibration VI

Your data

ME 241 Spring 2014

Page 36: Introduction to Labview - University of RochesterIntroduction to Labview Author: Paul Created Date: 2/7/2014 10:12:59 AM

You can now program in LabVIEW.

ME 241 - Level III

ME 241 Spring 2014