control & output with labview thursday, feb 2nd

41
Control & Output with LabVIEW Thursday, Feb 2nd LabVIEW DAQ Output for Voltage, Sensor Excitation, and Control Systems

Upload: craig

Post on 11-Feb-2016

48 views

Category:

Documents


0 download

DESCRIPTION

Control & Output with LabVIEW Thursday, Feb 2nd. LabVIEW DAQ Output for Voltage, Sensor Excitation, and Control Systems. Part 1: A Brief History of Some LabVIEW Stuff You’ve Done So Far in ME-241. LabVIEW Application (Review). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Control & Output with LabVIEW Thursday, Feb 2nd

Control & Output with LabVIEWThursday, Feb 2nd

LabVIEW DAQ Output for Voltage, Sensor Excitation,

and Control Systems

Page 2: Control & Output with LabVIEW Thursday, Feb 2nd

Part 1:A Brief History of Some LabVIEW

Stuff You’ve Done So Far in ME-241

Page 3: Control & Output with LabVIEW Thursday, Feb 2nd

LabVIEW Application (Review)

• LabVIEW can work with Data Acquisition (DAQ) Platforms in order to capture signals from a variety of instruments.

• These include the instruments you have used so far in ME241, such as:

Thermocouples, Pressure Transducers, Load cells, Strain gages (& anything that uses a Strain gage)

Linear Variable Differential Transformers

Page 4: Control & Output with LabVIEW Thursday, Feb 2nd

LabVIEW Application (Review)

• We capture data in the form of electrical signals by wiring our instrument into a DAQ device.

• These devices include boards that plug into the PC via a USB-port or…

• More sophisticated devices that use PCI cards inside a PC that plug into some benchtop device.

Page 5: Control & Output with LabVIEW Thursday, Feb 2nd

LabVIEW Application (Review)

The DAQ devices allow us to capture signals from a given instrument. These instruments allow us to measure the physical phenomenon that we are interested in.

Page 6: Control & Output with LabVIEW Thursday, Feb 2nd

LabVIEW VI Creation

In class and laboratory we have used LabVIEW to write virtual instruments (VIs).

We typically write a VI so that it can “talk” to the outside world (the experiment on the bench).

In order to do this we use the DAQ Assistant.

Page 7: Control & Output with LabVIEW Thursday, Feb 2nd

LabVIEW VI CreationWe use the LabVIEW block diagram to create code

that measures, displays and records voltages….

Page 8: Control & Output with LabVIEW Thursday, Feb 2nd

The DAQ Assistant is key….The DAQ Assistant allows us to tell LabVIEW

which channels on the DAQ device to sample.

For instance if we use a USB-6008 we might set up four channels as follows…

Page 9: Control & Output with LabVIEW Thursday, Feb 2nd
Page 10: Control & Output with LabVIEW Thursday, Feb 2nd

This will yield data from 4 separate channels….

Page 11: Control & Output with LabVIEW Thursday, Feb 2nd

Part 2:LabVIEW Can Generate Output!

Page 12: Control & Output with LabVIEW Thursday, Feb 2nd

DAQ Device OutputMost DAQ devices have the ability to generate

signals as well as collect signals.The DAQ devices are able to do this via the port

they connect to via a cable.Most standard DAQ devices can generate a signal

of 5-10 VDC.This voltage is ample enough to power some

small transducers and instruments.This is important to the proper collection of data.

Page 13: Control & Output with LabVIEW Thursday, Feb 2nd

• We use a battery to power the pressure transducer. The battery provides 9 volts.

Tank Draining Experiment Apparatus

Tank

TubePressure Transducer

+ + +

- - -

9 VDC Battery Pack

Page 14: Control & Output with LabVIEW Thursday, Feb 2nd

Tank Draining Experiment ApparatusPossible Alternative

• We could have used a DAQ Device to power the pressure transducer

• Advantage: PC provides power. Batteries not needed. Power provided is “steady.”

Tank

Tube

Pressure Transducer

9 VDC OutputFrom DAQ Device

AO0

SCXI to PC

Page 15: Control & Output with LabVIEW Thursday, Feb 2nd

Voltage Output• The BASICS: Most DAQ devices have the ability to produce

their own signals. We can use these signals to interact with the

experiment or equipment we are using.We can use these signals to power equipment.We can use these signals to trigger events and

make stuff happen.

Page 16: Control & Output with LabVIEW Thursday, Feb 2nd

Part 3:HOW do I make a DAQ device

provide a voltage???

Page 17: Control & Output with LabVIEW Thursday, Feb 2nd

• The BASICS: You need 3 things…..

LabVIEW ApplicationMAX

DAQ Device

Page 18: Control & Output with LabVIEW Thursday, Feb 2nd

Voltage OutputNote the ANALOG side of

the USB devices near your computers.

There should be terminals labeled AO0 and AO1

AO stands for Analog Output.

Most of the NI devices have at least 2 such terminals

For output we wire a terminal and a ground.

Page 19: Control & Output with LabVIEW Thursday, Feb 2nd

