Gas station without pumps

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.

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, 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.

Futuristic Lights office

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

Because my grades are all in and I didn’t have any appointments on campus today, I took the time to bicycle up to Scotts Valley with my son to see the Futuristic Lights office space.  The office is just over 8 miles from our house, near the top of Scotts Valley Drive. The got a pretty good deal on the office space, because Scotts Valley currently has a surplus of office space, and this particular office has almost no natural light (a tiny window into the next office, which has a skylight), but it is in a moderately new building, so is not run-down as I had feared from the rent they were paying. (See the Wasted Talent cartoon series “Office Saga” starting with “Office Saga—The Impetus” and particularly “Office Saga—New Lows” to see what I was fearing.)

Futuristic Lights has a bit more space than they need and they’ve set up folding tables and cheap shelving to make shipping easier.  While there, my son prepared 4 orders for shipping as well as some freebies (batteries and gloves) for some of their sponsored glovers. I helped out by assembling a number of sets of {Kinetic, 2 batteries, pull-tab, case, and diffuser}.  Each Kinetic is given a quick go/no-go test that checks out all three LEDs, the accelerometer, and (crudely) the processor. This tests consists of inserting a pair of batteries and giving the Kinetic a little shake—the LED starts red, but shifts to green and then blue with a shake.  Pressing the button changes the mode and the LED color, giving a button test as well.

The hardest and slowest part of assembling the parts for shipping is getting the flexible case over the board, batteries, and pull tab—there’s no way they would have gotten a commercial fulfillment company to do that right at an affordable price.  There are 6 pieces to make up each shippable Kinetic, and a standard order has 10 of the Kinetics, a pair of gloves, a drawstring bag, an instruction card, and a box: a total of 65 parts.

They’ve set up a pretty good system for the rest of the shipping, though, so they don’t really need a fulfillment company—at least not until their orders are 100 times what they are currently, at which point they might be able to afford one. I think that they do need to look into making their own cases, though, as the commercial ones that they are using have the logo of the company that makes the case, rather than the Futuristic Lights logo, and the cases are a bit of a pain to use every time the batteries need changing.

I did get a bit sun-burned on the ride to Scotts Valley—I’ve not been outside in short sleeves in quite a while, and my usual ride up to the UCSC campus is generally in the morning when it is still foggy, not in the early afternoon. Currently, I’m in a bit better shape than my son for bicycling (he’s not had a bike at UCSB), but by the end of the summer, he’ll be in better shape than me, after doing the Scotts Valley ride 4 or 5 times a week.

Next Page »

%d bloggers like this: