E80
Experimental Engineering
Experimental Engineering
Team size: 4
After successful completion of this lab, you will be able to…
Use the oscilloscope to perform Fourier analysis of a measured signal.
Explain the impact of parameters such as sampling frequency and sample number on the resolution and frequency range of a Fast Fourier Transform.
In this lab you will work as a team of four with underwater speakers to perform position measurements relative to your robot and relative to fixed beacons. The beacon measurements are most easily interpreted in the frequency domain, so you will be using Fourier analysis to understand the behavior of the signals. The purpose of this lab is to demonstrate the power of underwater acoustic measurements and to force you to wrangle early and often with Fourier analysis.
For the required portion of the Lab, beacons will be broadcasting sine waves at 9 kHz, 11 kHz, 13 kHz.
For the extra credit sections, each team is assigned an acoustic channel, and the team will need to filter out other teams’ measurements in addition to the ambient beacon signals in order to extract useful information. If you attempt these extra credit sections, you will be free to transmit up to 5 W at 14 kHz +1 kHz *(team number)+/- 300 Hz. If you emit at other frequencies while your peers are taking data then you may damage their experiments, so be diligent in controlling the frequency at which you broadcast.
These channels are in the audio range, so try to keep your experiments underwater and short lest your peers shout at you scornfully about the high-pitched whine you're producing. Be aware that your receiver could be overloaded by broadcasters in other channels, so keep an eye on your time domain signal to be sure that it is not clipping.
We are using both benchtop electronics and water in this lab, and the two don't mix, so BE EXTREMELY CAREFUL when putting anything in the water, removing anything from the water or mounting anything near the water. Instructors will stop your experiments if they think they pose a water hazard to equipment.
For pre-lab purposes, a sample submission sheet that contains all of the questions and requirements on the submission sheet is here.
Even if not every student can have hands on the oscilloscope (as a reminder, the Agilent/Keysight 2024A which has this spec sheet) during this part of the experiment, we would like every student to, at minimum, watch the proceedings. Please carry out this section as a whole group. Also note that much of this section can be predicted and analyzed very accurately in prelab with sample data generated in MATLAB.
Connect a function generator to an input channel of the oscilloscope. Double check that your oscilloscope channel is DC coupled. Drive an 11 kHz sine wave with an amplitude of 1.5 V and an offset of 0 V into the oscilloscope. Set the time scale of the oscilloscope so that 50 cycles of the signal fit on the screen. Use the math function of the oscilloscope to display the FFT of the signal. Set the span of the FFT to 100 kHz, the center to 50 kHz and the window to rectangular. Look at the FFT produced by the math menu. Is it what you expect?
Describe what happens to the FFT when you do each of the following:
Increase the drive signal's frequency by 1 kHz.
Change the drive signal into a square wave. Back up your assertions that this makes sense with a rigorous analytical analysis.
Change the window from rectangular to Hanning. Back up your assertions that this makes sense with a graphical analysis.
Change the time scale of the oscilloscope. Explain your results in terms of the sample rate, the number of samples and the total amount of time over which samples have been recorded. What is your oscilloscope's sample rate? You can find it displayed on the oscilloscope or figure it out from the scope's datasheet. Note that the sample rate may vary with your time scale: if you are taking a long acquisition, it is set by the size of the oscilloscopes memory -- i.e.: your total number of samples is fixed -- and if you are taking a short acquisition it is limited by the speed of the sampling circuitry in the oscilloscope.
Drive the square wave signal from item 3 into the oscilloscope, export your data (make sure that the max length option is turned on in your save settings) and then use MATLAB to take the FFT of your data. First take the FFT with no windowing and then use a Hanning window. Does the FFT in MATLAB match the oscilloscope and your analysis?
You will need to use microphones to pick up sounds in the tank. We will be using a waterproof electret microphone called the CME-1538-100LB. Build the reference circuit for your electret microphone. The reference circuit's output is AC coupled -- which means a capacitor is attached in series with the output -- and your oscilloscope probe looks like a large impedance attached to ground. What effects do the coupling capacitor and the probe resistance have when both are in place? Drawing a full circuit model may help to answer that question. Be sure that you consider the effects of the AC coupling circuit at both low and high frequencies. Verify that you can receive signals with your electret microphone by clapping near it. What frequencies in your hand clap signal contain the most energy?
You will need to amplify the signal that you receive in the tank to make it visible on your oscilloscope. Build an amplifier with a gain of 100 by cascading two stages that each have a gain of 10. You need to spread your gain over two stages because of an op-amp parameter called the gain-bandwidth product (often abbreviated GBW or GBP). How do you calculate your bandwidth once you know your amplifier's gain and the GBW? Use a dual-rail op-amp to build these amplifier stages (why?). Record your amplifier schematic in the submission sheet.
If your first amplifier stage is a non-inverting amplifier, then add a large resistor (~100k) between the positive amplifier input and ground. You don't need this resistor if your first stage is an inverting amplifier. This resistor is necessary to prevent the input leakage current in your op-amp from changing your results.
You may need to solder leads to this electret microphone to plug it into your breadboard. You should consider twisting the leads together to form twisted pair wire. These wires do not need to be very long. In the tankroom, you will be provided with water-proofed microphones with long leads so that you can dip the microphones into the tank from the work tables.
One way to locate your robot in the water is to listen to three beacons and calculate your distance to each of them based on the beacon power received at your robot. In this section we are going to create calibration curves which could allow you to trilaterate your robot based on a set of beacons. You will need to put your microphone into the tank, which will require long microphone wires as discussed in the last section.
Three beacons are installed in the test tank and will be constantly emitting sine waves of approximately 9 kHz, 11 kHz and 13 kHz. Figure out which beacon corresponds to which frequency by taking acoustic measurements in the water. Which beacon corresponds to which frequency? What are their exact frequencies?
Our goal is to see if we can infer the position of our microphone by measuring the power emitted by the beacons. We have an analytical expectation of how much power we should receive at a given distance from a speaker (what is it?), and you are going to compare that ideal analytical expression to measurements in the noise-limited, high-multipath environment of the tank. You need to be sure that your measurements capture evidence of multipath in the tank, so how closely will you need to space your measurements? (Hint: think about the wavelength of your waves and the size of the tank to predict multipath interference -- which is kind of "spatial frequency" -- to figure this out. Also, don't be afraid to look this up on external resources.)
Move your microphone around in the tank and measure the power to create received voltage vs. distance calibration curves for each beacon. Be sure to test how the orientation of your measurement system affects your received power and take that information into account when recording measurements. The FFT will be important to separate out the contribution of each speaker. Be sure to save and report some examples of the underlying FFT data which confirms that you have taken these measurements.
Make an analytical calculation of how much voltage you expect to observe. Note that you don't need to have the transmit power of the beacon or the pressure-to-voltage constant of your microphone (which is linear) to make this model. You can fit an appropriate voltage vs distance function to your data even without knowing these constants. How many parameters will you use to fit your function?
Compare your measurements against your ideal analytical model by overlaying them on the same plot. Comment on the suitability of amplitude measurements for range finding. Your comment should not conclude that your hardware is not working: your equipment needs to be working well enough to tease out interesting environmental effects.
Always connect to your Teensy pins through the E80 motherboard, which has protection circuits designed to prevent damage to the Teensy.
This section requires that you use the Teensy sampling rigs that have been set up in the tank room. It is an amplifier with an offset, and an E80 MTB is used to digitize your data. While tempting to connect your single analog signal directly to a Teensy, an E80 MTB with protection circuits should be used to prevent damage to the Teensy. Connect your microphone to a Teensy sampling rig, connect the rig to your computer with a micro USB cable and then run E80_Lab05_Teensy_Rig.m in order to retrieve information from the rig. This software uses the Teensy's analog to digital converter to measure signals received from the microphone attached to the setup. The sample rate on the Teensy is programmable in this software. (The Teensy should already be running E80_Lab05_Teensy_Rig.ino)
Use the software to measure vectors of sample data with sample rates of 10kHz and 100 kHz.
Plot the magnitude of FFTs of the 10 kHz and 100 kHz sampled data. Describe any differences between the resulting graphs and explain what causes the differences.
Plot the first 100 points of the time data for the 10 kHz and 100 kHz signals. Pay attention to the x axis of the signals. Describe any differences in the measured data and explain why they are there.
What is the minimum sampling rate you should use to measure signals in the tank? Prove it by sampling data at the frequency and presenting an FFT of that data.
All labs require two submissions per group. The first submission is a submission sheet in which specific data must be shown. The submission sheet is due at the end of the 4-hour lab period and must be uploaded before the end of your lab session at 5:15 pm. Note that only ONE member of each team should access and submit the submission sheet. It is the responsibility of that team member to add the rest of the team's names to the submission sheet.
For pre-lab purposes, a sample submission sheet that contains all of the questions and requirements on the submission sheet is here.
The second submission is a writing assignment, usually around 1 page in length. Each writing assignment will be based on a prompt, and must be completed by each student individually; no collaboration is allowed on the text or figures in these assignments, though you may speak among yourselves about concepts in keeping with the collaboration rules of the course. A first draft of the writing assignment must be uploaded by noon on Friday, and you need to bring a printed copy of your draft to the writing and reflection section on Friday at 1:15 p.m. During the first hour of the writing and reflection, you will engage in a peer editing exercise. The second hour of the Writing and Reflection section is reserved for you to edit your draft to produce a final draft of the writing assignment. This final draft must be uploaded before the end of the Writing and Reflection section on Friday at 3:15 p.m. Since multiple submissions are permitted, and only the last one is graded, you may want to submit a draft at 3 p.m. as insurance. The writing assignment is based on this prompt. This is the peer feedback worksheet. Note that you should include relevant calculations to explain the ideal analytical curves on your calibration plots on your submission sheet.
Note that the rubric is included in the prompt.
Recall that no late work is accepted, we will grade whatever is submitted at the deadlines.
After the writing and reflection section at the end of each week every person (not just one person per team) must submit a team dynamics check-in survey. These are part of your participation grade. The survey link can be found on the home page.
Return your PVC to the stock in the E80 lab. Be sure to return electret microphones, power amplifier boards and speakers to the electronics table.
Another common acoustic measurement is time-of-flight (ToF) range finding. ToF measurement relies on sending out a specially designed acoustic pulse from a speaker and measuring how long it takes for it to reach a microphone. Often the microphone is measuring reflections of your initial speaker pulse (eg. on a sounding vessel), but we'll get started by just sending our speaker pulse straight to our microphone.
You need to be able to carefully control the signals being sent from your speaker in order to stay in your audio channel while creating a short pulse. Specifically, you will send a burst of sine waves: a small number of sine wave cycles. We can accomplish this by using internally triggered burst modulation, an advanced feature of the old signal generators (the HP/Agilent 33120A). This function is not available on the function generators in your oscilloscope. You can control burst mode by pressing the series of keys shown below. Read the manual for clarification on how these key presses work.
Turn burst modulation mode on: Shift + the ramp/burst button / The text 'burst' will be highlighted at the top of the screen.
Turn burst modulation mode off: Shift + the ramp/burst button / The text 'burst' will no longer be highlighted at the top of the screen.
Turn manual triggering on and internal triggering off: Shift + the TRIG button / The text 'trig' will be highlighted at the top of the screen
Turn manual triggering off and internal triggering on: Shift + the TRIG button / The text 'trig' will no longer be highlighted at the top of the screen
Change the number of cycles sent out in each burst or the burst repetition rate:
Shift + Enter / Screen says "A: Mod Menu,"
v / Screen says "AM Shape,"
> / Screen says "AM Source,"
> / Screen says "FM Shape,"
> / Screen says "Burst CNT, "
v / Screen says some number." OR > / "Burst Rate," and then V / "some number."
Edit the number you see and press enter to save the setting.
You will be using Dayton DAEX25W-8 Audio Exciters as speakers to convert voltage signals into acoustic signals. These speakers, like most speakers, have very low input impedance. What is their impedance? Calculate the maximum power you could drive into them using one of the old HP/Agilent 33120A signal generators. You need to account for the output impedance of the signal generator in this calculation. Audio amplifiers, like the LM384, help us to bypass this problem. They are designed to drive large amounts of power through speakers. What is the maximum average power an LM384 can drive into a DAEX25W-8?
We have created a power amplifier board containing an LM384 to allow you to drive your speakers. Follow these instructions to use the driver board. You only have access to one power supply in the tank room, so you'll need to power your microphone amplifier off the same rails as the LM384 amplifier board. Be careful not to provide too much voltage to the microphone amplifier.
You are measuring in a noisy environment (beacons, other teams, etc), so measuring your received signal will also depend on carefully timing the snapshot that your oscilloscope takes. By gathering data that is synchronized with the signal you are sending and averaging over many samples, you can cancel out signals that are not at the same frequency as the burst repetition rate of your signal. This is called coherent averaging. Set this up using the following steps:
Use a second oscilloscope channel to probe the output of your function generator (or attach the trigger output of your function generator to your scope's trigger input)
Trigger your oscilloscope on the channel attached to the output of the function generator (or on the trigger input)
Set your oscilloscope to normal mode acquisition (so that it will only capture a new screen of data when it receives a trigger) and adjust the horizontal position of your oscilloscope trigger so that you don't waste samples recording data before you send out a burst.
Turn on averaging on your oscilloscope using the Acquisition/Mode button.
Affix your speaker to the wall and move your microphone to different distances away from it. Measure the time of flight to your receiver to create a calibration curve of distance vs. measured time of flight. Include an ideal analytical calculation of time-of-flight vs. distance on your calibration curve and compare it to your data. How long should a sound wave take to propagate from your speaker to the other side of the pool? How long for a round trip? A schematic of the test tank can be found here. If you're feeling particularly bold, you can try putting your speaker next to your microphone to measure a reflection off of something.
You may refer to this picture of an example range finding setup. As mentioned in the introduction, it is extremely important that your electronics and the tank water are not mixed. Use tape to hold electronics down so they can't fall into the tank, and keep bench top equipment as far from the tank edge as possible. Always dry your test apparatus with a towel as you remove it from the water and be mindful of nearby electrical setups. This is an opportunity for some careful mechanical design: a little PVC can go a long way towards making your setup work well. Include one to three pictures of your experimental setup on the table and pool edge in your submission sheet. These pictures will be graded on safety and quality of construction.
It is possible to use more complex modulation of the signal that your speaker emits to learn more about your robot. In this section you will use a frequency modulated sine wave to measure the velocity of your robot by leveraging the Doppler effect. This type of measurement is called a frequency modulated continuous wave (FMCW) measurement because, unlike your time of flight experiment, you are not sending out bursts of signal.
Use the signal generator to generate a triangle frequency modulated FMCW signal to drive into your speaker. Instructions to do so can be found in the manual. Set the frequency deviation to fill your channel, the modulation frequency to 10 Hz, and the modulation shape to be a triangle.
You will need a "true" measurement of velocity to compare against your Doppler measured velocity. We will record video of your robot and analyze it with frame tracking software. VLC works well as capture software, and we recommend tracker for tracking software (though some students have used video-physics). Attach one of the USB web cameras to your computer and build a PVC frame so that it has a top-down view of your robot. Make sure a length reference like a meter stick is visible in the image that you capture. Attach a brightly colored piece of pool noodle to your robot so that it is visible above the water. This will enable you to use auto tracking features in the video analysis software. Test your image capture / velocity measurement system before deploying your robot to be sure that it is working.
Use a claw hand or a piece of PVC to move your receiver through the water while driving the transmitter with your FMCW wave and recording the received audio. Also record video of the test using your image tracking system. It's easiest to carry out your recordings by taking a very long acquisition on the oscilloscope which you start manually by pressing the force trigger button.
Use the instructions in this document to process your received audio and extract the velocity as a function of time from your received FMCW. Bear in mind that you need to isolate your velocity signal before doing any signal processing, so don't be afraid to take an FFT and filter out other channels before processing your data. Also extract velocity from your recorded video. Generate a plot comparing your Doppler velocity against the velocity measured using your image capture system.
Writeups for this extra credit section are not counted against the page limit of your report. You may submit this as an additional document labeled "lab 5 doppler extra credit addendum."
Affix your speaker and microphone to your AUV and take velocity measurements while it is driving under its own power as in lab 1. Compare logged accelerometer data, image capture system data and Doppler data.
You won't be able to use our audio amplifier boards during the final project, but it's pretty easy to whip up your own LM384 on your protoboard. You can find the reference design for a typical 5 W amplifier in the LM384 datasheet. This reference design involves using a potentiometer for volume control, which you can probably replace with a fixed divider or omit depending on your design. Place an extra 4.7 µF bypass capacitor on the supply rails (not the bypass pin) in addition to your normal bypassing. Your amplifier will be unstable without this extra capacitor, so it may be educational to remove the capacitor and observe the amplifier output to understand exactly what bypassing does for you.
Notice this design has a capacitor in series with the speaker. This is done for two reasons: speakers can be damaged by DC current, and the audio response of the speaker is linked to relatively high frequency oscillations. The capacitor lets high frequencies through and stops DC. This technique of driving an output through a series capacitor is called AC coupling. You'll probably drive the input from a Teensy, but this input likes to have zero centered input signals, so we recommend AC coupling the input too.