Gas station without pumps

2015 April 2

Moving sampling lab early was a good idea

Filed under: Circuits course — gasstationwithoutpumps @ 20:00
Tags: , , , ,

This year I moved the sampling and aliasing lab to the first week, from the middle of the quarter.  To do this, I had to remove the design component from the lab: I gave them the circuit for the high-pass filter that re-centers the function generator output halfway between the power rails.  I didn’t tell the students that the function generator has the ability to set a DC offset itself, so we could have done the observations without building the filter, because a big point of the lab was to get students to translate a schematic into components and wires on a breadboard.  I was worried that the lab would not make sense before we’d covered RC filters, but by treating the filter as “magic” to be explained later, we could concentrate on the lab skills of wiring and running the PteroDAQ software, without them having to figure out a design at the same time.  The rest of the quarter will all be design labs.

I started the lab class with a mini-lecture covering:

  • block diagram.  I constructed a block diagram starting from the two ends: the function generator and the PteroDAQ, and working out what was needed in the middle to make the output of the function generator match the input of the KL25Z analog-to-digital converter in the PteroDAQ.
  • schematic. I redrew the schematic from my book:
    The DC-blocking filter they built has a corner frequency of 0.03Hz, and they were looking at waveforms in the 1Hz–25Hz range.

    The DC-blocking filter they built has a corner frequency of 0.03Hz, and they were looking at waveforms in the 1Hz–25Hz range.

    I explained briefly how capacitors block DC but allow AC currents, how electrolytic capacitors work, and how the insulating layer self-repairs when the voltage is in the right polarity and how it can catastrophically fail with the polarity reversed.  (I did mention blowing up capacitors.)  I did not explain RC time constants, high-pass filters, or even voltage dividers, promising that all the theory for this circuit would be coming over the next two weeks.

  • resistor color codes. I did not give the full resistor color code, but just explained the red-red-orange-gold bands on the 22E3Ω±5% resistors we had.
  • breadboard layout. I explained what holes were connected to what on the breadboards, and why the central channel was there (for dual-inline packages, which also dictate the 0.1″ spacing).
  • black/red color convention. I insist on students using black for GND and only for GND, and using red for the positive power rail (3.3V in this case) and only for the positive power rail.  I handed out about 4″ each of red, black, blue, and green 22-gauge wire to each pair of students.  (The lab has a couple of big spools of white and orange 24-gauge wire, but I’ve found 24-gauge unreliable in breadboards, so we’re going to use small amounts of 22-gauge instead.)
  • plotting two channels with gnuplot.  The assignment called for plotting the same signal twice, once at 50Hz and again down-sampled 10× to 5Hz), so I needed to show them how to plot both on the same plot in gnuplot (plot “data.txt” using 1:2, “data.txt” using 1:3 ).
  • V always relative to ground.  I reminded students that voltage is always the difference between points, and when we talk about the voltage at one node (like at the input), we always mean relative to the special node we call ground.
  • SchemeIt to create schematics.  I suggested to students that since the report this week is primarily about learning to use the tools they’ll need all quarter, it would be best if they reproduced the schematic using SchemeIt, rather than just cutting-and-pasting from the book.
  • function generator and oscilloscope demo. I demonstrated the use of the function generator and told them about the peak-to-peak voltage being a deliberate lie and needing to double what the function generator claims the output is (since we don’t use the expected 50Ω load, but an effectively infinite resistance).

After the mini-lecture, I had the students set up the function generators and observe the output on the digital oscilloscopes.  They also built their circuits, which I inspected before they powered them up.  There were the usual confusions about what holes were connected, but they seemed to clear up faster than usual this year.  For the morning lab, I had not mentioned the “V relative to ground” convention at the beginning of class and had to do a very short mini-lecture in the middle of class.  Perhaps because I made notes on the board of everything I ended up covering in the first lab, the second lab went a lot smoother.

I did find out this evening that one group had not read the assignment properly and missed the whole point of the sampling and aliasing lab—they only recorded one channel of data, not two at different sampling frequencies.  They’ll borrow correct data from another group (with appropriate credit).  I hope that the other group put appropriate metadata in the notes, so they can figure out what they are looking at.  I also hope that finding out at the last minute that they’d done the lab wrong will induce the students to read the assignments before lab in future, when the stakes are higher.  I am requiring pre-lab homework to be turned in on Mondays starting next week, so there will at least be a deadline before lab for them to have done some of the reading and thinking.

The students still have not gotten their full parts and tools kits.  They got breadboards and electrolytic capacitors today—we only loaned the 22kΩ resistors, since the resistor assortments have not arrived yet.

I was in the lab essentially all day 9:45—17:45, except for a break to eat my lunch just outside the lab between the two lab sections.  During that time I helped a lot of the students with installing the software they needed.  Incidentally, the widened hallway outside the lab is a popular study spot for engineering students (there are frequent formal and informal group study sessions there)—the area has been informally named “Jack’s Lounge” after the picture of a generous donor at the entrance (Jack Baskin, after whom both the building and the School of Engineering is named).  I don’t know if the implication is intended to be that Jack’s idea of “lounging” is studying hard, but if so it is rather flattering to him.

Next week’s lab will probably require more of my time, as they involve the temperature measurements, and I have to set up the hot water urn and ice water well before class starts.

2014 May 1

Sampling and aliasing lab

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 21:30
Tags: , , , , , ,

Yesterday, I only briefly mentioned sampling and aliasing, which was the subject of today’s lab.  I was hoping they would read the handout, as that has some of the explanation missing from the lecture. That, as usual, turned out to be a forlorn hope. Some of them did read the handout, but not in a way that gained them any comprehension, and no one had done the prelab exercises, so the first hour (or more) of lab time was spent with students trying to figure out how to do a high-pass filter that did level shifting, so that the output would be in the 0–3.3V range of the analog-to-digital converter.  They all got to reasonable designs eventually (with capacitor values in the range 4.7µF to 470µF—I really like that the answer is not dictated by having only a small selection of components!).  I did have to re-teach Thévenin equivalents to some of the teams, as they were not getting the RC time constants that they claimed.

The level-shifting high-pass filter design will be useful again next week, for connecting the microphone to an op-amp audio amplifier.

I did not bring the stroboscope into lab as a demo—the demo had not worked all that well last year, and the students have all seen stroboscopes before.

PteroDAQ worked well for doing downsampling, and students recorded several waveforms.  I’ll see whether anything sensible is said about them in this week’s lab reports.  At least they had fun looking at the weird beat patterns you get if the signal you are looking at is close to the Nyquist frequency.

I also got the data today from the students who had a loudspeaker that behaved differently from everyone else’s on Tuesday (they tested another loudspeaker with the identical setup and got normal results, and I checked a few of their measurements—I believe they did just have a weird speaker).  There was a little metadata missing (like exactly what their fixed resistor was for converting current to voltage), but I was able to fit their data with just two more parameters on the model, a resistor and capacitor in parallel with each other, in series with the rest of the model:

    The bad loudspeaker has a higher than expected resistance at low frequency, then a 1/f-sloped region after the resonance peak, then a return to normal behavior. I modeled this loudspeaker by adding an extra R||C in series with the model we used for good loudspeakers.

The bad loudspeaker has a higher than expected resistance at low frequency, then a 1/f-sloped region after the resonance peak, then a return to normal behavior. I modeled this loudspeaker by adding and extra R||C in series with the model we used for good loudspeakers.

I have no explanation for the physical or electrical causes of an extra R||C in the loudspeaker.

%d bloggers like this: