Anda di halaman 1dari 83

FACULTY OF ENGINEERING AND APPLIED SCIENCE

ENGR1015U INTRODUCTION TO ENGINEERING


LABORATORY MANUAL

PREPARED BY:
CLIFF CHAN P.ENG, HIDAYAT SHAHID P.ENG
REVISED BY: MASOUD FARZAM AND LEON WU FALL 2016

I. INTRODUCTION
The laboratory manual has been written to help you to understand the operation of laboratory exercises
and what is expected from you as a student. You should read and comprehend this manual completely.
Laboratory sessions are designed to support and supplement engineering topics introduced in the course
and also to expose you to relevant engineering applications. You are expected to work in small groups in
order to get maximum benefit from performing the hands-on exercises. A total of 5 hands-on exercises
must be completed during the semester. In addition, you will learn and get familiar with FEAS Health and
Safety Policies, which are strictly enforced in all labs.
The hands-on exercises consist of dissection of engineered products and introduction to basic engineering
instrumentation. The lab exercises will help you to develop awareness of the design process for
engineering products. The lab exercises will also develop a foundation of basic engineering knowledge
and develop skills that will include but are not limited to:

Identification of overall function of various engineering products


Identification of various components, sub-systems and basic mechanisms
Learning and analysis of how the components are assembled and work with each other to fulfill
functional requirements of the product
Preparation of basic record keeping for analysis e.g. hand sketches of components, bill of
materials and relevant notes in your logbook
Ability to communicate your ideas and technical content in small groups as well as to class
Development of appreciation of multi-disciplinary engineered products
Introduction to basic engineering instrumentation

In a laboratory setting, it is essential to keep track of what you have done; how you have done it, what
problems occurred, what went well and what went wrong. For this reason you are expected to prepare a
lab logbook. The logbook should be prepared in such a way that somebody else could make sense of it.
When writing a report or quiz on your work later, this lab book will be your main source of information.
It is therefore important to keep a complete record of your work in it. For example, you might not be able
to go back to the equipment later to re-sketch a component you may have forgotten to properly document
during your lab exercise. You should not expect your TA or Laboratory Coordinator to provide the
missing sketches. You should never use your friends logbook unless you have permission from the
Laboratory Coordinator or TA. Please note that Lab Coordinator will sign on your logbooks to ensure that
you are keeping proper records.
Ideally, the lab book is hardbound so that it survives the rough environment of the lab as well as frequent
use afterwards. If you use a collection of loose sheets, you are most likely going to lose the most
important page, or the pages get mixed up and you won't be able to put them back into order. Trying to
keep 'rough' notes on loose sheets of paper and transferring them into a 'neat' lab book afterwards, is a
waste of time and bad practice. Things to note in the lab book are:

The date and the title of the experiment and your objective.
A schematic sketch or drawing of the product used
List and sketches of components
Identification of each component including sensors
A record of what you are doing?
1

If working in groups, a list of your group members including their contact information.
Careful account of your Instructor or TAs presentation or lecture including a short description of
the product and analysis procedure.
Log of problems encountered, and notes
Short appraisal (conclusion/summary) of the lab exercise

II. Laboratory Attendance


Attendance is mandatory and students are expected to attend all scheduled lab session in the assigned
section. Shuttling among sections is not allowed. You will be randomly divided into groups during the
first lab session and will be required to work within the same group.

III: Requirement for Personal Protective Equipment (PPE)


It is a mandatory requirement for students to bring their own safety goggles to conduct activities in the
laboratory. It is the individual students responsibility to ensure his/her own safety goggles are clean and
in good condition. To avoid hygiene issue, please do not share your own safety goggles with anyone. If
you wear glasses, please choose a pair of safety goggles that have enough room for you to fit your safety
goggles on. Our bookstore:
(http://www.uoit.ca/faculty_staff/campus_services/facilities/campus_services/campusbookstore.php) provide two types of safety goggles for you to choose from. Feel free to get the ones that
fit you the most. We also recommend you to have a pair of work gloves handy in case you have to deal
with sharp objects whenever applicable.

Basic Safety and Tidiness Guidelines in the Laboratory:

It is extremely important that all lab work is done in a safe manner.


You must get familiar with the lab before doing any work.
You should know where exits are located.
You should also know the location of the nearest phone in the lab to call for help.
There is no food or drink allowed in the laboratory.
Working with electrical or mechanical components and tools can be dangerous if you
dont take certain safety precautions.
Electrical shock can not only injure you but also kill you!
Never dissect or open an engineering product until the power cord or battery is fully
removed.
Keep the work area clean and ensure there are no cluttered areas
Do not operate power tools after opening the cases. Power tools can create sparks which
may ignite the dust or fumes.
Stay focused during the lab session and carefully pay attention to what you are doing and
practice common sense when handling tools
2

There is zero tolerance for horseplay during lab sessions


Should you have any questions or concerns, immediately contact your lab supervisor
You must dress properly i.e. not wear loose clothing or jewelry such as rings necklace,
and any other loose metallic objects.
Keep your hair, clothing and gloves away from moving parts

Lab Exercise 1: Introduction to NI LabVIEW Programming

Objective
Familiarize the programming environment of NI LabVIEW via constructing a simulation model
and a hardware-in-the-loop prototype with block diagrams and graphical user interface (GUI)

Background
National Instruments LabVIEW is a graphical programming and modeling IDE (Integrated
Development Environment) which allows scientists and engineers to perform system design and
modeling, data acquisition, systems control and monitoring, and systems testing and validation,
etc.
Unlike traditional programming environment where applications are created with a bunch of
command lines in a source code (Fig. 1), LabVIEW uses a programming method called Visual
Programming, which allows users to create applications by moving functions (either predefined
by National Instruments or user-defined functions), building blocks, or code nodes to create
flowcharts or structure diagrams (Fig. 2) that are then compiled and run.
LabVIEW contains a wide variety of toolkits to aid users in building their own models. Each one
of these toolkits has its own unique features or functions such as, programming structure,
instrumentation, signal processing analysis, data communication, controller design, vision and
motion control, etc., depending on the type of toolkits installed in the LabVIEW environment.
Some of these toolkits come as standard features while some others are offered as add-on
packages (you have to pay extra for them!).
The main model file created in LabVIEW is called Virtual Instrument file (file name ends with
.vi extension). A virtual instrument file contains two main bodies: Front Panel (Fig. 3) and Block
Diagram (Fig. 4). Front Panel is where you build your control interface in a graphical format
called GUI (Graphical User Interface) such as, buttons, dials, numeric or character inputs,
numeric or graphical indicators, charts and graphs, etc. Block Diagram is where you specify all
the functions that you want to govern your model such as, programming structures, I/O types,
math functions, control logics, and signal analysis methodologies, etc.
Upon completion of the virtual instrument file, the user can run the file to see if it contains any
errors. If the file is compiled successfully, the results will be displayed on the Front Panel (Fig.
5).

Fig. 1 Source code in C++

Fig. 2 Visual programming of LabVIEW


5

Fig. 3 Front Panel of a virtual instrument file

Fig. 4 Block Diagram of a virtual instrument file


6

Fig. 5 Output shown on Front Panel

Apparatus

Laptop or desktop computer


NI USB-6210 DAQ (Data Acquisition) module
(http://sine.ni.com/nips/cds/view/p/lang/en/nid/203223) (Fig. 6)
10-k potentiometer (Fig. 7)
A jumper wire

Fig. 6 NI USB-6210 DAQ module


7

Fig. 7 10-k Potentiometer

Procedure
Task 1: Create a virtual Function Generator (NI USB-6210 DAQ module is not
required for Task 1)
(Duration: 20 min)

What is a Function Generator?

Function Generator is usually a piece of electronic test equipment or software


used to generate different types of electrical waveforms over a wide range of
frequencies and amplitudes.

1. Go to Windows Start menu bar and click on LabVIEW (32 bit) under All Programs |
National Instruments | LabVIEW 2011 (32 bit) to launch LabVIEW
2. Click on Blank VI (under NEW) from the Getting Started pop-up window
3. Two windows named Untitled 1 Front Panel and Untitled 1 Block Diagram are now
created for you
4. Go to either one of the windows and save it as Lab1a (make sure you keep the default
file type as VIs (*.vi))

5. In most cases when we create an application, we normally work with the Front Panel
first. As mentioned before, Front Panel is where you build your graphical user interface
(GUI).
6. As a general rule of thumb, you should specify the number and types of inputs and
outputs and identify functionalities of your model. In our case here, we have:
Input
Controls
Amplitude [V]
Frequency [Hz]

Input
Signal
Simulated
Voltage
Signal

Output

Waveform Waveform
in Chart
in Graph

Functions
1) Change amplitude of
input signal
2) Change frequency of
input signal

7. Go to Lab1a.vi Front Panel window and right click on your touch pad, a Controls
Palette will appear (Alternatively, you can also select Controls Palette from the top
toolbar under View). Controls Palette contains all sorts of control tools for you to design
and build your GUI on the Front Panel
8. On the Controls Palette, go to Express | Graph Indicators and click on Chart (Fig. 8)

Fig. 8 Working with the Controls Palette

9. Drag and drop the Chart onto the Front Panel open space. Repeat the same procedure for
Graph
10. On the Controls Palette, drag and drop the Knob and the Dial from Express | Num Ctrls
onto the Front Panel open space. Double click on the label of the Knob and rename it as
Amplitude [V]. Do the same for the Dial and rename it as Frequency [Hz]
11. Place the cursor on the Waveform Chart and right click on your mouse or touch pad,
select Properties. A Chart Properties window will pop up.
12. Type Voltage Signal in the Label box as shown in Fig. 9

Fig. 9 Chart Properties window

10

13. Now try to disable the label of the Waveform Graph, what would you do?
14. Now your Front Panel should look like Fig. 10. Minimize the Front Panel and go to
Lab1a.vi Block Diagram, you should also see that the corresponding blocks of the
control tools can be found on the Block Diagram as shown in Fig. 11

Fig. 10

Input controls and outputs on Lab1a.vi Front Panel

11

Fig. 11

Input controls and outputs on Lab1b.vi Block Diagram

15. You have just created the input controls and outputs on both windows, but you have not
specified the input signal and the functions you want your model to perform. So now you
have to drag and drop these items you have defined (refer to the table in Procedure #6)
onto the Block Diagram. The type of input signal we want here is called Simulate
Signal. The Simulate Signal block can be found when you right click the touchpad on
the Block Diagram and look into Express | Input. This particular function created by NI
already has the functionalities to change both the amplitude and frequency of the input
signal, so no more function blocks are required for our application here in this regard.
After you have inserted the Simulate Signal block onto the Block Diagram, your Block
Diagram should look like this (Fig. 12).

12

Fig. 12

Adding Simulate Signal block onto the Block Diagram

16. Double click on the Simulate Signal block, a Configure Simulate Signal window will
be opened (Fig. 13). This is where you configure your input signal settings such as, signal
type (e.g. sine, square, triangle, sawtooth, DC), amplitude, frequency, offset, phase as
well as the sampling rate, etc.

Why do we need to create the knob and dial on the Front Panel if every setting can
be configured at the Configure Simulate Signal window?

13

True. In fact, not all settings or parameters can be configured outside of the
Configure Simulate Signal. For example, sampling rate is one of the settings that
cannot be configured elsewhere. However, using input controls on the Front Panel
offers a few advantages: 1) allows change-on-the-fly configurations; 2) better
visual aid and more user-friendly; and 3) allows settings to be overridden even the
values were pre-set initially at the Configure Simulate Signal window

Fig. 13

Configure Simulate Signal window

17. Now you have all the function blocks you need. It is time to wire them together and
complete the application. To so do, go to the Block Diagram and place the cursor on the
terminal of the (source) block that you want it to be connected to, the cursor will turn to a
roll of thread symbol. Click on the terminal and drag the roll of thread cursor towards
the terminal of another (destination) block that you want the source block to be connected
to. Then, click on the destination terminal. Now the two blocks should be connected by a
single wire. Repeat the same procedure for all other blocks on the Block Diagram. Make
sure you wire the correct terminals together. For example, terminal from the Amplitude
block should be connected to the Amplitude terminal of the Simulate Signal block (Fig.
14

14). Remember, each wire represents a single data source and your application may not
run successfully if there are broken wires on the Block Diagram

Fig. 14

Wiring of block terminals

18. Wire all the blocks together on your Block Diagram according to Fig. 15.

15

Fig. 15

Block Diagram with complete wirings

19. Now you can place the cursor on the white arrow (Run) button and start the simulation.
What did you observe?

Is there anything wrong with the model?

No, everything is fine except you ask your simulation to execute only once. That
is the reason why it stops right after you release the Run button. For continuous
running application in LabVIEW, you have to encapsulate all the blocks (blocks
you want to run continuously) inside an Execution Control called While Loop.
While Loop allows blocks to run infinite times until a stop criterion is reached or
the user halts the application to a stop via pressing the Stop button on the toolbar.

20. To allow continuous execution, right-click on the Block Diagram and bring up the
Functions Palette. Select While Loop under Express | Execution Control and insert it
16

to the Block Diagram. When you add the While Loop to the Block Diagram, you have to
drag it over all the blocks to be encapsulated in the loop. When all is done, your Block
Diagram should look like this (Fig. 16)

Fig. 16

Block Diagram with While Loop

21. Now run the simulation again and see what happen. What did you observe? Are the
results easy to read?

Again, is there anything wrong with the model?


17

No, it is doing what you have asked for. However, the waveforms appear on the
chart and the graph are difficult to read because they are updated too quickly on
the plot. You may notice in the Configure Simulate Signal window in Fig. 13,
there are two radio buttons under Timing which allow the user to select either to
run the simulation with the Simulate acquisition timing or to Run (it) as fast as
possible. The former allows the application to run in synchronize (as much as
possible) with real time and the latter runs the application as fast as the internal
CPU clock permits. So to slow down the plotting rate on the chart/graph such that
the user can see the change of waveforms easily, one can simply select Simulate
acquisition timing. Simulate acquisition timing allows an application to work in
real time. This is especially useful because the user can get a feel of the true time
response of the system.

Is there any other way that you can slow down the chart/graph update? How about
changing the Samples per second (Hz) and Number of samples at the Configure
Simulate Signal window?

Well, before we answer this question, we should know what these settings mean.
Samples per second (Hz) defines how often a signal is sampled or generated
either by the hardware (e.g. DAQ module) or the computer (e.g. if it is a pure
simulation). Number of samples defines how often a signal is updated or plotted
on the display within one sampling cycle time. For example, if we define the
Samples per second (Hz) as 1 kHz (1000 Samples per second) and Number of
samples as 100, it simply implies that we will acquire or generate signal once
every 0.001 second and within this 0.001 second, 100 points will be plotted on the
display. In LabVIEW, there is a default (when the Automatic box is checked)
Sample per second to Number of samples ratio of 10:1 to ensure data points are
plotted smoothly on the chart/graph. So come back to the question, theoretically
speaking, you can just reduce the values of both settings in order to slow down the
updating rate of the display. However, since the CPU clock runs thousands of
times faster than the minimum time it takes for the naked eyes to catch a moving
dot, you will have a hard time reading the chart/graph even if you input the lowest
values to both settings. Therefore, choosing Simulate acquisition timing will be
a better option in this case.

22. Now make the changes and run the simulation again. What did you see this time?

18

23. Turn the Amplitude knob and frequency dial and see what happen to the chart and the
graph. Do you see any difference between the knob and the dial? What is the major
difference between a chart and a graph?

Task 2: Create a virtual Thermostat (NI USB-6210 DAQ module is not required for
Task 2)
(Duration: 20 min)

What is a Thermostat?

Thermostat is a temperature control system which monitors temperature via the


use of temperature sensor and controls the temperature of a control environment
via heating or cooling such that the temperature always stays the same as the (user
predefined) temperature set point.

1. Open Lab1a.vi and save it as Lab1b.vi


2. Go to the Front Panel, rename the label of the Knob to Temperature [degC] and rename
the label of the Dial to Temperature Setpoint [degC]
3. Delete the Chart and Graph and replace them with a Thermometer from Express |
Numeric Indicators
4. Drag and drop a Round LED onto the Front Panel and name it as Heater. Right click on
the Round LED and select Properties, change the ON color to Red
5. Drag and drop a Round LED onto the Front Panel and name it as A/C. Right click on the
Round LED and select Properties, change the ON color to Blue
6. Modify the settings of the Front Panel according to Fig. 17

19

Fig. 17

Lab1b.vi Front Panel

7. Go to the Block Diagram, drag and drop the Subtract block from Express | Arithmetic
and Comparison | Express Numeric
8. Drag and drop the Less than 0? block from Express | Arithmetic and Comparison |
Express Comparison
9. Drag and drop the Greater than 0? block from Express | Arithmetic and Comparison |
Express Comparison
10. Now complete the wirings according to the Block Diagram shown in Fig. 18. Can you
complete the wirings successfully?

20

Fig. 18

Lab1b.vi Block Diagram

What are the four funny little blocks in the middle of the Block Diagram used for?
Where can I find them?

These little blocks are Signal Manipulation blocks used for data type
conversions. Since the signal coming out from each block may have its own data
type (e.g. floating point, string, Boolean, scalar, waveform, 1-D array, 2-D
array..etc.), to allow the signal moving uniformly in between blocks, it is
necessary to use these signal manipulation blocks. Otherwise, the wires will not
be connected successfully. There are two types of data conversions we use here.
The ones on the left are called From DDT (Convert from Dynamic Data) while
the ones on the right are called To DDT (Convert to Dynamic Data). For our
task here, we use Boolean as the Scalar data type for both conversion blocks.
These conversion blocks can be found under Express | Signal Manipulation
21

11. Go back to the Front Panel and set the Temperature Setpoint to 25 C. Then, click Run
to start the simulation. Once the simulation is in progress, change the temperature value
on the fly with the Knob. What did you observe? Is your model working as you
expected?
12. Specify the inputs and outputs and identify the functionalities of this model. Fill out the
table below:
Input
Controls

Input
Signal

Output

Functions

Task 3: Create a Hardware-in-the-loop Thermostat (NI USB-6210 DAQ module is


required for Task 3)
(Duration: 20 min)

What is hardware-in-the-loop?

Hardware-in-the-loop is a method used to test real time embedded systems. It


usually involves the use of electrical emulation of sensors and actuators to act as
the interface between the plant simulation and the embedded system under test
[1].

1. Connect the NI USB-6210 DAQ module to the laptop and wait for driver initiation
2. A green light next to the USB port of the DAQ module should be flashing if the driver
initiation is completed successfully
3. Double click the NI MAX icon on your Desktop to launch Measurement and
Automation Explorer
4. Expand the Devices and Interfaces directory on the left panel, make sure NI USB-6210
Dev is declared without a red cross there. Congratulations if your Measurement and
Automation Explorer window looks like the one shown in Fig. 19. This means your DAQ
22

module is successfully connected to your laptop. Otherwise, unplug, reconnect the DAQ
module and reconfigure the driver

Fig. 19

Measurement and Automation Explorer

5. Connect the 10-k potentiometer and the jumper wire as shown in Fig. 20

23

AI0 +
AI0
Fig. 20

Potentiometer and jumper wire connection

NEVER connect a wire between the +5V terminal and the


GND terminal without a load (short circuiting). Short
circuiting can cause permanent damage to the DAQ
module!

6. Open Lab1b.vi and save it as Lab1c.vi


7. Go to the Block Diagram, remove the Temperature [degC] block and insert DAQ
Assistant from Express | Input
24

8. Expand the Acquire Signals directory and select Voltage from Analog Input
9. Click on ai0 (analog Input Channel 0) and then click Finish
10. Enter 5 for the Max Input Signal Range (supply voltage of 5V) and 0 for the Min Input
Signal Range
11. Choose Continuous Samples for the Acquisition Mode
12. Reconnect all the wires in the Block Diagram. Your Block Diagram should look like the
one shown in Fig. 21 and your Front Panel should look like Fig. 22

Fig. 21

Lab1c.vi Block Diagram

25

Fig. 22

Lab1c.vi Front Panel

13. Turn the potentiometer and observe the change of the thermometer reading as well as the
heater and A/C indicator lights. Does it work?

What happens to the temperature here?

In Task 2, the knob that is used to simulate the temperature has a full range from 0
to 30 degrees Celsius. Now in Task 3, the 10-k potentiometer is used to
substitute the knob. The problem here is that the maximum (voltage) value the
analog channel gets is 5V (from the DAQ +5V supply). So in order to reach the
full range of the temperature reading, we have to multiple the analog input value
by 6.
26

14. Insert the Multiply block and the Numeric Constant block as shown in Fig. 23 to
complete the Block Diagram.

Fig. 23

Modified Lab1c.vi Block Diagram

15. Now try again and run the simulation. Can the model this time duplicate what the virtual
thermostat of Task 2 does? Do you see a problem of such control method for a thermostat
(you will know the answer after you completed Lab 2)?

Reference
[1]

https://en.wikipedia.org/wiki/Hardware-in-the-loop_simulation
27

Lab Exercise 2: Thermocouple Instrumentation and Thermostat Simulation

Objective
Instrumentation of a Type-K thermocouple to be used for the design and fabrication of a
thermostat prototype

Background
Thermocouple is a complete circuit involving two dissimilar pure metal or alloy wires joined
together to form a loop [1, 2] as seen in Fig. 1. If a difference of temperature exists between both
ends, a difference in junction potential will occur resulting in a thermoelectric e.m.f.
(electromotive force) known as the Seebeck effect, which was discovered by Thomas Seebeck in
1821. If one junction is maintained at a constant and known temperature (the reference or cold
junction), and the characteristics of the thermocouple are known, the magnitude of the e.m.f.
generated will be a measure of the temperature of the other junction (hot junction). Depending on
the metals used and the temperatures of the junctions, the value of the potential difference
(usually measured in millivolts) varies. It is important to know that the e.m.f. generated for any
particular two metals at a given temperature will be the same, regardless of the size of the wires,
the areas in contact, and the method of joining them together [1].

Hot

Tref

Cold

Fig. 1 Seeback effect

Imagine if the circuit in Fig. 1 is broken at the center and only the left half of the circuit retains,
we now have constructed a simple thermocouple as illustrated in Fig. 2. The open circuit voltage,
the Seebeck voltage, is a function of the junction (thermocouple) temperature and the
composition of the two metals.
28

Metal A
T

Tref
+
eAB Seebeck voltage

Thermocouple

Metal B
Fig. 2 Simple thermocouple

What is Instrumentation?
Instrumentation is defined as the design, construction, and provision of
instruments for measurement, control, etc.; the state of being equipped with or
controlled by such instruments collectively [4].

For small changes in temperature, the change of Seebeck voltage is linearly proportional to the
change of the junction temperature given by:

(1)

where is the Seebeck coefficient (constant of proportionality, normally expressed as millivolt


per degree C) which is also a function of temperature as seen in Fig. 3, and given by the below
equation:

= ()

(2)

29

Fig. 3 Seebeck Coefficient versus Temperature plot for various types of thermocouple [2]

As you can see from the plot in Fig. 3, Eq. (2) is a non-linear function. Hence, Eq. (1) is also a
non-linear function. Only for small temperature changes or within a linear region (as shown by
the shaded area in Fig. 3), can be taken as a constant. From the plot, we can see that the slope
of the Type-K (Nickel Chromium vs. Nickel Aluminum) thermocouple approaches a constant
over a temperature range from 0C to 1000C. However, for a wider temperature range,
nonlinearity has to be taken into account. Thus, Eq. (1) has to be expressed as a non-linear
function with a second-order polynomial approximation as:

= + 2 2

(3)

30

where is the generated e.m.f. in volts, T and Tref are the measured temperature and the
reference temperature in K respectively, and a and b are constants dependent on the
thermocouple material. Constants a and b have to be determined experimentally.
In theory, if we measure the Seebeck voltage (using a voltmeter or DAQ module) according
to the setup in Fig. 2, we can determine the temperature T at the measure point. In reality,
however, this is not as straight forward as you may think. By connecting the leads of the
thermocouple to the voltmeter or DAQ module (Fig. 4), two more metallic junctions J2 and J3
will be created and they will create additional e.m.f.s to the thermocouple circuit. The additional
e.m.f.s will affect the measured value of . Note that regardless if there is any external copper
wires connection, the terminals connecting the internal circuitry of the voltmeter or DAQ module
are most likely made of copper.

Metal A
Thermocouple

J1
T
Metal B

J2 Metal C

eAB
J3 Metal C

DAQ
Fig. 4 Thermocouple-DAQ circuit

If we convert Fig. 4 into its equivalent circuit diagram, it will look like the circuit depicted in
Fig. 5.
J2

Thermocouple

J1
T

Metal A
+
V1

Metal B

+ V2

Metal C

+
eAB

+ V3

Metal C

J3
Fig. 5 Thermocouple-DAQ equivalent circuit
31

Hence, the voltage V1 across the thermocouple J1 is going to be the sum of the voltages (V2 and
V3) measured across each junction plus measured by the DAQ module:
1 = 2 + 3 +

(4)

So, to determine the temperature T at J1 from the measured value of , Eq. (4) will have to be
rearranged to:
= 1 2 3 2 3

and thus,

(5)

+ 2 + 3

(6)

where 2 and 3 are temperatures at J2 and J3 respectively. According to Eq. (6), before we can
find out the temperature T, we have to know the temperatures 2 and 3 .
J2

Thermocouple

J1
T

Metal A
+
V1

Metal B

Tref
Isothermal

+ V2

+
eAB

+ V3

J3
Fig. 6 Thermocouple-DAQ equivalent circuit

To reduce the number of variants in the equation, we can connect J2 and J3 to an isothermal block
(Fig. 6). Isothermal block is an electrical insulator but a good heat conductor and it serves to hold
all three junctions at the same temperature. According to the Law of Intermediate Metals, which
states that a third metal inserted between the two dissimilar metals of a thermocouple junction
32

will have no effect upon the output voltage as long as the two junctions formed by the additional
metal are at the same temperature (Fig. 7) [2].

Metal

Metal

Metal

Isothermal

Metal

Metal

Isothermal

Fig. 7 Law of Intermediate Metals

Therefore, by holding the junctions J2 and J3 to a constant reference temperature Tref, Metal C
(from Fig. 5) can be eliminated and Eq. (6) can be reduced to:

(7)

where the reference temperature can be measured by any device which has a characteristic
proportional to absolute temperature such as a thermistor, an RTD (Resistance Temperature
Detector), or an I.C. sensor (Integrated Circuit sensor). Thus, if we know the reference
temperature Tref and the measured value of , the thermocouple temperature T can be

33

determined. Note that Tref is NOT the initial temperature and it can change with respect to time
(time dependent). This is one of the disadvantages of using a non-calibrated thermocouple
because you always need to have a device to measure the reference temperature. It cannot
function alone (Thats another reason why it is call a couple?).
If a thermocouple is calibrated correctly, its output should be traceable according to standards
such as ASTM (American Society for Testing and Material) or NIST (National Institute of
Standards and Technology). For the thermocouple we use here, it was calibrated according to the
NIST standard, therefore, it should follow closely to the power series polynomial of Eq. (8):

= 0 + 1 + 2 2 + 3 3 + +

(8)

where n is the maximum order of the polynomial (up to n = 9), and a is the NIST Polynomial
Coefficients given in Table 1.

TYPE E

a0
a1
a2
a3
a4
a5
a6
a7
a8
a9

Nickel-10%
Chromium (+)
vs Constantan ()
-100C to
1000C
0.5C
9th order
0.104967248
17189.45282
-282639.0850
12695339.5
-448703084.6
1.10866E+10
-1.76807E+11
1.71842E+12
-9.19278E+12
2.06132E+13

TYPE J

TYPE K

TYPE R

TYPE S

Iron (+) vs
Constantan (-)

Nickel-10%
Chromium (+) vs
Nickel-5% (-)

Platinum-13%
Rhodium (+) vs
Platinum (-)

Platinum-10%
Rhodium (+)
vs Platinum (-)

0C to 1370C
0.7C
8th order
0.226584602
24152.10900
67233.4248
2210340.682
-860963914.9
4.83506E+10
-1.18452E+12
1.38690E+13
-6.33708E+13

0C to 1000C
0.5C
8th order
0.263632917
179075.491
-48840341.37
1.90002E+10
-4.82704E+12
7.62091E+14
-7.20026E+16
3.71496E+18
-8.03104E+19

0C to 1750C
1C
9th order
0.927763167
169526.5150
-31568363.94
8990730663
-1.63565E+12
1.88027E+14
-1.37241E+16
6.17501E+17
-1.56105E+19
1.69535E+20

0C to 760C
0.1C
5th order
-0.048868252
19873.14503
-218614.5353
11569199.78
-264917531.4
2018441314

Table 1

TYPE T

Copper (+) vs
Constantan (-)
-160C to
400C
0.5C
7th order
0.100860910
25727.94369
-767345.8295
78025595.81
-9247486589
6.97688E+11
-2.66192E+13
3.94078E+14

NIST Polynomial Coefficients

34

What is Temperature?

Temperature is a measure of heat intensity or hotness. It is not heat quantity


such as energy because temperature is a bulk measurement of heat which is
independent on the amount of material present [1, 3]. Our body feels warm or
cold not because of temperature but the amount of heat energy we receive or lose.
The amount of heat energy we receive or lose not only depends on temperature
but it also depends on other factors such as humidity and wind speed. This is the
reason why we have wind chill factor in winter time and heat index in summer
time for us to get a feel of the coldness or hotness in terms of the equivalent
temperature.

Apparatus

Laptop or desktop computer


NI USB-6210 DAQ module (http://sine.ni.com/nips/cds/view/p/lang/en/nid/203223)
Omega calibrated Type-K thermocouple (Fig. 8)
Jumper wires
Screw driver (flat)

Thermocouple
bead

Fig. 8 Omega calibrated Type-K thermocouple

ALWAYS handle the thermocouple with care as the tip


(bead) of the thermocouple is very fragile. Physical
damage or contamination may negatively affect the
temperature measuring performance

35

Procedure
Task 1:

Thermostat simulation with the use of LabVIEW build-in function for the
instrumentation of thermocouple
(Duration: 30 min)

1. Connect the NI USB-6210 DAQ module to the laptop and wait for driver initiation
2. A green light next to the USB port of the DAQ module should be flashing if the driver
initiation is completed successfully
3. Double click the NI MAX icon on your Desktop to launch Measurement and
Automation Explorer
4. Expand the Devices and Interfaces directory on the left panel, make sure NI USB-6210
Dev1 is declared without a red cross there.
5. Go to Windows Start menu bar and click on LabVIEW (32 bit) under All Programs |
National Instruments | LabVIEW 2011 (32 bit) to launch LabVIEW
6. Open and use Lab1c.vi from Lab 1
7. Save the file (select File | Save As) as Lab2a.vi
8. Go to the Front Panel of Lab2a.vi and construct a GUI according to Fig. 9

Fig. 9 Lab2a.vi Front Panel


36

9. Rename the Waveform Chart to Temperature Plot and the horizontal (y) axis from
Amplitude to Temperature [Deg C]
10. Go to the Block Diagram, place the Temperature Plot block inside the While Loop
11. Now identify your input, output and functions of your model (Hint: Go back to Lab 1 if
you forget how to do this)
Input
Controls

Input
Signal

Output

Functions

12. Remove the Gain of the input (the little blue box connected to the Multiply block
downstream of the DAQ Assistant block) and the Multiply block. We are now working
with the thermocouple not the potentiometer in Lab 1, so we need a unity gain for the
direct read out value from the thermocouple to be used for the voltage to temperature
conversion
13. Bring up the Functions palette, insert the Merge Signals block from Express | Signal
Manipulation to the While Loop
14. Connect the DAQ Assistant output signal wire and the Temperature Setpoint signal
wire to the input signal ports of the Merge Signals block. Then, connect the combined
signal port of the Merge Signals block to the Temperature Plot
15. Connect another wire from the DAQ Assistant output port to the Thermometer
16. Remove the Simulate Signal (DC) block and its associated wires.
17. Double-click the DAQ Assistant block and remove Voltage from Channel Settings as
shown in Fig. 10

37

Fig. 10

Change Channel Settings

18. Add ai0 channel for the thermocouple as shown in Fig. 11

38

Fig. 11

Adding a channel for the thermocouple

19. Select the appropriate Thermocouple Type and enter a value for the CJC Value (Cold
Junction Constant Value) (see Fig. 12). The CJC Value can be approximated by using a
physical temperature measuring device (e.g. thermometer) or the Device Properties |
Current Temperature value by launching the Measurement and Automation
Explorer as depicted in Fig. 13

39

Fig. 12

Fig. 13

Thermocouple Type and CJC Value

Current Temperature of the device

40

20. Add a Dial on the Front Panel and name it as Temperature Offset [degC]. We use this
temperature offset to zero the residue voltages that exist at the various junctions of the
thermocouple circuit. We call this procedure as Software Compensation

What is Software Compensation in thermocouple instrumentation?

Software Compensation in thermocouple instrumentation is a procedure that relies


upon the software of a computer to compensate for the effect of the reference
junction.

21. Connect all the blocks together, your Block Diagram should look like the diagram
depicted in Fig. 14

Fig. 14

Lab2a.vi Block Diagram


41

Yellow wire (+)

AI0 +
AI0

22. Now connect the thermocouple according to the photo and circuit diagram depicted in
Fig. 15

Red wire (-)

Fig. 15

Jumper wire

Thermocouple connection

23. Hold the thermocouple such that the tip (bead) is not touching anything except the air.
We can assume the junctions connected to the DAQ terminals (AI0+ and AI0-) and the
thermocouple all stay at the same reference temperature Tref. Now hit the white arrow
42

Run on the Front Panel and turn the Temperature Offset dial simultaneously such that
the temperature reading matches with the current temperature of the device as depicted in
Fig. 13. This will be your Tref. Can you read off the temperature value easily?
24. Your thermometer measurement probably has a lot of noise and is hard for the user to
read. One easy way to solve this problem is to utilize a filter that filters out the noise or to
smooth the signal plot. To do so, drag and drop a Filter block from Express | Signal
Analysis onto the block diagram. The Filter block should be inserted between the DAQ
Assistant block and the Add block
25. Select the Filtering Type and Filter Specifications according to Fig. 16

Fig. 16

Filter configuration window


43

What is a Filter?

Filter is a device that attenuates (i.e. reduce in amplitude) or altogether eliminates


signals of unwanted frequencies, such as those that may be caused by electrical
noise or other forms of interference [5]. There are many types of filters such as
low-pass (only allows low frequency signals to pass through), high-pass (only
allows high frequency signals to pass through), band-pass (passing mainly those
frequencies within a certain frequency range), and moving average (average data
continuously over a certain period of time).

26. The Half-width of moving average denotes how often you want to average the results.
For example, if the half-wide of moving average M is set to 100 sampling points, the total
sampling points N that are used to calculate the average value will be N = 2M + 1. In
other words, for a sampling rate of 1 kHz, a 100 samplings of the half-width of moving
average is equivalent to the duration of 201/1000 second, which is 0.201 second. So in
this case, the signal is averaged out for every 0.201 second. The higher the value of the
half-width of moving average, the smoother the plot but the slower the plot responds.
Thus, the value of the half-width of moving average should be chosen such that it
provides a smooth plot and yet the plot is fast enough to capture the dynamics of the
system
27. Input the value 200 for the half-width of moving average and press the white arrow Run
button on the Front Panel to run your model. Did you see any changes this time?
28. Now adjust the Temperature Setpoint (denoted by the red line in the Chart) and match
it with the reference temperature Tref plot
29. Put your finger tip close to the thermocouple (but do not touch the tip) or put the
thermocouple next to the CPU cooling fan of your laptop. See if you can raise the
temperature. As the temperature rises above or drops below the setpoint (red line), did
you see the Heater or the A/C indictors switch on and off? Is this what you have
expected? Do you see any problem with this type of control strategy?
30. If the measured temperature continuously fluctuates about the Temperature Setpoint, the
Heater and A/C will be turning on and off all the time. This is probably not what you
44

want as this not only wasting energy, it also reduces the life cycle of the Heater or the
A/C. One way to solve this problem is to insert a predefined nonlinearity called Schmitt
trigger into each temperature control device, one for the heater and one for the A/C.
Schmitt trigger (Fig. 17) allows the user to specify two threshold values instead of one
setpoint (Fig. 18). The two thresholds (upper and lower) are used for switching the
temperature control device either on or off while the region between the thresholds is
used to hold the temperature control device on or off for a certain time period. Fig. 19
shows a typical control strategy of a heater with a Schmitt trigger. For the case of the
A/C, the control (on/off) logic will be the opposite of the plot shown in Fig. 19.

Holding Time
Lower Threshold (i.e.
setpoint for Heater)

Upper Threshold (i.e.


setpoint for A/C)
Fig. 17

Schmitt trigger

What is a Schmitt trigger?

Schmitt trigger is a device used for noise rejection and prevention of undesired
multiple triggering. When the input voltage is beyond an upper switching
threshold and giving a low output, the input voltage needs to fall below the lower
threshold before the output can switch to high. Conversely, when the input
voltage is below the lower switching threshold and giving a high, the input needs
to rise above the upper threshold before the output can switch to low. Such a
device can be used to sharpen slowly changing signals because when the signal
passes the switching threshold it becomes a sharply defined edge between two
well-defined logic levels [6].
45

A/C ON, Heater OFF

Temperature

Hot
Cold

Setpoint

A/C OFF, Heater ON

Time
Fig. 18

Temperature control with a single setpoint

Heater OFF

Temperature

Hot

Upper Threshold

Heater On Hold
Cold
Heater Off Hold

Heater ON

Lower Threshold

Time
Fig. 19

Temperature control of a heater with Schmitt trigger

46

31. To construct a Schmitt trigger, we can use a Comparison (In Range) block from
Express | Arithmetic and Comparison | Express Comparison and another
Comparison (Greater OR Equal) block connected in parallel to each other as illustrated
in Fig. 20. In the Configure Comparison (In Range) window, set the minimum value
to 0 and maximum value to 0.5. These two values represent the lower and upper
thresholds of the Schmitt trigger. Enter 0.5 in the Numeric Constant block next to the
Comparison (Greater OR Equal) block. This numeric constant is the ON trigger which
defines how high above the temperature setpoint the A/C starts to kick in. The triangular
block located downstream of the two Comparison blocks is called Select and you can get
it from the same Express Comparison directory. This completes the Schmitt trigger of
the A/C control. Now follow Step 32 to construct a Schmitt trigger for the heater control.

Fig. 20

Schmitt trigger of the A/C control programmed in LabVIEW

32. To construct a Schmitt trigger for the heater control, simply copy and paste the subsystem structure you have created in Step 31. Double-click the Comparison (In Range)
block and change the minimum value to -0.5 and maximum value to 0. These two
values specify the lower and upper thresholds of the Schmitt trigger for the heater
control. Now replace the Comparison (Greater OR Equal) block with the Comparison
(Less OR Equal) block and change the value in the Numeric Constant block to -0.5.
This numeric constant is the ON trigger which defines how far below the temperature
setpoint the heater starts to kick in. Your Schmitt trigger of the heater control should look
like the one in Fig. 21.

Fig. 21

Schmitt trigger of the heater control programmed in LabVIEW


47

33. Now modify your LabVIEW block diagram to include the two Schmitt triggers you have
constructed in the previous steps. Your new block diagram should look like the one
depicted in Fig. 22.

Fig. 22

Thermostat model with the use of Schmitt triggers

The four blue arrows sitting on the border of the while loop are called Shift Registers.
Shift registers are used to pass values from the previous iteration to the present iteration
in a looping structure. In other words, they occupy memory to pass previously stored data
48

to the present state. Shift Register comes in pairs: one for the incoming data and the other
for the outgoing data. To create a shift register, simply drag a wire to or create a wire
from the border of the While Loop, then, right-click on the little square box called Loop
Tunnel and select Replace with Shift Register as shown in Fig. 23.

Fig. 23

Create a Shift Register in LabVIEW

34. Now run your simulation model and observe the changes you have made. Is this control
strategy with the use of Schmitt triggers more reliable to use?

Task 2:

Thermostat simulation with the use of the NIST polynomial for the
instrumentation of thermocouple
(Duration: 30 min)

1. Save the file Lab2a.vi as Lab2b.vi


2. Open DAQ Assistant and remove Temperature from Channel Settings
3. Add ai0 channel as the input for Voltage
4. Keep the same Acquisition Mode (Continuous Samples, 1 kHz Rate)
49

5. Construct a polynomial according to Eq. 8 with the NIST Polynomial Coefficients listed
in Table 1. Then, insert the polynomial into the While Loop of your model. (Hint: The
polynomial should be placed in between the DAQ Assistant block and the Filter block)
6. Now run your model and observe the differences between this new model and the one
you constructed earlier in Lab2a.vi

References
[1] Doyle, F. E. and Byrom, G. T. Instrumentation Temperature. Blackie & Son Limited,
London, England, 1970.
[2] Omega Temperature, Vol. 26, Omega Engineering Inc., Stamford, CT, USA, 1988.
[3] http://en.wikipedia.org/wiki/Temperature
[4] Oxford English Dictionary.
http://www.oed.com/view/Entry/97170?redirectedFrom=instrumentation#eid
[5] Rizzoni, Giorgio, Principles and Applications of Electrical Engineering (4th Edition). The
McGraw-Hill Companies, New York, 2004.
[6] Bolton, W, Mechatronics Electronic Control Systems in Mechanical and Electrical
Engineering (3rd Edition). Pearson Education Limited, Harlow, England, 2003.

50

Lab Exercise 3: Dissection and Assembly of a Hand Drill

Objective:
The purpose of this experimental exercise is to explore the mechanical dissection of a hand drill.
The exercise will help you to explore the design and construction of a common electromechanical system. You will disassemble and assemble a hand drill to:

Identify overall functionality of the product

Identify all components and their relationship to each other including how they are
assembled

Draw all components and assemblies using hand sketching techniques

Learn about common mechanisms and machine components

Identify and explore how components are designed and fabricated

Develop awareness of the design process

Introduction:
The product dissection is the process of discovering the technological principles of a device,
object, or system through analysis of its structure, function and operation. It may involve taking a
mechanical or electrical device apart and analyze how it works in details.
In this dissection exercise you will take apart and reassemble a cordless Black & Decker 12 V
hand drill that is shown in Fig 1.

51

Fig. 1 Black & Decker 12 V Hand Drill [1]


A hand drill is a very useful consumer tool that is designed to help end users to perform various
operations e.g. drilling or enlarging holes through various materials, installation or removal of
fasteners from various materials that are fastened together or buffing etc. The drilling operations
are normally performed with cutting tool attachments such as twist drill bits, auger bits and
countersinking bits etc. There are many types of power drills available in the marketplace with
basic or advance features e.g. cordless drills with variable speed, hammer drills, pistol grip
corded drills, etc.
In general, the fundamental purpose of a power drill is to produce and apply combination of
torque and a force with specified speed at the tool attachment. To achieve this basic function,
most power drills consist of two major subsystems namely, mechanical and electrical systems.
The subsystems interface with each other to create the overall functionality and architecture of
the product. The mechanical subsystem consists of various mechanical components and
mechanisms which produce and transfer forces to the tool attachments. The electrical subsystem
consists of electrical power source and various components to supply and control power.
The Black & Decker 12 V hand drill is designed for drilling and screw-driving through various
materials such as woods, metals and plastics. It is powered by a 12 V Lithium Ion battery and it
can generate torque and speeds up to 100 in-lb. and 600RPM, respectively. It is equipped with a
3/8 chuck which is very common for cordless power drills.

52

Procedure:
1. Discuss and define various roles for your team members
2. Document who is responsible for keeping track of all parts during the disassembly process.
Who is responsible for taking notes? It is extremely important to ensure that all parts are
tracked and proper notes and adequate sketches are taken in your logbooks. This information
will be vital during reassembly process and the following weeks lab session.
3. Please ensure to follow basic health and safety guidelines at all times. If you are unsure,
please contact your lab coordinator/instructor or supervisor!
Basic Safety Guidelines:

It is extremely important that all lab work is done in a safe manner


You must get familiar with the lab before doing any work
You should know where exits are located
You should also know the location of the nearest phone in the lab to call for help
There is no food or drink allowed in the laboratory
Working with electrical or mechanical components and tools can be dangerous if you
dont take certain safety precautions
Never dissect or open an engineering product until the power cord or battery is fully
removed!
Electrical shock not only can injure you but can also kill you!
Keep the work area clean and ensure there are no cluttered areas
Do not operate power tools after opening the cases. Power tools can create sparks which
may ignite the dust or fumes
Stay focused during the lab session and carefully pay attention to what you are doing and
practice common sense when handling tools
There is zero tolerance for horseplay during lab sessions
Should you have any questions or concerns, immediately contact your lab supervisor
You must dress properly i.e. not wear loose clothing or jewelry such as rings necklace,
and any other loose metallic objects
Keep your hair, clothing and gloves away from moving parts

4. Carefully examine the exterior and shape of the hand drill. Identify all visible major
components and features. You should be able to at least observe eight major components
which are shown in Fig 2. With careful examination you should be able to identify
additional features.

53

Fig. 2 Major components of hand drill visible from exterior [2]


5. Sketch the drill using hand sketching techniques and identify all visible features. Discuss the
functionality of each visible component within your team. Record all components and their
functionalities in your logbook. You can use the following format:
Table 1. Visible external components and features
Name of
Material
Function and
component or
design intent
feature

Relationship
with other
components

How is it made or
manufactured?

6. Without disassembling the hand drill, are you able to imagine and comment on what
components you can find inside? Write down your ideas and thoughts.
7. Now you are ready to disassemble the hand drill to examine all internal components.
8. Remove the battery first! Why is it important to remove the power source? To remove the
battery, press the buttons on both sides as shown in Fig 3 and pull the battery out. Examine
the battery and identify its features without opening it. How does it work and transfer
electrical power to other components? How does it hold charge? Please ensure to keep track
of all components as you further disassemble the hand drill. You can easily do this by
creating a bill of materials (BOM). For example you can use the following format:

54

Table 2. Bill of Materials (internal components)


Item Number Item Name
Quantity
Description/function/features Materials
1
Battery
1
Power source
Lithium,
plastic covers,
contacts etc.
2
3

Press the buttons

Fig. 3 Battery removal [1]


9. In order to further disassemble the hand drill, carefully examine how the hand drill is
assembled. You will notice some screws at various locations and a metal clip in the battery
compartment. Use a screw driver to unscrew the fasteners as shown below and also remove
the metal clip.

55

Fig. 4 Removal of fasteners and metal clip [1]


10. Please ensure to count total number of screws and record them in BOM. What is the purpose
of the screws and clip?
11. Identify all internal parts that are now visible. Next step is to observe and draw sketches of
the plastic housing. What are the advantages and disadvantages of using plastic housing?
Identify the features which help to align holes.
12. The next step is to disassemble the motor and gear drive. Please refer to the figures below
and use a flat head screw driver to remove the motor.

56

Fig. 5 Disassembly of motor and gear drive [1]


13. Examine, analyze and document all components which are now visible. Finish the sketches
and complete the table.
14. How does the motor work? How is the electrical energy transferred into mechanical energy?
What is the interface?
15. Observe the gear system from both sides, and take notes on which side is pointing to the
chuck. What kind of gear system is used in this drill? What is the purpose of gears? What is
the purpose of using the grease and ball bearings?

57

Fig. 6 Internal view of gear drive and housing [1]

16. Examine the trigger switch and document how it is assembled with the housing. Remove the
direction switch and describe how it controls the motor direction.
17. Brainstorm how this power drill can be designed in different ways. What features will you
change to improve this drill? Document all of your thoughts in your logbook.
18. Now you can assemble the drill. You should follow the steps in reverse order of disassembly.
Please refer to your notes and step backward and ensure that hand drill is fully functional and
reusable.
19. After you have reassembled the hand drill, further analyze major components such as: motor,
chuck, battery, battery charger and gear transmission, etc. How these components work?
How these components are made? What other types of similar components have you found?

References
[1] Dissection figures provided by Mr. Leon Wu
[2] Black & Decker 12 V Hand Drill Owner Manual

58

Lab Exercise 4: Dissection and Assembly of an Assigned Engineered Product

Overview:
The purpose of this experimental exercise is to use hands-on dissection experience gained from
exercise 3 & 4 to dissect and analyze an engineering product. In this exercise a random
engineered product will be assigned to each group who will dissect and reassemble the product
and use analytical skills to:

Identify overall functionality of the product

Identify all components and their relationship to each other including how they are
assembled

Draw all components and assemblies using hand sketching techniques

Identify and explore how components are designed and fabricated

Develop awareness of the design process

Write a technical report to describe dissection procedure

Use presentation tools such as Microsoft PowerPoint to communicate the function of the
assigned product as well as its components

Procedure:
1. Discuss and define various roles for your team members
2. Document who is responsible for keeping track of all parts during the disassembly
process. Who is responsible for taking notes?
3. It is extremely important to ensure that all parts are tracked and proper notes and
adequate sketches are taken in your logbooks. This information will be vital during
reassembly process and the following weeks lab session as well as your class
presentation.
4. Please ensure to follow basic health and safety guidelines at all times. If you are unsure,
please contact your lab coordinator/instructor or supervisor!
Basic Safety Guidelines:

It is extremely important that all lab work is done in a safe manner


You must get familiar with the lab before doing any work
You should know where exits are located
You should also know the location of the nearest phone in the lab to call for help
59

There is no food or drink allowed in the laboratory


Working with electrical or mechanical components and tools can be dangerous if you
dont take certain safety precautions
Never dissect or open an engineering product until the power cord or battery is fully
removed!
Electrical shock not only can injure you but can also kill you!
Keep the work area clean and ensure there are no cluttered areas
Do not operate power tools after opening the cases. Power tools can create sparks which
may ignite the dust or fumes
Stay focused during the lab session and carefully pay attention to what you are doing and
practice common sense when handling tools
There is zero tolerance for horseplay during lab sessions
Should you have any questions or concerns, immediately contact your lab supervisor
You must dress properly i.e. not wear loose clothing or jewelry such as rings necklace,
and any other loose metallic objects
Keep your hair, clothing and gloves away from moving parts

5. Carefully examine the exterior and shape of the assigned product. Identify all visible
major components and features. Sketch the product using hand sketching techniques and
identify all visible features. Discuss the functionality of each visible component within
your team. Record all identified components and their functionalities in your logbook.

Table 1. Visible external components and features


Name of
Material
Function and
component or
design intent
feature

Relationship
with other
components

How is it made or
manufactured?

6. Without disassembling the assigned product, are you able to imagine and comment on the
components you can find inside? Write down your ideas and thoughts.
7. Analyze the product within your team members and develop a plan to disassemble it.
Ensure to document all necessary steps to take it apart e.g., removal of fasteners, covers,
batteries, stickers etc. If you have any questions or concerns, contact your lab supervisor.
8. Take the product apart as much as possible.
9. Identify all components to explore and analyze their functionalities.
10. Prepare the bill of materials (BOM) and sketch all components. You can use the
following format for BOM.
60

Table 2. Bill of Materials (internal components)


Item Number Item Name
Quantity
Description/function/features Materials
1
Battery
1
Power source
Lithium,
plastic covers,
contacts etc.
2
3

11. Re-assemble the assigned product.


12. Use your logbook and notes to prepare a detailed report. This report is due at the end of
next weeks lab session.
13. Prepare necessary presentation material (oral, graphical and textural) to communicate the
functions of the assigned product and components for your peers.
14. The oral presentation schedule will be announced in the lab session and the presentation
should not exceed 10 minutes.

61

Lab Exercise 5:

Dissection of a Weight Scale and Introduction to MATLAB data


acquisition using NI module

Objective
The objective of this laboratory exercise is to dissect a weight scale to explore its design and
functionality of its components.You will disassemble and assemble a weight scale to:

Identify overall functionality of the product

Identify all components and their relationship to each other including how they are
assembled

Draw all components and assemblies using hand sketching techniques

Identify and explore how components are designed and fabricated

Develop awareness of the design process

In addition, you will get familiar with MATLAB programming Graphical User Interface to
achieve the task of data acquisition using NI module

Background
Weight scale is a device used to measure the force exerted by the mass of an object under the
influence of gravity. A simple electronic weight scale (Fig. 1) normally consists of at least the
following components: load cell(s), a LCD (Liquid Crystal Display) panel, a base, a loading
platform, a switch, a power source, and a control unit (e.g. microcontroller) that converts the
electrical (e.g. voltage) signal from the load cell(s) to digits (weight) displayed on the LCD.

62

Loading
Mount
LCD Panel
Base

Cable
Conduit
Loading
Platform
(glass panel)

Fig. 1 An electronic weight scale


When the base is detached, the components that make up the weight scale can be seen (Fig. 2).

Unit Select
Switch
(kg/lb)

Control Unit

Cable Bundle (power


cables + signal cables)

63

Load Cell (one at each corner)

Fig. 2 Dissection view of an electronic weight scale (the base is not shown here)

What is the difference between mass and weight?

64

Mass is a measure of a bodys inertia (the property of matter that causes it to


resist any change in its motion) [1]. The International System of Units (SI) for
mass is kg and the body used as the international standard of mass is a 1-kg
cylinder of platinum-iridium alloy (http://archive.nrc-cnrc.gc.ca/obj/nrccnrc/images/multimedia/picture/images/html/nrc-inms_prototype_kilogram-lr.jpg).
The imperial unit for mass is called slug. It is described as a mass that
accelerates by 1 ft/s2 when one pound of force is exerted on it. Weight is the
force by which a body is gravitationally attracted to the earth corrected for the
effect of rotation and equals the product of the mass of the body and the
acceleration of free fall (W = mg, where W is the weight, m is the mass of the
body, and g is the acceleration of free fall due to gravity) [1]. Since weight is
regarded as a force, its SI unit is the same as that of a force measured in
Newtons (N). Most weight scales measure weights in terms of either
kilograms (kg) or pounds (lb). It is important to know that a pounds weight
scale measures the force by which a body is gravitationally attracted to and is
sometimes regarded as pound-mass or lbm (this is used to distinguish the
difference between pound-force or lbf, which is used to describe the
magnitude of any force but not the body mass). A kilograms weight scale,
on the other hand, can only measure the body force corrected to its body mass
(m = W/g). Strictly speaking, a weight scale cannot measure the mass of a
body, but only the force by which a body is gravitationally attracted to. To
measure mass of a body, a balance has to be used. By comparing the mass of a
body to sets of standard masses on a balance, the mass of a body can be
determined. Mass of a body is constant wherever it is measured, subject to the
special theory of relativity. According to this theory, announced by Albert
Einstein in 1905, the mass of a body is a measure of its total energy content
(e.g. kinetic energy which relates to speed and internal energy which relates to
temperature). The change of mass governed by the special theory of relativity
is usually negligible in our daily-life activities because you will have to apply
extremely high energies to a body to make its mass change significantly.
Weight, on the other hand, changes depends on where it is measured because
the value of g varies at different localities on the earths surface and different
locations in space.

Load cell (Fig. 3) is a transducer that is used to convert a force into an electrical signal. Two
common types of load cell that can be found in small-scale weight or force measuring devices,
such as the weight scale we use here, are: strain-gauge type and piezoelectric type. Strain-gauge
type load cell relies on a strain gauge that is made of metal wires, foils, or semiconductor
materials, which are attached to structural members. When the members are stretched under
tensile stress, the resistance of the metal or semiconductor element increases [1]. By measuring
65

the change in resistance value (i.e. via measuring the change in voltage across the strain gauge
when an electrical source is supplied to it), an estimate of the strain can be made, and thus, the
loading force (weight) can be determined. Piezoelectric type load cell relies on a piezoelectric
element which uses the piezoelectric effect to measure strain. Piezoelectric effect is the
generation of a potential difference (i.e. voltage) across the opposite faces of certain nonconducting crystals (piezoelectric crystals) as a result of the application of mechanical stress
between these faces [1]. By measuring the voltage across the piezoelectric element, the weight
acting on the load cell can be determined.
Our weight scale here uses four load cells simultaneously to measure the load on the loading
platform. The control unit (microcontroller) takes the signals from all four load cells and
calculate the average weight value. The advantage of using multiple load cells in parallel to
measure weight is that it can compensate for a load that is unintentionally placed off-center on
the loading platform.

Fig. 3 A load cell

To convert the electrical signal from a load cell, hardware components (e.g. potentiometer,
amplifier, capacitor, etc.) or software components (e.g. formulas for voltage to weight
conversion and noise filtering) or both is required. In order to determine the relationship between
the electrical signal and the measured weight value, a procedure called calibration is required.
Calibration is a comparison between measurements one of known magnitude or correctness
made or set with one device and another measurement made in as similar a way as possible with
a second device. There are many types of calibration methods and in LabVIEW, there are four
types: 1) Linear, which scales values by using the equation y = mx + b, where x is a prescaled
value and y is a scaled value; 2) Map Ranges, which scales values proportionally from a range
of prescaled values to a range of scaled values; 3) Polynomial, which scales values using an nth
66

order polynomial equation (e.g. NIST polynomial approximation used for the calibrated
thermocouple in Lab 2); and 4) Table (also called look-up table), which maps an array of
prescaled values to an array of corresponding scaled values, with all other values scaled
proportionally.

What is a piezoelectric sensor?

Piezoelectric sensor (Fig. 4) is a device that uses the piezoelectric effect to


measure pressure, acceleration, strain or force by converting them to an
electrical signal. Some electronic weight scales utilize a piezoelectric sensor
as a turn-on switch. When the piezoelectric sensor senses a (kicking or
tapping) force by the user, it will send a signal to the control circuitry to
switch on the weight scale. After the weight is removed from the loading
platform for a few seconds, the weight scale will be automatically switched
off by the control circuitry. The use of a piezoelectric sensor here eliminates
the need for a physical switch and thus, gives the weight scale a slimmer and
more compact look and makes the weight scale easier to operate.
How do you turn on our weight scale here?

Fig. 4 A piezoelectric sensor

Apparatus

Laptop or desktop computer


NI USB-6210 DAQ module (http://sine.ni.com/nips/cds/view/p/lang/en/nid/203223)
Hometrends electronic weight scale (Fig. 1)
67

Jumper wires with alligator clips (Fig. 5)


Screw driver (#0 Philip) (Fig. 6)
Screw driver (2.4-mm flat) (Fig. 6)
Pliers (Fig. 7)
Safety glasses (Fig. 8)
Work gloves (Fig. 9)

Fig. 5 Jumper wires with alligator clips

Fig. 6 Screw drivers #0 Philip (left) and 2.4-mm flat (right)

68

Fig. 7 Pliers

Fig. 8 Safety glasses

Fig. 9 Work gloves


69

You may be dealing with sharp objects when doing the


dissection in this experiment. Therefore, it is mandatory to
wear your safety glasses at all times! It is also
recommended to put on your work gloves!

Procedure
Task 1: Dissection of an electronic weight scale

(Duration: 30 min)

1. Remove the battery and turn the weight scale upside down. Carefully remove the base by
loosening the four screws (circled in red) and gently shake the base loose (Fig. 10)

Fig. 10

Removing the base

70

2. Carefully take the load cell out from the support structure by gently press the top and
bottom clips outward (Fig. 11). Look at the design of the load cell. Can you tell how the
load cell is deformed when a load is applied to it? You can draw a Free Body Diagram to
illustrate.

Fig. 11

Taking the load cell out

It is always a good practice to mark the orientation of the


part with a marker before it is taken out (you can also
take a picture with your phone). Then you will know
exactly how the part is assembled when you put
everything together later on.

71

3. Remove the two screws on the circuit board (circled in red) and carefully take out the
LCD panel underneath (Fig. 12). Be careful not to damage the two plastic clips at the
bottom of the circuit board. Also, mark down the orientation of the LCD Panel. If you
flip it up-side-down when you put it back later, it will not work!

LCD Panel

Fig. 12

Taking the LCD panel out

Be careful not to drop the LCD panel because the panel is


made of glass. The panel is fragile and easily breakable!

4. You have just dissected the weight scale. Now sketch out each component and describe
its functionality. Record all components and functionality in your logbook. You can use
the following format:

Component or
feature

Material

Function or potential
design intent

How is it made or
manufactured?

72

5. Now for each component, assign an Item Number, specify the Quantity, Description, and
the Materials used. Then tabulate them as a Bill of Materials (BOM) shown below:
Item
Number
001

Item

Quantity

Description/function/features Materials

Battery

Power source

Lithium

002
003

..

..

..

..

6. After you have completed the BOM, assemble all the components together and put the
battery back to the battery compartment.
7. Follow the instruction on the sticker of the weight scale to operate. Test and see if the
weight scale is still working. If not, find out the problem and fix it. Ask the instructor if
you have any questions.

Task 2: MATLAB data acquisition using NI module

(Duration: 150 min)

Graphical User Interface


Throughout the entire computing history, one of the most successful and important
technological achievements and enhancements is the development of Graphical User
Interface (GUI). It has significantly enhanced the human interactions with input devices.
GUIs make things very easy from end-user point of view. Without GUIs users had to operate
on command line and thus a complete knowledge of programming was needed on the user
end. In this tutorial, we create a GUI to acquire data from the NI DAQ module for a specified
time defined by the user and plot it on a graph. At last, students are required to use their
gained knowledge to add some controls to the created GUI and display the average of the
acquired data on a digital display.

Create a MATLAB GUI using GUIDE


GUI development environment (GUIDE) could be invoked by typing guide from the
command line as follows
73

1. Connect the NI USB-6210 DAQ module to the laptop or Desktop


2. Connect the potentiometer with NI module as what you have done in lab 1

Fig.13

Potentiometer and jumper wire connections

3. Open NI MAX to rest the NI USB-6210 module by right clicking on the Reset as shown
below

Fig. 14

Measurement & Automation Explorer Window


74

4. Open MATLAB environment in default setting which is the command interface, type
guide to invoke GUIDE. Select Blank GUI (Default), and then click OK.

Fig.15

GUIDE Quick Start window

5. An untitled GUI interface window will pop up. (hint: it might take a couple of seconds to
see the pop-up window, therefore please close all other applications and programs
because GUIDE will consume some resources from your laptop or PC)

Fig. 16

GUIDE environment
75

6. Hover over to left to select Static Text, Listbox, Push Button and Axes, then drag them
one at time to the grid.

Fig. 17

Creating GUI components

7. Save the untitled.fig to lab5.fig(Good habit to save the file every step)

Fig. 18

Save the file


76

8. Right click on Push button and select Property Inspector. Go to the String field and edit it
to Plot Temperature

Fig. 19

Edit attribute on Push Button

9. Double click on the Static Text to open the Inspector Property window, and change the
string to Acquiring time

Fig. 20

Edit attribute on Static Text

77

10. Double click on Listbox to open the inspector window. Double click the icon beside
String as shown below, and then type 1,2,3,4,5 with return key after each number.

Fig. 21 Edit the attribute on Listbox


11. Each control box on the GUI is recognized by its Tag name defined on the property
inspector. Double click on axes to open the inspector window, and then change the Tag to
tempplot.

Fig .22 Edit the attribute on Axes

78

12. Right click on Plot Temperature, and select View Callbacks then select Callback

Fig. 23

Edit Callback function

13. Lab5.m text editor window will pop up with function pushbutton1 Callback(hObject,
eventdata,handles) highlighted automatically. Add the given code inside the function as
shown in the Fig. 24.

Fig. 24

Adding the code to the function


79

14. Insert the below given code :


axes(handles.tempplot);
s = daq.createSession('ni') % Create a DAQ Session for the NI DAQ card
s.addAnalogInputChannel('Dev1','ai0','Voltage'); % Add a NI Device (Dev1),
% add an analog input
% channel (ai0) and
% specify it as a Voltage
% input
s.Rate = 20; % Specify the sampling
% rate (20 Hz here)
trange=get(handles.timerange,'value'); % Get the user selected value by the
time range box
s.DurationInSeconds = trange; % Specify the duration in
% seconds (5 seconds here)
data = s.startForeground(); % Start data logging.
% Data will be stored in
% the variable "data"
k = s.Rate*s.DurationInSeconds; % Specify the size of the
% array that stores the
% time stamps
time(1) = 0; % Initialize the 1st
% element of the time
% stamps as zero
for i=1:k-1
time(i+1) = time(i) + 1/s.Rate; % Compute the values of
% the time stamps and
% store the values in the
% "time" array
end
scale = [transpose(time), data]; % Store the transpose of
% "time" and "data" in the
% 2-D array "scale"
hold all
plot(time.', data) % Plot a time plot of the
% load cell data

15. Study the given code to understand the functionality of the code. Please note % at the
beginning of a line means commenting that line in MATLAB. Comments are ignored by
the compiler and interpreter. It is a good practice to provide the comments while writing
the source code. It would be extremely helpful for documentation purposes and future
integration with source code management for all users.

16. After inserting the code, hit the run button to start the program while you are turning the
potentiometer knob from one end to another end.

80

Fig. 25

Running the application

17. Is the graph representing the correct data? Explain.


18. Change the acquiring time to 5 seconds and plot data while you keep the potentiometer in
the middle position. Explain the graph.
19. Record two plotted graphs on your log book.
20. Add a push button and a static text box to your GUI to be able to show the average of the
acquired data on the text box.
Hint 1: You need to use the commands mean for the average function and num2str
to convert a number to a string that could be shown on the String property of the static
text box.
Hint 2: Data is transferred between routines using handles. Let say you need to make
the data average_temp in the callback routine #1 available for the callback routine #2.
you need to add the following lines to the end of callback routine #1:
handles.average_temp=average_temp
Guidata(hObject,handles)
In callback routine #2 the average temperature is known as handles.average_temp.
Hint 3: When you need to change the properties of a control box on the GUI (e.g. change
the text of a Static text box) you need to use the handles related to the Tag name and
set the property that needs to be changed.
81

For example, following line changes the String property of a static box control with a
tag name mybox to show the word hello on it:
Set(handles.mybox, String, hello)

21. Show your work to the lab instructor.

References
[1] Oxford University Press. Concise Science Dictionary (New Edition). Oxford, England,
1992.

82

Anda mungkin juga menyukai