# Gas station without pumps

## 2015 July 1

### FG085 function generator output impedance

Filed under: Circuits course — gasstationwithoutpumps @ 01:01
Tags: ,

The output impedance of the FG085 function generator that I assembled yesterday is supposed to be 50Ω, so I decided to measure it by plotting RMS voltage as a function of load resistance:

RMS voltages were measured with a Fluke 8060A multimeter with the FG085 set to 100Hz and 5V.

The RMS voltage measurements are consistent with a series resistance of 46.66Ω (slightly less than the 50Ω spec) and with a peak-to-peak voltage of 5.018V (slightly more than the 5V requested).

It would be interesting to determine whether there is a parallel capacitance or series inductance that affects the output impedance. I may have difficulty measuring that, as the values are likely to be small, and so their effects will only be visible at high frequency, which the function generator is not very good for generating.

With the Fluke 8060A meter set to AC voltage, I should be providing a 10MΩ load with at most 100pF in parallel, and with that load I see no drop in voltage until about 200kHz.  The power drops by 2 (amplitude by $\sqrt{2}$) at around 277kHz, after which the voltage drops as a second-order filter (that is as approximately (277kHz/f)^2).  Since the 277kHz is a lower frequency than what I saw as a cutoff with the Bitscope oscilloscope (385 kHz and a first-order rolloff), I believe it is internal to the meter.

My voltmeters have a more limited range than the FG085 function generator—only the Bitscope digital oscilloscope allows me to make measurements at a high enough frequency to see the drop in voltage due to the function generator, rather than due to the measuring device.

I could take the function generator into the lab used for the circuits class, and characterize it a bit more precisely at the high frequency end, but I don’t think that will help much in determining whether there is extra capacitance or inductance in the output impedance of the function generator.  The problem is simply that the function generator doesn’t produce high enough frequencies for the inductance or capacitance to matter.

At 100kHz, a 33nF capacitor would have an impedance of –48j Ω, so small parallel capacitances (say, <100pF) would have negligible effect on the impedance of the series resistor. Similarly, at 100kHz, 80µH has an impedance of around 50j Ω, so small series inductances (say, < 1µH) would have negligible effect on the impedance of the function generator.

In short, I don’t see any easy way to improve the model of the function generator as a 46.66Ω source.

## 2015 June 30

### Sixth weight-loss progress report

Filed under: Uncategorized — gasstationwithoutpumps @ 11:20
Tags: , , ,

In 2015 New Year’s resolution , I said that I want to lose 10–15 pounds by June 2015. In Weight-loss progress report, Second weight-loss progress reportThird weight-loss progress report , Fourth weight-loss progress report, and Fifth weight-loss progress report I provided monthly updates.

June has been much the same as May—mostly keeping to the raw fruits and vegetables for lunch, but being a bit more relaxed about it than in the weight-loss months and allowing myself an occasional dessert or snack. My exercise has only dropped a little from during the school year, because I’ve still been cycling up to campus a lot, but that is likely to change during July—I hope to do most of my work from home this summer.

My weight has fluctuated a bit more this month than in May:

The peak weight came during a conference on campus—I ate a bit too much and drank a beer or two a day.

My weight is fluctuating about the amount I expected when I set up the target range, but is averaging about a pound more than it should to stay within the target. I’ll see if I can drop that pound over July, without having to go back to being overly strict about the diet.

### FG085 function generator

Filed under: Circuits course — gasstationwithoutpumps @ 10:15
Tags: , ,

I finally had time today to assemble the FG085 function generator kit that I bought last September (it’s been a busy 9 months).  I bought the kit from Sparkfun, on sale for $38 (it is now$50 from them or $47 from jyetech, who make the kit). The assembly is fairly simple, as they’ve already done all the surface-mount soldering, leaving only the through-hole parts to solder—about 200 solder points. I managed to make two stupid mistakes that required unsoldering—I soldered one of the 21 push buttons on the wrong side of the board and I forgot to peel the protective strip off the LCD display before soldering the BNC connector in place. The BNC connector is strangely mounted, so that the front panel can’t be removed without unsoldering the connector. Both errors were ones I realized right after I made them, and were fairly easy to fix. The function generator seems pretty easy to use, though not all the user interface is intuitive, as there are well-hidden features like that pressing “.” twice allows you to change the duty cycle of the square wave. Jyetech has pretty good documentation on-line though, including a user’s manual and a schematic for the function generator. They do direct digital synthesis with a 2.5MHz sampling rate and an 8-bit DAC, then scale the amplitude and add an offset. At 40Hz and below they drop the sampling frequency to 10kHz,in order to get a more precise frequency. They only claim to go to 200kHz (12.5 samples per period), but their low-pass filter at the DAC has a corner frequency of 1.426MHz (C=180pF, R=470Ω+150Ω) if their schematic is right. (Update 2015 Jun 30: that’s from Schematic_085F.pdf—from Schematic_085G.pdf, the corner frequency should be 713kHz.) So they are not really filtering down to 200kHz, and the software allows the user to enter up to 999,999Hz (in steps of 1 Hz). I checked the amplitude of the output using my Bitscope USB oscilloscope, with the FG085 set for 5V peak-to-peak and 0V offset: The low-pass filter in the FG085 function generator seems to be set for about 400kHz. At the higher frequencies the waveform is far from sinusoidal (3 points per period at 833,333Hz), and the beating due to phase change if the period is not exactly a power of 2 times the sampling period makes for pretty dancing patterns on the oscilloscope, but the amplitude is hard to read. I think that the bandwidth is about 400kHz, though the distortion of the waveform is pretty bad when the number of samples is tiny, so treating the signal as a sine wave is a bit dubious above about 100kHz. Because the bandwidth is so different from what I compute from their schematic, I suspected that either their resistor value or capacitor value in the low-pass-filter is misreported. A 2kΩ resistor instead of a 470Ω resistor for R9 leading into a 180pF capacitor C12 would match the behavior better (or C13 was populated despite the schematics). It is a little hard to figure out the size of capacitors on the PC board (they’re not labeled), but the resistor R9 does appear to be 470Ω, so I’m still a little mystified where the 400kHz corner frequency is coming from. I don’t know for sure whether the inaccuracy in the voltage measurements at low frequency is from the frequency generator being miscalibrated or from the Bitscope’s lack of calibration, but I suspect the function generator. If the 2V peak-to-peak 1kHz signal out of my Kikusui oscilloscope is accurate (a bit questionable), then the Bitscope is only reading 1% high, so the voltage errors would be in the function generator. I tried doing an FFT with the Bitscope, to see how much harmonic distortion there is (limited by the 8-bit resolution of both the function generator and the oscilloscope. The oscilloscope reports components at the desired frequency, but also at 2.5MHz ± the desired frequency. These two sidebands are about 40dB down, which is not too bad for an 8-bit DAC. Incidentally, I noticed that they used a very cheap and noisy DAC—just a resistor ladder with ordinary output pins from the processor driving it. Looking at a low-frequency waveform, there seems to be a glitch of about 30mV (on a 2V peak-to-peak signal) at the 8 transitions that correspond to the top three bit positions. This sort of non-linearity error is what you would expect from the very low-quality DAC they used. On the Bitscope FFT, the errors are near the noise floor, but there is a consistent set of 9th, 11th and 13th harmonics about 50dB below the fundamental. The FFT also points out a 3rd harmonic about 40dB down from the fundamental. I suspect that they could have made a better function generator for about the same price by using a more modern microprocessor—Freescale’s KL25Z includes a 12-bit DAC with a 550kHz bandwidth, with much better non-linearity than what they achieved—the chip is a bit more expensive, but would add at most$1 to their parts cost—it may actually be cheaper, if it replaces some of their other parts as well.

They adjust the gain and offset in amplifiers after the DAC, but it looks like they just use a 100-position digital potentiometer for the gain and PWM from the ATMega168 for the offset. They monitor the output voltage (before a 22Ω output resistor, not directly at the output), and adjust the offset and voltage to get the peaks more or less right. Given that the digital pot has only 100 positions, the accuracy on that can’t be much better than 1% of the largest amplitude setting, or 0.1V.

For under \$50, I did not expect a super-high quality function generator, and I didn’t get one, but FG085 looks like it might be usable for a number of less critical applications. I’ll probably try doing the labs in the book using it—most of them don’t rely on a very high quality sine wave, nor a very high frequency.  The ability to set the DC offset to 0V makes this a much more useful function generator than the one built into the Bitscope or the analog Elenco FG500 that I’ve talked about before.

## 2015 June 19

### Teaching as public speaking

Filed under: Uncategorized — gasstationwithoutpumps @ 21:57
Tags: ,

“Dean Dad” recently wrote a post Confessions of a Community College Dean: When Public Speaking Works Best, in which he talked about the advantages of improvised talks over highly prepared ones:

My best moments as a speaker have consisted of a layer of improvisation on top of a prepared framework. The words were substantially ad-libbed, but in a context that had been thought through in advance. Having the safety net of a clear framework, the knowledge of where I was going, and the security of knowing that the worst that could happen wouldn’t do permanent damage, made it possible to follow the muse of the moment. I could improvise knowing the direction I wanted to go, and having faith that I’d get there one way or the other.

That is my usual modus operandi for giving talks or class lectures. I start by figuring out what I want to cover and (sometimes) in what order, and make sure I understand the material thoroughly.  There have been a couple of times when I’ve had to give lectures on material I’m not completely comfortable with, and the results are not really satisfactory.  I know that there are people who can give scripted lectures from prepared PowerPoint slides on stuff they don’t really understand, but I can’t—I have to have the stuff really solid in my head. (Which is not to say that I never pass on mis-information—I have sometimes realized after further study that I’ve been teaching a simplification that is incorrect.)

My best classes usually have no more than about 5 words of lecture notes, reminding me of the topic of the day—the entire performance is improvised off of those notes, together with lots of “audience participation”—getting the students to ask questions and come up with partial solutions.  Such talks do not use prepared slides, but blackboard/whiteboard or live coding (for programs like gnuplot, where the concepts really rely on seeing what the program does with various scripts).  I also get a lot of digressions in the best classes, when students ask about what really interests them, rather than what I have prepared.  If the digressions are valuable and I know enough to go in that direction, I’ll take them.  If I don’t know enough, I’ll usually put the students off until the next lecture, so that I have time to do some reading.

I have, once, given a talk with a carefully written-out script (see Video of Designing Courses talk), when I had a very short time slot to present a large amount of material. The results were OK, but not as good as the longer, slower improvisational presentation I use in classes.

### 2015 AP Exam Score Distributions

Filed under: Uncategorized — gasstationwithoutpumps @ 21:36
Tags: , , ,

Once again this year, I’m posting a pointer to 2015 AP Exam Score Distributions:

Total Registration has compiled the following scores from Tweets that the College Board’s head of AP, Trevor Packer, has been making during June. These are preliminary breakdowns that may change slightly as late exams are scored.

I don’t know why I provide this free advertising for Total Registration, as I have no connection with the company, and do not endorse their services.  If the College Board would collect Trevor’s comments themselves, I’d point that page.  The main interest in AP result distributions comes in May, when students are taking the tests, and July when the students get the results.

The official score distributions (still from 2014 as of this posting—new results don’t go up until the Fall) from the College board are at https://apscore.collegeboard.org/scores/about-ap-scores/score-distributions, at least until the College Board scrambles their web site again, which they do every couple of years, breaking all external links.  They post a separate PDF file for each exam, which makes comparison between exams more difficult (deliberately, I believe, since inter-exam comparison is not really a meaningful thing to do).  It is also difficult to get good historical data on how the exam scores have changed over time—College Board probably has it on their website somewhere, but finding stuff in their morass is not easy.

My most popular post this year was once again How many AP courses are too many?, with about 19 views per day.  (It has also come in second over the lifetime of the blog, behind 2011 AP Exam Score Distribution.) The question of how many AP courses seems to come up both in the fall, when students are choosing their schedules, and in the spring, when students are overwhelmed by how many AP courses they took.

There aren’t many exams graded yet (only 11 on the Total Registration site), so I don’t have much to say about the results.  I probably won’t be looking at the exam scores much this year, since my son is no longer eligible to take AP exams, having graduated from high school. I might look at some of the statistics for the AP computer science exam, as I have some interest in seeing whether there are any changes in the number of test takers.  The interesting results (about gender and geography) won’t come out until the fall reports.

Next Page »