Вы находитесь на странице: 1из 97

QNET-015 MECHKIT

Quanser Engineering Trainer


for NI-ELVIS

QNET Mechatronic Sensor Trainer

Student Manual
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic
or mechanical, including photocopying, recording, storing in an information retrieval system, or
translating, in whole or in part, without the prior written consent of Quanser Inc.
Copyright 2009, by Quanser Inc. All rights reserved.

QNET-MECHKIT Laboratory Student Manual

Table of Contents
1. INTRODUCTION..........................................................................................................................................1
2. PREREQUISITES.........................................................................................................................................1
3. MECHKIT TRAINER VIRTUAL INSTRUMENTS...........................................................................................2
3.1. Summary...........................................................................................................................................2
3.2. Description........................................................................................................................................3
3.2.1. Flexgage.................................................................................................................................................3
3.2.2. Pressure Sensor......................................................................................................................................6
3.2.3. Piezo Film Sensor..................................................................................................................................9
3.2.4. Potentiometer.......................................................................................................................................12
3.2.5. Infrared Sensor.....................................................................................................................................15
3.2.6. Sonar Sensor........................................................................................................................................18
3.2.7. Optical Position....................................................................................................................................21
3.2.8. Magnetic Field.....................................................................................................................................24
3.2.9. Encoder................................................................................................................................................27
3.2.10. Temperature.......................................................................................................................................29
3.2.11. Switches and LEDs............................................................................................................................31
3.2.12. Switch Debounce...............................................................................................................................36

4. IN-LAB EXPERIMENTS.............................................................................................................................39
4.1. Strain Gage with Flexible Link.......................................................................................................39
4.1.1. Collect Data.........................................................................................................................................39
4.1.2. Calibrate Sensor...................................................................................................................................40
4.1.3. Natural Frequency................................................................................................................................41
4.1.4. Exercises..............................................................................................................................................42

4.2. Pressure Sensor...............................................................................................................................44


4.2.1. Collect Data.........................................................................................................................................44
Document Number 863 Revision 1.0 Page i

QNET-MECHKIT Laboratory Student Manual

4.2.2. Calibrate Sensor...................................................................................................................................45


4.2.3. Exercises..............................................................................................................................................46

4.3. Piezo Sensor....................................................................................................................................47


4.3.1. Data Analysis.......................................................................................................................................48
4.3.2. Natural Frequency................................................................................................................................48
4.3.3. Exercises..............................................................................................................................................48

4.4. Potentiometer..................................................................................................................................49
4.4.1. Collect Data.........................................................................................................................................49
4.4.2. Calibrate Sensor...................................................................................................................................50
4.4.3. Exercises..............................................................................................................................................52

4.5. Infrared............................................................................................................................................53
4.5.1. Collect Data.........................................................................................................................................53
4.5.2. Calibrate Sensor...................................................................................................................................54
4.5.3. Exercises..............................................................................................................................................56

4.6. Sonar...............................................................................................................................................58
4.6.1. Collect Data.........................................................................................................................................58
4.6.2. Calibrate Sensor...................................................................................................................................59
4.6.3. Exercises..............................................................................................................................................60

4.7. Optical Position..............................................................................................................................62


4.7.1. Collect Data.........................................................................................................................................62
4.7.2. Calibrate Sensor...................................................................................................................................63
4.7.3. Exercises..............................................................................................................................................65

4.8. Magnetic Field................................................................................................................................66


4.8.1. Collect Data.........................................................................................................................................66
4.8.2. Calibrate Sensor...................................................................................................................................67
4.8.3. Results..................................................................................................................................................69

4.9. Encoder...........................................................................................................................................70
4.9.1. Analysis of A, B, and I Signals............................................................................................................70
4.9.2. Encoder Calibration.............................................................................................................................71
4.9.3. Exercises..............................................................................................................................................72

4.10. Temperature Sensor......................................................................................................................73


4.10.1. Collect Data.......................................................................................................................................73
Document Number 863 Revision 1.0 Page ii

QNET-MECHKIT Laboratory Student Manual

4.10.2. Calibrate Sensor.................................................................................................................................74


4.10.3. Exercises............................................................................................................................................76

4.11. Switches and LEDs.......................................................................................................................78


4.11.1. Optical Switch....................................................................................................................................78
4.11.2. Micro Switch......................................................................................................................................79
4.11.3. Push Button........................................................................................................................................80
4.11.4. LEDs..................................................................................................................................................81
4.11.5. Exercises............................................................................................................................................83

4.12. Switch Debounce Analysis...........................................................................................................86


4.12.1. Running the Oscilloscope...................................................................................................................86
4.12.2. Micro Switch......................................................................................................................................87
4.12.3. Push Button........................................................................................................................................88
4.12.4. Exercises............................................................................................................................................89

5. REFERENCES...........................................................................................................................................93

Document Number 863 Revision 1.0 Page iii

QNET-MECHKIT Laboratory Student Manual

1. Introduction
This manual contains laboratory procedures and exercises for the QNET Mechatronic Sensors
(MECHKIT) trainer, depicted in Figure 1. See Reference [2] for details about the hardware of this
device.

Figure 1: QNET-MECHKIT on ELVIS II.

The prerequisites to run the LabVIEW Virtual Instruments (VIs) for the mechatronic sensors trainer are
listed in Section 2 and described in Section 3. The in-lab procedures for each of the on-board sensors
and switches are given in Section 4. The exercises are given within the lab procedures and labeled
Exercise. In that case, enter your answer in the Exercises section found at the end of that particular
laboratory.

2. Prerequisites
The following system is required to run the QNET MECHKIT virtual instruments:
PC equipped with either:
NI-ELVIS I and an NI E-Series or M-Series DAQ card.
NI ELVIS II
Document Number 863 Revision 1.0 Page 1

QNET-MECHKIT Laboratory Student Manual

Quanser Engineering Trainer (QNET) module.


LabVIEW 8.6.1 with the following add-ons:
DAQmx
Control Design and Simulation Module
When using ELVIS II: ELVISmx installed for required drivers.
When using ELVIS I: ELVIS CD 3.0.1 or later installed.

If these are not all installed the VI will not be able to run! Please make sure all the software and
hardware components are installed. If an issue arises, see the troubleshooting section in Reference [2].

3. MECHKIT Trainer Virtual Instruments


3.1. Summary
Table 1 below lists and describes the MECHKIT LabVIEW VIs supplied with the QNET CD.
VI

Description

QNET_MECHKIT_Flexgage

Calibrate strain gage attached to the flexible link and find


natural frequency of link.

QNET_MECHKIT_Pressure Sensor

Calibrate pressure sensor attached to plunger device.

QNET_MECHKIT_Piezo

Find natural frequency of plastic filament through power


spectrum.

QNET_MECHKIT_Potentiometer

Calibrate potentiometer to get correct angle.

QNET_MECHKIT_Infrared

Calibrate infrared sensor to measure target distance.

QNET_MECHKIT_Sonar

Instrument sonar sensor to measure target range..

QNET_MECHKIT_Optical

Calibrate optical sensor to measure the position of the flat


screw head, which can be adjusted using the knob.

QNET_MECHKIT_Magnetic_Field

Instrument magnetic field sensor to measure position of


the screw head, which can be adjusted using its knob.

QNET_MECHKIT_Encoder

Used to teach the fundamentals of a rotary optical


encoder.

QNET_MECHKIT_Temperature

Calibrate thermistor to measure correct temperature.

QNET_MECHKIT_Switches_and_LEDs

Change the on/off behaviour of the micro switch, push


button, and optical switch and drive on-board LEDs.

QNET_MECHKIT_Switch_Debounce

High-frequency analysis of micro switch and push button.

Table 1: MECHKIT VIs supplied with the QNET CD.


Document Number 863 Revision 1.0 Page 2

QNET-MECHKIT Laboratory Student Manual

3.2. Description
3.2.1. Flexgage
This VI can be used to view the strain gage measurements when moving the flexible link on the QNET
mechatronic sensors trainer. As a quick description, Table 2 lists and describes the main elements of the
QNET Flexgage VI and every element is uniquely identified by an ID number in Figure 2, Figure 3, and
Figure 4.

Figure 2: QNET-MECHKIT Flexgage VI: Collect Data tab selected.

Document Number 863 Revision 1.0 Page 3

QNET-MECHKIT Laboratory Student Manual

Figure 3: QNET-MECHKIT Flexgage VI: Calibrate tab.

Document Number 863 Revision 1.0 Page 4

QNET-MECHKIT Laboratory Student Manual

Figure 4: QNET MECHKIT Flexgage VI: "Natural Frequency".

Document Number 863 Revision 1.0 Page 5

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Flexgage (V)

Scope showing raw voltage measured by strain V


gage.

Link Position (cm)

Position of flexible link along printed graduated cm


ruler on QNET board.

Sensor Measurement (V)

Recorded strain gage measurement for each link V


position.

Sensor Readings

Graph showing measured and curve fitted data.

slope

Slope computed by curve fitting algorithm.

cm/V

intercept

Intercept computed by curve fitting algorithm.

cm

Gain (cm/V)

Sensor calibration gain, i.e. slope.

cm/V

Offset (cm)

Sensor calibration offset, i.e. intercept.

cm

Flexgage (cm), slider

Displays position of flexible link using Gain and cm


Offset parameter.

10

Flexgage (cm), scope

Displays position of flexible link using Gain and cm


Offset parameter.

11

Power Spectrum

Graph showing power spectrum of flexible link


(after being perturbed).

12

Cursor

Displays numerically the location of the cursor


on the Power Spectrum graph.

13

Device

Selects the NI DAQ device.

14

Sampling Rate

Sets the sampling rate of the VI.

15

Stop

Stops the LabVIEW VI from running.

Hz

Table 2: Nomenclature of QNET-MECHKIT Flexgage VI.

3.2.2. Pressure Sensor


This VI can be used to view the pressure sensor measurements as the plunger is moved at different
locations within the syringe on the QNET mechatronic sensors trainer. Table 3 lists and describes the
main components of the QNET Pressure Sensor VI and they are uniquely identified by an ID number in
Figure 5 and Figure 6.

Document Number 863 Revision 1.0 Page 6

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Pressure Sensor (V)

Scope showing raw voltage measured by V


pressure sensor.

Plunger Position (cm)

Position of syringe along printed graduated ruler cm


on QNET board.

Sensor Measurement (V)

Recorded pressure sensor measurement for each V


plunger position.

Sensor Readings

Graph showing measured and curve fitted data.

c (on Collect Data tab)

Intercept computed by curve fitting algorithm.

cm

b (Collect Data tab)

Slope computed by curve fitting algorithm.

cm/V

a (Collect Data tab)

Rate of slope computed by curve fitting cm/V2


algorithm.

a (Calibrate Sensor tab)

Rate of slope computed by curve fitting cm/V2


algorithm.

b (Calibrate Sensor tab)

Slope computed by curve fitting algorithm.

cm/V

10

c (Calibrate Sensor tab)

Intercept computed by curve fitting algorithm.

cm

11

Pressure Sensor (cm), scope

Chart displays position of flexible link using a, cm


b, and c parameters.

12

Pressure (cm)

Slide indicator displays position of flexible link cm


using a, b, and c parameters.

13

Device

Selects the NI DAQ device.

14

Sampling Rate

Sets the sampling rate of the VI.

15

Stop

Stops the LabVIEW VI from running.

Hz

Table 3: Nomenclature of QNET-MECHKIT Pressure Sensor VI.

Document Number 863 Revision 1.0 Page 7

QNET-MECHKIT Laboratory Student Manual

Figure 5: QNET MECHKIT Pressure Sensor: "Collect Data" tab selected.

Document Number 863 Revision 1.0 Page 8

QNET-MECHKIT Laboratory Student Manual

Figure 6: QNET MECHKIT Pressure Sensor VI: "Calib" Tab.

3.2.3. Piezo Film Sensor


Use the QNET Piezo VI to view the piezo sensor readings as the plastic strip on the QNET MECHKIT
trainer is perturbed. The components of the VI are listed in Table 4 and identified in Figure 7 and
Figure 8.

Document Number 863 Revision 1.0 Page 9

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Piezo (V)

Scope showing raw voltage measured by piezo V


film sensor.

Power Spectrum

Graph showing power spectrum of film (after


being perturbed).

Cursor

Displays numerically the location of the cursor


on the Power Spectrum graph.

Device

Selects the NI DAQ device.

Sampling Rate

Sets the sampling rate of the VI.

Stop

Stops the LabVIEW VI from running.

Hz

Table 4: Nomenclature of QNET-MECHKIT Piezo VI.

Document Number 863 Revision 1.0 Page 10

QNET-MECHKIT Laboratory Student Manual

Figure 7: QNET MECHKIT Piezo Sensor VI.

Document Number 863 Revision 1.0 Page 11

QNET-MECHKIT Laboratory Student Manual

Figure 8: QNET MECHKIT Piezo Sensor VI: "Natural Frequency" tab.

3.2.4. Potentiometer
This VI can be used to view the potentiometer measurements when moving the potentiometer knob on
the QNET mechatronic sensors trainer. As a quick description, Table 5 lists and describes the main
elements of the QNET Potentiometer VI and every element is uniquely identified by an ID number in
Figure 9 and Figure 10.

Document Number 863 Revision 1.0 Page 12

QNET-MECHKIT Laboratory Student Manual

Figure 9: QNET-MECHKIT Potentiometer VI.

Document Number 863 Revision 1.0 Page 13

