Lab 4 due 12/4
1. Reading: Chapters 7 and 8 of lab textbook and datasheet of ADXL335
(Other relevant accelerometer links:
Terminology,
Specifications,
Weblink: Breakout_ADXL335,
Datasheet of MMA-7361L,
Weblink: Breakout_MMA-7361L)
2. Lab Textbook Exercises: 7.1, 7.2, 7.5, 7.6, 7.7, 8.1, 8.2, 8.3 (Due Friday, 10/9 on Laulima)
3. Lab Report (Due Friday, 10/9 on Laulima)
(Your answers to the excercises should be in the same PDF file with your lab report.)
In this lab, we will measure the free-response of a vibrating beam using both a strain gage and an accelerometer. By analyzing the measurements you will estimate the parameters of the second order model:
damped natural frequency ω_d and
damping ratio ζ
Finally you will compare these experimental results to the analytical model predictions. We will do the free-response experiment twice, once for each of the following scenarios:
Beam with strain gauge at root
Beam with strain gauge at root and accelerometer at the tip
In this part, we will be collecting sufficient experimental evidence to determine the natural frequency and damping ratio of the cantilevered beam. To do this, we will need to repeat the setup from Lab 1 for the cantilevered beam so that we can measure strain at the root of the beam.
Repeat the setup from Lab 1 for the cantilevered beam so that we can measure strain as an indicator of displacement. Verify that when the tip of the beam is up the DAQ records a positive voltage, when the tip of the beam is down the DAQ records a negative voltage and that when there is not displacement of the tip of the beam the voltage is near zero.
As we saw in Lab 1, the output of the Wheatstone bridge is quite small, just a few millivolts (mV). Because the resolution and accuracy of our DAQ system is limited, we will use an instrumentation amplifier to increase the size of signal before it is connected to the DAQ.
Please read the datasheet for the instrumentation amplifier before moving on! You need to understand how the board works to use it effectively, and you need to make connections properly in order to avoid destroying the board! Beware, connecting these pins incorrectly can damage the instrumentation amplifier. Please make all connections with the 9 V battery and the A/D unplugged and double check before applying power!
You will want to make the following connections (see above figure):
Connect the negative terminal of your 9 V battery to the J1:Pin2,GND terminal and connect the positive terminal of your 9 V battery to the J1:Pin1,Vs terminal. You can do this using wired from the Wheatstone bridge module so that you need just one 9 V battery.
Connect the –Vout terminal of the Wheatstone Bridge Module to J3:Pin2,-IN.
Connect the +Vout terminal of the Wheatstone Bridge Module to J3:Pin1,+IN.
Connect the J4:Pin3,REF terminal to the CH1 LO terminal on the A/D.
Connect the J4:Pin2,OUT terminal to the CH1 HI terminal on the A/D.
With the output of the Wheatstone bridge still connected to Channel 0 of the DAQ, also connect the output of the Wheatstone bridge to the input of the instrumentation amplifier (J3). Connect the output of the instrumentation amplifier to Channel 1 of the DAQ. (You will want to configure the DAQ to read three channels of A/D input.)
You should make the connections as shown in the figure above. Make sure to double check the pinout on the USB-1408FS User’s Guide (p. 14 or 33). The locations of Ch0 HI/LO and Ch1 HI/LO are not obvious! Now we are prepared to verify the operation of the instrumentation amplifier.
Set the gain of the instrumentation amplifier to 5 (all DIP switches OFF).
Set the reference switch to the instrumentation amplifier to the up position, so that the reference is roughly 4.5 V (half of the 9 V input)
Start acquisition
Slowly move the tip of the beam up, down and return it to the neutral position
Stop acquisition
Verify that the signal from the instrumentation amplifier (CH1) is 5 times greater than the signal directly from the Wheatstone bridge (CH0).
Repeat these steps for each gain setting of the instrumentation amplifier (Table 2 of the ADXL335-Datasheet) and verify that all the gain settings are what you expect.
The gain setting for the instrumentation amplifier (set using the DIP switches) should be
large enough that the maximum input voltage on CH1 is greater than 25% of the CH1 A/D voltage range
small enough that the maximum input voltage on CH1 is less than 100% of the CH1 A/D voltage range.
To find a suitable setting will require some experimentation. For example, if the voltage range for the CH1 A/D is +/- 1.0 V, the output of the instrumentation amplifier should be at least 0.25 V (at its maximum point) and not greater than 1.0 V. Record the instrumentation amplifier gain setting chosen and include the value in your report.
An important consideration designing an instrumentation system is the sample rate, i.e., how fast to collect samples. This property of your data acquisition system can be specified as a sampling frequency in Hertz (Hz) which specified the number of samples to collect per second. (An alternative is to specify the sampling period, which is the amount of time between samples. For example, sampling at a frequency of 2 Hz is equivalent to a sampling period of 0.5 s.)
We will start with a rule of thumb as a guideline for selecting the sampling frequency: Set the sampling frequency to be a minimum of ten times the highest frequency of the incoming signal.
We can apply this rule of thumb by setting the sampling frequency f_s to be at least 10 times the natural frequency f_d you predicted from the prelab, i.e, f_s ≥ 10 f_d.
First we want to measure the zero strain case. With the beam static and not moving, collect a small amount of data that includes both the voltage of the Wheatstone bridge output and the voltage output from the instrumentation amplifier. This will give you the 'zero' voltage for both measurements. The free-response experiment is simple and quick:
Deflect the beam a small amount (don’t exceed the elastic limit!)
Release the beam and record the Wheatstone bridge output for sufficient time to capture the free-response. Record both the output directly from the Wheatstone bridge and the output from the instrumentation amplifier.
You will need to make some selections in order to collect quality measurements:
What sampling rate should you use?
What gain setting on the instrument amplifier should you use? What range of the DAQ channels should you use?
How long should you collect data?
One clean run of the experiment is satisfactory, but it would be better to collect a few runs that illustrate the free-response. This will give you a more detailed picture of the response and the uncertainty involved in measuring these parameters. For each run we will want to save the data as a text file so that you can import it into MATLAB. We will also want to record the following settings:
A/D Sampling rate and sampling duration;
Instrumentation amplifier gain setting;
Excitation voltage (measure the voltage of the 9 V battery).
What are the approximate 'zero' voltages for the Wheatstone bridge output and the instrumentation amplifier output?
Analysis:
Before we complete this part of the experiment we should make sure that our data will allow us to complete the logarithmic decrement analysis. See the Logarithmic Decrement section (pp. 55) of the lab textbook details on accomplishing this.
Based on the previous step, you should be able to estimate the natural frequency of your experiment from the strain measurements. You can do this by examining the graph of strain versus time and picking peaks from the strain. See Section 7.4.1 in the course textbook on “Measuring Frequency”. You should note that what you are estimating from the experiment is the damped natural frequency f_d.
Repeat the free-response experiment with the following settings where f_s is the sampling frequency and f_d is the experimentally determined damped natural frequency of your experiment:
f_s = 10 * f_d
f_s = 2 * f_d
f_s = f_d
f_s = 0.5 * f_d
You should observe the effect of aliasing on your data collection. Save each run of the free-response experiment and note the sampling time used for each experiment.
Now we need to setup and test the accelerometer so that we can use it to collect acceleration data using the DAQ.
Familiarize yourself with the operation of the ADXL335 Breakout Board. The website for the product available from the hardware page on the course website. Pay careful attention to the following:
The physical wiring of the board (Where does power go in? Where does the signal come out?)
The input voltage limits (Table 1 in the ADXL335-Datasheet)
The sensitivity of the accelerometer (Table 1 in the ADXL335-Datasheet)
The pin-out of the accelerometer is shown in above figure. Sketch a wiring diagram of your accelerometer including the following connections:
Power is supplied by 2 AA batteries (approximately 3.0 V).
The output of the Z-axis accelerometer is connected to the A/D (CH2).
The ground needs to be connected both the the DAQ and to the battery supply.
If necessary, build the connector and cable to use the accelerometer board 2. We will use the following:
Accelerometer board
6-pin Molex header connector to solder to the board
6-pin Molex connector and connection pins
Sufficient wire to make the following connectionsGround = blackPower = redAcceleration Signal (Z-axis) = any non-black, non-red color wire
Molex crimper
Wire stripper
2-AA battery holder
Prepare the three wires that need to be inserted into the Molex connector and crimp pins onto these three wires.
Insert the wires into the connector and connect the battery.
Verify using a multimeter that the voltage you anticipated is on the proper pins of the cable. (Too high a voltage or the wrong polarity will destroy the device!)
Once we have built and tested the cable we can connect the cable to the accelerometer board and test the accelerometer. Connect the accelerometer to Channel 2 of the DAQ.
We can test this without the beam by lightly tapping the accelerometer to see if it generates a signal. We should see a squiggly line output that corresponds to our tapping.
Now we will mount the accelerometer on the tip of the beam and simultaneously measure the tip acceleration and the root strain during the free-response to an initial displacement. Do not allow the connectors on the accelerometer to contact the aluminum directly; this can cause a short circuit and destroy the device. A small piece of electrical tape can insulate the beam from the accelerometer.
In this part of the experiment you will measure all of the following signals (see Figure below):
The output from the Wheatstone bridge (CH 0)
The output from the instrumentation amplifier (CH 1)
The output from the accelerometer (CH 2)
Once we have the instrumentation working, repeat the free-response test from Part 1 simultaneously recording both acceleration and strain signals. We should also measure the 'zero' condition with the beam static (no strain) so that we know the 'zero' voltage of each channel.
You may want to repeat this a few times to make sure you get multiple quality runs for analysis.
A few things to keep in mind:
Record the Wheatstone bridge excitation voltage (9V battery voltage) in order to be able to convert the output from voltage to units of strain.
Record the supply voltage for the accelerometer (2 AA batteries). This will be necessary to convert the accelerometer signal to units of acceleration (see accelerometer sensitivity section below.)
Record the gain setting of the instrumentation amplifier
Periodically re-zero the output of the Wheatstone bridge. This will drift slowly over time.
Record the 'zero' voltages on all three channels for each run.
Previously, we measured the output of the ADXL335 accelerometer as voltage, but we will need to convert the output voltage to an acceleration value. To accomplish this conversion requires us to know (and know how to use) the sensitivity of the sensor. The sensitivity is given in Table 1 of the ADXL335-Datasheet. The following are the key specifications:
Sensitivity (Ratiometric):
Min = 270 mV/g @ Vs = 1.8 V
Typ = 300 mV/g @ Vs = 3.0 V
Max = 330 mV/g @ Vs = 3.6 V
Ratiometric means that the values are proportional to the supply voltage (Vs). The power source that you used was approximately 3.2 V, provided by two AA batteries. (You should verify the battery voltage with your multimeter!) Based on this source voltage you can determine the sensitivity for your accelerometer via linear interpolation.
Now, once you have the sensitivity, for example S = 0.300 V/g, you can convert the voltage signal to an acceleration signal by dividing the voltage by the sensitivity. Here, A_g is the acceleration in units of g's and V_out is the acceleration in units of volts.
Each student will write a short laboratory report to present and discuss their results. You can assume that the reader is familiar with the experiment; focus on a clear description of your results. The report should be logically organized and include titles, headings and subheadings to organize the report. The report should present and discuss the following 4 topics:
Amplification Comparison – Estimating the Gain
For Part 1 of the lab (free response with just the strain gage, section 1.5) you should have measured both the unamplified output from the Wheatstone bridge and the amplified strain signal from the instrumentation amplifier. You should report and justify the settings you choose for this experiment (sample rate, sampling duration, gain value and A/D range).
Also, you should verify that the gain setting you used for the amplifier was actually implemented. For example, you should calculate the gain you measured in the lab. This is the ratio between the amplified and unamplified measurements. Then you can compare this to the gain value you set on the instrumentation amplifier using the DIP switch (see the instrumentation amplifier datasheet for the actual gain values).
Include a figure showing the free response measured by the strain gage. The figure should include both the unamplified and amplified signal measurements.
Aliasing: Effect of Sampling Frequency
For the strain gage only experiments you were supposed to make the measurement at a set of different sampling frequencies. The goal of this portion of the lab is to illustrate the effect of sampling too slow (a sampling frequency that too low).
Estimate the damped natural frequency based on graphs of free-response at the different rates. Explain (perhaps using some combination of figures, tables and text) how the choice of sampling frequency effects the estimate of damped natural frequency.
System Identification – Estimating Natural Frequency and Damping Ratio
System identification is the process of estimating the parameters of a model (our second-order model) based on the measured system response (the free response experiment). In this case you will use the free response experimental measurements to estimate both the undamped natural frequency and the damping ratio. Summarize the results of your system identification analysis. This should include the estimate each of the following:
damping ratio
damped natural frequency
undamped natural frequency
for each of three scenarios:
using the strain gage signal with only the strain gage installed
using the strain gage signal with both the strain gage and accelerometer installed
using the accelerometer signal with both the strain gage and accelerometer installed
Include the following:
a table summarizing the estimates of system parameters for based on the different experiments and
appropriate figures to illustrate your use of the logarithmic decrement method for each scenario.
Model-Experiment Comparison
In the pre-lab you modeled the free response of the beam using the second- order mathematical model. Furthermore you calculated the natural frequency of this model. Using this model make an analytical prediction of the following:
The natural frequency of the beam with just the strain gage. Use the actual dimensions of your beam.
The natural frequency of the beam with the added accelerometer. The analytical model for a cantilevered beam with a mass at the free-end is in your textbook. Compare the analytical predictions for the natural frequency for these two scenarios with the experimentally identified natural frequencies. Include the following:
appropriate figures to qualitatively compare the modeled and measured free response
a discussion which compares (what is the same about the model and the experiment) and contrasts (what is different about the model and the experiment) the model and the experimental results.
Using MATLAB, try to accomplish most, if not all, of the tasks below in this lab. Make sure to carefully read the deliverables for the lab report.
Note: There are multiple ways to accomplish the deliverables for the lab report using MATLAB. The below hints are just a rough guide if you are not 100% familiarized with MATLAB yet. Feel free to create your own scripts independently.
Create a new folder containing all of the data that you acquired during Lab 2.
To import the data into MATLAB, the data import function importStripChartData.m (Download) needs to be in the same folder as the data.
Open MATLAB and create a new script, make sure that MATLAB's "current folder" is the folder containing your data.
The first part of the script imports the data you measured in section 1.5. First we need the data from the "zero voltages" to determine the offset (reference) of the instrumentation amplifier.
%import the zero voltage data
%(row one of 'zerodata' contains the data measured on ch0 of the DAQ, row two contains ch1 data
[zerodata,zerotime,TS]=importStripChartData('your_zerovoltage_datafilename.txt');
Next, we import the actual data measured during the free response of the beam.
%import free response data (all channel outputs are saved in array 'datavec')
[datavec,timevec,TS2]=importStripChartData('your_freeresponse_datafilename.txt');
5. Determine the zero voltages of both channels by averaging the data using the mean() command.
zero_ch0=mean(zerodata(:,1)); %zerodata(:,1) just uses the first row of the data array (ch0 data)
zero_ch1=mean(zerodata(:,2)); %zerodata(:,2) is the second row of the data array (ch1 data)
6. Extract the measured data of the free response from the datavec array.
%extract data for each channel from datavec. 'datavec(:,1)' only outputs the first row of the array.
%Make sure that this assignment is according to your DAQ channel setup during the experiment.
unamplifiedStrainGageSignal_nonzero=datavec(:,1);
amplifiedStrainGageSignal_nonzero=datavec(:,2);
7. Subtract the zero voltages to remove the offset.
unamplifiedStrainGageSignal=unamplifiedStrainGageSignal_nonzero-zero_ch0;
amplifiedStrainGageSignal=amplifiedStrainGageSignal_nonzero-zero_ch1;
8. There are several ways to determine the amplification gain between both curves. One would be to devide both data vectors by each other using MATLAB's rdivide (./) command for vector division. The mean() of the resulting vector could be the amplification gain.
meanAmplificationGain=mean(amplifiedStrainGageSignal./unamplifiedStrainGageSignal);
An other option is to select just a certain amount of representative data points and determine the gain factor for them. The following code determines the average amplification gain only for the local maxima of the graph.
[pks,y]=findpeaks(amplifiedStrainGageSignal);
meanAmplificationGain=mean(amplifiedStrainGageSignal(y)./unamplifiedStrainGageSignal(y));
It might also possible to determine the gain graphically.
%create new figure
figure(1);
clf();
%plot graph
plot(timevec,(amplifiedStrainGageSignal)*1000); %convert unamplifiedStraingGageSignal to mV
hold()
plot(timevec,unamplifiedStrainGageSignal*1000); %convert unamplifiedStraingGageSignal to mV
xlabel('Time [s]')
ylabel('Voltage [mV]')
legend('amplified Wheatstone voltage', 'unamplified Wheatstone voltage', 'location', 'northeast');
Choose any method (preferably the most accurate one).
You should have 4 recorded data sets for the following cases:
f_s = 10 * f_d
f_s = 2 * f_d
f_s = f_d
f_s = 0.5 * f_d
Here is an example how to determine the damped natural frequency from one of your data sets.
New script. Import the data to your workspace.
[aliasdata,aliastime,T]=importStripChartData('your_aliasing_datafilename.txt');
Extract the amplified data from the aliasdata array.
amplifiedAliasData=aliasdata(:,2);
Plot the data.
%create new figure
figure(1);
clf();
%plot graph
plot(aliastime,(amplifiedAliasData)*1000); %convert unamplifiedStraingGageSignal to mV
xlabel('Time [s]')
ylabel('Voltage [mV]')
legend('amplified Wheatstone voltage', 'location', 'northeast');
Read Chapter 7.4.1 in the textbook to learn how to measure the damped natural frequency.
You can use the "Data Cursor" in MATLAB to extract data from a graph.
In a new script, import the data of your results when only the strain gage was installed and when both, the strain gage and accelerometer were installed, to the workspace (including zero voltages).
[data_os,time_os,T]=importStripChartData('your_onlystraingage_datafilename.txt');
[zero_os,zerotime_os,Ts]=importStripChartData('your_zerovoltage_onlystraingage_datafilename.txt');
[data_sa,time_sa,T]=importStripChartData('your_strainGageAndAccelerometer_datafilename.txt');
[zero_sa,zerotime_sa,Ts]=importStripChartData('your_zerovoltage_strainGageAndAccelerometer_datafilename.txt');
%extract data
amp_nonzero_os=data_os(:,2);
amp_nonzero_sa=data_sa(:,2);
accel_nonzero_sa=data_sa(:,3);
%determine zero voltages
zero_amp_os=mean(zero_os(:,2));
zero_amp_sa=mean(zero_sa(:,2)); zero_accel_sa=mean(zero_sa(:,3));
Subtract the zero voltages to remove offset.
amp_os=amp_nonzero_os-zero_amp_os;
amp_sa=amp_nonzero_sa-zero_amp_sa;
accel_sa=accel_nonzero_sa-zero_accel_sa;
Initialize your battery excitation voltages (according to your records) and the gain factor of the amplifier.
exciteV_amp_os=9V;
exciteV_amp_sa=8.9V;
exciteV_accel_sa=3.1V;
gain=100;
Convert voltages to strain (for wheatstone bridge data). Do you remember the equation of V_o from Lab 1?
strain_os=amp_os/gain/exciteV_amp_os*4/2; % Estimated strain [m/m]
strain_as=amp_sa/gain/exciteV_amp_sa*4/2; % Estimated strain [m/m]
Convert accelerometer voltage to acceleration using the sensitivity of the sensor. Determine your sensitivity according to your excitation voltage via linear interpolation.
Min = 270 mV/g @ Vs = 1.8 V
Typ = 300 mV/g @ Vs = 3.0 V
Max = 330 mV/g @ Vs = 3.6 V
For example in our case (exciteV_accel_sa=3.1V), the sensitivity is 305mV/g. Use: A_g = V_out/S
acceleration_as=accel_sa*1000/305; %[g]
Plot the graphs.
%create new figure
figure(1);
clf();
%plot strain_os
plot(time_os,strain_os);
xlabel('Time [s]')
ylabel('Strain [m/m]')
legend('XXXXXXXXXXXX','location','northeast');
figure(2);
clf();
%plot strain_sa
plot(time_sa,strain_sa);
xlabel('Time [s]')
ylabel('Strain [m/m]')
legend('XXXXXXXXXXXX','location','northeast');
figure(3);
clf();
%plot acceleration_as
plot(time_sa,acceleration_as);
xlabel('Time [s]')
ylabel('Acceleration [g]')
legend('XXXXXXXXXXXX','location','northeast');
Determine the damping ratio in all three cases using the logarithmic decrement method (Textbook Chapter 7.4.2).
Determine the damped natural frequencies as done before (Topic 2), and calculate the undamped natural frequencies.