Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
si
on11.
10
HandsOn:
DoEngi
neer
i
ng
Anyt
i
me,Anywher
e
wi
t
hNImyDAQ
uk.
ni
.
com
i
r
el
and.
ni
.
com
uk.
ni
.
com/
handson
Goal
Get hands-on with the NI myDAQ, a technology to enable students to Do Engineering. In this
exercise, we will use NI myDAQ and NI LabVIEW to explore SmartGrid technology
Scenario
The NI myDAQ myGrid is a tool to simulate how renewable energy sources can be used to supplement
power plants that utilise expendable fuels. It shows a model of how power is generated, transmitted and
distributed in a real-life industrial, commercial or residential setting. It combines expendable and
renewable energy sources to power a load (LEDs in this case). NI LabVIEW is used to optimise the system
as the power production from the solar panel and the load change. This is visualised through a power
produced and consumed display, as well as an RPM measurement from the generator.
More details on the myGrid components and instructions for how to build your own myGrid are included
at http://bit.ly/nvej0h
CONCEPTS COVERED
Open LabVIEW
a. If you have not already done so, start LabVIEW, either from the shortcut on your
desktop, or by going to Start>>Programs>>National Instruments LabVIEW 2011.
2. Open the myGrid Application
a. Select Open from the Getting Started Splash Screen
b. Navigate to the relevant folder on the desktop and select myGrid.vi to open
c.
d.
e.
f.
Generator Power fill slideControls how much power is applied to the generator
through analog output 0.
Manual Control of Houses switchesControl which LEDs are connected to the power
produced by turning on and off the reed relays through DO 2, 3, and 4. When fewer LEDs
are connected to power, less power is necessary to turn them on.
Waveform chartDisplays the analog input readings. The DPDT switch on the PCB
controls which set of channels are measured; either the voltage before and after the
shunt resistor or the voltages supplied by the motor and the solar panel.
Cycles Per Second gaugeMeasures the rotational speed of the motors with the hall
effect sensor and digital input 0.
Auto Control of Houses When the Auto Time button is on, the LED houses
automatically turn off and on depending on the timer.
MilliWatt Gauge Displays the power consumption of the myGrid. This feature only
works properly when the DPDT switch is set to A.
Turn on the LEDs and try adjusting the POT to see how it changes the solar panels output
voltage. Depending on the ambient light, the LEDs may or may not turn on.
Adjust the POT to a level where the LEDs are off. Now, increase the Generator Power till
the LEDs turn on again.
The waveform chart should show that the motors are now generating power for the LEDs.
d.
Switch the DPDT to position A. The two analog input channels are now reading the
voltage before and after the shunt resistor.
The difference of these two measurements can be used to determine the power consumption of the
circuit, which is displayed in the milliWatts meter. This meter only gives a proper reading when the
DPDT is set to position A.
c.
The top loop controls the power generation to the motor. A DAQ Assistant express vi is
used to send the output to Analog Output channel 0 on the myDAQ. The value of the
voltage sent is determined by the Generator Power slider on the front panel
d.
The middle loop acquires the signals from the myGrid which relate to the voltage
generated from the battery, the voltage generated from the solar panel, as well as
calculating the power consumption of the circuit
e.
The bottom loop controls the load on the myGrid (LEDs). A DAQ assistant express vi is
used to send the digital signals to the myDAQ depending on the values selected by the
user. The auto control of house lighting can also be used to set the load on the myGrid.
c.
2.
Note how some of the instruments in this launcher are greyed out. These instruments
are available to use with the NI ELVIS platform
Use the DMM to measure the voltage at different points of the active circuit
a. Click on the Featured instruments tab to bring up a list of addition instruments available
with your myDAQ.
Note: The Get More Instruments button takes you to one of the myDAQ community pages. On the NI
community users share code, instruments, tips and knowledge. They are a good resource for new features
and content. If you have internet access then try it now, otherwise be sure to check out the NI community
at a later date. The landing page is shown below for your interest
b.
On the Featured instruments panel select DC Level Output to bring up the instrument
shown below. Click the start button and raise the voltage to spin the motor.
NOTE: Featured instruments such as the DC Level Output are all written in LabVIEW and the source code
is easily available on the community pages. This code often makes a great starting point if you are
developing your own custom instrument.
c.
View the NI ELVISmx Instrument Launcher once again and this time launch the Digital
Mult Meter .
d.
Run the DMM and use the probes to measure voltages at different parts of the circuit.
3. Take some time exploring the circuit and the other instruments available in the NI
ELVISmx Instrument Launcher.
View the Block Diagram of the myGrid application that we studied earlier.
Click and drag to draw a box around
a
the top loop and the attached DAQ assistant express VI to
select them.
Delete all the selected Vis.
Vis. In this exercise we are going to rewrite this part of the code from
scratch to better understand how applications such as this can be written.
7. To configure an Analogue output to drive the motor, click on Analog Output >>
Voltage. Click the + sign next to the Dev1, scroll down and highlight channel ao0 and
click Finish. This adds a physical channel to your measurement task.
8.
In the DAQ Assistant dialogue box that appears configure the task as shown below then click
OK:
9.
From the Functions palette place down Express>>Execution Controls>> While Loop Draw
this loop around the DAQ Assistant that you have just placed down
10. Adding timing to the loop will stop it using excess processor time. Add the function
Programming>>Timing>>Wait in the top right-hand corner of your new loop.
11. Right Click on the terminal of the Wait function and select Create Constant. Set the constant to
a value of 100. This will force the loop to iterate 10 times per second.
12. To stop the motor when the application stops we must output a voltage of 0. Hold down Ctrl
while clicking and dragging the DAQ Assistant VI out to the right-hand side of the while loop.
This will create a copy.
13. In a similar fashion make a copy of the numeric constant wired to the Wait function. Place this
directly below the other constant and set this constant to 0.
16. Resize and rearrange this to look similar to the front panel shown below
17. Switch back to the Block Diagram and complete the wiring to resemble the diagram below:
http://bit.ly/nvej0h