Voltage Output• We access the analog output functions via

LabVIEW. To do this we can access the DAQ Assistant.

• We can right-mouse click and access Functions on the Block Diagram.

• Select the DAQ Assistant on the OUTPUT Menu

Page 20: Control & Output with LabVIEW Thursday, Feb 2nd

Voltage Output• When the DAQ Assistant is selected you get 2 choices:• “Acquire Signals”…what we have used so far• “Generate Signals” choose this one for voltage output!

Page 21: Control & Output with LabVIEW Thursday, Feb 2nd

• Once you select Generate Signals choose Voltage• The device or devices will appear. Choose either one

or both channels (depending on how many signals must be generated.)

Page 22: Control & Output with LabVIEW Thursday, Feb 2nd
Page 23: Control & Output with LabVIEW Thursday, Feb 2nd

DAQ Assistant for Voltage Output

Compare Differences/Similarities

Page 24: Control & Output with LabVIEW Thursday, Feb 2nd

Build a Control to Dial 0-5 voltsOn the Front Panel place a dial.

Connect this to “data’ on the Output DAQ Assistant.

Page 25: Control & Output with LabVIEW Thursday, Feb 2nd

Build a Control to Dial 0-5 voltsTurn the knob to some arbitrary value and press

the run arrow.This vi will produce…

Page 26: Control & Output with LabVIEW Thursday, Feb 2nd

We can confirm this value by adding an INPUT DAQ Assistant.

Build one that reads from input channel AI1.Add a graph or indicator to your vi to show

output.

Page 27: Control & Output with LabVIEW Thursday, Feb 2nd

Exercise: Build A VI to Generate an Output

and Collect that Voltage as an Input

Page 28: Control & Output with LabVIEW Thursday, Feb 2nd

Part 4: Applications and

Demonstrations

Page 29: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 1

• Sometimes we need more than just 5 or 10 volts

• How can the LabVIEW output function help us to run a pump or motor?

Application: We need to use LabVIEW to control a motor. The motor uses a variable voltage from 60 to 120 volts to adjust from top speed to low speed.

Page 30: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 1

In this case we would use a device with the motor’s manual control electronics.

The controller will accept a grounded DC signal and generates a proportional output voltage.

This output can be supplied to the speed setting circuit of the motor’s controller.

This will drive the motor at a speed proportional to the signal that LabVIEW sends to it.

Page 31: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 1

Main power suppliedBy 120 VAC outlet

Control boxWith SCR-basedpotentiometers

0-10 VDC “control” volts from LabVIEW

Power line from control

Drive Motor

Turn-Table with experiment

Page 32: Control & Output with LabVIEW Thursday, Feb 2nd

Turntable Control Application

Page 33: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 2

Using LabVIEW with advanced NI hardware.In this example we want to send simple

commands to control the speed of a stepper motor.

We will use a PCI-card in the PC, a “smart” encoder/motor power board, and LabVIEW software.

Page 34: Control & Output with LabVIEW Thursday, Feb 2nd

Demo Application 2

stepper

Coil wires

SCXI cable

PCI-card

LabVIEW Control VI

Page 35: Control & Output with LabVIEW Thursday, Feb 2nd

Demo Application 3

• Use LabVIEW to send commands and receive data from a balance.

• In this case we have no DAQ or PCI cards

• We can only use the PC’s serial port to “talk” to the balance.

Page 36: Control & Output with LabVIEW Thursday, Feb 2nd

PC

Demo App 3: Balance vi

• To use a “stand-alone” instrument like the balance we have to:

• 1. write a vi that talks to a serial port• 2. wire up a cable per the manufacturer’s

specs

0.847 g

BalanceCable has 2 RS-232 (9 pin) connectors

The vi reads…0.847 g

Page 37: Control & Output with LabVIEW Thursday, Feb 2nd

Demo Application 3

• In this case we will “write” data to the balance using LabVIEW.

• LabVIEW will assign the serial port to transmit data (Tx) and commands to the balance.

• The balance will use the same port to send (Rx) data and information.

• In this case we will use a vi called a binary converter in order to write between LabVIEW and the balance.

Page 38: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 4

• Using LabVIEW with non-NI hardware.• In this example rather than control voltage

directly via a DAQ we will send commands directly to circuit boards.

• As in the Balance DEMO we will use only the serial bus to link LabVIEW with the circuit boards.

• HOW can LabVIEW talk directly to a circuit board?

Page 39: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 4

• We talk to the circuit board by using “Op-Code.”

• Op-Code will serve as a bridge between LabVIEW and the binary assembly language that a circuit board expects to see.

Page 40: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 4

Think of it as translation…English Spanish Irish“Good Morning” “Buenos Dias” “Dia duit!”

LabVIEW PC Interface Circuit Board“G-Code” “Op-Code” “Assembly”

Page 41: Control & Output with LabVIEW Thursday, Feb 2nd

DEMO Application 4PC with LabVIEW

Serial Communications Card

Power Board with SCR-based Transformer

Power Supply

24 VDC

Train Track

0-15 volts