The goal of this practicum is to model and simulate the vertical motion of the ROV using the LabVIEW programming environment. In addition, you will learn how to control the ROV’s thrusters by creating a Pulse-Width-Modulated (PWM) output signal.
Take a few minutes to skim through the practicum before you get started.
These deliverables are split into sections to make sure you and your partner know the purpose and main takeaways of each practicum.
LabVIEW
These refer to tangible skills or tools that are used in today's practicum and revisited throughout the semester.
PWM
On the other hand, concepts refer to useful ideas or practices that are taught in the lab.
See equations of motion solved by computer, you'll solve them later by hand.
This section links us back to skills you learned in tutorial that you can now apply to practicum.
Save altered LabVIEW VI’s at the end of lab
Turn in Submission Sheet
This section shows you what data to save for the future and will have a link to the submission sheet.
You will see this icon throughout the practicum as a reminder to save your data from that section!
Saving your data on the lab computer doesn't count! You won't necessarily get the same one back.
This section refers to items you need to grab that aren't already on your lab bench and files to download (if needed). For a more detailed parts list, please see the references section at the end of each practicum.
Computer with LabView
The student LabView library, which is on Canvas. This contains files you will use including: AccelCalc.vi, DoubleIntegration.vi, PWM.vi and ValuetoPWM.vi
This header means that this section of the practicum refers to what you learned in tutorial that week. Having notes from tutorial will be useful, and you will likely see aspects of this practicum in your problem sets!
These sorts of questions are meant to prep you by reminding you of information needed for a particular section, or by checking for understanding after you've completed it. Please take a moment to think of a response before checking your answer!
For this practicum, we will need an equation describing the vertical motion of the Remotely Operated Vehicle (ROV). You should have already derived this in tutorial.
In your equation, z should represent the vertical position of the ROV. The equation should include terms with mass m (kg), buoyancy force fB (N with positive up direction), a vertical thruster input force fT (N with positive down direction), and a linear drag force (N) whose direction opposes the direction of motion.
Write down the governing equation for the vertical direction of the ROV.
In this part of the lab, you will create a virtual instrument (aka a LabVIEW program) that outputs ROV acceleration given the inputs of mass, buoyancy, drag coefficient, velocity, and thrust input.
NOTE: When closing a VI, a window may pop up prompting you to save the VI and any lower level VI’s used within it, even if you didn’t make any changes. This will happen with any VI from a library that was just downloaded onto the computer, such as from Canvas or Google Drive. When that window pops up, just click the “save all” option, then it shouldn’t pop up again for that VI as long as it stays on the computer. If you need to re-download a library, then this window will pop up when closing the VI’s from that library, and you will need to save them once again so the window won't pop up anymore.
ROLES: Identify each student on your team as student A or student B. Student A should complete section 5.1 while student B watches and guides student A by reading the manual out loud to student A. These roles will be switched at the start of section 5.2. Write down who is who (A or B) so you don’t forget.
Find the file named "E79_F19_Init.llb" in the folder named “Resources/Practicums/” on Canvas. Place a copy of these files in the folder named “Desktop/E79/Section X/Practicum YZ”, where X is your section number, Y is the practicum module number, and Z is the practicum module letter. For example: “Desktop/E79/Section 2/Practicum 1B”. If a folder isn’t there, feel free to make the folder. This will be your working folder for this practicum. If you double click on this file, LabView should open a menu showing the library contents which include PWM.vi, ValueToPWM.vi, DoubleIntegration.vi and AccelCalc.vi .
Close the library and LabView and rename your copy of the file to be “E79_F19_Init_<LastName1_LastName2>”. For example, Dre Helmns and Ethan Ritz will rename their file to be “E79_F19_Init_Helmns_Ritz.llb”. Note the file extension .llb is an acronym for labview library and .vi is an acronym for virtual instrument.
Double-Click the file in the windows explorer pane to open it. This will launch LabVIEW as well as open the library. Double click AccelCalc.vi in the window that appears. Once your new Virtual Instrument (VI) is opened, you’ll notice two windows: the front panel and block diagram.
The Front Panel is the gray, ruled window upon which you can place graphical controls. The front panel acts as a user interface (UI) for the VI when it is running.
The Block Diagram is the white window. In this window you will typically add wires and function blocks to connect the front panel’s controls for desired behavior.
Tip: You can switch back and forth between the two windows by pressing ctrl+E on your keyboard. Try this out.
LabVIEW is a software application used to create software versions of hardware instruments.
Consider a hand-held motor controller for a radio controlled car.
If we were to create a VI version of the real hardware, the Front Panel would be a software representation of the knobs and joy sticks that allow an operator to input commands or settings, (e.g. Fig. 5.1a).
The Block Diagram would be a software representation of the wires and electrical components that could be found inside the controller, (e.g. Fig. 5.1b).
Figure 5.1: An RC Car control box (a) and its internal wiring and circuit (b).
Inspect the front panel of your VI, (Fig. 5.2a). You should see 5 fields where a user can input numeric values. The fields should be labeled Mass, Thrust, Buoyancy, Drag Coefficient, and Velocity (with appropriate units). These fields are call Numeric Controls, and they allow a user to set the parameters before (or while) running the VI.
On the front panel there should also be a sixth numeric field labeled Acceleration. This is an instance of a Numeric Indicator, which is used to display the numeric value of output signals.
In Fig. 5.2b, all the function blocks corresponding to numeric controls (e.g. mass), have outputs that are connected to the inputs of a Formula Node function block. These connections are made with wires, the bright orange lines on the block diagram.
Above the numeric control function blocks on the block diagram is a Numeric Constant whose value is 9.81. This will be used for the gravity term of our acceleration calculation, and is wired to be an input to the formula node.
The output of the formula node block is wired to the input of the Acceleration numeric indicator block.
Figure 5.2: Front panel (a) and block diagram (b) of the VI AccelCalc.
The central block is a formula node. Using the equation from section 4, complete the functionality of the block by double clicking the block and typing in the correct equation for acceleration as a function of mass, thrust, buoyancy, damping coefficient, and velocity. Ensure you end the equation with a semi-colon, and that you use the correct variable names (i.e. G, M, fT, fB, DC, V, and A). You may want to double check the correctness of your equation before using it here. (Questions 1 &2 on submission sheet)
Save the file by clicking File->Save. Or using the keyboard shortcut ctrl+S.
Figure 5.3: Modifying the Equation of Motion function block.
Run your program by clicking the arrow (Fig. 5.4) on the front panel or block diagram, (either will work). If all the values on the front panel are zero, your calculated acceleration will be NaN, (since m = 0 implies that you are dividing by 0). Try changing the values of the inputs, and note how the output changes values.
Important: Running the program only makes a single calculation for acceleration. To make the acceleration output update in response to changing inputs, we will use a while loop, (later in section 5.2).
Figure 5.4: The Run arrow.
In the last section you edited an existing VI called AccelCalc. In this section, you will write a new VI named VDSim.vi which will also reside in your library. At the core of this new VI will be the calculation of the ROV’s vertical acceleration, accomplished by your AccelCalc VI. In doing so, you effectively embed your AccelCalc VI as a SubVI into the block diagram of the VDSim VI. Follow the steps below to see how this is accomplished.
ROLES: Student B should complete the first 8 steps of section 5.2 while student A watches and guides student B by reading the manual out loud to student B.
Click on File->New VI, or use the keyboard shortcut ctrl+N. This creates a new virtual instrument (VI). The first thing we're going to do is save the VI and get it's name right: click on File -> Save As, double click on your library, and then specify the file name VDSim in the window that lab view creates. This saves your new VI inside your library. If you are not using a library in the future, you can always just save a VI anywhere on your computer: it will show up as a file with the .vi extension. Make sure your VDSim files are not floating.
Select the front panel. You should notice an accompanying window appear, named Controls. If it doesn't automatically show up, right click and make it persistent by clicking the pin icon in the top left corner.
Figure 5.5: The LabVIEW Controls Palette.
3. Ensure that you are in the Modern tab of the Controls Palette and click on Numeric. Click and drag the Vertical Pointer Slide onto the Front Panel. You’ll notice that the slider will show up in both the front panel and block diagram.
This slider will be used to control the thrust force of your motor. Rename it Throttle by double clicking on the word Slide.
Figure 5.6: Adding a Pointer Slide.
4. Next, right click on the slider in the front panel and click Display Format…, this will open a new window. In this window, click on the tab labeled Scale. Finally, change the min max range values of the slider to -0.5 and 0.5 respectively. Click Ok, and you should see the slider in the front panel updated with the new range.
Figure 5.7: Setting Slide scale.
Since we want to continuously check the value of the slider while the VI is running, we will need to include a while loop in our program. A While Loop repeatedly executes the block of code it surrounds, as long as a specified condition is true. In our case, this condition is that we have not clicked a stop button.
5. Go to the block diagram and navigate to the small window labeled Functions. Similarly to the Control Palette, right click to display it and click the pin icon in the upper left corner to make it persistent.
6. Click on Structures, located under the Programming tab. Next, click once on the While Loop button. The cursor should change to a dashed box with an arrow in the top left corner. With this cursor, click and highlight a large box that surrounds the Throttle slider in the block diagram window, (Fig. 5.8).
Figure 5.8: Adding a While Loop structure.
7. Before trying to run the program, you will need to add a stop button. To do this, switch back to the front panel, navigate to the Controls Palette->Modern and click on Boolean. Next, drag and drop the stop button. Resize the button to make it larger and remove the text above. Select the button by highlighting it. Drag it to the left of the slider.
Next, switch to the block diagram window. You’ll see a new block with the words ‘STOP’. Click and drag this block to the bottom right of the while loop, next to the red stop sign.
Figure 5.9: Adding a Stop button.
Figure 5.10: Moving the Stop button.
8. We need to wire the two blocks together so that clicking the Stop button on the front panel will break the while loop and end the program.
Hover the mouse pointer over the center right side of the stop button block in the block diagram. A small image of a spool of wire should appear. Click and drag the wire to the center left side of the red button. Release the button click to make the wire appear.
Figure 5.11: Wiring the Stop button.
ROLES: Student A should complete steps 9 to 17 of section 5.2 while student B watches and guides student A by reading the manual out loud to student A.
9. In the block diagram of this new VI, navigate to the Functions palette and click on Select a VI…, located near the bottom. When prompted, select your library from the file explorer, pick the AccelCalc.vi VI you just made, and then move to the block diagram to place the VI. Remember that you saved it in the directory named “Desktop/E79/Section X/Practicum YZ”, where X is your section number, Y is the practicum module number, and Z is the practicum module letter. For example: “Desktop/E79/Section 2/Practicum 1B”.
10. Hover the cursor over the input and output terminals of the VI icon you just added. These are located on the left and right edges of the VI icon, but won’t be visible until you hover the mouse pointer there. You should observe that they are all labeled. Wire up the Throttle slide control to the Thrust input terminal on the AccelCalc VI.
Figure 5.12: Wiring the Throttle slide control to the subVI icon’s Thrust wire input.
11. Create numeric controls for the Mass, Buoyancy, and Drag Coefficient. Right click over each of the inputs of the subVI and select Create -> Control. A numeric control will appear with the appropriate name.
Figure 5.13: Wiring up the throttle control (a) and adding Numeric Controls to the AccelCalc VI icon (b).
12. Every time the while loop is executed, time is incremented. Velocity will be calculated by multiplying the acceleration with the time step associated with the while loop. We will assign a value of 20 milliseconds for this time step. To do this, from the block diagram, navigate to the functions palette. Search for Wait Until Next ms Multiple, located in Programming->Timing. Drag this into your window.
To add the 20 ms delay, right click on the block’s input and click Create->Constant. Set the constant to 20.
Figure 5.14: Setting the While Loop’s time delay to 20 ms.
13. One method for numeric calculation of velocity at time step n, given previous velocity vn-1, acceleration an, time step size Δt is the backward Euler method:
14. We can implement this in LabVIEW using the arithmetic operation blocks. There already exists a VI that will do this called DoubleIntegration that is also inside your library. To insert the VI, right Click on the block diagram, scroll to the bottom on the menu and click Select a VI….
Once the VI is on the block diagram, connect the output of the AccelCalc VI to the input of the DoubleIntegration VI labeled Acceleration.
Figure 5.15: Adding velocity and position calculation with the DoubleIntegration VI.
15. To create Numeric Indicators on your VDSim VI that display your Acceleration, Velocity, and Position, right click on the output terminals of the DoubleIntegration block, then select Create->Indicator. See Fig. 5.16. Note that a constant block 0.02 (20 ms) must be defined for the time step size Δt. Create a constant for the DoubleIntegration input node labeled as deltaT. Set the value of the constant to be 0.02.
Figure 5.16: Adding Numeric Indicators for Acceleration, Velocity, Position.
16. This next step is very important. In order to feed the calculated velocity back into the input of the AccelCalc block, create a wire from the input terminal on the AccelCalc block to the wire leaving the DoubleIntegration block Velocity output terminal. After doing this, LabVIEW should automatically add a Feedback Node. This block saves the value and passes it into the addition block after every iteration of the loop. See Fig. 5.17.
Note: The feedback node may be pointing in the wrong direction when compared with Fig. 5.17. To fix this, right click the feedback node, and click change direction.
Next, hover over the bottom of the feedback node, right click on the bottom terminal, and add a constant with a value of 0. This will be the initial value of velocity in the feedback node when you start the program. See Fig. 5.17.
Figure 5.17: Adding velocity feedback to calculate acceleration.
17. Now do a quick test to see if everything is working as expected. Switch to the front panel, input the approximate mass of your ROV (about 1 kg), the buoyancy (try 9.81 N), and the drag coefficient (use 1 kg/s). Click RUN.
You should expect to see the acceleration, velocity, and position of your ROV change as you vary the thrust. Make sure that your simulation reaches steady state values for acceleration and velocity when the thrust is kept constant. Note what happens when you set the throttle to zero, mass to 1 and the buoyancy to 9.81. In this case, the buoyancy exactly cancels out the gravity term, (check your equation).
Figure 5.18: VI Front Panel when simulating.
ROLES: Student B should complete steps 18 to 22 of section 5.2 while student A watches and guides student B by reading the manual out loud to student B.
18. What’s the fun in simulations if there aren’t any visuals? Let’s add graphs to plot the acceleration, velocity, and position as a function of time. From the front panel, navigate to the controls palette, and add on Waveform Chart, located in Silver->Graph. Once it is in the front panel, right click on the chart and click Properties from the drop down menu. You’ll need to make two changes. The first is under the Display Format tab. Change type for the X-Axis to Relative Time. Next, under the Scales tab, check the box near Autoscale.
Click OK to exit.
Figure 5.19: Adding a Chart to the VI Front Panel.
Figure 5.20: Setting Chart parameters.
19. Click on the chart, then copy and paste two more charts. These will be used to display the acceleration, velocity, and position of your simulated ROV as a function of time. Rename the charts.
Figure 5.21: Three charts added to the VI Front Panel.
20. Next, switch to your block diagram and wire the respective output to the input of the charts you just inserted. The result should look something like the image on the right.
Switch back to the front panel to test out your simulation.
(Question 3 on submission sheet)
When your buoyancy force is balanced by your gravitational force (e.g. m=1, Buoyancy = 9.81), setting the throttle to a new value and leaving it at that new value should produce the following behavior:
Velocity should exponentially approach some steady state value.
Since acceleration is the change in velocity, it should become zero as the velocity approaches steady state.
Position will tend to increase or decrease at a constant rate as the velocity reaches steady state.
Make sure your simulator does this.
(Question 4 on submission sheet)
DEMONSTRATE THIS TO YOUR PROCTOR OR INSTRUCTOR, AND HAVE THEM CHECK THAT YOUR DATA (YOUR ALTERED VI) GETS SAVED TO THE DESKTOP. THEN SAVE YOUR DATA TO A THUMB DRIVE OR TO THE CLOUD
Figure 5.22: Completed Simulator Block Diagram.
Figure 5.23: Completed Simulator Front Panel during a simulation.
Make sure to save your altered VIs for later labs!
You aren't guaranteed to get the same computer next week, so save them to a thumb drive or somewhere on the internet.
In this section, you will be using a MyDAQ to acquire voltage readings from a linear, solid state temperature sensor. MyDAQs are data acquisition devices. They give you the ability to measure voltages in circuits (they also have many other features that make them very handy, such as multimeter, control, audio analysis, etc). Solid State Temperature Sensors are circuit elements that output a voltage which correlates to the temperature; thus, they can be used as a tool to measure ambient temperature.
Figure 6.1: (a) National Instruments MyDAQ – Data acquisition device; (b) Pins of solid State Linear Sensor.
Many of the analog/digital inputs on the MyDAQ are located on the right side. These inputs are where you will plug in the voltages you are measuring.
Figure 6.2: Diagram showing how to connect a voltage source to the MyDAQ. is the voltage you are trying to measure.
The solid state temperature sensor that you will be using for this practicum is the Microchip Technology MCP9701 Linear, Active thermistor. Simply put, it is a sensor that outputs a voltage which corresponds to the ambient temperature. As the name states, this relationship between voltage and ambient temperature is linear (in its region of operation, -40°C to 125°C). Thus, the output voltage and ambient temperature will have the following form shown in Fig. 6.3.
Figure 6.3: Relationship between sensor output voltage and ambient temperature, as reported in the sensor’s datasheet. and are constant values.
The temperature sensor that you receive will already be soldered to three wires. Red is connected to the source voltage (+5 Volts), black/green is ground (0 Volts), and blue/white is the output voltage. Refer to Figure 6.4 to the right.
Figure 6.4: (a) Wired temperature sensor; (b) Colored wires marking the voltage requirements: Red (+5V), Green/Black (0V, Ground), Blue/White (Sensor Output).
Begin by connecting the blue/white wire to Analog Input 0+ (AI0+) in the MyDAQ, this is pictured below in Figure 6.5. Make sure that the wire is stripped at the end before you connect it.
Figure 6.5: (a) Analog input ports that you will be using on the MyDAQ; (b) Use the small flat-head NI screwdriver to raise or lower the port; (c) Loosen the port by turning counter clockwise, place the blue/white wire in AI0+, then gently tighten by turning clockwise.
Take a short black or green wire, one that is stripped on both ends, and insert it into the AI0- port, as shown in Fig. 6.6 (a). This wire will be connected to our circuit’s ground. Loop it back to the terminal labeled AGND as shown in Fig. 6.6 (b).
Insert the Ground wire of the sensor into AI0-. There should now be two wires coming into AI0-, one connected to the AGND terminal, and one leading to the Ground of the sensor, (see Fig. 6.6 (b)).
Figure 6.6: (a) Short wire connected to negative terminal of AI0 (AI0-); (b) Connecting the temperature sensor GROUND to AI0-, and connecting AI0- to AGND with the short wire.
Next, you will need to provide power to the sensor from the 5V power supply of the digital side of the myDAQ. First, add a black/green wire that connects the AGND to the DGND so all voltages will be referenced to the same ground. See Fig. 6.7. Next, connect the 5V input line of the sensor (red wire), to the 5V supply on the myDAQ.
Figure 6.7: Wiring the MyDAQ to the temperature sensor.
In order to read the data from this analog input, you will need to connect the MyDAQ to your computer using the provided USB cable and set up a quick LabVIEW program. Do this now.
Create a new VI and save it into your library with the name tempReader.vi.
LabVIEW has a helpful MyDAQ Assistant, which makes it fairly simple to interface with the MyDAQ in LabVIEW. From the block diagram window, navigate to the functions palette and click Express->Input. Drag the DAQ Assistant into the block diagram. See Fig. 6.8.
Figure 6.8: DAQ Assistant (in red) located in Functions Palette.
Upon dropping the MyDAQ assistant into your block diagram, a screen should open, asking you to select whether you would like to Acquire or Generate a signal. Click on Acquire Signals->Analog Input->Voltage. Fig. 6.9a shows the DAQ Assistant window.
Next, select your myDAQ then ai0, as shown in Fig. 6.9b. Once it is highlighted, click Finish.
Figure 6.9: (a) DAQ Assistant screen; (b) DAQ Assistant input selection
Another window should open. As shown in Fig. 6.10, change the Acquisition Mode to Continuous Samples. This gives you the ability to plot the temperature in real-time.
Figure 6.10: Change the acquisition mode from 1 Sample (On Demand) to Continuous Samples.
Finally, click OK in the bottom right. LabVIEW will ask you to add a while loop; click Yes. Afterwards, your block diagram should look like the diagram in Figure 6.11.
Figure 6.11: Automatically generated LabVIEW VI.
LabVIEW will automatically generate a simple VI; however, we will not be able to plot our data yet. In your front panel, add a Waveform Chart from the controls palette in Silver->Graph->Waveform Chart.
From the block diagram, connect the Data output of the DAQ Assistant block to the input of the waveform chart.
Figure 6.12: MyDAQ data output connected to waveform chart.
To fix the scale of the y-axis on your waveform chart, right click on the chart, click on Properties; and under the Scales tab, select the Y-Axis in the drop down, turn off autoscale in the same tab, and set the range you would like to see, (0V to 2V is a good range).
Before running the VI and testing your connections, verify that your circuit is wired correctly and exposed wires are separated from each other.
Run your VI.
(Optional) If your signal is very noisy, ask your proctor or professor for a capacitor to place between the two analog inputs, as shown in Figure 6.13. It will be a little difficult to keep the wires inside, so ask a partner for assistance.
Note: Disconnect your 5V power when making changes to a circuit.
If everything is wired correctly, you should see something like the plot shown in Fig. 6.14.
Figure 6.13: Optional capacitor to reduce noise.
Figure 6.14: Voltage output corresponding to temperature.
Warm up the thermistor with your hands and watch how the voltage signal responds.
Although the result is very interesting, it isn’t very meaningful. In order to get the temperature, you will need to rearrange the equation from Fig. 6.3, seen to the right here.
According to the data sheet shown in Figure 6.15, we get the information shown to the right.
Figure 6.15: DC electrical characteristics from data sheet.
We will use the arithmetic operations in LabVIEW to implement the equation from Fig. 6.15 and convert the output voltage from the MyDAQ into ambient temperature in °C. From the Functions Palette, under Numeric, find the Subtract block. See Fig. 6.16 below.
Figure 6.16: The Numeric tab on the Functions Palette.
Click on the Subtract block and place one in your block diagram. Wire the output data terminal from the DAQ Assistant block to the top input terminal on the Subtract block. Also, right click on the lower input terminal of the Subtract block and select Create Constant. Set this constant to be 0.4. See Fig. 6.17.
Figure 6.17: Converting to Celsius, step 1.
Now add a Divide block from the functions palette Numeric tab. Use it to divide the signal by TC before plotting it on the chart. Fig. 6.18 shows the result.
Consider rescaling the chart y-axis to provide appropriate range of temperatures to plot.
Note, you will be using these skills to measure water temperatures in your ROV later in the course.
(Question 5 on submission sheet)
Figure 6.18: Sensor output in Celsius after being placed in cold water and removed.
In this section of the practicum, you will be using PWM signals to control the brightness of an LED. PWM stands for pulse-width modulation. In digital electronics, PWM is a method of quickly sending a signal that switches between on and off (a square wave) as a means of providing a desired voltage to a load. Fig. 6.19 shows you an example of this. PWM signals also have another important characteristic: their duty cycle. A duty cycle is the percentage of a waveform’s period that the signal is on. A duty cycle of 100% implies that the signal is always on, while a duty cycle of 50% implies that the signal is on for only half the period of the waveform. With a fast enough PWM signal, you can use digital signals to control the voltage supplied to motors, LEDS, etc.
Figure 6.19: Four examples of PWM signals, each with a different duty cycle.
For this practicum, you will be using Professors Spjut’s PWM.vi which can be found in your library. This VI uses the digital ports in the MyDAQ. Refer to Figure 6.20 below.
Figure 6.20: MyDAQ digital I/O pins.
Cut and strip both ends of two fairly short wires; one for ground (black/green) and another for digital pin 0. Use a small flathead screwdriver to place them in the correct MyDAQ pins. Refer to Fig. 6.21 for a picture.
Figure 6.21: Wires inserted into DGND and DIO-0.
Using alligator clips, make the circuit illustrated in Fig. 6.22. LEDs are directional; therefore, you must make sure to wire them in the right direction. The longest pin on the LED will be the positive terminal; connect this pin to the MyDAQ’s digital output. The shorter pin is connected to the digital ground (DGND).
Figure 6.22: LED wiring diagram; the longer LED pin is the positive terminal.
Connect the MyDAQ to your computer and open the PWM virtual instrument. This is what will be used to control your motors in the future; however, we now only use it to control an LED using Chan 0.
The following step is very important. In the front panel, there is a box labeled “Channel Settings”. Type (or copy and paste) this into the dropdown: myDAQ1/port0/line0:7 . Refer to Figure 6.23. You need to do this because the VI has been configured to use all of the output pins (we are only concerned with Pin 0).
Note: You may get an error when you run the IV that states that the DAQ is not connected. This error is because your DAQ might not be called myDAQ1. Somewhere on the error message it should display suggested DAQ number. Change the number to the suggested one in "Channel Settings." You can also delete the 1 in "Channel Settings" and the program should auto-suggest the correct one.
Once you have changed the output, you can now run your VI! Vary the Chan 0 slider and observe how the brightness of the LED changes. The slider is simply changing the duty cycle of the PWM signal.
Figure 6.23: Change the channel settings to lines 0 through 7.
Move the slider to the left. This is the effect of a shorter duty cycle. See Figure 6.24a.
Move the slider to the right. This is the effect of a longer duty cycle. See Figure 6.24b. You will eventually use a similar VI to control speed of your motors using digital signals.
(Question 6 on submission sheet)
Figure 6.24: (a) Effects of longer duty cycle; (b) Effects of shorter duty cycle.
1. Temp sensor Spec sheet: https://ww1.microchip.com/downloads/en/DeviceDoc/20001942G.pdf
2. MyDAQ manual: http://www.ni.com/pdf/manuals/373060f.pdf
3. MyDAQ Photo: http://zone.ni.com/images/reference/en-XX/help/370466W-01/mydaq_pinout_ioconn.gif
4. LED Photo: https://www.raspberrypi.org/learning/images/components/led.png
Tools Per Station
LabVIEW Introduction
Laptop
MyDAQ Introduction
MyDAQ
USB Cable
NI screwdriver
Software
LabVIEW Introduction
AccelCalc.vi
DoubleIntegration.vi
MyDAQ Introduction
PWM.vi
ValuetoPWM.vi
Materials Per Kit
LabVIEW Introduction
N/A
MyDAQ Introduction
Red LED
wire
MCP9701 Solid State Thermistor