QNET MECHKIT - Workbook (Student)
QNET MECHKIT - Workbook (Student)
Quanser Inc.
119 Spy Court
Markham, Ontario
L3R 5H6 Canada
info@quanser.com
Phone: 1-905-940-3575
Fax: 1-905-940-3576
For more information on the solutions Quanser Inc. offers, please visit the web site at:
http://www.quanser.com
This document and the software described in it are provided subject to a license agreement. Neither the software nor this document may be
used or copied except as specified under the terms of that license agreement. All rights are reserved and no part may be reproduced, stored in
a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior
written permission of Quanser Inc.
Acknowledgements
Quanser, Inc. would like to thank the following contributors:
Dr. Hakan Gurocak, Washington State University Vancouver, USA, for his help to include embedded outcomes assessment, and
Dr. K. J. Åström, Lund University, Lund, Sweden for his immense contributions to the curriculum content.
Contents
1 Introduction 6
2 Sensor Properties 7
2.1 Resolution 7
2.2 Range 7
3.1 Background 9
3.6 Results 13
4 Pressure Sensor 14
4.1 Background 14
4.5 Results 17
5 Piezo Sensor 18
5.1 Background 18
6 Potentiometer 19
6.1 Background 19
6.5 Results 22
7 Infrared 23
7.1 Background 23
7.5 Results 26
8 Sonar 27
8.1 Background 27
8.5 Results 30
9 Optical Position 31
9.1 Background 31
9.5 Results 34
10 Magnetic Field 35
10.5 Results 38
11 Encoder 39
11.1 Background 39
11.5 Results 42
12 Temperature Sensor 43
12.1 Background 43
12.5 Results 47
13.1 Background 48
13.7 Results 55
14 Switch Debounce
Analysis 56
14.1 Background 56
14.6 Results 60
15.4 Piezo VI 66
15.5 Potetiometer VI 68
16 Lab Report 85
1 INTRODUCTION
Mechatronics engineering is a cross-disciplinary field that combines mechanical and electronic design in control
systems architecture though the application of computer programming. One of the most useful topics that can be
covered in an introductory mechatronics course is the understanding and application of sensors. Various sensors
are used in all types of industries. For example, in the automotive industry magnetic field transducers are used for
throttle, pedal, suspension, and valve position sensing. In assembly line and machine automation, optical sensors
The QNET mechatronics sensors (MECHKIT) trainer is shown in Figure 1.1. It has ten types of sensors, two types
of switches, a push button, and two LEDS. This QNET module can be used to teach the physical properties of
most sensors used today, and the techniques and limitations of their application.
There are 12 experiments: strain gage with flexible link, pressure sensor, piezo sensor, potentiometer, infrared,
sonar, optical position, magnetic field, encoder, temperature sensor, switches and LEDs, and switch debounce
analysis. The experiments can be performed independently.
Topics Covered
Prerequisites
In order to successfully carry out this laboratory, the user should be familiar with the following:
2 SENSOR PROPERTIES
This section discusses various sensor properties that are often found in technical specifications.
2.2 Range
Range sensors can only take measurements of a target within a certain operating range. The operating range
specifies a maximum, and sometimes also a minimum, distance where the target can be from the sensor in order
to obtain an accurate measurement. Sensors with a small range are the magnetic field and optical position
sensors. Sensor with a relatively larger range are infrared and sonar.
Some of the different ways to characterize analog sensors is illustrated in Figure 2.1.
y = ax + b (2.1)
where a is the rate of change and b is the offset. Variable x is the sensor output signal and y is the measurement,
e.g. for the potentiometer x would be the voltage measured by the sensor and y would be the angular
measurement (in either degrees or radians). Other types of sensors need to be characterized by more complex
relationship such as polynomial
y = ax2+ bx + c (2.2)
or exponential
y = aebx (2.3)
Figure 3.1: Strain gage measuring deflection of flexible link on QNET mechatronic sensors trainer
2. Open and configure the QNET MECHKIT Flexgage VI as described in Section 15.2. Make sure the correct
Device is chosen.
3. Run QNET_MECHKIT_Flexgage.vi
5. Enter the strain gage voltage reading in the Sensor Measurement (V) array (indicated in Figure 3.2).
6. Repeat for -0.5 cm, 0 cm, 0.5 cm, and 1.0 cm. A linear curve is automatically fitted to the data being entered
and its slope and intercept are generated.
7. Enter the measured voltages and capture the Sensor Readings scope.
Sensor Measurement: at 0 cm V
Gain cm/V
Offset cm
2. Select the Calibrate Sensor tab and enter the slope and intercept obtained in Section 3.3 into the Calibration
Gain and Offset controls shown in Figure 3.3, below. When the link is moved, the slider indicator in the VI
should match up with the actual location of the flexible link on the QNET module.
3. Manually perturb the flexible link and stop the VI when it stops resonating (after about 5 seconds). The
spectrum should then load in the chart, as shown in Figure 3.4 (the value shown is incorrect).
4. Enter natural frequency found and capture the resulting power spectrum response. Hint: You can use the
cursor to take measurements off the graph.
3.6 Results
Parameter Value Units Notes
Gain cm/V
Offset cm
Natural Frequency Hz
Pressure sensors can also be used to indirectly measure other values. For example, in the QNET mechatronics
board the position of the plunger head is measured. It can also be used to measure the amount of volume in a
reservoir or the altitude of an aerial vehicle.
2. Open and configure the QNET MECHKIT Pressure VI as described in Section 15.3. Make sure the correct
Device is chosen.
Important: Completely remove the plunger from the tube and re-insert it. This will ensure the chamber is
pressurized enough.
3. Run QNET_MECHKIT_Pressure_Sensor.vi
4. Push the plunger up to the initial 1 ml mark on the tube and measure the resulting voltage using the
Pressure (V) scope (or the digital display).
5. Enter the result in the Sensor Measurement (V) array, as indicated in Figure 4.2.
6. Repeat for when the plunger is at 0.8 ml, 0.6 ml, 0.4 ml, 0.2 ml, and 0 ml. The pressure sensor is quadratic.
The coefficients for the second-order polynomial are generated and the fitted curve is automatically plotted.
Sensor Measurement: at 0 ml V
2. In the Calibrate Sensor tab, enter the polynomial coefficients, as illustrated in Figure 4.3, to measure correct
position of the plunger. Verify that the sensor is reading properly, e.g. display should read 0.5 ml when
plunger is placed at 0.5 ml.
4.5 Results
Parameter Value Units Notes
a ml/V2
b ml/V
c ml
5 PIEZO SENSOR
5.1 Background
Piezo sensors measure vibration. The piezo sensor on the QNET-MECHKIT trainer, shown in Figure 5.1, is
connected to a plastic band that has a brass disc weight at the end.
2. Open and configure the QNET MECHKIT Piezo VI as described in Section 15.4. Make sure the correct
Device is chosen.
3. Run QNET_MECHKIT_Piezo.vi
4. Manually perturb the plastic band that is attached to the piezo sensor by flicking it and examine the response
in the Piezo (V) scope.
5. Grab the end of the plastic band and move it slowly up and down. Examine the response.
6. Based on these two tests, what does the Piezo sensor measure? How is this different then a strain gage
measurement? Capture a sample Piezo (V) scope response after it has been perturbed (by flicking it).
3. Capture the resulting power spectrum response and give the measured natural frequency. Hint: You can use
the cursor to take measurements off the graph.
2. Open and configure the QNET MECHKIT Potentiometer VI as described in Section 15.5. Make sure the
correct Device is chosen.
3. Run QNET_MECHKIT_Potentiometer.vi
5. Enter the position in the Pot Angle (deg) array, as indicated in Figure 6.2.
6. Enter corresponding measured sensor voltage in Sensor Measurement (V) array (shown in Figure 6.2).
7. Fill out table with an appropriate amount of data points. Notice that as the measured potentiometer readings
are entered, a curve is automatically generated to fit the data. The slope and intercept of this line is
generated as well.
8. Enter the collected data and capture the Sensor Reading chart.
Gain deg/V
Offset deg
2. In the Calibrate Sensor tab, set the Gain and Offset controls, as indicated in Figure 6.3, to values such that
the potentiometer measures the correct angle. Verify that the sensor is reading properly, e.g. when pot arrow
is turned to 45.0 deg, the Display: Potentiometer (deg) knob indicator should read 45.0 degrees.
6.5 Results
Parameter Value Units Notes
Gain deg/V
Offset deg
7 INFRARED
7.1 Background
Infrared (IR) sensors are widely used in robots, automotive systems, and various other applications that require an
accurate, medium-range non-contact position measurement. An IR sensor is typically composed of an infrared
emitting diode (IRED), a position sensing detector (PSD), and a signal processing circuit. It outputs a voltage the
correlates to the distance of the remote target. The infrared distance measuring sensor on the QNET MECHKIT
board is shown in Figure 7.1.
Infrared-based distance sensors typically have a smaller maximum range than sonar but the resolution is better.
2. Open and configure the QNET MECHKIT Infrared VI as described in Section 15.6. Make sure the correct
Device is chosen.
3. Run QNET_MECHKIT_Infrared.vi
4. Turn ON the IR switch to enable the Infrared sensor. The IR ON LED should be lit bright red. Important:
Make sure you turn OFF the IR switch when the experiment is over. When active, the infrared sensor tends
to generate noise in other sensor measurements.
5. Get a target, such as a sturdy piece of cardboard, that is at least 10 by 10 cm 2 with a reflective colour like
white or yellow.
6. Begin with the target close to the IR sensor and slowly move it away.
8. Enter the corresponding measured voltage from the IR sensor in the Sensor Measurement (V) array, as
shown in Figure 7.2.
9. Repeat for different target positions. The IR sensor is quadratic. As the measurements are entered, the
coefficients for the second-order polynomial are generated and the fitted curve is automatically plotted.
10. Record your distance and voltage observations and capture the corresponding Sensor Readings scope.
Parameter Value Units Notes
Sensor Measurement: at 17cm V
Sensor Measurement: at 22 cm V
Sensor Measurement: at 27 cm V
Sensor Measurement: at 32 cm V
Sensor Measurement: at 37 cm V
Sensor Measurement: at 42 cm V
Sensor Measurement: at 47 cm V
Sensor Measurement: at 52 cm V
Sensor Measurement: at 57 cm V
11. What did you notice when the target is close to the IR sensor? That is, did the behaviour of the sensor
change when the target was in close proximity as opposed to being further away?
2. In the Calibrate Sensor tab, enter the polynomial coefficients to correctly measure the distance of the target.
Check that it is measuring correctly, e.g. when target is 25.0 cm away, the display should read 25.0 cm.
7.5 Results
Parameter Value Units Notes
a cm/V2
b cm/V
c cm
8 SONAR
8.1 Background
Often used in mobile robotics, sonar sensors are fitted with an emitter that generates ultrasonic waves and a
receiver that captures them after hitting a target. A timer calculates how long it takes for the signal to return and,
given the speed of sound in air, the distance of the remote target is measured. The sonar ranger on the
mechatronic trainer is pictured in Figure 8.1.
Sonar sensors are great for long-distance measurements. For example, the one mounted on mechatronic board
can go up to 21 feet. However, in general, these devices do not have good close-range measurements and their
resolution can be relatively coarse.
2. Open and configure the QNET MECHKIT Sonar VI as described in Section 15.7. Make sure the correct
Device is chosen.
3. Run QNET_MECHKIT_Sonar.vi
4. Get a target, such as a sturdy piece of cardboard, that is at least 10 by 10 cm 2 with a reflective colour like
white or yellow.
5. Begin with the target close to the sonar sensor and slowly move it upwards.
6. Once its range of operation is found, enter the distance between the target and the sonar sensor in the
Target Range (cm) array, as shown in Figure 8.2.
7. Enter the corresponding measured voltage from the sonar sensor in the Sensor Measurement (V) array, as
shown in Figure 8.2.
9. Enter your collected target distances and voltages. Capture the Sensor Readings scope as well.
Parameter Value Units Notes
Sensor Measurement: at 7 cm V
Sensor Measurement: at 8 cm V
Sensor Measurement: at 9 cm V
Sensor Measurement: at 10 cm V
Sensor Measurement: at 11 cm V
10. What is the resolution and operating range of the sonar sensor? How does the resolution and range
compare with the IR sensor?
2. Select the Calibrate Sensor tab and enter Gain and Offset coefficients to correctly measure the distance of
the target. Make sure the coefficients are correct, e.g. when the target is 10.0 inches away then the Sonar
(inch) display should read 10.0 inches.
8.5 Results
Parameter Value Units Notes
Range cm
Resolution cm
Gain cm/V
Offset cm
9 OPTICAL POSITION
9.1 Background
Optical position sensors are used in applications such as assembly lines, machine automation, and even edge
detection in robots. The optical position sensor on the QNET mechatronic sensors board is the black plastic
Figure 9.1: Optical position sensor (bottom) and target position knob (top) on QNET mechatronic sensors trainer
2. Open and configure the QNET MECHKIT Optical Position VI as described in Section 15.8. Make sure the
correct Device is chosen.
3. Run QNET_MECHKIT_Optical.vi
4. Gently turn the knob of the optical position sensor clockwise until the flat metal surface gently rests on top
of the tube. Then, rotate the knob slightly counter-clockwise so the 0 mark on the knob faces up. At this
point, the reflective target is very close to the optical sensor and will be the reference 0 inch position. Enter
the 0 position in the first element of the Target Range (inch) array, shown in Figure 9.2.
5. Enter the voltage measured by the optical position sensor, when the target is 0 inches away, in the Sensor
Measurement (V) array, as indicated in Figure 9.2.
6. Turn the knob counter-clockwise one rotation to move the target further from the sensor. The target moves
1-inch for every 20 turns. Enter the position the target has moved from the reference in the Target Range
(inch) array, which is shown in Figure 9.2.
8. Take samples for the entire range of the target (i.e. until the knob cannot be rotated CCW anymore).
Remark that the optical position sensor is exponential. As data is being entered, the exponential
parameters are generated and the fitted curve is automatically plotted.
9. Enter the measured sensor data and capture the Sensor Readings response.
Parameter Value Units Notes
Sensor Measurement: at 0 in. V
2. Select the Calibrate Sensor tab, enter values for the Gain and Damping exponential function parameters, as
shown in Figure 9.3, to correctly measure the distance of the target, e.g. when target is 0.10 inches away
then display should read 0.10 inches.
3. Enter the Gain and Damping parameters used into Table 9.2.
9.5 Results
Parameter Value Units Notes
Gain in
Damping
2. Open and configure the QNET MECHKIT Magnetic Field VI as described in Section 15.9. Make sure the
correct Device is chosen.
3. Run QNET_MECHKIT_Magnetic_Field.vi
4. Gently turn the knob of the magnetic field sensor clockwise until it is at its limit. Then, rotate the knob
slightly counter-clockwise so the 0 mark on the knob faces up. This will be reference 0 inches target
position. Enter this in the Target Range (inch) array, shown in Figure 10.2.
5. Enter the voltage measured from the magnetic field position sensor for the reference 0 inch position in the
Sensor Measurement (V) array. The array is indicated in Figure 10.2.
6. Turn the knob counter-clockwise one rotation to move the target further from the sensor. The target moves
1-inch for every 20 turns. Enter the position the target has moved from the reference in the Target Range
(inch) array.
8. Take samples for the entire range of the target (i.e. until the knob cannot be rotated CCW anymore). The
magnetic field sensor is exponential. The parameters of the exponential function are outputted and the
fitted curve is automatically plotted as data is entered.
9. Enter the range and measured sensor voltages and capture the Sensor Readings scope.
Parameter Value Units Notes
Sensor Measurement: at 0 in. V
2. Enter Gain and Damping exponential function parameters to correctly measure the distance of the target.
For instance, when target is at 0.10 inches from the reference, then the display should read 0.10 inches.
10.5 Results
Parameter Value Units Notes
Gain in/V
Damping
The encoder has a coded disk that is marked with a radial pattern. As the disk rotates (with the shaft), the light
from an LED shines through the pattern and is picked up by a photo sensor. This effectively generates the A and B
signals shown in Figure 11.2. An index pulse is triggered once for every full rotation of the disk, which can be used
for calibration or homing a system.
The A and B signals that are generated as the shaft rotates are used in a decoder algorithm to generate a count.
The resolution of the encoder depends on the coding of the disk and the decoder. For example, an encoder with
1024 lines on the disk can generate a total of 1024 counts for every rotation of the encoder shaft. However, in a
quadrature decoder the number of counts quadruples, therefore the encoder would generate 4098 counts per
revolution.
Figure 11.3: Encoder wheel on QNET mechatronic sensor Figure 11.4: Encoder LEDs on QNET mechatronic sensor
trainer trainer
2. Open and configure the QNET MECHKIT Encoder VI as described in Section 15.10. Make sure the correct
Device is chosen.
3. Run QNET_MECHKIT_Encoder.vi
4. Turn the encoder knob clockwise and examine the response of the A and B signals. Note that the signals are
offset by 2.5 V for display purposes. Similarly, turn the encoder knob counter-clockwise and enter your
observation.
5. When is the index pulse triggered? What can this be used for?
2. Using the 16-bit Position (counts) indicator on the VI, as shown in Figure 11.5, rotate the knob and determine
how how many counts there are per revolution. Enter your result in the Counts per rev box in the VI. Rotate
the knob and confirm that the Angle (deg) indicator is displaying an accurate angle.
3. Turn the knob such that the 0 is in the upward position and reset the counter by clicking on the Reset button.
5. Rotate the knob a full CW turn until the index is triggered. Keep turning the knob until the 0 mark on the knob
is pointing upwards. What do you notice about the 16-bit Position (counts) and the Angle (deg) indicator
values?
6. Adjust the Reload Value such that Angle (deg) measures 0 degrees when the 0 mark of the knob is pointing
up. Confirm this by moving the knob CW.
7. Enter the Count per rev and the Reload Value values used for a calibrated measurement.
8. Position the knob such that its 0 label is pointing upwards again. The Counts per rev and Angle (deg) should
both be reading 0. Rotate the knob in the CCW fashion one full rotation. Is Angle (deg) reading 0 degrees?
Discuss why or why not.
11.5 Results
Encoder Knob Rotation A or B Signal Leads?
Clockwise
Counter-clockwise
12 TEMPERATURE SENSOR
12.1 Background
As described in [2], there are several different types of transducers available to measure temperature: the
thermocouple, the resistance temperature detector (RTD), the thermistor, and the integrated circuit (IC). Each
have their own advantages and disadvantages. The Thermocouple has a wide temperature range and is easy to
use but is the least stable and sensitive. The RTD, on the other hand, is most stable and accurate of the sensors
but is slow and relatively more expensive. The IC is the only linear transducer, has the highest output, but is slow.
The thermistor responds very quickly but has a limited temperature range. The thermistor on the mechatronic
sensors board is shown in Figure 12.1.
The thermistor is a resistor that changes value according to the temperature. As given in [3], the relationship
between the resistance of the thermistor and the temperature, T , can be described using the B-parameter
equation
(12.1)
The resistance is R0 when the temperature is at T0. For the thermistor on the mechatronic sensors trainer, the
sensor resistance is
R0 = 47000Ω (12.2)
T0 = 298.15K (12.3)
Thermistors are typically part of a circuit. In the QNET mechatronic sensors trainer, the thermistor is in the circuit
shown in Figure 12.2 and labeled by R.
Using the voltage divider rule, the voltage entering the negative terminal of the second operation amplifier, i.e. the
offset op amp, is
Figure 12.3: Thermistor Gain and Offset potentiometers on QNET mechatronic sensors trainer
2. Open and configure the QNET MECHKIT Temperature VI as described in Section 15.11. Make sure the
correct Device is chosen.
3. Run QNET_MECHKIT_Temperature.vi
4. As discussed in Section 12.1, the thermistor is part of a circuit and the output voltage can be varied using
the Gain and Offset potentiometers on the QNET mechatronic sensors board. Rotate the Gain knob on the
counter-clockwise until it hits its limit.
5. Adjust the Offset knob such that the Temperature Sensor (V) scope reads 0 V. This is the voltage measured
at room temperature, T0 = 298 K. Note: For this step, assume your room is at 25.0 degrees Celsius ( ◦C)
even though it's probably warmer or cooler.
6. Gently place your fingertip on the temperature sensor and examine the response in the Temperature Sensor
(V) scope. The surface temperature of the fingertip is approximately 32.0 ◦C. Enter the voltage read at room
temperature and with the fingertip.
1. The voltage being measured on the QNET MECHKIT is the output voltage, vo, of the circuit discussed
Section 12.1. Using the circuit and its corresponding equations, derive the formula that can be used to find
the thermistor resistance from the output voltage of the circuit, R.
2. Find the thermistor resistance at room temperature, R0, and at the fingertip, R.
3. Derive the equation to find the exponential parameter, B, and compute it based on the obtained results.
2. Enter the B parameter that was found in Section 12.4.1 in the Temperature Sensor VI, as shown in Figure
12.5. Place your fingertip on the sensor and capture the obtained response in Temperature Sensor (deg C)
scope.
3. Based on the measured response in Step 2, is the temperature sensor reading correctly?
12.5 Results
Temperature (◦C) Temperature (K) Measured Voltage Units Notes
(V)
25 298 V Voltage at room temp, T0
13.1.1 Switches
Different applications call for different types of switches. For example, a micro switch may be used to detect
mobile robot hitting a wall whereas an optical switch could be used to detect an edge. The push button is the most
common type of switch mechanism. A switch that is active high means the output is high, e.g. 5.0 V, when the
switch is triggered (e.g. pressed down). Active low means the signal is high, e.g. 5.0 V, when the switch is not
engaged (e.g. not pressed down).
The different switches on the QNET mechatronic sensors trainer are introduced in this section followed by a
discussion about debouncing.
Micro Switch
The micro switch is an active low device and is shown in Figure 13.1.
Push Button
The push button on the QNET MECHKIT is pictured in Figure 13.2 and is active high.
Optical Switch
The optical switch, shown in Figure 13.3, is a photo-microsensor that includes transmissive and reflective
components. As opposed to the push button and micro switch, this is a non-contact triggering solution. It is
triggered when the reflective sensor does not detect any light, i.e. when an object is placed between the
components. It goes low when no object is detected.
A light-emitting diode, or LED, is a low-energy and robust indicator that is used in many applications. The LEDs on
the mechatronic sensors trainer, labeled LED7 and LED8, are pictured in Figure 13.4. They are connected to
digital output lines from which they can be turned on and off. As with switches, LEDs can be wired to be active
high or active low.
2. Open and configure the QNET MECHKIT Switches and LEDs VI as described in Section 15.12. Make sure
the correct Device is chosen.
3. Run QNET_MECHKIT_Switches_and_LEDs.vi
5. Take piece of paper and slide it up and down into the optical switch. Examine the raw responses in the
Optical Switch scope.
6. Adjust threshold, indicated in Figure 13.5, to obtain an on/off or 0/1 digital measurement in the Optical
Switch - Digital scope.
7. Record threshold used to get on/off measurement and paste the response of the Optical Switch and Optical
Switch - Digital scopes.
2. Run QNET_MECHKIT_Switches_and_LEDs.vi
4. Press on the micro switch and examine its raw response in Micro Switch scope.
5. Adjust the Gain and Offset, shown in Figure 13.6, such that this the signal goes from 0 to 1 in the Micro
Switch Digital scope when the micro switch is pressed.
6. Record the Gain and Offset used and capture representative Micro Switch and Micro Switch - Digital
responses.
2. Run QNET_MECHKIT_Switches_and_LEDs.vi
4. Press on the push button and examine its raw response in the Push Button scope.
5. Adjust the Gain and Offset, indicated in Figure 13.7, such that this signal goes from 0 to 1 in the Push Button
Digital scope when the push button is pressed.
6. Record the Gain and Offset parameters used and capture representative Push Button and Push Button -
Digital responses.
7. Explain how the micro switch and push button behave differently.
3. As shown in Figure 13.8, switch DO 1 and DO 0 between the up/down positions and examine its effect on
the on-board LEDs.
4. Record what position, i.e. up or down, the DO 1 and DO 0 switches have to be in such that the DO 1 and DO
0 LEDs are lit.
13.7 Results
Parameter Value Units Notes
Gain
Gain
Offset
When implemented digitally, debounce is a type of signal conditioning algorithm that ensures the switch, button, or
sensor does not trigger anything due to unexpected conditions.
For example, consider a high-powered cart that is mounted on a track. Proximity sensors are installed that detect
when the cart goes beyond a safety limit, in which case the amplifier is deactivated. However due to the
highfrequency switching in the motor leads, the proximity switches are sometimes unexpectedly triggered even
when the cart is in the safe zone. The raw signal from the proximity sensor is shown in the top plot of Figure 14.1.
To avoid this, the output signal from the sensor is passed though a debounce switch and the resulting signal is
shown in the bottom plot of Figure 14.1.
2. Run the Oscilloscope NI ELVISmx instrument. By default, this is located under Start \All Programs \National
Instruments \NI ELVISmx \Instruments.
4. To read the micro switch, set the Source control in Channel 0 Settings to AI 1 (i.e. analog input channel #1).
The response obtained should be similar as shown in Figure 14.2.
5. Press on the micro switch and ensure you are getting the expected signal. Since the Acquisition Mode is set
to continuous, the instrument keeps on running and the signal can be observed in real-time.
6. To examine the behaviour of the micro switch when it is engaged, configure the Trigger section to stop.
Note: If preferred, you can change the Acquisition Mode to Run Once so the oscilloscope stops when the
trigger is engaged.
7. If the trigger has been setup correctly, then the oscilloscope screen should capture a closeup view of the
micro switch signal as it goes from 5 V to 0 V.
9. When you are done, stop and close down the Oscilloscope instrument.
Caution: Make sure any ELVISmx instrument, e.g. the oscilloscope, is closed before running any ELVIS II
based VIs. Otherwise the VI will not be able to run.
2. The QNET MECHKIT Debounce VI, which is shown in Figure 14.3, has the same functionality as the
Oscilloscope tool used in Section 14.3. It is already setup with a trigger and does not run continuously as the
oscilloscope instrument does. The Debounce VI is described in more detail in Section 15.13.
3. Run QNET_MECHKIT_Debounce.vi
5. Press the micro switch. The VI should stop and a response displayed on both graphs.
6. Capture the Micro Switch scope. What do you notice about the output signal from the micro switch?
2. Run QNET_MECHKIT_Debounce.vi
3. Setup the Trigger for the Push Button (CH #1) and enter the settings in Table 14.1.
4. Press the push button. The VI should stop and a response displayed on both graphs.
5. Capture the Push Button scope. What do you notice about the push button signal?
6. Which control would require debounce more micro switch or push button? Explain.
7. When triggering on one channel, notice that there is a signal on the other channel (e.g. when pressing the
micro switch observe the Ch1 scope). Capture representative plots and explain why this occurs.
14.6 Results
Trigger Parameters Value Units Notes
Micro Switch
Type
Slope
Source
Push Button
Type
Slope
Source
Level V
• NI ELVIS II
• Quanser QNET Mechatronic Sensors Trainer. See QNET MECHKIT User Manual ([1]).
Required Software
• NI LabVIEWr2011 or later
Caution: If these are not all installed then the VI will not be able to run! Please make sure all the software
and hardware components are installed. If an issue arises, then see the troubleshooting section in the QNET
VTOL User Manual ([1]).
Figure 15.6: QNET MECHKIT Piezo Sensor VI: Collect Data tab
15.5 Potetiometer VI
This VI can be used to view the potentiometer measurements when moving the potentiometer knob on the QNET
mechatronic sensors trainer. Table 15.5 lists and describes the main elements of the QNET Potentiometer VI and
every element is uniquely identified by an ID number in Figure 15.8 and Figure 15.9.
Figure 15.10: QNET MECHKIT Infrared Sensor VI: Collect Data tab
9 Scope: Optical Position (in) Scope that shows position of target based on entered in
Amplitude and Damping parameters
10 Display: Optical Position (in) Slider indicator displays position of target based on in
entered
Amplitude and Damping parameters
11 Device Selects the NI DAQ device
Figure 15.16: QNET MECHKIT Magnetic Field VI: Collect Data tab
9 Scope: Magnetic Field (in) Scope that shows position of target based on entered in
Amplitude and Damping parameters
10 Display: Magnetic Field (in) Slider indicator displays position of target based on in
entered
Amplitude and Damping parameters
11 Device Selects the NI DAQ device
4 Enable Index When enabled, the encoder count is reset on an index pulse
4 V
Figure 15.20: QNET MECHKIT Switches and LEDs VI: Opto Switch tab
Figure 15.22: QNET MECHKIT Switches and LEDs VI: Push Button tab
8 Scope: Push Button Scope shows the push button output voltage V
9 Scope: Push Button - Digital Scope displays calibrated push button output based on Gain
and Offset parameters.
10 Gain Push button calibration gain
3 Slope Select whether the trigger is to occur when the edge is rising
(positive) or decreasing (negative)
6 Level (V) Threshold of the trigger V
4 Graph: Micro Switch/ELVIS Ch0 Graph displays the triggered micro switch output
16 LAB REPORT
This laboratory contains twelve groups of experiments, namely,
1. Flexgage,
2. Pressure Sensor,
4. Potentiometer,
5. Infrared Sensor,
6. Sonar Sensor,
7. Optical Position,
8. Magnetic Field,
9. Encoder,
For each experiment, follow the outline corresponding to that experiment to build the content of your report. Also,
in Section 16.13 you can find some basic tips for the format of your report.
1. Collect Data
2. Calibrate Sensor
3. Natural Frequency
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
16.2
(Pressure Sensor)
I. PROCEDURE
1. Collect Data
2. Calibrate Sensor
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
1. Data Analysis
2. Natural Frequency
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the
following:
1. Collect Data
2. Calibrate Sensor
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
1. Collect Data
2. Calibrate Sensor
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
16.6
(Sonar Sensor)
I. PROCEDURE
1. Collect Data
2. Calibrate Sensor
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the
following:
16.7
(Optical Sensor)
I. PROCEDURE
1. Collect Data
2. Calibrate Sensor
1. Collect Data
2. Calibrate Sensor
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
2. Encoder Calibration
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
1. Provide applicable data collected in this laboratory from Table 11.1 and Table 11.2.
III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the
following:
1. Collect Data
2. Calibrate Sensor
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
IV. CONCLUSIONS
Interpret your results to arrive at logical conclusions for the following:
16.11
(Switches and LEDs)
I. PROCEDURE
1. Optical Switch
2. Micro Switch
3. Push Button
4. LEDs
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the
following:
2. Micro Switch
3. Push Button
II. RESULTS
Do not interpret or analyze the data in this section. Just provide the results.
III. ANALYSIS
Provide details of your calculations (methods used) for analysis for each of the following:
• Has cover page with all necessary details (title, course, student name(s), etc.)
• Typed.
• Figures are numbered, axes have labels, each figure has a descriptive caption. •
Tables are numbered, they include labels, each table has a descriptive caption.
• Data are presented in a useful format (graphs, numerical, table, charts, diagrams).
[2] Agilent Technologies. Practical Temperature Measurements (Application Note 290), 2008.