Gas station without pumps

2019 February 15

Why do I write?

Filed under: Circuits course — gasstationwithoutpumps @ 19:56
Tags: ,

O Why Do You Write? Charles French asks

I have a question for all you out  there who write, and that includes writers of books, poetry, plays, nonfiction, and blogs. If I left out any kind of writing, you are included also.

Why do you write?

I wrote my textbook Applied Analog Electronics because I was creating a course for which I could find no suitable textbook. I wanted a college-level introduction to electronics that was focused on designing things, not on applied math. I don’t have an objection to math (there is plenty in my textbook), but I wanted it to be there to solve a particular design problem, not just with sterile exercises. The central theme of the book had to be iterative engineering with design, construction, and debugging of interesting circuits, with almost everything else as support for that activity.

All I could find on the market either delayed design until the third or fourth course (which seems to be the standard approach in EE departments) or was very hand-holding—telling students exactly what to wire and leaving no electronics design to the students.

When I started the book writing, I already had a fairly thorough set of lab handouts and felt that the book would be a simple rewrite with a bit of additional material. Boy, was I wrong!

The book has taken over much of my life (when I’m not teaching the course from it or grading student work) for the past few years. I had a “finished” draft at the beginning of January, but students in my class have pointed out about 170 problems with it, and they are only halfway through the book. A lot of the problems were tiny copy-editing things (commas, spaces, spelling errors), but some were substantive. I have about 50 to-do notes accumulated for me to work on this summer.

I think that this year’s students have been motivated to find errors by the token amount I pay for each error found (25¢) and by the “leaderboard” on Piazza, where I keep track of what I owe each student. To encourage more feedback, I try to be generous in allocating the quarters—something doesn’t have to be a real mistake, if I agree that the wording can be improved or something needs to be rewritten for clarity or completeness.  Students can ask questions about something they don’t understand, and if that triggers a specific idea for a change to the book, I give credit for that also.  (Having question-triggered corrections means that even students at the bottom of the class can get credit for book corrections.)

The question of why I write on this blog is a harder one.  Sometimes I am trying to share something I learned, sometimes I’m asking for help finding a solution to a problem, sometimes I’m motivating myself by making something public (like my weight and exercise records), sometimes I’m just thinking out loud (like many of my posts about the design of my course).  I’d like to say that I blog for the social connections, but so few people respond to my posts that I can’t really pretend even to myself that I am having a conversation.

I think that a few of my posts have been valued (at least Google thinks enough of them for people to come to them with searches), so I have some incentive to keep on writing.

2019 January 21

More typos than expected

Filed under: Circuits course — gasstationwithoutpumps @ 16:53
Tags: , ,

When I released my textbook in December, I offered 25¢ for each typo or other mistake found in the book.  I expected, based on how much material was new, to have about 50 typos in the book.

My students have already found 42 errors, and they are only up to about page 200, so I’m having to revise my error estimate upward to about 100 errors.

This year’s class seems to be pretty sharp—they have done much better on the first two quizzes than last year’s class did, and in two weeks they have already found about as many typos as last year’s class did over two quarters.

2019 January 8

Struggles with Canvas

Filed under: Circuits course — gasstationwithoutpumps @ 11:30
Tags: ,

Yesterday (2019 Jan 7) was a crazy day for me.

I got up early to walk my son down to the bus station for his trip back to college, then bought groceries, walked home, had breakfast, and cycled to work. It was the first day of class, so I had meetings with my teaching team (5 undergrads, but one was snowed in at Tahoe and unable to make the meetings—there were two meetings, because no time worked for all five students).

I spent most of the day struggling with “Canvas” the learning management system that the campus makes us use. Setting up courses on it is a major pain, even if all you use it for is turning in assignments and grading them. My course has 12 homeworks, 6 prelab reports, and 5 design reports, plus about 10 quizzes.  One of the problems is that each assignment takes many mouse clicks to create— setting the name, the due date, the number of points, the grace period for submission, whether it is a group assignment, what group set it is associated with … .  Setting up lab groups the way I wanted turned out to be impossible in Canvas.  I wanted random pairs, respecting section boundaries, with no pair of students working together twice.  Even the simplest version of this (doing random pairings without the no-repetition constraint) didn’t work in Canvas, which tried creating one group of 3 and one singleton, for a section with an even number of students.

I figured that it would be easiest for me to create the pairings on my own computer and upload them to Canvas. But Canvas doesn’t have any way to upload group assignments! The only way it supports instructor-assigned groups would have required about 1000 mouse clicks. I ended up doing the assignments on my computer and posting them on the class bulletin board, telling the students to enter themselves into the assigned lab groups. I hope that this did not violate any FERPA rules (I checked the summary provided to faculty and it looked ok, but it would have been better for Canvas to have permitted uploads, so that I didn’t need to worry).

Lecture went ok, but afterwards I found that one of the figures in my book had gotten messed up between the Dec 15 and Dec 30 releases, and I had to come up with a new way to create the figure and re-release the book. LeanPub is nice in that anyone who has bought the book can pick up the new releases for free.  I think some of my students haven’t figured this out yet, as there have been more uses of the free coupon I issued than there are students in the course.

So I was continually busy from 6am when I got up to midnight when I got to bed. This morning I went for a 1.5km run in light rain before breakfast, created the quiz for tomorrow’s class, and cycled up to campus for office hours, faculty meeting, and 4 hours of instructional lab. Today is (probably) not going to be as hectic as yesterday was.

The new complex-number exercises in the book have prompted a couple of students to come in for help, as they did not really understand Euler’s formula.  I ended up redrawing and re-explaining the figure from the book, and that seemed to help them.  I’m hoping that this complex-number review will make it easier for them when we get to complex impedances.

One figure has been giving me grief for a long time

Filed under: Circuits course — gasstationwithoutpumps @ 09:22
Tags: , , ,

There is one figure in my book that has been giving me trouble for a long time:

A Moiré pattern figure for the sampling and aliasing chapter that was giving me trouble.

The figure itself is very simple, and it should have been no trouble at all. I created the figure in hand-written SVG, and all the SVG readers (Inkscape, Preview, and browsers) had no trouble rendering it on the screen. But when Inkscape converted it to PDF (using the Cairo library, I believe), it threw away the black bars in the background. When I asked Inkscape to print the image to PDF, it rotated the image.

For a while, I got away with rerotating the image in Preview and saving the result, but the file got damaged or deleted at some point, and redoing the rotation in Preview no longer worked—pdflatex seemed to have no idea that there was a rotation nor a bounding box any more.  (I think Preview changed when I upgraded the mac OS on my laptop.) This change happened between the 2018 Dec 15 and 2018 Dec 30 releases of the book, so the Dec 30 release had a messed-up figure without my realizing it.

Yesterday evening, I noticed the problem and set about trying to fix it.  Nothing I could do with Inkscape or Preview seemed to work—I either ended up with no black bars or with the image rotated and scaled wrong.  (Viewing the individual image with Preview sometimes worked—but the inclusion by pdflatex was failing in those cases.)

Finally, I decided that since Inkscape was incapable of rendering in PDF the pattern-fill I was using to create the bars, that I would give up on pattern fill to create them.  Instead I used a Python program to generate separate rectangles.  Inkscape had no trouble converting that longer but less sophisticated SVG program to PDF, and I was able to fix the figure.

Because this figure was messed up in the “final” release of 30 Dec 2018, I did a quick re-release last night, fixing this figure and a bunch of typos students had found.  Yesterday was the first day of class, and students have already reported 7 errors in the book (one reported after yesterday’s release, so it is still in the current version at LeanPub).

This year’s class seems to be very diligent, as all the students had the book downloaded by the first day of class, and some had started on the homework.

2019 January 6

OpenScope MZ review: Bode plot

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 14:47
Tags: , , ,

Continuing the review in OpenScope MZ review, I investigated using the OpenScope MZ for impedance analysis (used in both the loudspeaker lab and the electrode lab).

Waveforms Live does not have the nice Impedance Analyzer instrument that Waveforms 3 has, so impedance analysis is more complicated on the OpenScope MZ than on the Analog Discovery 2.  It can be done well enough for the labs of my course, but only with a fair amount of extra trouble.

There is a “Bode Plot” button in Waveforms Live, which performs something similar to the “Network Analyzer” in Waveforms, but it uses only a single oscilloscope channel, so the setup is a little different. I think I know why the Bode plot option uses only one channel, rather than two channels—the microcontroller gets 6.25Msamples/s total throughput, which would only be 3.125Msamples/s per channel if two channels were used. In contrast, the AD2 gets a full 100Msamples/s on each channel, whether one or two is used, so is effectively 32 times faster than the OpenScope MZ.

We still make a voltage divider with the device under test (DUT) and a known reference resistor, and connect the waveform generator across the whole series chain.  Because there is only one oscilloscope channel, we have to do two sweeps: first one with the oscilloscope measuring the input to the series chain (using the “calibrate” button on the Bode panel), then another sweep measuring just across the DUT.  The sweeps are rather slow, taking about a second per data point, so one would probably want to collect fewer data points than with the AD2.  Also there is no short or open compensation for the test fixture, and the frequency range is more limited (max 625kHz).

The resulting data only contains magnitude information, not phase, and can only be downloaded in CSV format with a dB scale.  It is possible to fit a model of the voltage divider to the data, but the gnuplot script is more awkward than fitting the data from the impedance analyzer:

load '../definitions.gnuplot'
set datafile separator comma

Rref=1e3

undb(db) = 10**(db*0.05)
model(f,R,C) = Zpar(R, Zc(f,C))
div(f,R,C) = divider(Rref, model(f,R,C))

R= 1e3
C= 1e-9
fit log(abs(div(x,R,C))) '1kohm-Ax-Bode.csv' skip 1 u 1:(log(undb($2))) via R,C

set xrange [100:1e6]
set ylabel 'Voltage divider ratio'
plot '1kohm-Ax-Bode.csv' skip 1 u 1:(undb($2)) title 'data', \
      abs(div(x,R,C)) title sprintf("R=%.2fkohm, C=%.2fnF", R*1e-3, C*1e9)

The fitting here results in essentially the same results as the fitting done with the Analog Discovery 2.

Although the Bode plot option makes the OpenScope MZ usable for the course, it is rather awkward and limited—the Analog Discovery 2 is still a much better deal.

Next Page »

%d bloggers like this: