Upload
phamhuong
View
226
Download
2
Embed Size (px)
Citation preview
1
ELE744 Electronics & Instrumentation
Electrical & Computer Engineering
MAJOR LABORATORY PROJECT
Developed & prepared by Dr. M.S. Kassam © Ryerson University
Instrumentation design - using PIC embedded controller - for real-time
Stress (cantilever based load-cell) and Deflection-Angle measurements.
1.0 PREAMBLE:
Although the evolution of the microcontroller began in early 1980s, its cost outweighed
the advantages at first for use in high-volume smart instrumentation. With the advent, and
rapid development, of high-density CMOS based Integrated Circuit (IC) technology, the
microcontroller has emerged as one of the fundamental building blocks in electronics
technology. In most modern instrumentation designs, digital signal processing and
control are increasingly replacing some of the traditional forms of analog signal
processing/conditioning. This has generally resulted in flexible product designs that tend
to be reliable and cost-effective for mass production, to have increased functionality on
significantly smaller packaging footprints, and to be easily scalable. In tandem with the
microcontroller evolution, the CMOS technology has also led to the emergence of a host
of “smart” IC based sensors and transducers (e.g. accelerometer, pressure, force,
temperature, humidity, position, proximity, flow, etc.) giving designers perhaps a broader
latitude to create sophisticated product designs.
For today’s engineers, the myriad of IC based analog and digital devices in the
marketplace has resulted in an increased blurring of the line between traditionally analog
and digital based instrumentation, thus demanding confidence and proficiency in their
abilities to apply knowledge to conjure up “neat” engineering solutions that would most
likely entail blending and integration of analog circuits and digital signal processing,
high-density and high-speed devices, smart transducers, effective PCB grounding/layout
techniques, and so on. In such instrumentation designs, optimization and trade-offs
between microcontroller (or DSP) resources and analog signal processing/ conditioning
circuitry to meet product requirement specifications can often be daunting.
Thus, the main thrust behind this Major Project is to expose senior-level students to make
effective design and implementation choices (and trade-offs) to create an intelligent
instrumentation that potentially embodies state-of-the-art digital (e.g. microcontroller,
smart sensors, etc.) and traditional analog (e.g. passive sensors, stable amplifiers, signal
conditioners, A/D, compensation networks, etc.) circuitry for a Cantilever Beam
application used in industries like Aerospace, Automotive, Construction, etc.
2
2.0 BACKGROUND:
In certain small-winged manned or unmanned aircraft control application, it is often
desirable to continuously sense and monitor stress points along the wing span, and the
resultant deflection or inclination angle relative to its unstressed or resting longitudinal
axis. The principles behind such types of measurements can be demonstrated and
implemented using a simple cantilever beam setup as shown in Figure 1. For simplicity,
the measurement of stress on the beam is limited to a single point and the deflection
angle, θ as depicted in Figure 2. Brief summaries of stress and angle measurement
principles are given below, and the students are urged to review the lecture material,
suggested reference articles and sensor datasheets to gain further insights.
Strian-Gage
F
L
W
t
Upper Strain-Gage
Lower Strain-Gage
F
L
Figure 1 Simple Cantilever Beam schematic
Stress Measurement Technique: Figure 2 shows how an applied force, F can be
converted to strain (ε) and corresponding resistance change using dual strain-gages for
measurement. The cantilever beam assumes a semicircular shape because of the applied
force, the top surface of the beam elongates and the bottom compresses. Students should
investigate the design advantage of using two identical strain-gages mounted on either
side of the beam at a fixed point location, noting that either upward or downward
application of vertical force should cause one strain-gage to stretch and the other to
compress.
Upper Strain-Gage
Lower Strain-Gage
F
Figure 2 Cantilever Beam under Load
θ
3
The equation below
o σ (Stress) = (6 x F x L)/(W x t2) N/m
2 (newtons/ square meter)
where applied force, F is measured in newtons (N) where 1N = 0.225 LBs.
o ε (Strain) = σ/E m/m (meters per meter)
where E is the Modulus of Elasticity of the beam material given in N/m2.
shows that the Stress (σ) at a given point is directly proportional to the applied force
magnitude, F and the force distance, L (or the bending moment F.L); and indirectly
proportional to the beam width, W and the square of the beam thickness, t. With all
distance measurements in meters and the force in newtons, the Stress (σ) will be found in
units of newtons per square meter. Since modulus of elasticity, E in newtons per square
meter is known for the beam material, this allows the Strain (ε) in meters per meter to be
calculated. Once this is accomplished, the resulting increase or decrease in the resistance
of the strain-gages can be determined. Conversely, if the strain-gage characteristics (e.g.
GF, Ro, etc.) and resistance changes are known, then the Strain (ε) can be easily
determined from the strain-gages resistance changes, and from which both the Stress (σ)
and F can be calculated using the beam’s E and dimensional values, respectively. As can
be noted from the equations, when the product (W x t2) related to the dimensional
Modulus of the beam is assumed relatively unchanged and the applied force, F is known,
then the Stress/Strain values do linearly increase from zero (at the force application point)
to their maximum values at the fixed pivot point, allowing extrapolation of the
Stress/Strain along the cantilever beam from just a single measurement. Students are
encouraged to investigate similar techniques used in designs of load cells or force
transducers. A robust circuitry incorporating bridge amplifiers, bridge balancing and
temperature compensation techniques, proper signal conditioning and interface need to
be designed to ensure accurate and repeatable measurements of very small changes in
the strain-gage resistances converted to d.c. voltages.
Tilt- Angle Measurement Technique: The Micro Electrical Mechanical Systems
(MEMS) IC technology has resulted in a new generation of MEMS devices to add a wide
variety of functionality to products such as cellphones, PDAs, Automobiles,
GPS/Compass, handheld gaming, pedometers, appliances, etc. These newer MEMS
devices are tilt and motion sensors, commonly known as accelerometers, and are
constructed with no moving parts. The basic principle of operation is based on
differential thermal sensing of a heated gas bubble in a hermetically sealed IC part
(referred to as MEMSic). Constructing of this MEMSic sensor in a standard CMOS
process has significantly lowered cost, thereby opening up a host of applications. With no
moving parts, this thermal-based MEMSic accelerometer sensor is capable of surviving
the high shocks experienced with consumer gadgets (e.g. cellphones), both in the field
and during mass production, since it eliminates the traditional problems of stiction and
particle issues with previous generation of capacitive-based MEMS IC accelerometers. In
addition to the acceleration sensing technology, the MEMSic IC offers “smarts” by
4
incorporating signal processing and conditioning using built-in analog/digital ASIC
designs to deliver stable digital outputs in the form of Pulse-Width Modulated (PWM)
clock stream where the duty-cycles are directly proportional to induced accelerations.
Unlike passive sensors (e.g. strain-gage), these smart MEMS sensors do not require
additional signal conditioning circuits thereby significantly reducing the components
overhead. These transducers do provide for accurate and repeatable measurements, and
are mostly standalone devices directly interface-able to any type of microcontroller. Both
static (gravity and tilt) and dynamic (vibration and motion) accelerations can be reliably
detected with the MEMSic transducers, and the students are urged to research and review
references on MEMSic technology to grasp the principles of operation behind its thermal-
based acceleration sensing and signal conditioning.
The MEMS2125 device is a low-cost, dual-axis (x and y) accelerometer capable of
measuring static and dynamic accelerations with a range of +/- 2g. A common application
of it is in dual-axis tilt or angle sensing. When a tilt angle lies on a vertical plane defined
by the sensing axes and gravitational vector, the absolute inclination angle, θ (referenced
to horizontal) can be measured from any initial accelerometer orientation. Students are
encouraged to review the MEMS2125 specifications and references to properly
understand the geometry of the angle measurements depending on either a horizontal or
vertical position of the MEMSic device relative to the gravitational vector. For the angle
measurement requirement for this Cantilever project, students should confirm that single-
axis inclination is best measured and resolved from a vertical mounting of the MEMSic
device whereby the Ax and Ay accelerometer outputs can be effectively combined to
obtain a good resolution of angles through the full 360° arc range.
α
β
MEMSicAccelerometer
Device
MEMSicAccelerometer
Device
x
y
g
x
y
g
Figure 3 Inclination from Vertical orientation of Device
Students should also verify from Figure 3, the desired inclination angle, θ of the
Cantilever application can be calculated by applying the inverse of the tangent function:-
θ = tan-1
(Ay/Ax) Students should confirm the following:- (1) in addition to providing good inclination
resolution to any angle, the vertical mounting of the device offers other advantages, such
as, errors that are common to both outputs are removed in the signal process of dividing
Ay by Ax ; and (2) possibility of further increase in resolution (through use of tan-1
to
measure angles) by effectively “doubling” the size of the Look-Up-Table (LUT) in the
microcontroller making use the following trigonometric identity:
tan-1
(m) = π/2 - tan-1
(1/m) if m > 0.
5
3.0 OBJECTIVE:
Analyze, simulate, design, implement and test a PIC microcontroller based
instrumentation for a Cantilever beam (Load-cell and Angle) sensing application to meet
the requirement specifications (given in Section 5.0). This design and development
exercise should embody the following:-
Robust analog signal processing and conditioning circuitry for the strain-gage
measurements and conversions to ensure accuracy, resolution and repeatability,
using available single-supply power supplies (+15, +5Vand +3.3V). Review the
PIC EXPLORER 16 specifications to determine appropriate power supply for
the main PIC board to avoid damaging the IC components.
Computational and resource efficient algorithms for the tilt-angle measurement
with desired resolution and update rate.
Well designed software structure and efficient use of the PIC architecture
resources to implement an integrated solution for simultaneous “real-time”
measurements and display of Stress, Force and Tilt-angle parameters.
Seamless execution of the required User functions in “real-time”, per the
specifications.
Properly conceived testing methodologies to validate the measurements.
Well documented source-code and schematics.
Formal technical report.
4.0 SUGGESTED REFERNCES:
ELE744 Lecture Material.
ELE744 Course Text: “Design with Operational Amplifiers & Analog Integrated Circuits”, 3rd Edition, by
Sergio Franco, McGraw Hill, 2002.
ELE744 Course Text: “Programming 16 bit Microcontrollers in C Learningg to fly the PIC”, by Lucio Di
Jasio, Newnew, 2007.
Microchip MPLAB ICD3 and EXPLORER 16 KIT documentation.
“Operational Amplifiers with Linear Integrated Circuits”, Stanley, Prentice-Hall., 2002.
“Transducers: Theory & Application”, Allocca & Stuart, Reston Publishing,
"Microelectronic Circuits", Sedra and Smith, 5th edition, Oxford University Press, 2003.
“Applications of Analog Integrated Circuits”, Soclof, Prentice Hall., 1996
“ A User’s Guide to IC Instrumentation Amplifiers”, App. Note AN-244, & “Error Budget Analysis in IA
Applications” AN-539, www.analog.com
www.parallax.com website for MEMSic technical information and applications.
Appl.-Note-#007 “Inclination Sensing with Thermal Accelerometers” & Appl.-Note-#001 “Accelerometer
Fundamentals” : www.memsic.com/memsic/products/product.asp?product=56
“It’s All About Angles”, Column #92, www.nutsvolts.com.
“Pulse Operations with the 16 bit Micro Experimenter”, Nuts and Volts August 2010 issue Page 46.
“Electronic Angle Measurement”, Circuit Cellar, Issue 179, June 2005, www.circuitcellar.com.
Explorer 16 (1-4), Elektor Jan, Feb, Mar, Apr, 2007, www.elektor-electronics.co.uk.
MEMS2125 Accelerometer datasheets
“Pieces of the Puzzle” & “Measuring Gage Factor”, The Mechanics
www.vishay.com/brands/measurements_group/guide/notebook/e5/e5.html “Cantilever Bending Beam Load Cell” Specifications from Futek Advanced Sensor Technology Inc.,
www.futek.com
6
Datasheets for the strain-gage, IA amplifiers, voltage reference, IPB Board devices in your ELE744 kits, are
available on ELE744 Course website.
5.0 SPECIFICATIONS:
Angle Force Angle & Force
Indicator
LEDs
Push-button
Switches
2-Line
LCD Display
(Momentary action type)
A N G L E = X X X . X ( D E G )
System Block
Diagram
Explorer 162 Line by 16 Character LCD
Proto-Card
LED A LED B LED C
Push Button
Switches
A to D IC1 IC2
Bridge &
Balancing
Circuit
Bridge &
Balancing
Circuit
Instr.
Amplifier
Circuit
Signal
Conditioning
& Level Shift
Circuit
MEMS
2125
Strain
Gage
Voltage
Ref
Circuit
Power Supply
Sources
+5V, +3.3V from
Explorer 16
+15V from Bench
Supply
7
Functional: (Sequence of Operation)
1. On Power-Up, the “Angle” LED should light-up & flash indicating angle
measurement in progress. The LCD display should display Angle in “real-time”,
together with the “live’ bar-chart display corresponding to current angle:-
A N G L E = X X X . X ( D E G )
2. For Force selection, the user momentarily presses the “Force” Push-button to
light-up & flash the “Force” LED, indicating Force measurement. The LCD
display should display Force in “real-time”, together with the “live’ bar-chart
display corresponding to current applied force:-
F O R C E = X X X . X (N o r gms )
3. When the user presses the “Angle & Force” Push-button, only the “Force &
Angle” LED is turned on and flashing, with “real-time” display of the parameters
as shown:
F O R C E = X X X . X (N o r gms )
A N G L E = X X X . X ( D E G )
4. When the user presses the “Angle” Push-button, the cycle reverts to Step 1
above.
8
Electrical/Mechanical:
o Force: Should cover range (in a contiguous manner) to maximum weight of 1 LB or 455 grams
(maximum beam deflection of 0.28mm). Minimum accuracy of +/- 2 %, and maximum drift of <
1%/min at room temperature.
o Angle: Using a separate test-jig, angle range should cover tilt of 0° to 180° (in a contiguous
manner) from the horizontal, with minimum resolution of 0.2°.
o “real-time” Update Rate: Update or refresh rate for all measured values ≤ 12.5 msecs.
o LED “Flashing” Rate: 0.5 second ON, 0.5 second OFF.
o Cantilever Beam: Test jig on each lab bench has the following parameters (refer to the Load Cell
datasheets from Futek for the L, W and T parameters):-
E = 1.48 x 1011
N/M2. (for the steel-alloy beam material)
defl. = 0.30 mm (maximum deflection of the Beam permitted)
Strain-Gages: = (pre-mounted) 17-4PH Stainless Steel; GF = 2.0; Ro = 1000Ω.
o Voltage Reference: The stable bridge excitation voltage should be set anywhere in the range of
5V to 10V d.c. using the 10V Voltage Reference IC provided in your Kit.
o Accelerometer: MEMSIC2125
Refer to Datasheets.
o Microcontroller: PIC24FJ128GA010
Refer to Datasheets and Lab Manual.
o Power Supply: +15V and +5V only.
o Code Requirements: All hardware function for the PIC24FJ128GA010 must use .h and .c files.
For example, ADC initialization and polling functions must be stored in adc.h and adc.c file.
Hardware functions that require interrupts are exempt.
9
6.0 Suggested SYSTEM SPECIFICATION BLOCK DIAGRAM:
Specification Block
Diagram
Explorer 16
2 Line by 16 Character LCD
Push Button
Switches
Angle = xxx.x (DEG)
[][][][][][]------
S3
8 LEDS
D10
S6 S5 S4
D3
Angle Force Angle & Force
PIC24JF128GA010
7.0 Recommended DESIGN PROCESS:
Undertake a thorough background research and analysis work on the sensor
technologies to understand their operating principles and interfacing/conversion
requirements. Analyze and properly understand the functionality and
specifications of the Cantilever Beam project, and then develop a high-level
conceptual design the engineering solution. Understand and analyze the design of
the Explorer 16 board, and make notes on the functionality, role and interfacing
of all the logic devices around the PIC24FJ128GA010 microcontroller.
Identify the critical areas or challenges that would require special attention in the
design and development, and then develop a Project Plan to guide you through
timely implementation per the milestones given.
Fully test the Explorer 16 board and ICD 3 programming interface, see the
tutorials and test procedures included with the kit. Understand the architecture
resources of the PIC24FJ128GA010 (e.g. ICR, OCR, FRC, Timers, Interrupt
structure, I/O, A/D, Output timers, etc.) to formulate a proper software structure
solution for the instrumentation requirements.
1
0
Develop a detailed high-level flow chart or pseudo-code for your software
structure. Keep in mind that while it is prudent to test the Strain-gage and
accelerometer sensors independently, your software structure should take into
account the requirement of concurrent measurements in “real-time”. Also, use of
C's built-in functions (e.g. multiply, divide, trig., etc.) can consume exorbitant
amount of computational resources, and so dedicated in-code algorithm and
table-look-up schemes need to be used to meet the “real-time” specifications. Design, implement and test the push-button switch and the LEDs, together with
your source-code to monitor the switch and drive the LEDs,
Develop the interface and algorithms for the Tilt-Angle measurement. Use the
test-jig provided in the Lab to test your design, and make the appropriate
measurements to validate the specifications.
From your design analysis, use either pSPICE or MultiSIM software package to
capture and simulate your designs for the various analog signal
processing/conditioning circuitry required to accurately measure the Force (and
stress) on the Cantilever beam. Familiarize yourselves with the finer details of the
cantilever beam test jig supplied in the Lab. Compare the simulated results with
your theoretical analysis & predictions. Generate and plot all the relevant signals.
Once the simulation results are verified, draw proper detailed schematics of your
design, and then implement the physical hardware and thoroughly test your
design. Record all measurements.
Once the Angle and Force (or Stress) functions are independently tested, your
source-code should be evolved to integrate both sets of measurements to realize
the full functionality of the instrumentation. Look for opportunities where your
code can be optimized for seamless execution of the functions. Make appropriate
measurements to your integrated design to validate compliance to the desired
specifications.
Prepare a formal technical report as per the guidelines provided in Section 10.0.
One formal report per Lab group is required..
1
1
8.0 MILESTONES, DELIVERABLES & GRADING SCHEME:
Week #
Scheduled Lab
Week of:
Suggested Activities/Milestones/Deliverables
Grade
weight
1 September 3rd
Background research on various technologies, and review of the specification requirements.
Analyze ICD 3 and Explorer 16 hardware. Familiarize self with the PIC MPLAB IDE, see included tutorials, write a C program that uses
the on board LED's, Switch, and LCD to demonstrate effective use of development tools.
Solder headers to Proto Board.
2 September 10th
3 September 17th
4
September 24th
MILESTONE #1
=>
Oral & demo to Lab Instr. during scheduled lab session.:- Fully-functioning Explorer 16 board and proto board populated with
headers .
Sample Test program. Understanding of Explorer 16 board hardware design and use of
MPLAB IDE and debugging techniques (e.g. breakpoints, trace,
single-stepping program, etc.)
Submit at least 3 pages on Explorer 16 board design analysis, and
list of references reviewed on sensor technologies.
20%
5 October 1st
Analysis, design and implementation of accelerometer H/W & S/W to display Angle as per
specifications. Obtain test results. Analysis, design and simulations of strain-gauge circuitry.
6 October 8th
7
October 15th
MILESTONE #2
=>
Oral & demo to Lab Instr. during scheduled lab session:- Demonstrate ANGLE measurement function as per specification. Submit test results, algorithms and source-code listing.
15%
8 October 22th
Implement and test analog circuitry design for strain-gauge, and then interface to
microcontroller. Implement S/W to provide FORCE function per specifications. Continue to work on integrating FORCE & ANGLE functions per specifications.
Continue to work on preparing formal technical report.
9 October 29th
10
November 5th
MILESTONE #3
=>
Oral & demo to Lab Instr. during scheduled lab session:- Demonstrate FORCE measurement functions as per specifications.
Submit test results, algorithms and source-code listing.
25%
11 November 12th
Early-birds can demonstrate final Milestone #4 during this week.
12
November 19nd
MILESTONE #4
=>
Oral & demo to Lab Instr. during scheduled lab session:- Complete demonstration of all functions per specifications.
Seamless execution “in real-time” of all functions, and any enhancements implemented.
Final source-code version to be compiled during the demo. A printed
copy to be submitted to Lab Instructor. Show final schematic, algorithms and test results.
20%
13 November 26th
MILESTONE #5
=>
Formal technical report to be submitted to your lab instructor by
4.30 p.m. on Friday, November 30th .
Only one formal report per group is required.
Reports will be graded as per the marking scheme presented in
Section 9.0.
20%
TOTAL MARK => 100%
Note:
1. A soft copy of all milestone files must be submitted to the TA via email. This includes the
MPLAB IDE project files and a PDF copy of all reports.
2. Support for the MPLAB X IDE will not be provided by the TA and all demonstrations must be
performed using the lab computers. 3. Failure to submit and/or demonstrate the above deliverables as scheduled will result in an
automatic zero mark for each of the missed milestone. No exceptions.
1
2
9.0 FORMAL REPORT MARKING SCHEME:
There is no mark given for directly copying materials from the course notes (or text
books) or the descriptions from the component data sheets. For simplicity, the grading of
the report is based on total unit of 100.
Format: Title, date, index, page number (2)
Proper labelling of results (3)
General neatness and ease of reading (5) ______/20
Technical writing (grammer, spelling, etc.) (10)
Routine Content: Abstract & Objective (5)
Specification Summary (5)
Accurate schematics (5)
Experimental Procedures (5)
Conclusions & Recommendations (10) _______/30
Creative Content: Concise description of operating principles (10)
Theory and design analysis of all circuits,
software algorithms and code optimization. (25)
Measurements & observations (15) _______/50
(tables, waveforms, graphs, etc.)
_______/100
NOTE:-
FINAL REPORT should be limited to 12 PAGES, not including
Appendix section . Marks will be deducted for exceeding this maximum
page limit.
10.0 Suggested REPORT WRITING GUIDELINES:
1
3
o TITLE PAGE
This page includes:- the title of the report; authors’ names; for whom and when the report
was prepared; course name; and Statement of Declaration claiming ownership of the
report content, signed by both authors.
o ABSTRACT
An abstract is a short paragraph summarizing the report. One or two sentences for each of
the following items would be appropriate:
Purpose
Methods
Observations (figures-of-merit)
Conclusions & Recommendations
An abstract can be thought of as an executive summary. The Corporate Executive or your
Engineering Manager may just want to read a short paragraph and to be able to put the
report into context with other related materials without spending much time reading the
whole report. Thus, an abstract requires careful preparation and is the LAST item to be
written in a report. It should be independent and the rest of the report should be written
as if the abstract does not exist.
o OBJECTIVES
A short paragraph states the purposes of the study, and the technical specifications.
o INTRODUCTION
This page (or 2 to 3 paragraphs) explains the initiation of the study (product design), the
problem to be investigated, the approach or the method to be employed for the study.
o THEORY
Provide the theory on the principle of operations of all relevant sensor/transducer
technologies; and the foundational basis for any algorithm created. Develop all
theoretical formulations or explanations for the expected performance of the system
under investigation. Use figures and/or graphs where appropriate.
o DESIGN ANALYSIS
1
4
The proposed system overview of the product should be provided and explained. Explain
the design methodology used, provide detail design analysis and explanations with proper
circuit schematics, algorithms, software structure, etc.
o EXPERIMENTAL PROCEDURE
Describe the methodology and detail the procedures for performing various tests and/or
experiments, for both the Simulations and actual hardware implementation.
o RESULTS & OBSERVATIONS
Record all data in several tables and/or plots. Photographs, oscilloscope tracings and
waveform drawings should be reported in this section for both the Simulations and
hardware designs.
o CONCLUSIONS & RECOMMENDATIONS
It is important to make a precise conclusion of the project based on the Observations.
List the major results together with short explanations and comments. Recommendations
are also necessary in a report. In essence, the reader needs to know from your conclusions
about hoe the project worked and what limitations may be encountered.
o REFERENCES & BIBLIOGRAPHY
List all reference materials in this section.
o APPENDIX
In this section you may want to include a list of component parts used, cover page of any
specialized component, source-code; and whatever else you feel would be useful to the
reader.