Lab 4 starts on 4/5
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 Report (Due Thursday, 4/7 on Laulima)
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 2 for the cantilevered beam so that we can measure strain at the root of the beam.
Repeat the setup from Lab 2 for the cantilevered beam so that we can measure strain as an indicator of displacement. Make sure you can balance the bridge circuit fairly closely with the beam at rest before recording any data.
As we saw in Lab 2, the output of the Wheatstone bridge is quite small, just a few millivolts (mV). Because the resolution and accuracy of the Arduino analogRead function is limited, we use an instrumentation amplifier with its own high-resolution to improve the precision and resolution of the signal before it is communicated to the Arduino.
The datasheet, spcifications, and a user guide for the instrumentation amplifier are available from the supplier website: HX711 Load Amplifier
Note: Your bridge circuit and amplifier board connections should be the same as in Lab 2, with the DAT to Arduino pin 3 and CLK to Arduino pin 2.
The HX711 load cell amplifier can produce a gain of 32, 64, or 128. In its default configuration the gain is 128.
An important consideration designing an instrumentation system is the sample rate, i.e., how fast to collect samples. You may have seen in Lab 2 that the amplifier analog-to-digital converter operated at 10 Hz (samples per second). A rule of thumb for selecting the sampling frequency of a dynamic system is to:
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 fs to be at least 10 times the natural frequency fd you predicted from the prelab, i.e, fs >= 10fd . Because the default 10 Hz sampling frequency is only suitable for dynamics frequencies of 1 Hz or less, the load cell amplifier should be set to a higher rate. On the center of the back of the amplifier circuit board there are two patches labelled 'RATE': If the electrical contact between these two patches is scraped away then the amplifier sampling frequency switches to 80 Hz. If this has not been done to your amplifier previously, then use a knife, pin, or screwdriver with a sharp tip to scrape away the contact between the two patches to set the sampling rate to 80 Hz.
First we want to measure the zero strain case. With the beam static and not moving, collect a small amount of data from the amplifier. This will give you the 'zero' strain signal. 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 amplifier signal for sufficient time to capture the free response until the amplitude of the vibrations has settled to less than 5% of the initial deflection.
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 you can copy and paste the printed data from the Arduino serial monitor directly into MATLAB.
Analysis
Before you complete this part of the experiment you should make sure that your data will allow you to complete the logarithmic decrement analysis. See the Logarithmic Decrement section of the 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 fd.
To show the effects of aliasing, reduce the sampling frequency of the strain measurements by adding a delay (msec) at the end of your loop routine in your Arduino code to delay each sample update by msec milliseconds. Repeat your experiment at the following sampling frequencies where fs is the sampling frequency and fd is the experimentally determined damped natural frequency of your experiment:
fs ≈ 5 fd
fs ≈ 2 fd
fs ≈ fd
fs ≈ 0.5 fd
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.
This step is completely separate from the beam experiments and can be completed at any time. Now we need to setup and test the accelerometer so that we can use it to collect acceleration data.
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)
2. The pin-out of the accelerometer is shown in the above figure. Sketch a wiring diagram of your accelerometer including the following connections:
Connect VCC or 3.3V to 3.3V on the Arduino
GND to any GND on the Arduino
Z to analog input pin A0
To measure and print or plot tip acceleration at the same time as beam strains, add the lines:
Serial.print(analogRead(A0));
Serial.print(" ");
in your loop() routine before "Serial.println(scale.read());". To see the strain gage and accelerometer signals at the same scale on the Serial Plotter, divide the scale.read() signal by a suitable value when printing, for example "Serial.println(scale.read()/1000000.0);".
You can test the accelerometer without the beam by lightly tapping it to see if it generates a signal. You should see a squiggly line output on the Serial Plotter that corresponds to your 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.
Once you have the instrumentation working, repeat the free-response test from Part 1 simultaneously recording both acceleration and strain signals. You should also measure the 'zero' condition with the beam static (no strain) so that you 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:
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.3 V from the Arduino. 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, Ag is the acceleration in units of g's and Vout is the acceleration in units of volts.
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.
You should have 4 recorded data sets for the following cases:
fs = 5 fd
fs = 2 fd
fs = fd
fs = 0.5 fd
Here is an example how to determine the damped natural frequency from one of your data sets.
Copy and paste the data from the Arduino serial monitor to the MATLAB command window
dataset = [ --paste here--
];
Plot the data.
%create new figure
figure(1);
clf();
%plot graph
plot(dataset(1,:), datatset(2,:)); %convert unamplifiedStraingGageSignal to mV
xlabel('Time [s]')
ylabel('24-bit digital signal')
legend('Amplifier Signal', 'location', 'northeast');
Change the figure limits to show only the area of interest from the strain initial condition to when the oscillations have decreased to 10-20% of their initial amplitude with the axis ([xmin xmax ymin ymax]) command. Define the values as applicable.
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.
You can also copy-paste your serial monitor data when only the strain gage was installed, and when both the strain gage and accelerometer were installed, directly to the MATLAB command window.
To extract data of interest from an array of data, use the colon notation as described in "help :" and shown below. First find the numbers of the first and last row of the oscillation data you want to select, then this example will select data from the 2nd column of a data array:
ampdata = dataset([firstrownumber]:[lastrownumber],2)
timedata = dataset([firstrownumber]:[lastrownumber],1)
Then you can average the data and subtract the average from the data vector to remove offsets:
ampdataaverage = mean(ampdata);
zerocenterampdata = ampdata - ampdataaverage;
To convert amplifier signals to bridge voltage, the 24-bit signal data must be divided by 2^24 (data range), multiplied by 5 (voltage range), and divided by 128 (the amplifier gain):
bridgevoltage=zerocenterampdata/2^24*5.0/128;
Then to convert bridge voltage to strain, remember this equation from Lab 2: Vo ≈ Vs G F ϵ / 4
Convert the accelerometer signals to voltage by dividing the signal by its data range (1024) and multiplying by the analogRead voltage range (5.0). Then convert voltage to acceleration in g using the sensitivity of the sensor. Determine your Sensor sensitivity depends on excitation voltage according to the sensor datasheet:
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 (Vs=3.3V), the sensitivity is 315mV/g. Use: Ag = Vout / S
The units for Ag, Vout and S are g, V and V/g respectively.
acceleration = accelerationvoltage/315; %[g]
Plot the graphs, according to your own converted data array names.
%create new figure
figure(1);
clf();
%plot strain
plot(timedata,strain);
xlabel('Time [s]')
ylabel('Strain [m/m]')
legend('XXXXXXXXXXXX','location','northeast');
figure(2);
clf();
%plot acceleration
plot(timedata,acceleration);
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, and calculate the undamped natural frequencies.
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 three topics:
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 is 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.