Docstoc

Abstract

Document Sample
Abstract Powered By Docstoc
					Pneumatic Tester for Elastomer Durability
                       Design and Analysis


                            May 6, 2005



                      Company Consultants
                         John Arimond
                      Associate Research Fellow
                         Tim Creegan, P.E.
                       Senior Systems Engineer

                         Faculty Advisors
                         Nigel M. Sammes
  UTC Chair Professor of Fuel Cell Technology, Mechanical Engineering
                              Lei Wang
               Assistant Professor, Electrical Engineering

                    Mechanical Engineering
                         Loi Cheng
                       Phillip de Mello
                      Anthony Guarnieri

                      Electrical Engineering
                       Andrew Chemistruck
                             Brain Pile
                          Samuel Yuseph
I. Abstract

The purpose of this project was to design and develop a pneumatic fatigue tester for
Rogers Corporation. The tester was built to be capable of delivering up to a 500 lbf
(2.2kN) preload and 2000 lbf (8.9kN) dynamic load in increments of 10 lbf (44N) while
running at a frequency up to 10 Hz. The linear position resolution is within 0.0001 in.
(2.54*10-4 cm), and the tester has been built for use with circular, as well as rectangular,
elastomer pieces that are 1-2 in. (2.54-5.08 cm) in length, and 0.25-0.5 in. (0.635-1.27 cm)
in thickness. Measurement of the sample‟s deflection is made using a single Linear
Variable Differential Transformer (LVDT) and a load cell was used to measure the load
applied on the sample. Over the past year, the mechanical engineers of Team 9 have
used computer aided design (CAD) models and various mechanical analyses to design
and build this tester. In addition, electrical engineers of the team have developed a
control algorithm and hardware to operate the tester, which can be done through a
graphical user interface on a computer.




                                       Page 2 of 45
Table of Contents                                                                                                               Page

I. Abstract ............................................................................................................................ 2
II. Terminology ................................................................................................................... 5
III. Introduction ................................................................................................................... 6
IV. Mechanical Design ........................................................................................................ 9
   IV. 1 Frame Design ......................................................................................................... 9
   IV. 2 Force measurement - Load Cell ........................................................................... 12
   IV. 3 Displacement measurement - LVDT .................................................................... 13
   IV. 4 Pneumatic System ................................................................................................ 14
V. Electrical Design .......................................................................................................... 17
   V. 1 Power Supply......................................................................................................... 17
   V. 2 Digital Signal Controller ....................................................................................... 18
   V. 3 Valve Control ......................................................................................................... 19
   V. 4 Analog Inputs......................................................................................................... 20
   V. 5 Digital Inputs ......................................................................................................... 21
   V. 6 Control Implementation......................................................................................... 22
   V. 7 Control Algorithm ................................................................................................. 22
   V. 8 User Interface ........................................................................................................ 23
   V. 9 DSC Code Flow ..................................................................................................... 26
VI. Results......................................................................................................................... 27
VII. Summary ................................................................................................................... 29
VIII. Acknowledgements .................................................................................................. 30
IX. References................................................................................................................... 30
   Appendix A Material Properties.................................................................................... 31
   Appendix B Previous Design Considerations ............................................................... 31
   Appendix C Bill of Materials ........................................................................................ 37
   Appendix D Code Listing ............................................................................................. 39




                                                           Page 3 of 45
List of Figures                                                                                                                 Page
Figure 1: Overview of Fatigue Tester ............................................................................... 10
Figure 2: Free body diagram of the cross-member (C4 x 7.25 channel) ...........................11
Figure 3: Load cell and LVDT placement on the Cylinder ............................................... 12
Figure 4: Load Cell Calibration Graph ............................................................................. 14
Figure 5: Piping Diagram of Pneumatic Cylinder ............................................................ 15
Figure 6: Picture of Pneumatic System ............................................................................. 15
Figure 7: Electrical System Diagram ................................................................................ 17
Figure 8: Digital Signal Controller Connections .............................................................. 18
Figure 9: Digital-to-Analog Converter with Valve Scaling .............................................. 19
Figure 10: Analog Filtering with Terminal Connections .................................................. 20
Figure 11: Second Order Butterworth Filter Realized in Sallen-Key Topology ............... 21
Figure 12: Digital Diode Protection .................................................................................. 21
Figure 13: Control Loop Schematic .................................................................................. 22
Figure 14: Control Block Diagram ................................................................................... 22
Figure 15: General Setup Window .................................................................................... 23
Figure 16: Input Waveform Window ................................................................................ 24
Figure 17: Real-Time Test Data Window ......................................................................... 24
Figure 18: PID Tuning Window ........................................................................................ 25
Figure 19: DSC High Level Control Flowchart ................................................................ 26
Figure 20: 1Hz Response with Force Minimum = 500lbs, Force Maximum = 1900lbs, P =
0.5, I = 0.03 ....................................................................................................................... 28
Figure 21: 5Hz Response with Force Minimum = 500lbs, Force Maximum = 1900lbs, P =
1.25, I = 0.04 ..................................................................................................................... 28
Figure 22: 10Hz Response with Force Minimum = 500lbs, Force Maximum = 1900lbs, P
= 1.5, I = 0.06 .................................................................................................................... 29
Figure 23: Static Deflection Analysis on ANSYS ............................................................ 32
Figure 24: Diagram of pneumatic tester with a movable cross-member .......................... 33
Figure 25: Mass Spring Damper System .......................................................................... 34
Figure 26: Deflection vs. Time of Model varying Piston mass using Sine Wave Input ... 35
Figure 27: Change in Capacitance Distance ..................................................................... 36
Figure 28: Change in Capacitance Area............................................................................ 36

List of Tables
Table 1: Fatigue Tester Specifications - Mechanical .......................................................... 7
Table 2: Fatigue Tester Specifications - Electrical .............................................................. 7
Table 3: Bill of Materials .................................................................................................. 38




                                                          Page 4 of 45
II. Terminology

a-           Acceleration (m/s2)
A-           Area (m2)
A/D –        Analog to Digital Converter
C-           Capacitance
CAD –        Computer Aided Design
CMOS –       Complimentary Metal Oxide Semiconductor Logic Family
d-           Distance (in.)
DSC –        Digital Signal Controller
DSP –        Digital Signal Processor
ε-           Permittivity
F-           Force (lbf)
ICD2 –       Microchip In-Circuit Debugger Version 2
I/O –        Input/Output
LVDT –       Linear Variable Differential Transformer
m-           Mass
MOSFET –     Metal Oxide Semiconductor Field Effect Transistor
OSHA-        Occupational Health and Safety Administration
P-           Pressure
PDIP –       Plastic Dual Inline Package
PLL –        Phase Locked Loop
RS-232 –     A serial communication interface that uses standard serial cables to
             connect a computer‟s COM port to a hardware device
SCFM –       Standard Cubic Feet per Minute
SLPM-        Standard Liters per Minute
UART –       Universal Asynchronous Receiver/Transmitter
UL –         Underwriters Laboratory
USB –        Universal Serial Bus
x-           Position




                                     Page 5 of 45
III. Introduction
Rogers Corporation is a manufacturer of specialty materials for applications in wireless
communications, computers and hard disk drives, imaging, transportation and consumer
products. These materials include advanced circuit materials; high performance foams;
and polymer materials and components.        Headquartered in Rogers, CT, it is a global
enterprise with manufacturing facilities located in the United States, Europe, China, and
Korea, and sales offices worldwide.

Polymer materials manufactured by Rogers include elastomeric foams used for printing,
imaging, and transportation applications. Elastomers are specialty polymers with
mechanical properties that are generally similar to natural rubber. They are usually
characterized by their elastic deformation capabilities. For example, a typical elastomer
can deform 800% of its initial length without experiencing any permanent deformation.
Unlike natural rubber, which must be harvested in a slow and difficult manner, elastomers
are synthetic and can be manufactured with ease in large quantities.

In most applications, elastomers are subject to frequent dynamic loads. Under these
conditions, elastomers can eventually wear out and require replacement. In order to
predict their service lifetimes, it is very important to understand its mechanical properties.
Therefore, it is necessary to analyze the behavior of elastomers under everyday use.
Rogers required a means to replicate a variety of conditions similar to that which the
elastomers may experience in application. As a result, a mechanical tester was made to
cycle their elastomeric samples under a variable controlled compressive load and
frequency.

Through the use of this tester, samples of newly developed elastomers can be tested for
hysteresis losses and breakdown that can occur after repeated and extended compressive
loading. These test results can be used to aid in the design of a new product and allow
for an improvement in design and production of an existing product. In addition,
maintenance schedules of equipment with elastomeric components can be developed
using these results.

The design and construction of this tester was the objective of the Team 9 project. It can
apply an adjustable load profile to a sample with a fixed cyclic frequency. As specified
by Rogers Corporation, the tester uses pneumatic actuation to deliver the load.
Actuation parameters include a user selectable maximum and minimum loads at a
specific frequency. Load can be applied to elastomer samples within a specific range of
sizes and geometry. The exact mechanical and electrical specifications are listed in
Table 1 and Table 2, respectively.

Actuation Type                                  Pneumatic
Force Capability – Preload                      Adjustable 0 – 500 lbf (0-2.2 kN)
Force Capability – Dynamic Load                 0 – 2000lbf (0-8.9 kN) in 10lbf (45 kN)
                                                increments
Cycle Frequency                                 1 – 10 Hz
Linear Position Resolution                      0.0001” (2.54*10-4 cm)



                                        Page 6 of 45
Test Sample Geometry (L x W x H)                 Rectangular: (1 – 2 in. x 1 – 2 in. x 0.25 –
                                                 0.5 in.)
                                                 (2.54 – 5.08 cm x 2.54 – 5.08 cm x .637 –
                                                 1.27 cm)
                                                 Cylindrical: (1 – 2 in. diameter x 0.25 – 0.5
                                                 in. depth)
                                                 (2.54- 5.08 cm x .637 – 1.27 cm)
                       Table 1: Fatigue Tester Specifications - Mechanical

Input Voltage                                    110VAC nominal
Electromechanical/Sensor Excitation              5, ±12, 24VDC
Voltage
Microcontroller Supply Voltage                   5V
Power Requirements                               80W
Tester Control                                   On-board Microcontroller with computer
Software Test Computer Interface                 LabVIEW 6.1
User Input Parameters                            Actuation force, cyclic frequency, test
                                                 duration
Output Parameters                                Linear position, force during cycle
                       Table 2: Fatigue Tester Specifications - Electrical

Several user inputs are required to operate this tester. First, the maximum and minimum
force to apply to the sample must be specified. While the specifications state a
minimum load of 0 lbf may be used in a test, in order to ensure accurate test results it is
recommended that a nominal preload be constantly applied to the sample. This will
hold the sample in place throughout the test and help produce accurate and consistent test
results. The tester is capable of producing a maximum of 2000 lbf (8.9 kN) using 80
psig (653 KPa) shop air. The second, an actuation frequency selection from a range of
1-10 Hz is necessary to determine the rate at which load varies from the maximum to the
minimum. Finally the user must select a duration of test, the test duration is usually set in
terms of number of cycles, and the time the test takes to complete depends on the
actuation frequency and the number of cycles selected.

Depending on the user inputs and the sample in place, outputs of varying magnitude are
produced. These outputs include the load on the sample and its displacement from
deformation, at any given time. Although load is an input, it is necessary to have output
of it to confirm that both values match. Displacement, recorded as linear displacement,
is a required output and has a precision up to 0.0001 in. (2.54*10-4 cm)

The tester was built with the intention that it is to be put into regular use by Rogers
Corporation and it was designed with this in mind. As data produced by this tester
potentially can have a significant impact on the outcome of a company project, all
specifications have been met.

Many non-specified factors were taken into great consideration when building this tester.
For example, size and weight were a major constraint. While the goal was not to make
the tester portable, it was kept at a reasonable size and weight, so that it can be


                                         Page 7 of 45
transported with relative ease. The weight of the tester was a compromise between
portability and its effective vibration control. It was necessary for the tester to have a
sufficient weight such that it is stable and does not vibrate at a level that can significantly
affect test results. User friendliness was also a concern, and test operation was made
fairly simple, requiring only a handful of numeric inputs. In addition, ease of
maintenance was achieved through the use of removable parts in the majority of the
system, as well as limiting the total number of parts. Finally, noise concerns due to the
use of pneumatics were addressed with a muffling system to keep the sound to an
allowable decibel level as allowed by Occupational Safety and Health Administration
(OSHA).

In addition to the concerns above, a thorough evaluation was made in several key areas.
First, the frame, which supports the tester, was thoroughly analyzed to ensure there is no
static deformation or dynamic fatigue caused by normal tester operation. Second, the
pneumatic system was extensively examined. While a fairly simple analysis was done
to ensure the pneumatic system will be capable of producing the required force, further
investigation into flow characteristics, compressibility, and time delay of the system were
done in order to implement a proper control algorithm. Third, measurement theory was
another key area under examination. Various changes were made in the data acquisition
system so that the tester can take fast, accurate and precise measurements. In addition,
significant deformation in several parts of the tester was analyzed. These results were
used to develop filters that remove deformation present in other areas of the tester from
appearing in the test results to ensure that only deflection in the sample is measured.




                                         Page 8 of 45
IV. Mechanical Design

This section outlines the final implemented design of the mechanical system of the tester.
This system can be broken down into three main subsystems: the frame, the pneumatic
system, and the measurement system. Overall, the tester was designed to be durable and
capable of supporting numerous tests with little to no maintenance in between.
Economics, machineability, simplicity, durability are just some of the factors that
influenced each design decision. A number of different options were considered for all
of the systems. These design considerations and pertaining analysis can be found in the
appendices.

IV. 1 Frame Design

The framework for the pneumatic tester was designed to be rigid and durable. The
maximum stress in the frame must be below the fatigue stress of the material. Carbon
steel (AISI 1060) was chosen for the main components on the frame. This material has
a strong resistance to plastic deformation and is also machineable. In addition, this
particular type of steel was cost efficient and readily available.

The components in the frame design can be separated into two categories; the main frame
components which were machined and attached together, and the parts responsible for
mechanical operation and measurement. The first set of components include a base
plate, two steel rods 2.5 in. (6.35 cm) in diameter, and two American Standard C Shape
Channels (C4 x 7.25). The second set of components are attached to the main frame and
include a single load cell, a pneumatic cylinder, a Linear Variable Differential
Transformer (LVDT), an air regulator, a muffler, and piping.

The base plate has a surface dimension of 12 x 10.5 in. (30.48 x 26.67 cm), and is 1 in.
(2.54 cm) thick. Along the ends from the longest side are the steel rods which protrude
9 in. (22.86 cm) above the top of the base plate. The rods were dovetailed at the bottom
and the diameter changes from 3 in. at the bottom of the rods, to 2.5 in. (6.35 cm). The
dovetail has a height of 0.5 in. (1.27 cm). The holes in the base were made to match the
dovetail of the rods with the widest radius on the bottom of the plate. The rods were
then inserted from the bottom and permanently welded around the bottom. The main
force the rods must withstand is a tensile force which tries to pull it through the base.
With the dovetail of the rod and the matching holes in the base, a force far greater than
the tester is capable of producing would be required to pull the rods free. In between the
rods is the load cell, and attached to the uppermost 4 in. (10.16 cm) of the steel rods are
two C4 x 7.25 channels lined together with their flat ends facing the supporting steel rods.
The flat ends have a 3 in. (7.62 cm) block behind them with a 2.5 in. (6.35 cm) diameter
hole to allow the steel rods to slide between it. Four bolts were put through the C4 x
7.25 channels and the rods to prevent any further movement. A Unigraphics model of
the pneumatic tester was created and is shown in Figure 1.




                                       Page 9 of 45
                            Figure 1: Overview of Fatigue Tester



In order for the system to function properly, the entire frame was built to resist shaking
through a performed test. The frame was designed to be able to withstand a 2000 lbf
(8.9kN) load from the cylinder, and the base plate was firmly attached to the two
supporting rods which support the cross-member beam. The cross-member beam (C4 x
7.25 channels) support the pneumatic cylinder and the force exerted from actuation. A
free body diagram of the cross member and the forces it would undergo is shown in
Figure 2. A 2000 lbf (8.9kN) load from the cylinder would be distributed over 4 bolts
that hold the cylinder to the cross-member. To ensure a high factor of safety, grade 8
bolts were used when assembling the tester. The bolts are rated to withstand a minimum
of 4,300 lbf (19.1 kN) shearing and 3,300 lbf (14.7 kN) in tension. Since 4 bolts are
used the maximum force in a bolt at a given time is 500 lbf. This gives a factor of
safety against failure in the shear bolts of σs = 8.6 and a factor of safety in the axial
direction of σa = 6.6. Since the factors of safety are so high, the bolts used might appear
to be over-designed. The intent of using bolts far stronger than necessary is to minimize
the deflection that occurs in the bolts. Since each bolt lies right above the center point
of contact between the rods and the member, force vectors have been drawn directly
above these fastening points in the free body diagram. In order to find the deflection in
the beam, the modulus of elasticity and moment of inertia must be known for steel and
the design of the beam.




                                      Page 10 of 45
             Figure 2: Free body diagram of the cross-member (C4 x 7.25 channel)

The properties for steel and the „C‟ shape can be found in Appendix A. With the help of
ANSYS, the maximum deflection in the beam was found to be 6.05*10-5-inch
(1.53*10-4cm), which is an order of magnitude less than the desired linear position
resolution of the tester. [1]

A protective Lexan wall has been placed underneath the C4 x 7.25 channels surrounding
the load cell. This wall will serve as a safety precaution to prevent the operator from
coming in contact with the actuator during operation. The wall completely encompasses
the load cell and actuator. The wall completely segregates the moving parts of the tester
from the operator. The front of the wall is hinged to allow it to open in between tests to
change samples. The wall is to remain sealed during tests.




                                       Page 11 of 45
IV. 2 Force measurement - Load Cell




                    Figure 3: Load cell and LVDT placement on the Cylinder

To accurately measure the compressive force imparted on a sample at any time during the
test, a load cell device is positioned directly below the sample. This positioning allows
the device to experience the same magnitude of load that is imparted on the sample. A
pancake-type load cell made by Honeywell Sensotec was selected. Named according to
its geometry, this type of load cell is well suited for measuring pure compression. It can
accurately read the magnitude of force imparted on its top, rounded surface in a voltage
based scale, which can be converted into units of lbf.      The model used in this tester, the
41, can measure an applied load up to 5000lbf (22.2 kN), which is well over the tester‟s
specified load capability of 2000lbf (8.9 kN). While this load cell is not fatigue-rated,
the cyclic loads imparted on it during operation will not affect its performance over time,
as the load cell will only experience loads at less than half of its maximum capability.

As shown in Figure 3, the load cell is attached on top of a plate that is held to base of the
tester by several bolts. This plate serves several purposes in terms of function and ease
of use of the tester. First, the plate allows easy removal of the load cell from the tester,
which can be accomplished by removing the four bolts that holds the plate down.
Second, the plate is used to adjust the height of the load cell. Due to the actuator‟s
limited 0.25 in. (0.653 cm) stroke, the tester cannot support samples of 0.25 in. and 0.50
in. (1.27 cm) without a method to adjust the location of the sample so that it is in the
stroke range. Therefore, varying plate thickness can be used to raise the load cell and
the sample as well. Either one or multiple plates can be placed between the load cell


                                       Page 12 of 45
and the base to achieve the working height.

The top, rounded surface of the load cell allows it to properly read a point load, as
opposed to reading stress. While this design allows accurate force readouts, it does not
allow for easy sample placement. Furthermore, it is necessary to place the sample
between two parallel flat surfaces to ensure even force distribution. To solve these
problems, a compression platen is placed between the sample and the load cell. This
platen is secured on the rounded surface of the load cell with to three tensile loaded
springs symmetrically placed around platen. One end of the springs is attached to the
platen and the other end is attached to the variable thickness plate, since it was not
possible to perform any machining on the load cell.

Because of the spring secured mechanism, the compression platen is allowed to rotate
slightly in any direction. Therefore, tests can be performed on samples that may not
have perfectly parallel surfaces. However, significantly nonparallel surfaces would
cause an unevenly distributed load and affect the validity of test results. Therefore, the
spring mechanism is not a means to allow testing of samples that poorly conform to the
specified geometry requirement. Since the springs will constantly be stretched to hold
the plate in place, the load cell will always read a small preload. This preload is taken
into account and load outputs are not affected by this factor.

On the platen surface where the sample rests, a recessed surface with a diameter a little
greater than 2 in. and a depth of approximately 0.0015 in. (3.81*10-3cm) was made to
improve sample handling by the user and the tester. First, this recessed surface allows
the user to easily locate the center of the platen, where the sample should rest. Second,
it constrains the sample from potentially sliding away from the center. It is essential for
the sample to be centered on the platen for an even distribution of force to be imparted.


IV. 3 Displacement measurement - LVDT

In order to satisfy the displacement output requirement, a LVDT is used. The LVDT is
composed of a cylindrical housing and an unattached armature that slides freely within
the housing.     A MS3 LVDT from Honeywell Sensotec was selected for this project. It
has a stroke range of ±0.3 in. (0.762 cm) to account for various sample thicknesses. In
addition, it has positional resolution of less than 0.0001 in. (2.54*10-4 cm) with use of a
12-bit analog to digital converter. As with the load cell, the LVDT reads measurements
in voltage-based scale and can be converted in terms of in.

As shown in Figure 3, the LVDT housing is mounted to one of the C4 x 7.25 channels
and the armature is mounted to the pneumatic cylinder through a bracket. The armature
can freely slide within the housing without hindering actuation. This LVDT
arrangement thereby measures the distance traveled by the piston with respect to the
frame. When the actuator compresses a sample, the LVDT measures the deflection of
all the items between the platen and the base, which includes the sample and load cell.
Deflections of the load cell was analyzed and found to vary linearly with force in the



                                      Page 13 of 45
tested range of 0 - 2000 lbf (0 - 8.9 kN). Results of this analysis can be found in Figure
4.

                     0.024



                    0.0235
                                             y = 0.000002322x + 0.018407037
                                                     R2 = 0.998874376
                     0.023



                    0.0225
  Deflection (in)




                     0.022



                    0.0215



                     0.021



                    0.0205



                      0.02
                             0   500                1000                      1500   2000   2500
                                                             Load (lb)


                                       Figure 4: Load Cell Calibration Graph

This result showed that load cell deflection can have a significant contribution to the
LVDT readout. In order to only measure the change in sample thickness, deflection of
the load cell is accounted for by the calibration curve, which is integrated into the
measurement software. This calibration curve is an experimentally produced set of data
containing the deflection of the load cell for any given load in the range of 0-2000 lbf (0 -
8.9 kN). Raw LVDT measurements are adjusted appropriately according to the
calibration curve to produce true deflection values of the sample.

IV. 4 Pneumatic System

The pneumatic system is designed to be mechanically simple. Pressurized shop air is
fed into a pressure regulator for the tester. The regulated air will then feed into a valve,
which will drive a pneumatic cylinder, providing a force on the sample. Figure 5
provides a schematic of the pneumatic system, while Figure 6 shows a picture of the as
built system.




                                                  Page 14 of 45
                                         Exhaust Muffler
                                                                 Pneumatic
                  Regulator                                      Cylinder


      Shop air
      in



                                  Servo Valve


                       Figure 5: Piping Diagram of Pneumatic Cylinder




                                               Servo
                                               valve
                 Regulator



                                                                        Muffler




                                                     Pneumatic
                                                     Actuator




                             Figure 6: Picture of Pneumatic System

The main driving force for the tester is a two-way pneumatic cylinder. The cylinder
used is a heavy-duty short stroke pneumatic cylinder. Rogers has stated that they can
supply compressed air with a pressure of 80 psig (653 kPa). There is a simple
relationship between the pressure supplied and the force applied:




                                        Page 15 of 45
     F  P* A                                                                     (1)

Using Equation (1), the size of the cylinder needed to provide the 2000lbf (8.9kN) was
determined. A 6 in. (15.24 cm) diameter cylinder with a 0.25 in. stroke was chosen.
It is capable of providing the required force, even with some expected losses due to
friction within the cylinder and pressure losses though the pipes, valve and fittings. The
cylinder is a two-way cylinder which can be pressurized on either side of the piston to
provide a compressive or tensile force. When the cylinder is pressurized above the
piston it provides the main compression force for the test. Pressure applied below the
piston relieves the force applied to the sample, which can also put the cylinder in position
to allow sample placement or removal. The cylinder is capable of hundreds of millions
of cycles without maintenance. In addition, the cylinder chosen is a heavy duty model
capable of handling 250 psig (1825 kPa). Because the cylinder can support pressures
much greater than that are used, a long cylinder life is ensured. Thus, it is capable of
supporting the long term tests the machine is intended to perform.

In order to actuate the cylinder at the desired 10Hz frequency, a high performance valve
is used. The valve chosen is a HR/Textron pneumatic servo valve. This high
performance servo valve has response times much lower than 100ms and can be switched
through its full range of motion more than 10 times in one second. Having a valve
capable of operating at a higher frequency than 10 Hz is vital to this project. In fact, it
would be impossible to facilitate the mass transport process into the cylinder if the valve
itself could not operate faster than 10Hz. The HR/Textron servo valve is a 4-way
3-position valve which is capable of directing flow to either side of the pneumatic
cylinder. The valve is proportional, and can shut off the flow it can also throttle the flow
to either side of the cylinder.    A proportional valve allows for different load profiles to
be applied to the sample as well as different cycle speeds.

In order to improve response time, the pipe connecting the valve to the cylinder is
designed to be short as possible. This short distance prevents delays in the airflow from
allowing the tester to operate at 10 Hz. The valve is directly connected to the top of the
cylinder by a nipple. This setup does all but prevent the flow attenuation as a pressure
wave flows through the pipes and into the pneumatic cylinder, since more air needs to
flow into the top part of the cylinder to provide the compressive force than to the bottom
part of the cylinder

To ensure that an adequate pressure is maintained throughout the test, air coming in from
the line will be fed into a regulator before going into the valve. This should prevent
large pressure fluctuations due to others using air while the test is being performed. An
expected flow rate necessary to run the system at 10Hz has been calculated at 35 SCFM.
In order to accommodate this flow rate, 0.75 in. (1.905 cm) diameter pipes are used to
interconnect the parts of the pneumatic system. With such a high possible flow rate an
excess of noise is produced from the exhausted air. To keep the noise to a minimum and
well within OSHA standards, a muffler is place on the exhaust of the valve. All the air
exhausted from the system must go back through the valve and therefore the muffler.
The muffler generates very little back pressure in the system and allows for the high flow
rate while reducing noise by 30 dB.


                                       Page 16 of 45
V. Electrical Design




                           Figure 7: Electrical System Diagram

The electrical hardware system, shown in Figure 7, consists of a power supply, an LVDT,
a load cell, a Digital Signal Controller (DSC), a pneumatic servo valve, and a RS-232
interface between the DSC and the test computer. The electrical software system
consists of assembly code on the DSC and custom LabVIEW software to control the
valve movements. The following sections will detail each component of the system.

V. 1 Power Supply

The design team decided to use the Power-One MAP80-4001 power supply [2] because it
is more reliable and safer than one that could be designed by the team (VDE and UL
approved for office use). The power supply has short circuit protection on each of the
four outputs: +5V, ±12V, +24V. The +5V output was used to power the DSC and the
single supply operational amplifiers. The ±12V output was used to power the valve
scaling operational amplifier and the LVDT. The +24V output was used for the load cell
and valve excitation power.




                                     Page 17 of 45
V. 2 Digital Signal Controller




                       Figure 8: Digital Signal Controller Connections

Figure 8 shows the connections to the RS-232 DB-9 connector as well as the inputs used
in the A/D converter. In addition, there is a 6MHz crystal used to generate the clock
signal for the DSC to allow for in-circuit debugging. The electrical design team picked
the Microchip dsPIC30F3013 DSC [3] because of the following features:

      Single Supply Operation at 5V
      One clock multiplication and 18 clock division operations
      Integrated Universal Asynchronous Receiver/Transmitter (UART) controller for
       RS-232 communication with the test computer
      Integrated Serial Peripheral Interface (SPI) that was used for communication to
       Digital-to-Analog Converter (D/A)
      12-bit Analog-to-Digital converters (A/D)

This DSC has few required electrical excitation connections for operation: the DSC
operates from a single +5V supply, which makes system integration simple because the
power supply requirements are very relaxed (no supply ramping requirements). There is
a separate voltage reference on the DSC for the A/D converters that is tied to +5V
(separate from the digital +5V) to avoid noise caused by digital switching being coupled
to the A/D channel.

The DSC can do multiplies very quickly, which reduced the system computational delays
to allow for the control output to be applied with negligible delay. Standard
microcontrollers take over 400 clock cycles to do 18-bit multiplication because of the
large number of comparisons and additions required. Because of the increased speed of



                                      Page 18 of 45
multiplication and division, the chip has no problem sampling and sending the data back
to the test computer at 500 Hz.

The integrated UART controller allows for easy interface with the test computer system
using RS-232 communication protocol. A Maxim MAX232A interface chip [4], which
can provide up to 200kbps (kilobits per second), is used to provide the voltage translation
between the CMOS levels of the DSC and the RS-232 standard voltages. The current
system uses 115.2kbps to communicate between the test computer and the DSC.

V. 3 Valve Control




                     Figure 9: Digital-to-Analog Converter with Valve Scaling

As shown in Figure 9, the SPI interface was used because the Texas Instruments
TLV5616 D/A [5] required three wires to interface to the DSC instead of 13 for a parallel
load of data (12 data lines and one update line). The DSC has means of supporting
many different types of implementations of the SPI standard and the DSC output is done
with a dedicated hardware module so system operation is not affected. The D/A uses
Framed Mode SPI, which has a free running clock and the Slave Select Input line (SSI) is
used to trigger the start of the data reception on the Serial Data Input (SDI) of the D/A.
This mode allows for ease of synchronization between the DSC and D/A for data transfer.
One problem with this D/A was that the output voltage only spanned between 0V and
4.5V. To get around that, a special voltage reference circuit was constructed using a
potentiometer (buffered from the D/A and level shifting amplifier) to adjust the output
voltage into the range of -5V to +5V. The shifting amplifier is a simple difference
amplifier with the following equation:
      2.72 VD / A  1.83V                                                             (2)
Thus, the D/A will output a voltage between 0V and 3.66V (twice its reference) and this
will be shifted to the -5V to +5V range as required by the valve.




                                         Page 19 of 45
V. 4 Analog Inputs




                     Figure 10: Analog Filtering with Terminal Connections

Figure 10 depicts the analog filtering and diode clamping required for proper A/D
conversion while operating in the recommended voltage ranges for the DSC. The Texas
Instruments OPA2340 operational amplifiers [6] have diode protection for the inputs
already incorporated into the chip, which will compensate for overstress and special
buffer stages have been included to protect the sensors from excess current drive.
Diodes D1 and D2 are included to ensure that the voltage stays within -0.3V to 5.3V so
that the DSC does not become damaged by failures in other components.

According to [7], the Nyquist Sampling Theorem requires the system to sample the signal
at least twice as fast as the desired frequency to detect. However, the Nyquist Theory
assumes ideal sampling and because the DSC uses a sample-and-hold algorithm, there is
an added time delay that needs to be accounted for. Therefore, the implementation used
an excessive sampling rate to avoid time delays caused by anti-aliasing filtering. To
estimate the required sampling frequency, the following approximations for calculating
the sampling frequency apply:

            2.5
     n                                                                            (3)
             tr
     and
      1      12.5
         10 n                                                                     (4)
      h     2  tr

where tr is the rise time of the signal, ωn is the natural frequency of the system, and h is
the sampling period (refer to [7]). The tester is required to operate at 10Hz, which
corresponds to a 10-90% rise time of 16ms. Using Equation (4), the approximate



                                        Page 20 of 45
required sampling frequency is 250 Hz; however, to account for uncertainty, 500 Hz was
selected to provide a safety margin for control.


                                                            C2

                                                            +12V



                Vin                                     +
                          R1            R2
                                                                           Vout
                                             C1
                                                        -



                                                            -12V




           Figure 11: Second Order Butterworth Filter Realized in Sallen-Key Topology

Two second order anti-aliasing filters per input were constructed based off the circuit
shown in Figure 11. There are simple equations that describe the relationships between
the components to generate a Butterworth response.
                    1
      R1 R2                                                                            (5)
              4 f 3dB C1C 2
                2 2




                        C2
     R1  R2  2 R1 R2                                                              (6)
                        C1
Using Equations (5) and (6), we can determine what R1 and R2 should be by picking C1 =
47nF and C2 = 100nF and using the Quadratic Equation. A cutoff frequency of 78 Hz
was selected since when cascaded, the total filter cutoff was 62 Hz (experimentally
verified using PSPICE), which is approximately ¼ of 250Hz. This was done in the
event that the lower sampling frequency was adequate for sinusoidal reproduction since
the sampling frequency in the DSC is easy to change and the pertinent signal information
is contained near 10 Hz.

V. 5 Digital Inputs




                               Figure 12: Digital Diode Protection

As shown in Figure 12, the DSC requires diode clamping so that the voltage does not


                                        Page 21 of 45
 exceed -0.3V and 5.3V. Therefore, the digital signals are fixed in this range and the
 control software checks the state of the digital inputs and takes appropriate action (i.e.
 disabling the tester and venting the cylinder).

 V. 6 Control Implementation

 This testing machine uses pneumatic actuation to apply a cyclic load to an elastomeric
 sample. The desired loading profiles, specified by the user, are created with a
 closed-loop control system involving a servo-valve, a compression load cell, an
 embedded digital signal controller, and a test computer. A simplified schematic for the
 interconnections of these elements are shown in Figure 13. The test computer logs the
 testing data and uses the information to generate the required control signal, which is sent
 to the DSC. This is done with a graphical user interface designed in LabVIEW 6.1.
 The DSC samples the sensors and sends the control voltage to the servo-valve via the
 D/A.


                                                  D/A

                      RS-232
                                     Digital Signal
                                      Controller


                                                          A/D


                               Figure 13: Control Loop Schematic

 V. 7 Control Algorithm

 A classical proportional-integral (PI) controller is used to obtain the desired response
 from the tester. A block diagram of this system is shown in Figure 14.

              e(n)
        +
                            K                +               u(n)                    f(n)
r(n)                        P                           P               G(z)
        -                   P                +          K
                            UI


                K=e(n)
                UI=Ie(n)+UI(n-1)
                                Figure 14: Control Block Diagram




                                        Page 22 of 45
In Figure 14, r(n) is the reference input generated in the LabVIEW interface, e(n) is the
error signal, u(n) is the control signal created by the PI controller, and the system output
f(n) is the force applied to the testing sample. The gain P and the integral gain I are
adjustable via the LabVIEW interface. Because the tester uses pneumatic actuation, the
tester system dynamics are nonlinear. Therefore, at different operating frequencies, the
gains P and I need to be tuned to achieve the desired response. In addition, operating
over different amplitudes and offsets requires the gains to adjusted as well. Therefore,
the operator will have to tune the parameters at the beginning of each test since they are
highly sensitive to the specific test requirements.

V. 8 User Interface

The user interface for this testing machine was developed in LabVIEW 6.1. The
interface is composed of the following features:

      General Setup (Figure 15)

       In this section of the GUI the user may enter general test parameters along with
       descriptive information regarding the material to be tested. Such parameters are:

                      Test Duration
                      Sample Attributes
                                  o Material Type
                                  o Shape
                                  o Dimensions
                      Testing Data Save Path




                              Figure 15: General Setup Window

      Reference Profile Generator (Figure 16)

       This feature of the GUI allows the user to create a cyclic loading profile. The
       profile is the sinusoidal force reference function, r(n), with the following user
       specified attributes:


                                       Page 23 of 45
                   Minimum/Maximum Applied Force
                   Loading Frequency (10Hz Max)
                   Signal Offset




                          Figure 16: Input Waveform Window

   Output Waveform Display (Figure 17)

    In this window the real-time testing data is plotted. The force applied to the
    sample is shown in white and the sample displacement is shown in red. In
    addition to plotting the data in real-time, the test data is also saved to a .CSV file
    that is specified in the general setup tab by the user.




                        Figure 17: Real-Time Test Data Window




                                    Page 24 of 45
   PI Controller Tuning Window (Figure 18)

    This window is always available. Here, the user can perform the PI tuning
    process required to achieve a desired system response. This is done by adjusting
    the gains P and I accordingly. The signal offset also plays a role in tuning the
    controller. In addition to the tuning parameters, the user can also switch between
    open-loop and closed-loop operation. Also, when restarting a test that has been
    previously halted, it is often required that the integral portion of the control be
    cleared prior to restarting. Built up integral control values can cause the tester to
    behave erratically upon restart and should always be cleared in such a case.




                            Figure 18: PID Tuning Window




                                   Page 25 of 45
V. 9 DSC Code Flow




                        Figure 19: DSC High Level Control Flowchart

As can be seen in Figure 19, the DSC code is broken down into simpler modules that
allow for greater code reuse. In addition, there are interrupt service routines for actions
that can take a long time to perform. By using these routines, the processing core is free
to execute other code while it waits for the slower peripheral processes to complete their
tasks. As currently implemented, the DSC allows the user to specify the 12-bit D/A
output in a raw voltage value followed by a carriage return using the following mapping:
                                   0.000  0x000  -5V
                                   2.500  0x800  0V
                                  4.999  0xFFF  +5V
This mapping allows for easy control of the valve from Microsoft‟s Hyper Terminal
program in case the LabVIEW interface is not functioning correctly. After being


                                       Page 26 of 45
converted to the raw HEX value, the data is sent over the SPI to the D/A. In addition,
the DSC uses a double buffered receive in case the control code takes longer than the
time required to receive one character over the UART (the minimum time would be 69
μs). A/D samples are taken at 500 Hz and transmitted over the UART link back to the
test computer so that it can calculate the required valve output parameter. The sampling
process is started by using Timer3 to generate an interrupt to begin sampling. Then the
A/D module generates an interrupt to signal that sampling is completed and the data
should be stored and a flag is set. In the main loop, the flag triggers the data to be
converted to raw voltage values in ASCII representation and then it is sent back to the test
computer. The code for the DSC was written with the help of references [3,8-10].


VI. Results

Rogers will use this tester to determine how their elastomers react to a repeated cyclical
force applied over time. The data collected by the tester was compared to that obtained
from an Instron servo hydraulic fatigue tester at 10 Hz with a sinusoidal load from 500
(2.2kN) to 2000 lbs (8.9kN) in November of 2004. The sample in the Instron
experienced a maximum displacement of 7 mils (0.178mm). The servo pneumatic tester
applied forces that ranged from 400 lbs (1.8kN) to 1900 lbs (8.5kN) and the sample
encounter a maximum cycle displacement of nearly 8 mils (0.203 mm). The closeness
in deflection measured by both machines builds confidence in the data collected from the
student-built machine, especially since the Instron LVDT was oversized since they did
not have a very accurate LVDT available.

The tester was required to run at frequencies from 1-10 Hz. To demonstrate that the
requirements have been met, data was taken at 1, 5 and 10 Hz as shown in Figure 20,
Figure 21, and Figure 22 respectively. The flat line at the beginning of the 1 and 5 Hz
test were caused by the soft start software that avoids slamming the sample. At all
frequencies, the sample displace was sinusoidal with amplitude of about 8 mils
(0.203mm). Over time, there might be a change of displacement based on frequency or
duration of compression, but is not noticeable in these plots because of the short
durations of the tests. The force applied also appears to be sinusoidal and looks fairly
repeatable over the duration of the tests that were conducted. The test computer used to
capture this data was a Pentium IV 2.4 GHz with 256 MB RAM.




                                      Page 27 of 45
Figure 20: 1Hz Response with Force Minimum = 500lbs, Force Maximum = 1900lbs, P = 0.5, I = 0.03

As shown in Figure 20, the control parameters for the 1 Hz case appear to be rather small
for the system to satisfy the sinusoidal force profile above. This is good because the
system responds well to very fast frequencies. In addition, the force and displacement
profiles look rather sinusoidal, which matches very well with the reference sinusoidal
signal.




 Figure 21: 5Hz Response with Force Minimum = 500lbs, Force Maximum = 1900lbs, P = 1.25, I =
                                           0.04

As shown in Figure 21, the gain for the 5 Hz case is much higher in terms of the
proportional control, but the integral control remains close to the 1 Hz case. Again the
desired load profile is close to being attained and the response is approximately
sinusoidal.




                                        Page 28 of 45
 Figure 22: 10Hz Response with Force Minimum = 500lbs, Force Maximum = 1900lbs, P = 1.5, I =
                                           0.06

As shown in Figure 22, the control parameters for the 10 Hz case are rather close to the 5
Hz case, which makes it easier to tune the faster systems. There were some issues with
using these parameters when starting the system, so the operator will have to start at low
P gain and work up to the gains shown above. The main problem is that the integral
saturates very quickly, so a better PI algorithm could be used to improve the system
performance.

VII. Summary

The purpose of this project was to design and build a compressive fatigue tester to be
used by Rogers Corporation to test their newly developed elastomers. The tester will
use pneumatics to provide a cyclic compressive load on a sample. The samples will
have a variety of sizes and geometries so the tester is adaptable to handle all geometries.
The tester makes use of shop air all ready available to run its pneumatic system. Using
the shop air the tester is capable of applying a 2000 lbf (8.9 kN) compressive force on a
sample at up to 10 Hz. The force is produced by a pneumatic cylinder; a servo valve is
used to direct the flow into the cylinder. A rigid frame was designed and built using
steel. Deflection measurements are made to within 0.0001 in. (2.54*10-5 cm) using a
LVDT mounted to the frame and the piston rod. A load cell placed underneath the
sample measures the actual force output of the cylinder each cycle. The servo valve is
controlled using a custom control board equipped with a digital signal controller (DSC).
The control board allows for the control algorithm computations done on the test
computer to be sent directly to the valve for control. The test computer is interfaced
with the control board and is used primarily for data logging, control calculations, and
real time graphing. The operator sets the test up using a simple graphical user interface
that allows for the user to adjust compressive force applied, cyclic frequency, and test
duration.




                                       Page 29 of 45
VIII. Acknowledgements

The electrical team would like to thank Victoria Hatem for letting them use her laptop
and bringing food when they were working on the project.

IX. References

1      Shigley, J., Mischke, C., Budynas, R., Mechanical Engineering Design Seventh
       Edition, 2004.
2      Power-One, “MAP80 AC/DC Series Data Sheet,” 1 January 2005,
       <http://www.power-one.com/resources/products/datasheet/map80.pdf>
3      Microchip, “dsPIC30F2011, dsPIC30F2012, dsPIC30F3012, dsPIC30F3013
       Datasheet,” 11 November 2004,
       <http://ww1.microchip.com/downloads/en/DeviceDoc/70139C.pdf>
4      Dallas Maxim, “+5V-Powered, Multichannel RS-232 Drivers/Receivers,” 1
       November 2004, <http://pdfserv.maxim-ic.com/en/ds/MAX220-MAX249.pdf>
5      Texas Instruments, “TLV5616C, TLV5616I 2.7V to 5.5V Low Power 12-bit
       Digital-to-Analog Converters with Power Down,” 1 December 2004,
       <http://focus.ti.com/lit/ds/symlink/tlv5616.pdf
6      Texas Instruments, “OPA340, OPA2340, OPA4340 Single Supply, Rail-to-Rail
       Operational Amplifiers MicroAmplifier Series,” 10 November 2004,
       <http://focus.ti.com/lit/ds/symlink/opa2340.pdf>
7      Kleinman, D., Class Notes for a Comprehensive Course on Digital Control:
       Classical and Modern Design Approaches, Storrs: University of Connecticut,
       1992.
8      Microchip, “dsPIC30F Family Reference Manual,” 11 November 2004,
       <http://ww1.microchip.com/downloads/en/DeviceDoc/70046c.pdf>
9      Microchip, “dsPIC30F Programmer‟s Reference Manual,” 11 November 2004,
       <http://ww1.microchip.com/downloads/en/DeviceDoc/70030f.pdf>
10     Microchip, “dsPICDEM Starter Code and Information,” 3 February 2005,
       <http://ww1.microchip.com/downloads/en/DeviceDoc/dsPICDEM_SBD.zip>




                                      Page 30 of 45
Appendix A Material Properties

Properties of Steel:
Modulus of Elasticity  E  30 106 psi (207GPa)

Properties of „C‟ Shape Beam
Area  A  2.13 in 2 (13.74cm2 )
Flange Width  b f  1.721 in (4.3713cm)
Flange Thickness  t f  0.296 in (.6833cm)
Web Thickness  tw  0.321 in (.8153cm)
Inertia X Axis  I x  4.59 in 4 (191.1cm 4 )
Inertia Y Axis  I y  0.433 in4 (18.02cm4 )

Appendix B Previous Design Considerations

Frame Design

To ensure that the frame can withstand the specified load of up to 2000 lbf (8.9kN)
without causing measurement errors, a static deflection analysis was done in ANSYS. A
simple model was created containing 3 elements representing the two 2.5 in. (6.35 cm)
diameter cylindrical columns and the C4 x 7.25 channels connecting them. A force of
1000 lbf (4.5 kN) are placed near each the columns to simulate the loads on the bolts,
which connects the actuator to the channels. Figure 23 shows the ANSYS output of the
deformed frame under load. A maximum deflection of 6.05*10-5 in. (1.536*10-4 cm)
confirms that the frame can withstand the load requirements.

In the previous frame design (Section IV- I), the C4 x 7.25 channels were originally
intended to move up and down the supporting steel rods to accommodate different
sample sizes. Although this method was the method of choice for similar commercial
grade pneumatic testers, it was found to add unnecessary complications for this project.
When the height of the channel needed to be changed, bolts would have to be loosened
and the user would need to adjust the height by hand or with the help of the cylinder fully
extended. In order for the test to be performed properly, the user would have to make
sure the channels were perfectly aligned each time the height was modified. Also, since
the channels were held in place using only friction, there was a higher chance of failure
overtime when comparing this method to the current one. A diagram of the earlier
design can be found in Figure 24.




                                        Page 31 of 45
Figure 23: Static Deflection Analysis on ANSYS




               Page 32 of 45
              Figure 24: Diagram of pneumatic tester with a movable cross-member

Load Cell

As the previous design used a movable cross member as shown in Figure 24, the load cell
was initially designed to be fixed on the base plate. Fixing the load cell to the base
rather than to the actuator prevented reduced the total inertia in the moving components
and allow for faster response rates. Having a stationary load cell makes the force
sensing far more simplistic. If the load cell were moving an accelerometer would be
needed in addition to the load cell to account for the load cells inertia as it moves with the
cylinder. The readings from both the accelerometer as well as the load cell would then
need to be combined to get the actual force applied to the sample. Using both an
accelerometer and a load cell would bring in an additional source of uncertainty which is
both undesired, and also, unnecessary. In addition, several load cell options were
available initially. The pancake and the beam deflection types were explored. The
pancake type was found to be more suited for this project since deflection in the bending
type load cell would cause the sample to not be fully horizontal during the test, which
would bring difficulties in deflection measurements.

Pneumatic System

When designing the pneumatic system many options were considered. One of the first
choices made was to use a double acting cylinder instead of a spring return. The double


                                       Page 33 of 45
acting cylinder was chosen for a number of reasons. The spring return would not just
provide force to pull the cylinder back, but it would also resist the cylinder pushing on
the sample. This force induced by the spring would add to the size of the cylinder
necessary to overcome the force. The spring return also made control of the cylinder
significantly more difficult, the sample would not deform the same distance every cycle
and therefore a different return force would be imparted on the cylinder. The spring
return would also change the natural frequency of the setup, and it would oscillate at its
natural frequency with the forcing motion superimposed. This would not be desirable,
as it would lead to an irregular force profile during the test. A spring return cylinder
was just not feasible for the project so a double acting cylinder, which could be
pressurized from either side, was chosen.

Sizing of the cylinder and operating pressure created important design tradeoffs that had
to be explored. From Equation (1), a relationship between pressure force and piston size
was determined. In order to reduce the inertial effects of the mass of the piston, a small
piston size was desired. Compressed air at 80 psig, which can be found in Rogers
facilities, would require a 6-inch (15.24 cm) diameter piston size in order to produce the
2000 lbf (8.9 kN) required force. In order to reduce the size further a boost of pressure
would be needed. Using the ideal gas law an approximation of the mass flow rate
needed for the tests was determined to be 30 SCFM (850 SLPM). Passive pressure
boosters would only be able to handle 6-8 SCFM (170 – 227 SLPM), which is far below
the needed flow rate. Using multiple pressure boosters would complicate the system
excessively and lend itself to failure. A dedicated compressor for the system was also
considered. However, prices for systems that would allow a 4-inch (10.16 cm) diameter
bore to be used at the required flow rate were prohibitively expensive. A mathematical
model of the dynamic system was developed as a mass spring damper system. Figure
25 represents the force supplied by the air pressure on the piston. The mass of the
piston is represented by m. The elastomer being tested is represented by the spring with
spring constant k. The damper b represents the friction for in the cylinder and the
damping within the elastomer.




                           Figure 25: Mass Spring Damper System




                                       Page 34 of 45
     F  m x  b x kx                                                             (4)

This model was used to determine the relative magnitude of the inertial effects of the
pistons in order to determine if the cost of a compressor could be justified. The results
show that with the mass varying between 2 kg and 20 kg there is little effect on the
response of the system (Figure 26). The system with the larger mass takes slightly
longer to reach steady state and then behaves the same as the smaller system. Therefore
the cost of a compressor in order to use a smaller cylinder is unjustified. The decision
was made to use the 6 in. (15.24 cm) bore cylinder in conjunction with standard 80 psig
shop air.




        Figure 26: Deflection vs. Time of Model varying Piston mass using Sine Wave Input

Once the cylinder was chosen the control method of the cylinder could be chosen. The
initial choice was between servo and solenoid valves. The choice to use servo valves
was made because they provide the fastest response for a proportional valve that can
handle a large flow rate. The inertial effects of the motor in a servo valve were also of
concern in selecting which type of valve to use, however the inertial effects were found to
be quite small and would not significantly affect the performance of the valve. Another
consideration was the type of valve or valves to use. It is possible to use one 4-way
3-position valve, or two 3-way 2-position valves. Using two valves had the distinct
disadvantage of trying to control two valves, the valves would not perform identically
and then the control algorithm would be much more complicated. In addition there is
added chance for leaks with a more complicated pneumatic system. The 4-way
3-postion proportional spring return valve was chosen. A 4-way 3-position valve is
capable of directing one input flow to either of two outputs, while draining the output the
input is shut off. It is ideal for controlling a double acting pneumatic cylinder as it will
easily direct the flow to either side of the piston controlling its force and position.

Capacitive Linear Displacement Sensing



                                        Page 35 of 45
Linear displacement can be sensed using capacitive based methods. These techniques
are implemented by monitoring a reference capacitance that is proportional to the desired
displacement. Equation 5 gives the parallel plate capacitance, C, as a function of the
permittivity, , the plate common area, A, and the distance between the plates, d.

          A
     C                                                                        (5)
          d


Available capacitive displacement sensors change the reference capacitance by varying
any of the three parameters in Equation (5). The methods utilizing change in the
distance d or change in the common area A are shown below in Figure 27 and Figure 28.




                         Figure 27: Change in Capacitance Distance




                           Figure 28: Change in Capacitance Area

The method shown in Figure 27 would be the best capacitive method for sensing the
displacement of a sample under compressive loading. However, the permittivity of an
elastomer is changed when a compressive force is applied. The reference capacitance
would then be a function of distance and the permittivity, which would complicate the
implementation of capacitive sensing in the design considerably. Since the permittivity
of elastomers changes under compression, capacitive displacement sensing is not suitable
for this design.


                                      Page 36 of 45
           Appendix C Bill of Materials

                     Item                              Make                   Model                    Supplier        Price
Servo pneumatic valve                         HR/Textron            27G50F-1E01-995             Fluid Power Products $3,295.00
Pneumatic cylinder                            Galland Henning Nopak Class P6                    Fluid Power Products  $418.12
Subplate for servo valve                      HR/Textron            25001024-001                Fluid Power Products  $275.00
Valve mating connector                        HR/Textron            MS3106E14S-2S               Fluid Power Products    $55.00
Metal for base                                                      1-inch thick steel plate    Local                   $50.00
2.5 dia. Steel poles                                                1045 steel 3ft 2.5in dia.   Local                   $80.00
Sheet metal for housing                                             Misc                        Local                   $20.00
Pressure vessel (20gal steel tank max 160psi)                       1814K83                     McMaster Carr         $163.21
Pipes                                                               Misc                        Local                   $30.00
Fittings                                                            Misc                        Local                   $50.00
Bolts                                                               Misc                        Local                   $10.00
Metal for cylinder support (crossbar)                               C4 x 7.25 Channel           Local                 $100.00
Metal for compression platens                                       Manufactured at Rogers                               $0.00
Lexan                                                                                           Local                   $40.00
Teflon Tape                                                         Misc                        Local                    $5.00
Paint                                                               Misc                        Local                   $10.00
Load Cell                                     Sensotec              41                          Sensotec              $700.00
Load Cell In-line amplifier                   Sensotec              008-0296-00                 Sensotec              $300.00
Load Cell Cabling                             Sensotec              AA123                       Sensotec                $55.00
LVDT                                          Sensotec              MS3HM                       Sensotec              $386.00
LVDT                                          Sensotec              MS3HF                       Sensotec              $485.00
Power Supply (+5V, +12V, -12V, +24V)          Power-One             MAP80-4001                  Digikey               $200.00
Digital Signal Controller                     Microchip             dsPIC30F3013-20I/SO         Digikey                  $9.53
1k Resistor 1%                                Yageo                 MFR-25FBF-1K00              Digikey                  $0.54
1.1k Resistor 1%                              Yageo                 MFR-25FBF-1K10              Digikey                  $0.54
3k Resistor 1%                                Yageo                 MFR-25FBF-3K01              Digikey                  $0.54
10k Resistor 1%                               Yageo                 MFR-25FBF-10K0              Digikey                  $0.54
10k Potentiometer                             Panasonic             EVN-D8AA03B14               Digikey                  $0.35
23.2k Resistor 1%                             Yageo                 MFR-25FBF-23K2              Digikey                  $0.54
38.3k Resistor 1%                             Yageo                 MFR-25FBF-38K3              Digikey                  $0.54
22pF Capacitors 5% COG                        Kemet                 C410C220J1G5CA7200          Digikey                  $0.58
47nF Capacitors 10% X7R                       Kemet                 C430C473K1R5CA7200          Digikey                  $1.88
0.1uF Capacitors 10% X7R                      Kemet                 C0603C104J4RACTU            Digikey                  $3.76
Rail-to-Rail Op Amp                           Texas Instruments     OPA2340UA                   Digikey                  $8.37
Precision High Voltage Op Amp                 Texas Instruments     OPA2277UA                   Digikey                  $3.53
ESD Protection and Clamping Diode             On Semi               BAT54SLT1                   Digikey                  $1.82
12-bit D/A Converter, SPI                     TI                    TLV5616CD                   Digikey                  $5.20
DB9 Socket                                    Norcomp               190-009-262-001             Digikey                  $2.15
6 MHz Crystal Oscillator                      Citizen               HC49US6.000MABJ             Digikey                  $0.70
RS-232 Interface Chip                         Maxim                 MAX232ACPE                  Digikey                  $5.51
6P6C RJ11 Jack                                Molex                 95001-2661                  Digikey                  $1.74
5-position Terminal Block                     Phoenix Contact       1725685                     Digikey                 $11.52
8-position Terminal Block                     Phoenix Contact       1725711                     Digikey                  $4.61
Perfboard                                     Waldom/GC             22-510                      Cables and Connectors    $6.99
15ft 4-conductor 18 AWG shield cable          JSC                   6152-0500GRY                Cables and Connectors    $7.20
10ft 9-conductor 24 AWG shield cable          JSC                   6627-0500                   Cables and Connectors    $4.20
Electrical Enclosure                          Philmore              1411XU                      Cables and Connectors   $26.99
Power Switch                                  Philmore              30-10059                    Cables and Connectors    $4.99



                                                       Page 37 of 45
Panel Mount Fuse Holder            Philmore               525              Cables and Connectors      $2.79
1.5 A 5x20mm Fuses                 Philmore               EF1015           Cables and Connectors      $1.99
#6-32 Screws & Nuts                Philmore               10-106, 10-016   Cables and Connectors      $2.49
3-prong AC Outlet Plug with Wire   Compaq                 61-2868          Radio Shack                $4.99

Grand Total                                                                                        $6,845.45
                                         Table 3: Bill of Materials




                                              Page 38 of 45
Appendix D Code Listing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; File Name: Rogers.s                                                         ;
; Author: Andy Chemistruck (University of Connecticut)                        ;
; Date Created: March 6, 2005                                                 ;
; Last Modified: May 2, 2005                                                  ;
; Changelog:                                                                  ;
; April 25, 2005: Changed sampling frequency to 500 Hz                        ;
; April 20, 2005: Completed UART RX State Machine                             ;
; April 16, 2005: Completed Raw Voltage Output on UART                        ;
; March 16, 2005: Verified operation of UART module and attempted to debug    ;
;     A/D and timers with limited success                                     ;
; Design Notes:                                                               ;
; --Fcy is 1/4 the oscillator frequency with PLL                              ;
; --Load Baud Rate Generator for UART with 12 for 115,200bps                  ;
; --Maximum Baud Rate is 115,200bps for this module (because of 232 chip)     ;
; --Load Timer1 PR1 with 48000 to generate 500 Hz sampling                    ;
; --Most of the work is done with ISR-triggered events                        ;
; --Double buffered UART RX machine to allow for simutaneous data processing ;
; Description:                                                                ;
;    Provides all the software control for the pneumatic tester               ;
;    and sends data back to the data logging computer over RS-232.            ;
;    The data logging computer can enter what specific setpoints              ;
;    should be and determine the logging rate.                                ;
; MPLAB Software: MPLAB 7.1.0 with MPASM30 for dsPIC30F3013                   ;
; Code template and concepts taken from example code provided by Microchip. ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Program Initialization                                                      ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    .equ __30F3013, 1
    .include "p30f3013.inc"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Interrupt Service Routine Handlers                                          ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    .global   __reset              ;Reset Subroutine
    .global   __T3Interrupt        ;Timer3 Interrupt Handler
    .global   __ADCInterrupt       ;A/D Interrupt Handler
    .global   __U2RXInterrupt      ;UART2 RX Interrupt Handler

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Equivalence Declarations                                                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    .equiv   Control, 0            ;Calculate control output with new samples
    .equiv   UTX, 1                ;UART TX event
    .equiv   URX, 2                ;UART RX event
    .equiv   BufBank, 3            ;Determine which bank to use for UART RX

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; RAM Declaration                                                             ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.bss
          .align    2
Flags:    .space    2              ;Action flags set from ISRs
RXState: .space     2              ;Buffer for UART RX state machine
RefLen:   .space    2              ;Length of Reference Data
LCData:   .space    2              ;Buffer for load cell data to send over UART
SampData: .space    2              ;Buffer for sample LVDT data to send over UART

RawVal:   .space    8              ;Buffer for computing the 12-bit decimal value
RXBuf0:   .space    12             ;First Buffer of Double Buffer for UART
RXBuf1:   .space    12             ;Second Buffer of Double Buffer for UART
RXMem:    .space    2              ;Memory address for next data load




                                      Page 39 of 45
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Welcome Message Space                                                       ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
.text
     .align 2
Msg: .ascii"==================================\r\n"
     .ascii"UCONN Pneumatic Compression Tester\r\n"
     .ascii"Code Created by Andy Chemistruck\r\n"
     .ascii"April 27, 2005\r\n"
     .ascii"==================================\r\n\0"
LCName:   .ascii"LC: \0"
SampName: .ascii"SD: \0"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Program Code Space                                                          ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    .text

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: __reset                                                         ;
; Description: Handles processor reset events and master clear events         ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

__reset:
     mov #__SP_init, W15           ;Initalize the Stack Pointer
     mov #__SPLIM_init, W0         ;Initialize the Stack Pointer Limit Register
     mov W0, SPLIM
     nop                           ;Add NOP to follow SPLIM initialization
     clr W14                       ;Initialize w14 to w0's address
     repeat    #13                 ;Repeat 14 times
     clr [W14++]                   ;Clears W0 to W13
     clr W14                       ;Clear W14

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Initialization Subroutine Calls                                             ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    rcall   Init_AD                ;A/D converters
    rcall   Init_RS232             ;UART2 for RX/TX at 115200 baud
    rcall   Init_SPI               ;SPI for D/A output for servovalve
    rcall   Init_Interrupts        ;Enable all required interrupts and modules
    rcall   SendMsg                ;Send welcome message over UART

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Main Loop                                                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MainLoop:                          ;State Machine
     btsc Flags, #Control          ;Test for control calculation flag
     bra CalcControl               ;Branch to control calculation flag
CheckSend:
     btsc Flags, #UTX              ;Test for TX flag
     bra SendData                  ;Branch to send next data code
CheckRX:
     btsc Flags, #URX              ;Test for RX flag
     bra LoadProfile               ;Loads Profile data as reference
     bra MainLoop                  ;Branches back to top of Main Loop

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: SendMsg                                                         ;
; Description: Sends welcome message over UART link                           ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SendMsg:
     bset CORCON, #PSV             ;Enable reading from Program Memory
     mov #psvpage(Msg), W1         ;Move Msg address to PSVPAG
     mov W1, _PSVPAG
     mov #psvoffset(Msg), W1       ;Make pointer
     rcall SendChars               ;Push onto TX buffer



                                      Page 40 of 45
    return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: SendLC                                                          ;
; Description: Sends LC data over UART link                                   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SendLC:
     bset CORCON, #PSV              ;Enable reading from Program Memory
     mov #psvpage(LCName), W1       ;Move Msg address to PSVPAG
     mov W1, _PSVPAG
     mov #psvoffset(LCName), W1     ;Make pointer
     rcall SendChars                ;Push onto TX buffer
     mov LCData, W4                 ;Push LCData
     rcall toAscii                  ;Convert the 12-bit sample to raw voltage
     return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: SendSamp                                                        ;
; Description: Sends Samp data over UART link                                 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SendSamp:
     bset CORCON, #PSV              ;Enable reading from Program Memory
     mov #psvpage(SampName), W1     ;Move Msg address to PSVPAG
     mov W1, _PSVPAG
     mov #psvoffset(SampName), W1   ;Make pointer
     rcall SendChars                ;Push onto TX buffer
     mov SampData, W4               ;Push LCData
     rcall toAscii                  ;Convert the 12-bit sample to raw voltage
     return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: SendChars                                                       ;
; Description: Sends Character String stored in program memory                ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SendChars:
     mov [W1], W0
     and #0x00FF, W0
     bra Z, MsgEnd
     rcall SendChar                 ;Send first character normally
     mov [W1++],W0
     swap W0
     and #0x00FF, W0
     bra Z, MsgEnd
     rcall SendChar                 ;Send second character normally
     bra SendChars
MsgEnd:
     return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: SendChar                                                        ;
; Description: Send Byte over RS-232 port                                     ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SendChar:
     btsc U2STA,#UTXBF              ;Wait for an empty buffer
     bra SendChar
     mov W0, U2TXREG                ;Send the buffer
     return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: toAscii                                                         ;
; Description: Converts to Numerical Voltage Format                           ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

toAscii:
     mov #5000, W0                  ;Get 3 decimal place accuracy
     mul.uu W0, W4, W0              ;Multiply sampled data to get voltage
     mov #4096, W2



                                       Page 41 of 45
    repeat #17

     div.ud W0, W2                ;Divide by 4096
     mov #10, W2                  ;Setup to divide by 10
     mov #RawVal, W5              ;Place to copy data
     mov #2, W4                   ;Setup a do loop that runs 3 times
     do W4, AsciiDone
     repeat #17                   ;Divide by 10
     div.u W0, W2
     mov W1, [W5++]               ;Save in reversed order
AsciiDone: nop
     add #0x30, W0                ;Send highest voltage value
     rcall SendChar
     mov #'.', W0                 ;Send period
     rcall SendChar
     mov [W5--], W0               ;Remove extra zero from division
     mov #2, W4                   ;Setup a do loop that runs 3 times
     do W4, SendDone
     mov [W5--], W0
     add #0x30, W0                ;Shift so it is a number
     rcall SendChar               ;Send numerical value
     nop
SendDone: nop
     return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; State: CalcControl                                                          ;
; Description: Calculates the output for control and sent to the D/A.         ;
;   Currently this is done on the test machine and sent directly to D/A.      ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

CalcControl:
     bclr Flags, #Control         ;Clear flag
     bra CheckSend                ;Begin checking again

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; State: SendData                                                             ;
; Description: Send cycle number, load cell, and LVDTs to logging machine     ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SendData:
     bclr Flags, #UTX             ;Clear flag
     rcall SendLC                 ;Send the Load Cell data
     rcall SendSamp
     mov #0x000D, W0              ;Load a CR
     rcall SendChar               ;Send Character
     bra CheckRX                  ;Begin checking again

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; State: LoadProfile                                                          ;
; Description: Push the next data point into reference buffer                 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

LoadProfile:
     bclr Flags, #URX             ;Clear flag
     mov #RXBuf1, W4              ;Determine which of the double buffers to use
     btsc Flags, #BufBank
     mov #RXBuf0, W4
     mov [W4++], W0               ;Move first value
     sub #0x30, W0                ;Subtract off ASCII representation
     mov #1000, W2                ;Scale to highest place
     mul.uu W0, W2, W0            ;Multiply by 1000
     mov W0, W3                   ;Use W3 to store answer
     mov #100, W2
     mov [W4++], W0               ;Skip over period symbol
     mov [W4++], W0
     sub #0x30, W0                ;Subtract off ASCII representation
     mul.uu W0, W2, W0            ;Multiply by 100
     add W0, W3, W3               ;Add to result
     mov #10, W2
     mov [W4++], W0



                                      Page 42 of 45
     sub #0x30, W0                 ;Subtract off ASCII representation
     mul.uu W0, W2, W0             ;Multiply by 10
     add W0, W3, W3                ;Add to result
     mov [W4], W0
     sub #0x30, W0                 ;Subtract off ASCII representation
     add W0, W3, W3                ;Add last digit to result
     mov #4096, W2                 ;Scale to 12-bit output
     mul.uu W3, W2, W0
     mov #5000, W2                 ;Divide by 5000 to get 12-bit output
     repeat #17
     div.ud W0, W2                 ;Should be 12-bit value
DummyClear:
     btsc SPI1STAT, #SPITBF        ;Test to see if buffer is full
     bra DummyClear                ;Jump back if not ready
     mov W0, SPI1BUF               ;Copy Load Cell output to D/A as a test
     bra MainLoop                  ;Begin checking again

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: Init_RS232                                                      ;
; Description: Initializes the RS232 communication between the test computer ;
;   and the compression tester using interrupts for servicing RX and TX events;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Init_RS232:
     clr U2MODE                    ;Standard transmit mode: 8 data bits,
                                   ;   no parity, 1 stop bit
    clr U2STA                      ;Clear all status bits and set interrupts
                                   ;for one character TX/RX buffer space
    mov #12, W0
    mov W0, U2BRG                  ;Initialize Baud Rate Generator to 115,200bps
    clr RXState                    ;Clear RX State Machine buffer
    mov #RXBuf1, W0                ;Initialize RXMem variable
    mov W0, RXMem
    bset IPC6, #U2RXIP2            ;Set UART RX interrupt priority
    bclr IPC6, #U2RXIP1
    bclr IPC6, #U2RXIP0
    return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: Init_AD                                                         ;
; Description: Initializes the A/D converter to sample at 20kHz and sample    ;
;   3 channels after receiving the pulse to start sampling                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Init_AD:
     clr Flags                     ;Clear all the status registers
     clr ADCON1                    ;Integer Representation
     bset ADCON1, #SSRC2           ;Internal counter activated for autosample
     bset ADCON1, #SSRC1
     bset ADCON1, #SSRC0
     clr ADCON2                    ;AVDD/AVSS references
     bset ADCON2, #SMPI1           ;Trigger Interrupt on every 3rd conversion
     bset ADCON2, #SMPI0
     bset ADCON2, #CSCNA           ;Enable scan through inputs
     mov #63, W0                   ;Internal Clock for sampling with TAD=687.5ns
     mov W0, ADCON3
     bset ADCON3, #SAMC4           ;Autosample at 32TAD
     bset ADCON3, #SAMC3
     bset ADCON3, #SAMC2
     bset ADCON3, #SAMC1
     bset ADCON3, #SAMC0
     clr ADCHS                     ;CH0 Input connected to AN0
     mov #0xFFFC, W0               ;Enable A/D Scan on AN0, AN1
     mov W0, ADPCFG                ;All digital except for AN0, AN1
     mov #0x0003, W0
     mov W0, ADCSSL                ;Scan AN0, AN1
     clr T2CON                     ;Set to 16-bit timer mode
     clr T3CON                     ;Clear Timer3 Control Register
     clr TMR3                      ;Clear Timer3
     mov #48000, W0                ;Timer3 Interrupts every 2mS
     mov W0, PR3



                                      Page 43 of 45
    bset IPC1, #T3IP2              ;Timer3 interrupt priority level 4
    bclr IPC1, #T3IP1
    bclr IPC1, #T3IP0
    return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: Init_Interrupts                                                 ;
; Description: Enable interrupts and modules all together to avoid            ;
;   stalling initalization                                                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Init_Interrupts:
     bclr IFS0, #ADIF              ;Reset A/D Interrupt Flag
     bset IEC0, #ADIE              ;Enable A/D Interrupt
     bclr IFS1, #U2RXIF            ;Clear the RX interrupt flag
     bclr IFS1, #U2TXIF            ;Clear the TX interrupt flag
     bset U2MODE, #UARTEN          ;Enable UART module
     bset U2STA, #UTXEN            ;Enable Transmission
     bset IEC1, #U2RXIE            ;Enable ISR processing
     bclr IEC1, #U2TXIE            ;Disable ISR processing
     bclr IFS1, #T3IF              ;Clear Timer3 Interrupt flag
     bset IEC0,#T3IE               ;Enable the Interrupt
     bset T3CON, #TON              ;Enable Timer3
     bset ADCON1,#ADON             ;Enable A/D Converter
     bset SPI1STAT, #SPIEN         ;Enable SPI module
     return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: Init_SPI                                                        ;
; Description: Initialize SPI module to communicate with D/A chip             ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Init_SPI:
     bclr TRISB, #2                ;Set pin 4 as output for /SSI (rest are inputs)
     clr SPI1STAT                  ;Clear SPI status register
     clr SPI1CON                   ;Clear SPI Control Register
     bset SPI1CON, #FRMEN          ;Enable Framed Transfer Mode
     bset SPI1CON, #MODE16         ;16-bit transfer mode
     bset SPI1CON, #MSTEN          ;Enable Master mode
     bset SPI1CON, #SPRE2          ;Enable Secondary 4:1 prescale
     bset SPI1CON, #PPRE1          ;Primary prescale is set to 1:1
     bset SPI1CON, #PPRE0
     return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: __U2RXInterrupt                                                 ;
; Description: Triggers the next data value to be received                    ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

__U2RXInterrupt:
     bclr IFS1, #U2RXIF            ;Clear the flag
     push W0                       ;Save working registers to not destroy data
     push W1
RXTop:
     btss U2STA, #URXDA            ;Check to make sure there is data to read
     bra EndRX
     mov RXMem, W0                 ;Load next address to put data in
     mov #RXBuf1, W1               ;Move address of RXBuf1 to W1
     btss Flags, #BufBank          ;Check which bank we are in
     mov #RXBuf0, W1               ;Move address of RXBuf0 to W1
     sub W0, W1, W1                ;W1<=W0-W1
     cp W1, #11                    ;Compare with 9
     bra N, StoreBuf               ;Room to store
     mov #RXBuf1, W0
     btsc Flags, #BufBank          ;Check which bank
     mov #RXBuf0, W0
     btg Flags, #BufBank           ;Switch Buffers
StoreBuf:
     mov U2RXREG, W1
     cp W1, #0x0D                  ;Check for 0xD (CR) character
     bra Z, SwitchBufs



                                      Page 44 of 45
     mov W1, [W0++]
     bra EndRX
     bra RXTop
SwitchBufs:
     bset Flags, #URX              ;Set process buffer flag
     mov #RXBuf1, W0

     btsc Flags, #BufBank          ;Check which bank
     mov #RXBuf0, W0
     btg Flags, #BufBank           ;Switch Buffers
     bra RXTop
     bra EndRX
EndRX:
     mov W0, RXMem
     pop W1
     pop W0
     retfie

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: __T3Interrupt                                                   ;
; Description: Handles Timer3 interrupts by starting sampling                 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

__T3Interrupt:
     bclr IFS0, #T3IF              ;Reset Timer3 Interrupt Flag
     bset ADCON1, #ASAM            ;Trigger sampling to auto-start
     retfie

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Subroutine: __ADInterrupt                                                   ;
; Description: Services an A/D Interrupt that indicates that our 3 samples    ;
;    have been recorded and that our control loop and UART TX should occur.   ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

__ADCInterrupt:
     bclr IFS0, #ADIF              ;Reset A/D Interrupt Flag
     push W0
     bclr ADCON1, #ASAM            ;Shut off Automatic conversion
     mov ADCBUF0, W0               ;Copy Load Cell to LCData
     mov W0, LCData
     mov ADCBUF1, W0               ;Copy Sample LVDT to SampData
     mov W0, SampData
     bset Flags, #UTX              ;Send data
     pop W0
     retfie

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; End of code                                                                 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     .end                ;End of code in this file




                                      Page 45 of 45

				
DOCUMENT INFO