QNET-MECHKIT Laboratory Student Manual

Figure 10: QNET-MECHKIT Potentiometer VI: "Calibrate Sensor" tab selected.

Document Number 863 Revision 1.0 Page 14

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Potentiometer (V)

Scope showing raw voltage measured by V


potentiometer.

Pot Angle (deg)

Angle of top arrow on the potentiometer knob.

Sensor Measurement (V)

Recorded potentiometer measurement for each V


angle.

Sensor Readings

Graph showing measured and curve fitted data.

slope

Slope computed by curve fitting algorithm.

deg/V

intercept

Intercept computed by curve fitting algorithm.

deg

Gain (deg/V)

Sensor calibration gain, i.e. slope.

deg/V

Offset (deg)

Sensor calibration offset, i.e. intercept.

deg

Potentiometer (deg), scope

Displays angular position of potentiometer deg


according to the Gain and Offset parameters.

10

Potentiometer (deg), knob

Displays position of potentiometer according to deg


the Gain and Offset parameters.

11

Device

Selects the NI DAQ device.

12

Sampling Rate

Sets the sampling rate of the VI.

13

Stop

Stops the LabVIEW VI from running.

deg

Hz

Table 5: Nomenclature of QNET-MECHKIT Potentiometer VI.

3.2.5. Infrared Sensor


Use the QNET Infrared VI to view the readings of the infrared sensor on the MECHKIT as the target
distance is changed. The components of the VI are listed in Table 6 and identified in Figure 11 and
Figure 12.

Document Number 863 Revision 1.0 Page 15

QNET-MECHKIT Laboratory Student Manual

Figure 11: QNET-MECHKIT Infrared VI.

Document Number 863 Revision 1.0 Page 16

QNET-MECHKIT Laboratory Student Manual

Figure 12: QNET-MECHKIT Infrared: "Calibrate Sensor" tab.

Document Number 863 Revision 1.0 Page 17

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Infrared Sensor (V)

Scope showing raw voltage measured by V


infrared sensor.

Target Range (cm)

Distance between target and IR sensor.

Sensor Measurement (V)

Recorded IR measurement for each target V


position.

Sensor Readings

Graph showing measured and curve fitted data.

c (on Collect Data tab)

Intercept computed by curve fitting algorithm.

cm

b (Collect Data tab)

Slope computed by curve fitting algorithm.

cm/V

a (Collect Data tab)

Rate of slope computed by curve fitting cm/V2


algorithm.

a (Calibrate Sensor tab)

Rate of slope computed by curve fitting cm/V2


algorithm.

b (Calibrate Sensor tab)

Slope computed by curve fitting algorithm.

cm/V

10

c (Calibrate Sensor tab)

Intercept computed by curve fitting algorithm.

cm

11

IR Sensor (cm)

Displays target distance using entered a, b, and c cm


parameters.

12

IR (cm)

Knob displays position of target using entered a, cm


b, and c parameters.

13

Device

Select the NI DAQ device.

14

Sampling Rate

Sets the sampling rate of the VI.

15

Stop

Stops the LabVIEW VI from running.

cm

Hz

Table 6: Nomenclature of QNET-MECHKIT Infrared VI

3.2.6. Sonar Sensor


Use this VI to view the sonar measurements as a target is moved at different distances away from the
sensor. Table 7 lists and describes the main components of the QNET Sonar VI and they are uniquely
identified by an ID number in Figure 13 and Figure 14.

Document Number 863 Revision 1.0 Page 18

QNET-MECHKIT Laboratory Student Manual

Figure 13: QNET-MECHKIT Sonar VI.

Document Number 863 Revision 1.0 Page 19

QNET-MECHKIT Laboratory Student Manual

Figure 14: QNET-MECHKIT Sonar VI: "Calibrate Sensor" tab.

Document Number 863 Revision 1.0 Page 20

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Sonar (V)

Scope showing raw voltage measured by sonar.

Target Range (in)

Distance between target and sonar sensor.

in

Sensor Measurement (V)

Recorded sonar measurement for each target V


position.

Sensor Readings

Graph showing measured and curve fitted data.

slope

Slope computed by curve fitting algorithm.

in/V

intercept

Intercept computed by curve fitting algorithm.

in

Gain (in/V)

Sensor calibration gain, i.e. slope.

in/V

Offset (in)

Sensor calibration offset, i.e. intercept.

in

Sonar (inch), scope

Displays angular position of potentiometer in


according to the Gain and Offset parameters.

10

Sonar (inch), knob

Displays position of potentiometer using Gain in


and Offset parameters.

11

Device

Selects the NI DAQ device.

12

Sampling Rate

Sets the sampling rate of the VI.

13

Stop

Stops the LabVIEW VI from running.

Hz

Table 7: Nomenclature of QNET-MECHKIT Sonar VI.

3.2.7. Optical Position


The QNET-MECHKIT Optical VI is used to view the measurements of the optical position sensor as
the target is moved at different locations using the knob. The components of the VI are described in
Table 8 and identified in Figure 15 and Figure 16.

Document Number 863 Revision 1.0 Page 21

QNET-MECHKIT Laboratory Student Manual

Figure 15: QNET-MECHKIT Optical VI.

Document Number 863 Revision 1.0 Page 22

QNET-MECHKIT Laboratory Student Manual

Figure 16: QNET-MECHKIT Optical VI: "Calibrate Sensor" tab.

Document Number 863 Revision 1.0 Page 23

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Optical Position Sensor (V)

Scope showing raw voltage measured by optical V


position sensor.

Target Range (in)

Distance between target and sensor.

in

Sensor Measurement (V)

Recorded measurement for each target position.

Sensor Readings

Graph showing measured and curve fitted data.

Exponential function amplitude


computed by curve fitting algorithm.

Exponential function decay/growth parameter


computed by curve fitting algorithm.

Amplitude

Gain of exponential function.

Damping

Exponential decay/growth factor of exponential


function.

Optical Position (inch)

Scope that shows position of target based on in


entered Amplitude and Damping parameters.

10

Display: Optical Position (in) Slider indicator displays position of target based in
on entered Amplitude and Damping parameters.

11

Device

Selects the NI DAQ device.

12

Sampling Rate

Sets the sampling rate of the VI.

13

Stop

Stops the LabVIEW VI from running.

parameter

Hz

Table 8: Nomenclature of QNET-MECHKIT Optical VI.

3.2.8. Magnetic Field


Using this VI, the magnetic field measurements can be read as the target is moved at different locations
using the knob on the QNET mechatronic sensors trainer. The components of the QNET Magnetic
Field VI are summarized in Table 9 and identified in Figure 17 and Figure 18.

Document Number 863 Revision 1.0 Page 24

QNET-MECHKIT Laboratory Student Manual

Figure 17: QNET-MECHKIT Magnetic Field VI.

Document Number 863 Revision 1.0 Page 25

QNET-MECHKIT Laboratory Student Manual

Figure 18: QNET-MECHKIT Magnetic Field VI: "Calibrate Sensor" tab.

Document Number 863 Revision 1.0 Page 26

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Magnetic Field Sensor (V)

Scope showing raw voltage measured by V


magnetic field sensor.

Target Range (inch)

Distance between target and sensor.

in

Sensor Measurement (V)

Recorded measurement for each target position.

Sensor Readings

Graph showing measured and curve fitted data.

Exponential function amplitude


computed by curve fitting algorithm.

Exponential function decay/growth parameter


computed by curve fitting algorithm.

Amplitude

Gain of exponential function.

Damping

Exponential decay/growth factor of exponential


function.

Magnetic Field (inch)

Scope that shows position of target based on in


entered Amplitude and Damping parameters.

10

Display: Magnetic Field (in)

Slider indicator displays position of target based in


on entered Amplitude and Damping parameters.

11

Device

Selects the NI DAQ device.

12

Sampling Rate

Sets the sampling rate of the VI.

13

Stop

Stops the LabVIEW VI from running.

parameter

Hz

Table 9: Nomenclature of QNET-MECHKIT Magnetic Field VI.

3.2.9. Encoder
This VI shows the A, B, and Index signals generated by the rotary optical encoder on the QNET
mechatronic sensors trainer as the knob is rotated. The components of the QNET Encoder VI are
described in Table 10 and identified in Figure 19.

Document Number 863 Revision 1.0 Page 27

QNET-MECHKIT Laboratory Student Manual

Figure 19: QNET-MECHKIT Encoder VI.

Document Number 863 Revision 1.0 Page 28

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Encoder A and B (V)

Scope showing encoder A (blue) and B (red) V


voltage signals. Note the signals are offset by 2.5
V for viewing purposes.

Encoder Index (V)

Scope displays the index trigger.

Reset

Resets the encoder count.

Enable Index

When enabled, the encoder count is reset on an


index pulse.

16-bit Position (counts)

Count generated by decoder.

counts

Counts per rev

Number of counts for every full rotation.

count/rev

Reload Value (counts)

Resets the count to this value.

counts

Angle (deg)

Angle measured by encoder according to the deg


Counter per rev parameter.

Device

Selects the NI DAQ device.

10

Sampling Rate

Sets the sampling rate of the VI.

11

Stop

Stops the LabVIEW VI from running.

Hz

Table 10: Nomenclature of QNET-MECHKIT Encoder VI.

3.2.10. Temperature
The measured voltage output from the thermistor circuit is displayed on this VI as well as the calibrated
temperature reading. The QNET MECHKIT Temperature VI components are given in Table 11 and
identified in Figure 20.

Document Number 863 Revision 1.0 Page 29

QNET-MECHKIT Laboratory Student Manual

Figure 20: QNET-MECHKIT Temperature VI.

Document Number 863 Revision 1.0 Page 30

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

R0

Resistance of thermistor at temperature specified


in T0.

T0

Room temperature in Kelvin.

Thermistor equation exponential parameter.

Temperature Sensor (V)

Scope shows the output voltage of the thermistor V


circuit.

Temperature Sensor (deg C)

Scope displays the measured temperature based deg C


on the T0 and B parameters entered.

Temperature (deg C)

Thermometer displays the measured temperature deg C


based on the T0 and B parameters entered.

Device

Selects the NI DAQ device.

Sampling Rate

Sets the sampling rate of the VI.

Stop

Stops the LabVIEW VI from running.

Hz

Table 11: Nomenclature of QNET-MECHKIT Temperature VI.

3.2.11. Switches and LEDs


The QNET MECHKIT Switches and LEDs VI allows users to view the output of the optical switch,
micro switch, and push button and calibrate them to obtain a desired on/off behaviour. This VI can also
be used to drive the digital output lines #0 and #1 that are connected to the LEDs on the QNET
mechatronics sensors trainer. The VI components are listed in Table 12 and identified in figures 21, 22,
23, and 24.

Document Number 863 Revision 1.0 Page 31

QNET-MECHKIT Laboratory Student Manual

Figure 21: QNET-MECHKIT Switches and LEDs VI: "Opto Switch" tab selected.

Document Number 863 Revision 1.0 Page 32

QNET-MECHKIT Laboratory Student Manual

Figure 22: QNET-MECHKIT Switches and LEDs VI: "Micro Switch" tab selected.

Document Number 863 Revision 1.0 Page 33

QNET-MECHKIT Laboratory Student Manual

Figure 23: QNET-MECHKIT Switches and LEDs VI: "Push Button" tab selected.

Document Number 863 Revision 1.0 Page 34

QNET-MECHKIT Laboratory Student Manual

Figure 24: QNET-MECHKIT Switches and LEDs VI: "Digital Outputs" tab selected.

Document Number 863 Revision 1.0 Page 35

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Unit

Optical Switch

Scope shows the optical switch output voltage.

Optical Switch Digital

Scope displays readout of optical switch when


passed through Threshold switch.

Threshold

Adjusts the threshold of the optical switch that V


determines when it is ON or OFF.

Micro Switch

Scope shows the micro switch output voltage.

Micro Switch Digital

Scope displays calibrated micro switch output


based on Gain and Offset parameters.

Gain

Micro switch calibration gain.

Offset

Micro switch calibration offset.

Push Button

Scope shows the push button output voltage.

Push Switch Digital

Scope displays calibrated push button output


based on Gain and Offset parameters.

10

Gain

Push button calibration gain.

11

Offset

Push button calibration offset.

12

DO 1

Digital output to channel #1 connected to


LED7 on QNET MECHKIT trainer.

13

DO 0

Digital output to channel #0 connected to


LED8 on QNET MECHKIT trainer.

14

Device

Selects the NI DAQ device.

15

Sampling Rate

Sets the sampling rate of the VI.

16

Stop

Stops the LabVIEW VI from running.

Hz

Table 12: Nomenclature of QNET-MECHKIT Switches and LEDs VI.

3.2.12. Switch Debounce


In this VI, the triggered output of the Micro Switch and the Push Button can be viewed. The ELVISmx
Oscilloscope VI is setup to monitor either the Micro Switch or Push Button analog input lines at a
sample rate 100 kHz. Once the signal is triggered, the VI automatically stops and outputs a 1k sample
of the voltage output. In effect, this gives a a 10 ms sample of the signal. See Table 13 for a listing of
the VI components that are shown in Figure 25.

Document Number 863 Revision 1.0 Page 36

QNET-MECHKIT Laboratory Student Manual

Figure 25: QNET-MECHKIT Debounce VI.

Document Number 863 Revision 1.0 Page 37

QNET-MECHKIT Laboratory Student Manual

ID #

Label

Description

Type

Type of signal trigger.

Source

Select which ELVIS channel, i.e. 0 or 1, that is to


trigger.

Slope

Select whether the trigger is to occur when the


edge is rising (positive) or decreasing (negative).

Level (V)

Threshold of trigger.

Micro Switch / ELVIS Ch0

Graph displays the triggered micro switch


output.

Push Button / ELVIS Ch1

Graph displays the triggered push button output.

Device

Selects the NI DAQ device.

Unit

Table 13: Nomenclature of QNET-MECHKIT Debounce VI.

Document Number 863 Revision 1.0 Page 38

QNET-MECHKIT Laboratory Student Manual

4. In-Lab Experiments
4.1. Strain Gage with Flexible Link
1. Ensure J7 is set to Strain Gage.
2. Open the QNET_MECHKIT_Flexgage.vi.
3. Ensure the correct Device is chosen, as shown in Figure 26.

Figure 26: Selecting correct device.

4.1.1. Collect Data


1. Run the QNET_MECHKIT_Flexgage.vi, as shown in Figure 27, below
2. Move the flexible link to -1 cm.
3. Enter the strain gage voltage reading in the Sensor Measurement (V) array (indicated in Figure
27).
4. 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.
5. Exercise 1: Enter the measured voltages in Table 14 and capture the Sensor Readings scope.
6. Click on Stop button to stop the VI.

Document Number 863 Revision 1.0 Page 39

QNET-MECHKIT Laboratory Student Manual

Figure 27: Collecting flexgage data.

4.1.2. Calibrate Sensor


1. Run the QNET_MECHKIT_Flexgage.vi.
2. Select the Calibrate Sensor tab and enter the slope and intercept obtained in Section 4.1.1 into
the Calibration Gain and Offset controls shown in Figure 28, 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. Exercise 2: Enter the gain and offset obtained in Table 14.
4. Click on Stop button to stop the VI.

Document Number 863 Revision 1.0 Page 40

QNET-MECHKIT Laboratory Student Manual

Figure 28: Calibrating the strain gage sensor.

4.1.3. Natural Frequency


1. Run the QNET_MECHKIT_Flexgage.vi.
2. Select the Natural Frequency tab.
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 29 (note, however,
that the value shown in incorrect).
4. Exercise 3: Enter natural frequency found and capture the resulting power spectrum response.
Hint: You can use the cursor to take measurements off the graph.

Document Number 863 Revision 1.0 Page 41

QNET-MECHKIT Laboratory Student Manual

Figure 29: Finding natural frequency of flexible link.

4.1.4. Exercises
Exercise 1: Collected Data
Parameter

Value

Units

Sensor Measurement: at -1.0 cm

Sensor Measurement: at -0.5 cm

Sensor Measurement: at 0 cm

Sensor Measurement: at 0.5 cm

Sensor Measurement: at 1.0 cm

Notes

Table 14: Collected strain gage data.

Document Number 863 Revision 1.0 Page 42

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Sensor Calibration


Parameter

Value

Units

Gain

cm/V

Offset

cm

Notes

Table 15: Stain gage calibration data.

Document Number 863 Revision 1.0 Page 43

QNET-MECHKIT Laboratory Student Manual

Exercise 3: Natural Frequency

4.2. Pressure Sensor


1. Ensure J9 is set to Pressure.
2. Run the QNET_MECHKIT_Pressure_Sensor.vi.
3. Important: Completely remove the plunger from the tube and re-insert it. This will ensure the
chamber is pressurized enough.

4.2.1. Collect Data


1. Push the plunger up to the 6 cm marked on the MECHKIT board and measure the resulting
voltage using the Pressure (V) scope (or the digital display).
2. Enter the result in the Sensor Measurement (V) array, as indicated in Figure 30.
3. Repeat for when the plunger is at 5.0 cm, 4.0 cm, 3.0 cm, 2.0 cm, 1.0 cm, and 0 cm. The
pressure sensor is quadratic. The coefficients for the second-order polynomial are generated and
the fitted curve is automatically plotted.
Document Number 863 Revision 1.0 Page 44

QNET-MECHKIT Laboratory Student Manual

4. Exercise 1: Enter collected results in Table 16 and capture the Sensor Readings scope.

Figure 30: Pressure sensor VI when collecting data.

4.2.2. Calibrate Sensor


1. Run the the QNET_MECHKIT_Pressure_Sensor.vi.
2. In the Calibrate Sensor tab, enter the polynomial coefficients, as illustrated in Figure 31, to
measure correct position of the plunger. Verify that the sensor is reading properly, e.g. display
should read 0.5 cm when plunger is placed at 0.5 cm.
3. Exercise 2: Enter the a, b, and c, parameters used in Table 17.

Document Number 863 Revision 1.0 Page 45

QNET-MECHKIT Laboratory Student Manual

Figure 31: Calibrating the pressure sensor.

4.2.3. Exercises
Exercise 1: Collect Data
Parameter

Value

Units

Sensor Measurement: 6.0 cm

Sensor Measurement: 5.0 cm

Sensor Measurement: 4.0 cm

Sensor Measurement: 3.0 cm

Sensor Measurement: 2.0 cm

Sensor Measurement: 1.0 cm

Sensor Measurement: 0.0 cm

Notes

Table 16: Data collected from the pressure sensor.

Document Number 863 Revision 1.0 Page 46

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Sensor Calibration


Parameter

Value

Units

Notes

cm/V2

cm/V

cm

Table 17: Pressure sensor parameters.

4.3. Piezo Sensor


1. Ensure J8 is set to Piezo.
2. Run the QNET_MECHKIT_Piezo.vi.

Document Number 863 Revision 1.0 Page 47

QNET-MECHKIT Laboratory Student Manual

4.3.1. Data Analysis


1. Manually perturb the plastic band that is attached to the piezo sensor by flicking it and examine
the response in the Piezo (V) scope.
2. Grab the end of the plastic band and move it slowly up and down. Examine the response.
3. Exercise 1: From 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).

4.3.2. Natural Frequency


1. Manually perturb the piezo sensor.
2. Once it stopped resonating, stop running the VI (after about 3 seconds). The spectrum should be
displayed in the Power Spectrum graph.
3. Exercise 2: Capture the resulting power spectrum response and give the measured natural
frequency.
Hint: You can use the cursor to take measurements off the graph.

4.3.3. Exercises
Exercise 1: Strain Gage versus Piezo

Document Number 863 Revision 1.0 Page 48

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Measured Natural Frequency

4.4. Potentiometer
1. Ensure J10 is set to POT.
2. Run the QNET_MECHKIT_Potentiometer VI.

4.4.1. Collect Data


1. Rotate the arrowhead of the potentiometer to a certain position, e.g. 45 degrees.
2. Enter the position in the Pot Angle (deg) array, as indicated in Figure 32.
3. Enter corresponding measured sensor voltage in Sensor Measurement (V) array (shown in
Figure 32).
4. Fill out table with 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.
5. Exercise 1: Enter the collected data in Table 18 and capture the Sensor Reading chart.

Document Number 863 Revision 1.0 Page 49

QNET-MECHKIT Laboratory Student Manual

Figure 32: Collecting potentiometer data.

4.4.2. Calibrate Sensor


1. Run the the QNET_MECHKIT_Potentiometer VI.
2. In the Calibrate Sensor tab, set the Gain and Offset controls, as indicated in Figure 33, 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 deg..
3. Exercise 2: Enter Gain and Offset values used in Table 19.

Document Number 863 Revision 1.0 Page 50

QNET-MECHKIT Laboratory Student Manual

Figure 33: Calibrating the potentiometer.

Document Number 863 Revision 1.0 Page 51

QNET-MECHKIT Laboratory Student Manual

4.4.3. Exercises
Exercise 1: Collected Data
Pot Angle (deg)

Sensor Measurement (V)

Table 18: Collected potentiometer data.

Document Number 863 Revision 1.0 Page 52

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Calibration Data


Parameter

Value

Units

Notes

Gain

deg/V

Offset

deg

Table 19: Gain and offset parameter of calibrated potentiometer.

4.5. Infrared
1. Ensure J10 is set to Infrared.
2. Run the QNET_MECHKIT_Infrared VI.
3. Turn ON the IR switch to enable the Infrared sensor. The IR ON LED should be lit bright red.
4. 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.

4.5.1. Collect Data


1. Get a target, such as a sturdy piece of cardboard, that is at least 10 by 10 cm2 with a reflective
colour like white or yellow.
2. Begin with the target close to the IR sensor and slowly move it away.
3. Once its range of operation is found, enter the distance between the target and the IR sensor in
the Target Range (cm) array, as shown in Figure 34.
4. Enter the corresponding measured voltage from the IR sensor in the Sensor Measurement (V)
array, as shown in Figure 34.
5. 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.
6. Exercise 1: Record your distance and voltage observations in Table 20 and capture the
corresponding Sensor Readings scope.
7. Exercise 2: 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 way?

Document Number 863 Revision 1.0 Page 53

QNET-MECHKIT Laboratory Student Manual

Figure 34: Collecting IR data.

4.5.2. Calibrate Sensor


1. Run the QNET_MECHKIT_Infrared VI.
2. In the Calibrate Sensor tab, enter the polynomial coefficients to correctly measure the distance
of the target. Make it is measuring correctly, e.g. when target is 25.0 cm away then display
should read 25.0 cm.
3. Exercise 3: Enter a, b, and c, parameters used in Table 21.

Document Number 863 Revision 1.0 Page 54

QNET-MECHKIT Laboratory Student Manual

Figure 35: Calibrating the IR sensor to get range measurement.

Document Number 863 Revision 1.0 Page 55

QNET-MECHKIT Laboratory Student Manual

4.5.3. Exercises
Exercise 1: Collect Data
Target Range (cm)

Sensor Measurement (V)

Table 20: Collected IR data.

Document Number 863 Revision 1.0 Page 56

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Infrared Sensor Range

Document Number 863 Revision 1.0 Page 57

QNET-MECHKIT Laboratory Student Manual

Exercise 3: Calibration Parameters


Parameter

Value

Units

cm/V

cm/V

cm

Notes
2

Table 21: IR sensor calibration parameters.

4.6. Sonar
1. Ensure J9 is set to Sonar.
2. Run the QNET_MECHKIT_Sonar VI.

4.6.1. Collect Data


1. Get a target, such as a sturdy piece of cardboard, that is at least 10 by 10 cm2 with a reflective
colour like white or yellow.
2. Begin with the target close to the sonar sensor and slowly move it upwards.
3. 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 36.
4. Enter the corresponding measured voltage from the sonar sensor in the Sensor Measurement (V)
array, as shown in Figure 36.
5. Repeat for different target positions. The sonar sensor is linear. The slope and intercept are
generated and the fitted curve is automatically plotted.
6. Exercise 1: Enter your collected target distances and voltages in the Table 22. Capture the
Sensor Readings scope as well.
7. Exercise 2: What is the resolution and operating range of the sonar sensor? Enter them in in
Table 23, below. How does the resolution and range compare with the IR sensor?

Document Number 863 Revision 1.0 Page 58

QNET-MECHKIT Laboratory Student Manual

Figure 36: Collecting sonar data.

4.6.2. Calibrate Sensor


1. Run the QNET_MECHKIT_Sonar VI.
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.
3. Exercise 3: Enter Gain and Offset values used in Table 23.

Document Number 863 Revision 1.0 Page 59

QNET-MECHKIT Laboratory Student Manual

4.6.3. Exercises
Exercise 1: Collected Data
Target Range (cm) Sensor Measurement (V)

Table 22: Collected sonar sensor measurements.

Document Number 863 Revision 1.0 Page 60

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Range and Resolution

Document Number 863 Revision 1.0 Page 61

QNET-MECHKIT Laboratory Student Manual

Parameter

Value

Units

Range

in

Resolution

in

Notes

Table 23: Range and resolution of sonar sensor.

Exercise 3: Calibration Parameters


Parameter

Value

Units

Gain

in/V

Offset

in

Notes

Table 24: Calibration parameters of sonar sensor.

4.7. Optical Position


1. Ensure J7 is set to Optical Position.
2. Run the QNET_MECHKIT_Optical VI.

4.7.1. Collect Data


1. 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 cm position. Enter the 0 position in the first element of the Target Range (cm)
array, shown in Figure 37.
2. Enter the voltage measured by the optical position sensor, when the target is 0 cm away, in the
Sensor Measurement (V) array, as indicated in Figure 37.
3. 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 (cm) array, which is shown in Figure 37.
4. Record the measured sensor voltage in the Sensor Measurement (V) array.
5. 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.
6. Exercise 1: Enter the measured sensor data in Table 25 and capture the Sensor Readings
response.

Document Number 863 Revision 1.0 Page 62

QNET-MECHKIT Laboratory Student Manual

Figure 37: Collecting data for optical position sensor.

4.7.2. Calibrate Sensor


1. Run the QNET_MECHKIT_Optical VI.
2. In the Calibrate Sensor tab, enter values for the Gain and Damping exponential function
parameters, as shown in Figure 38, to correctly measure the distance of the target, e.g. when
target is 0.10-inch away then display should read 0.10-inch.
3. Exercise 2: Enter the Gain and Damping parameters used in Table 26.

Document Number 863 Revision 1.0 Page 63

QNET-MECHKIT Laboratory Student Manual

Figure 38: Calibrating the optical position sensor.

Document Number 863 Revision 1.0 Page 64

QNET-MECHKIT Laboratory Student Manual

4.7.3. Exercises
Exercise 1: Collected Data
Target Range (in) Sensor Measurement (V)

Table 25: Collected measurements from optical sensor.

Document Number 863 Revision 1.0 Page 65

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Calibration Data


Parameter

Value

Gain

Units

Notes

in

Damping
Table 26: Exponential terms of optical position sensor.

4.8. Magnetic Field


1. Ensure J8 is set to Magnetic Field.
2. Run the QNET_MECHKIT_Magnetic_Field VI.

4.8.1. Collect Data


1. 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
cm target position. Enter this in the Target Range (cm) array, shown in Figure 39.
2. Enter the voltage measured from the magnetic field position sensor for the reference 0 cm
position in the Sensor Measurement (V) array. The array is indicated in Figure 39.
3. 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
Document Number 863 Revision 1.0 Page 66

QNET-MECHKIT Laboratory Student Manual

reference in the Target Range (cm) array.


4. Record the measured sensor voltage in the Sensor Measurement (V) array.
5. 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.
6. Exercise 1: Enter the range and measured sensor voltage in Table 27, below, and capture the
Sensor Readings scope.

Figure 39: Collecting data for magnetic field sensor.

4.8.2. Calibrate Sensor


1. Run the QNET_MECHKIT_Magnetic_Field VI.
2. Enter Gain and Damping exponential function parameters to correctly measure the distance of
the target. For instance, when target is at 0.10-inch from the reference then the display should
read 0.10-inch.
3. Exercise 2: Record Gain and Damping parameters used for correct measurement in Table 28.

Document Number 863 Revision 1.0 Page 67

QNET-MECHKIT Laboratory Student Manual

Figure 40: Magnetic field sensor calibration.

Document Number 863 Revision 1.0 Page 68

QNET-MECHKIT Laboratory Student Manual

4.8.3. Results
Exercise 1: Collected Data
Target Range (in) Sensor Measurement (V)

Table 27: Magnetic field sensor measurements.

Document Number 863 Revision 1.0 Page 69

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Calibration Data


Parameter

Value

Gain

Units

Notes

in/V

Damping
Table 28: Magnetic field calibration parameters.

4.9. Encoder
1. Ensure jumpers J7 is set to Enc A, J8 to Enc B, and J10 to Enc I.
2. Run the QNET_MECHKIT_Encoder VI.

4.9.1. Analysis of A, B, and I Signals


1. Exercise 1: 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. Enter your observation in Table
29. Similarly, turn the encoder knob counter-clockwise and enter your observation.
2. Exercise 2: When is the index pulse triggered? What can this be used for?
Document Number 863 Revision 1.0 Page 70

QNET-MECHKIT Laboratory Student Manual

4.9.2. Encoder Calibration


1. Using the 16-bit Position (counts) indicator on the VI, as shown in Figure 41, 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.
2. Turn the knob such that the 0 is in the upward position and reset the counter by clicking on the
Reset button.
3. Enable the index by clicking on the Enable Index button.
4. 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?
5. 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.
6. Exercise 3: Enter the Count per rev and the Reload Value values used for a calibrated
measurement in Table 30.
7. Exercise 4: 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.

Document Number 863 Revision 1.0 Page 71

QNET-MECHKIT Laboratory Student Manual

Figure 41: Running the encoder VI.

4.9.3. Exercises
Exercise 1: Synchronization of Encoder A and B Signals
Encoder Knob Rotation

A or B Signal Leads?

Clockwise
Counter-clockwise
Table 29: A and B signals and encoder rotation.

Document Number 863 Revision 1.0 Page 72

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Index Pulse

Exercise 3: Encoder Specifications


Parameter

Value

Units

Notes

Counts per rev

counts/rev

Reload Value

counts

Table 30: Encoder calibration.

Exercise 4: Encoder Reset

4.10. Temperature Sensor


1. Ensure J9 is set to Temperature.
2. Run the QNET_MECHKIT_Temperature VI.

4.10.1. Collect Data


1. As discussed in Reference [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.
2. Adjust the Offset knob such that the Temperature Sensor (V) scope reads 0 V. This is the
Document Number 863 Revision 1.0 Page 73

QNET-MECHKIT Laboratory Student Manual

voltage measured at room temperature, T0 = 298 K.


Note: For this step, assume your room is at 25.0 degrees Celsius (deg C) even though it's
probably warmer or cooler.
3. Exercise 1: 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 deg C. Enter the voltage read at room temperature and with the fingertip in Table 31.
Hint 1: The thermistor is very sensitive. Do not press down too hard on the sensor with your
finger when taking measurements. Otherwise, the measurement will not be consistent.
Hint 2: After releasing the sensor it takes a a while for the temperature reading to settle back
to 0 V. You can bring the temperature down faster by gently blowing on the sensor.

Figure 42: Collecting data for temperature sensor.

4.10.2. Calibrate Sensor


1. Exercise 2: The voltage being measured on the QNET MECHKIT is the output voltage, vo, of
the circuit discussed in Reference [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.
Document Number 863 Revision 1.0 Page 74

QNET-MECHKIT Laboratory Student Manual

2. Exercise 3: Find the thermistor resistance at room temperature, R0, and at the fingertip, R. Enter
your results in Table 32.
3. Exercise 4: Derive the equation to find the exponential parameter, B, and compute it based on
the obtained results.
4. Run the QNET_MECHKIT_Temperature VI.
5. Exercise 5: Enter the B parameter that was found in Exercise 4 in the Temperature Sensor VI,
as shown in Figure 43. Place your fingertip on the sensor and capture the obtained response in
Temperature Sensor (deg C) scope.

Figure 43: Temperature sensor calibration.

Document Number 863 Revision 1.0 Page 75

QNET-MECHKIT Laboratory Student Manual

4.10.3. Exercises
Exercise 1: Measured Voltage
Temperature (deg
C)

Temperature
(K)

Measured Voltage Units


(V)

Notes

25

298

Voltage at room temp, T0

32

305

Voltage with finger, T

Table 31: Measured thermistor readings.

Exercise 2: Thermistor Resistance Equation

Exercise 3: Measured Thermistor Resistance


Temperature Temperature
(deg C)
(K)

Measured Resistance Units


( )

Notes

25

298

Resistance at room temp, R0

32

305

Resistance with finger, R

Table 32: Measured thermistor resistances.


Document Number 863 Revision 1.0 Page 76

QNET-MECHKIT Laboratory Student Manual

Exercise 4: Find Exponential Parameter

Document Number 863 Revision 1.0 Page 77

QNET-MECHKIT Laboratory Student Manual

Exercise 5: Calibrated Temperature Sensor Reading

4.11. Switches and LEDs


1. Ensure jumper J7 is set to Opto Switch, J8 to Micro Switch, and J9 to Push Button.
2. Run the QNET_MECHKIT_Switches_and_LEDs VI.

4.11.1. Optical Switch


1. Select the Opto Switch tab.
2. Take piece of paper and slide it up and down into the optical switch. Examine the raw responses
in the Optical Switch scope.
3. Adjust threshold, indicated in Figure 44, to obtain an on/off or 0/1 digital measurement in the
Optical Switch - Digital scope.
4. Exercise 1: Record threshold used to get on/off measurement and paste the response of the
Optical Switch and Optical Switch Digital scopes.

Document Number 863 Revision 1.0 Page 78

QNET-MECHKIT Laboratory Student Manual

Figure 44: Optical switch VI.

4.11.2. Micro Switch


1. Select the Micro Switch tab.
2. Press on the Micro Switch and examine its raw response in Micro Switch scope.
3. Adjust the Gain and Offset, shown in Figure 45, such that this the signal goes from 0 to 1 in the
Micro Switch Digital scope when the Micro Switch is pressed.
4. Exercise 2: Record the Gain and Offset used in Table 33 and capture representative Micro
Switch and Micro Switch Digital responses.

Document Number 863 Revision 1.0 Page 79

QNET-MECHKIT Laboratory Student Manual

Figure 45: Calibrating micro switch.

4.11.3. Push Button


1. Select the Push Button tab.
2. Press on the Push Button and examine its raw response in the Push Button scope.
3. Adjust the Gain and Offset, indicated in Figure 46, such that this signal goes from 0 to 1 in the
Push Button Digital scope when the Push Button is pressed.
4. Exercise 3: Record the Gain and Offset parameters used in Table 34 and capture representative
Push Button and Push Button Digital responses.
5. Exercise 4: Explain how the Micro Switch and Push Button behave differently.

Document Number 863 Revision 1.0 Page 80

QNET-MECHKIT Laboratory Student Manual

Figure 46: Calibrating the push button.

4.11.4. LEDs
1. Select the Digital Outputs tab.
2. As shown in Figure 47, switch DO 1 and DO 0 between the up/down positions and examine its
effect on the on-board LEDs.
3. Exercise 5: In Table 35, 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.

Document Number 863 Revision 1.0 Page 81

QNET-MECHKIT Laboratory Student Manual

Figure 47: Setting the digital outputs.

Document Number 863 Revision 1.0 Page 82

QNET-MECHKIT Laboratory Student Manual

4.11.5. Exercises
Exercise 1: Optical Switch

Document Number 863 Revision 1.0 Page 83

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Micro Switch


Parameter

Value

Units

Notes

Gain
Offset
Table 33: Micro switch digitization parameters.

Document Number 863 Revision 1.0 Page 84

QNET-MECHKIT Laboratory Student Manual

Exercise 3: Push Button


Parameter

Value

Units

Notes

Gain
Offset
Table 34: Push button digitization parameters.

Document Number 863 Revision 1.0 Page 85

QNET-MECHKIT Laboratory Student Manual

Exercise 4: Micro Switch and Push Button Comparison

Exercise 5: Digital Output Switches


Parameter

Value

Units

Notes

DO 1 Switch position for DO 1


LED to be on
DO 0 Switch position for DO 0
LED to be on
Table 35: Digital output switches.

4.12. Switch Debounce Analysis


Note that this section is for the ELVIS II only. The ELVIS I does not have the functionality to perform
this experiment.
1. Ensure jumper J8 is set to Micro Switch and J9 to Push Button.
2. Run the Oscilloscope NI ELVISmx instrument. By default, this is located under Start \ All
Programs \ National Instruments \ NI ELVISmx \ Instruments.

4.12.1. Running the Oscilloscope


1. Click on the green start arrow to run the Oscilloscope.
2. 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 48.
3. 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.
4. To examine the behaviour of the micro switch when it is engaged, configure the Trigger section
to stop.
Document Number 863 Revision 1.0 Page 86

QNET-MECHKIT Laboratory Student Manual

Hint: If preferred, you can change the Acquisition Mode to Run Once so the oscilloscope
stops when the trigger is engaged.
5. 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.
6. Try to setup the oscilloscope for the Push Button. This is on analog input channel #2 and you
can choose to configure it on the Channel 1 of the oscilloscope (if you do, make sure you enable
the channel).
Hint: To increase the sampling rate and obtain a more closeup view of the signal, decrease
the Time/Div knob control.
7. 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 VI. Otherwise the VI will not be able to run.

Figure 48: NI ELVISmx Oscilloscope instrument when pressing micro switch.

4.12.2. Micro Switch


1. The QNET_MECHKIT_Debounce VI, which is shown in Figure 49, has the same functionality
Document Number 863 Revision 1.0 Page 87

QNET-MECHKIT Laboratory Student Manual

2.
3.
4.
5.

as the Oscilloscope tool used in Section 4.12.1. It is already setup with a trigger and does not
run continuously as the oscilloscope instrument does.
Run the QNET_MECHKIT_Debounce VI.
Exercise 1: Setup the Trigger for the Micro Switch (ELVIS CH #0) and enter settings in Table
36.
Press on the micro switch. The VI should stop and a response displayed on both graphs.
Exercise 2: Capture the Micro Switch scope. What do you notice about the output signal from
the micro switch?

Figure 49: VI used to analyze debounce of micro switch and push button.

4.12.3. Push Button


1. Run the QNET_MECHKIT_Debounce VI, depicted in Figure 49.
2. Exercise 3: Setup the Trigger for the Push Button (ELVIS CH #1) and enter the settings in
Table 37.
3. Press on the push button. The VI should stop and a response displayed on both graphs.
4. Exercise 4: Capture the Push Button scope. What do you notice about the push button signal?
5. Exercise 5: Which control would require debounce more micro switch or push button?
Document Number 863 Revision 1.0 Page 88

QNET-MECHKIT Laboratory Student Manual

Explain.
6. Exercise 6: 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.

4.12.4. Exercises
Exercise 1: Trigger Parameters for Micro Switch
Trigger Parameters

Value

Units

Notes

Type
Slope
Source
Level

Table 36: Trigger parameter for micro switch.

Document Number 863 Revision 1.0 Page 89

QNET-MECHKIT Laboratory Student Manual

Exercise 2: Micro Switch Behaviour

Exercise 3: Trigger Parameters for Push Button


Trigger Parameters

Value

Units

Notes

Type
Slope
Source
Level

Table 37: Trigger parameters for push button.

Document Number 863 Revision 1.0 Page 90

QNET-MECHKIT Laboratory Student Manual

Exercise 4: Push Button Behaviour

Exercise 5: Push Button and Micro Switch Comparison

Document Number 863 Revision 1.0 Page 91

QNET-MECHKIT Laboratory Student Manual

Exercise 6: Switch Analog Input Signal Analysis

Document Number 863 Revision 1.0 Page 92

QNET-MECHKIT Laboratory Student Manual

5. References
[1] QNET Practical Control Guide
[2] QNET User Guide

Document Number 863 Revision 1.0 Page 93

Оценить