Professional Documents
Culture Documents
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.
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.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.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
5. REFERENCES...........................................................................................................................................93
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.
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
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].
Description
QNET_MECHKIT_Flexgage
QNET_MECHKIT_Pressure Sensor
QNET_MECHKIT_Piezo
QNET_MECHKIT_Potentiometer
QNET_MECHKIT_Infrared
QNET_MECHKIT_Sonar
QNET_MECHKIT_Optical
QNET_MECHKIT_Magnetic_Field
QNET_MECHKIT_Encoder
QNET_MECHKIT_Temperature
QNET_MECHKIT_Switches_and_LEDs
QNET_MECHKIT_Switch_Debounce
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.
ID #
Label
Description
Unit
Flexgage (V)
Sensor Readings
slope
cm/V
intercept
cm
Gain (cm/V)
cm/V
Offset (cm)
cm
10
11
Power Spectrum
12
Cursor
13
Device
14
Sampling Rate
15
Stop
Hz
ID #
Label
Description
Unit
Sensor Readings
cm
cm/V
cm/V
10
cm
11
12
Pressure (cm)
13
Device
14
Sampling Rate
15
Stop
Hz
ID #
Label
Description
Unit
Piezo (V)
Power Spectrum
Cursor
Device
Sampling Rate
Stop
Hz
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.
ID #
Label
Description
Unit
Potentiometer (V)
Sensor Readings
slope
deg/V
intercept
deg
Gain (deg/V)
deg/V
Offset (deg)
deg
10
11
Device
12
Sampling Rate
13
Stop
deg
Hz
ID #
Label
Description
Unit
Sensor Readings
cm
cm/V
cm/V
10
cm
11
IR Sensor (cm)
12
IR (cm)
13
Device
14
Sampling Rate
15
Stop
cm
Hz
ID #
Label
Description
Unit
Sonar (V)
in
Sensor Readings
slope
in/V
intercept
in
Gain (in/V)
in/V
Offset (in)
in
10
11
Device
12
Sampling Rate
13
Stop
Hz
ID #
Label
Description
Unit
in
Sensor Readings
Amplitude
Damping
10
Display: Optical Position (in) Slider indicator displays position of target based in
on entered Amplitude and Damping parameters.
11
Device
12
Sampling Rate
13
Stop
parameter
Hz
ID #
Label
Description
Unit
in
Sensor Readings
Amplitude
Damping
10
11
Device
12
Sampling Rate
13
Stop
parameter
Hz
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.
ID #
Label
Description
Unit
Reset
Enable Index
counts
count/rev
counts
Angle (deg)
Device
10
Sampling Rate
11
Stop
Hz
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.
ID #
Label
Description
Unit
R0
T0
Temperature (deg C)
Device
Sampling Rate
Stop
Hz
Figure 21: QNET-MECHKIT Switches and LEDs VI: "Opto Switch" tab selected.
Figure 22: QNET-MECHKIT Switches and LEDs VI: "Micro Switch" tab selected.
Figure 23: QNET-MECHKIT Switches and LEDs VI: "Push Button" tab selected.
Figure 24: QNET-MECHKIT Switches and LEDs VI: "Digital Outputs" tab selected.
ID #
Label
Description
Unit
Optical Switch
Threshold
Micro Switch
Gain
Offset
Push Button
10
Gain
11
Offset
12
DO 1
13
DO 0
14
Device
15
Sampling Rate
16
Stop
Hz
ID #
Label
Description
Type
Source
Slope
Level (V)
Threshold of trigger.
Device
Unit
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.
4.1.4. Exercises
Exercise 1: Collected Data
Parameter
Value
Units
Sensor Measurement: at 0 cm
Notes
Value
Units
Gain
cm/V
Offset
cm
Notes
4. Exercise 1: Enter collected results in Table 16 and capture the Sensor Readings scope.
4.2.3. Exercises
Exercise 1: Collect Data
Parameter
Value
Units
Notes
Value
Units
Notes
cm/V2
cm/V
cm
4.3.3. Exercises
Exercise 1: Strain Gage versus Piezo
4.4. Potentiometer
1. Ensure J10 is set to POT.
2. Run the QNET_MECHKIT_Potentiometer VI.
4.4.3. Exercises
Exercise 1: Collected Data
Pot Angle (deg)
Value
Units
Notes
Gain
deg/V
Offset
deg
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.3. Exercises
Exercise 1: Collect Data
Target Range (cm)
Value
Units
cm/V
cm/V
cm
Notes
2
4.6. Sonar
1. Ensure J9 is set to Sonar.
2. Run the QNET_MECHKIT_Sonar VI.
4.6.3. Exercises
Exercise 1: Collected Data
Target Range (cm) Sensor Measurement (V)
Parameter
Value
Units
Range
in
Resolution
in
Notes
Value
Units
Gain
in/V
Offset
in
Notes
4.7.3. Exercises
Exercise 1: Collected Data
Target Range (in) Sensor Measurement (V)
Value
Gain
Units
Notes
in
Damping
Table 26: Exponential terms of optical position sensor.
4.8.3. Results
Exercise 1: Collected Data
Target Range (in) Sensor Measurement (V)
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.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.
Value
Units
Notes
counts/rev
Reload Value
counts
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.
4.10.3. Exercises
Exercise 1: Measured Voltage
Temperature (deg
C)
Temperature
(K)
Notes
25
298
32
305
Notes
25
298
32
305
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.
4.11.5. Exercises
Exercise 1: Optical Switch
Value
Units
Notes
Gain
Offset
Table 33: Micro switch digitization parameters.
Value
Units
Notes
Gain
Offset
Table 34: Push button digitization parameters.
Value
Units
Notes
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.
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.
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
Value
Units
Notes
Type
Slope
Source
Level
5. References
[1] QNET Practical Control Guide
[2] QNET User Guide