# Gas station without pumps

## 2019 June 10

### Make magazine has folded

Filed under: Uncategorized — gasstationwithoutpumps @ 15:31
Tags: ,

Last Friday, Maker Media halted operations and laid off all staff [https://techcrunch.com/2019/06/07/make-magazine-maker-media-layoffs/].  That means no more Make magazine and no more Bay Area Maker Faire.  Sigh, I’d just renewed my subscription to the magazine a month ago!

There is currently a gofundme campaign (https://www.gofundme.com/lets-save-maker-faire) to keep the servers running for the digital content, but it is not organized by the remnants of Maker Media, so I don’t know how legitimate it is.

Running a print publication theses days is a difficult business, and the Maker Faires relied heavily on industrial sponsors, who seem to have left for other opportunities.  Maker Media was relying on venture capital, but there was no path to profitability, so venture capital dried up.

There are some thoughts that the organization may be rebuilt as a not-for-profit, since their biggest successes were in education.  That might be a good way to rescue the core of the business, particularly if some of the startups that have made it big decide to donate.

I’ll be watching for news on further developments.

## 2019 June 2

### Thirty-sixth weight progress report

Filed under: Uncategorized — gasstationwithoutpumps @ 22:38
Tags: , , , , , , , ,

This post is yet another weight progress report, continuing the previous one, part of a long series since I started in January 2015.

I was finally getting my weight back into my self-chosen target region when further progress slowed, and I’m seeing a gradual weight gain again.

Keeping my weight down has been an ongoing struggle. If I don’t pay close attention to how much I eat, my weight creeps back up, and I have to work pretty hard to reset it.

I’ve been bicycling an average of about 5 miles a day, but I’ve had to stop running (at least for a while, see Running hiatus), so my exercise level has been ok.  That is about to change, though, as I only have one more week of classes, after which I’ll be bicycling to campus much less frequently.

The end of Spring quarter and the beginning of summer seem to be bad times for weight gain—I think that the heavy grading load results in less physical activity and more snacking. Then the lack of bike commuting kicks in and my level of physical activity drops even further.  Perhaps this summer I’ll get a gym membership or pay to use the University equipment, as I want to learn how to run on a treadmill (which is supposedly easier on arthritic hips than running on pavement).  I’m going to have to do something, as I have 6 months a year for the next two years of not needing to be in my office on campus, and bike commuting is currently about my only exercise.

I have been snacking a lot during my grading, and it is likely to get worse: I estimate I have about 85–150 hours of grading to do in the next two weeks, depending on how much commentary I put in the student papers.  I generally reduce the feedback on the last paper, because I think that very few students look at the feedback when they know that they won’t be doing another paper for me.  But even at the minimal level that I consider responsible, I have more than a full time job grading for the next two weeks.  I’m already running a little behind schedule (about two days), as I had hoped to have started grading Lab 12 this weekend, but I only just finished grading Lab 10+11 late Sunday night.

## 2019 May 22

### Interaction between bias resistor and active high-pass filter

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

In grading the preamplifier lab, I made a mistake when correcting a number of student papers.  Students who had used a bias resistor rather than a transimpedance amplifier to convert the microphone’s current output to voltage had not taken into consideration the interaction between the bias resistor and the input impedance of the next stage, which was usually an active high-pass filter.  In grading, I overcorrected the student work, changing both the i-to-v gain and the first-stage gain, when the correct action would have been to change either one, leaving the other alone.

Schematic of bias resistor and active high-pass filter. The input is the current I_in.

The passband gain for the circuit is $R_b\frac{R_f}{R_b + R_i} = (R_b || R_i) \frac{R_f}{R_i}$. The first version corrects the gain of the filter, while the second version corrects the gain of the current-to-voltage conversion. In my grading, I mistakenly applied the correction twice getting $(R_b || R_i) \frac{R_f}{R_b + R_i}$.

There are two ways to get to the correct answer: using Thévenin equivalence and from first principles.

If we replace the current input and $R_b$ with a Thévenin equivalent, whose AC voltage is the AC component of $I R_b$ and whose resistance is $R_b$, then we get a simple active high-pass filter with passband gain $\frac{R_f}{R_i + R_b}$ for a total passband gain of $R_b\frac{R_f}{R_b + R_i}$ and a corner frequency of $\frac{1}{2 \pi (R_i+R_b) C_1}$.

For those who don’t quite trust themselves to do Thévenin equivalence, we can use first principles to reason about the various currents in the schematic. The negative-feedback loop holds the op amp’s negative input to $V_{ref}$, and the input node has a voltage, so we get
$V_{input} = V_{dd} - I_b R_b = V_{ref}-I_f \frac{j\omega R_i C_1 + 1}{j \omega C_1}$
which we can rearrange to get
$I_b = \frac{V_{dd} - V_{ref}}{R_b} + I_f \frac{j \omega R_i C_1 + 1}{j\omega R_b C_1}$.
Because $I = I_b + I_f$, we get
$I= \frac{V_{dd} - V_{ref}}{R_b} + I_f \frac{j \omega R_i C_1 + 1}{j\omega R_b C_1} + I_f$
and can solve for $I_f$ to get
$I_f = (I- \frac{V_{dd} - V_{ref}}{R_b}) \frac{j\omega R_b C_1}{1+j\omega(R_b+R_i)C_1}$.

Finally, because $V_{out}-V_{ref} = I_f R_f$, we get
$V_{out}-V_{ref} = R_f (I- \frac{V_{dd} - V_{ref}}{R_b}) \frac{j\omega R_b C_1}{1+j\omega(R_b+R_i)C_1}$.

Our transimpedance gain (including the DC offsets for input current and output voltage) is
$\frac{V_{out}-V_{ref}}{I- \frac{V_{dd} - V_{ref}}{R_b}} = R_f \frac{j\omega R_b C_1}{1+j\omega(R_b+R_i)C_1}$.
At DC, this has the appropriate gain of 0, and for high frequencies (in the passband), the gain is approximately $\frac{R_f R_b}{R_b + R_i}$, as claimed earlier. The corner frequency, where the real and imaginary parts of the denominator match is at $\omega = \frac{1}{(R_b+R_i)C_1}$.

## 2019 May 20

### Why charitable giving

Filed under: Uncategorized — gasstationwithoutpumps @ 11:32
Tags:

I have done some thinking about charitable giving (mainly during my morning bike commute, which is long enough for random musings on all sorts of things) without the benefit of reading the articles.

My first conclusion is that before I decide how much to give to charity and who to give it to, I need to get clear in my own head why I’m giving, so that the action will further the goals.  I tried to list mentally various reasons that people might have for charitable giving, to see which ones resonated with me.  Here are a few reasons I came up with:
• feeling good about oneself.  Giving altruistically with no return makes one feel noble and virtuous.
• giving back or paying forward. Acknowledging that one has been given much by others and reciprocating makes for a fair balance.
• virtue signaling. Letting others know that one is a good person (or faking it, to hide being not such a good person) seems to be a bit too manipulative, but serving as a good example to others is not a bad thing.
• making the world a better place. Fixing everything wrong in the world is impossible, but progress can be made in small steps.
• participating in a community. Joining a group dedicated to making some improvements can provide a circle of similarly minded people who are good to have as friends and associates.
• reducing the money given to the government or to heirs.  Giving money away to charity can reduce the amount paid in taxes while living or the amount left to others when one dies.
• religious or social obligation.  Require charitable giving as a tenet of a religion is common, though this requirement has often been corrupted into con games to enrich the leaders of the religion at the expense of the followers.

There are undoubtedly many other possible reasons for charitable giving.

I was brought up to believe that good people are charitable, so feeling good about myself requires charitable giving.  I do not feel further obligation to those organizations that supported me when I was younger—most of them have already received more from me than they provided—but I do feel an obligation to provide for others some of what was provided for me.  That is, “paying forward” makes more sense to me than “giving back”.

Virtue signaling is not a big deal for me—I don’t feel any need to trumpet my contributions.  But I do believe in setting an example, so I don’t feel obliged to keep my donations secret either.  If my modest contributions can encourage those wealthier than me to give more, then I don’t mind my name appearing on donor lists.  Being an example does not require boasting—I’ve been quietly advocating for bicycle transportation for decades by relying on my bicycle for transportation, rather than getting a driver’s license.  Some people have been inspired by this example to try the car-free life themselves, or at least to try bike commuting occasionally.

Making the world a better place seems to me to be the main point of philanthropy—but this broad goal is so vague that it does not provide a lot of guidance on where to give.  The tiny amounts of money I have to give cannot make much difference to the world as a whole—so should I concentrate on improving a small part of the world (like the local community), look for giving that may have a large effect in future (giving to research, for example), or having maximal effect right now.  Are political changes more or less important than direct services to those in current need?

I’m not much motivated by tax consequences, nor by religious or social obligations.

The two reasons for giving that resonate with me right now are feeling myself to be a good person and making the world a better place.  The main thing I feel I need to think about is in what ways I can effectively make the world (or some small part of it) better.

Readers, what reasons for charitable giving have I missed? What motivates you to give?

## 2019 May 10

### Inductive spikes

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

One of the labs in my textbook Applied Analog Electronics asks students to look at the inductive spikes created by switching a nFET on and off with a loudspeaker as a load:

A 5V pulse signal to Gn will turn the nFET on.

My students were very confused when they tried the experiment, because they got a different result:

What the students got at the nFET drain went a little above 5V, but did not have the enormous inductive spike they expected.

Of course, I lied to you a little about what their circuit was—they were working with half-H-bridge boards that they had soldered:

The half H-bridge boards have a pFET and capacitor on them, as well as an nFET.

The pFET was left unconnected, so the circuit was really the following:

The gate and pFET source were left floating in the student setups.

So what difference does the pFET make? Well, with the gate floating and staying near 0V, the pFET turns on when the pFET source voltage gets high enough, allowing the capacitor to charge.

The pFET source gets up to about 7.2–7.3V, and the time constants for the capacitor and loudspeaker are long enough that the capacitor looks like a power supply (not changing voltage much on this time scale), so that the body diode of the pFET snubs the inductive spike at about a diode drop above the pFET source voltage.

So how did I miss this problem when I did my testing before including the lab in the book? One possibility is that I left out the bypass capacitor—without it you get the expected spike. But I know I had included the capacitor on my half-H-bridge boards—I had to solder up a board without the bypass capacitor specially last night, in order to get the “expected” plot in the first plot of this post.  I think what happened is that when I had done my tests, I had always connected the pFET gate to the pFET source, to ensure that the pFET stayed off, but when I wrote the book, I forgot that in the instructions. Here are the plots of the board with the pFET gate and source tied together (both floating), both floating separately, and with the them both tied to 5V:

With the pFET gate and source tied together, the circuit behaves as expected, with large inductive spikes if the pFET source is floating, but snubbed to a diode drop above 5V if the source is tied to 5V.

The pFET source voltage gets quite high when the pFET gate and source are tied together to keep the FET off, but they are not tied to the power rail:

Because the pFET never turns on, the body diode and capacitor acts as a peak detector, and the capacitor charges until the leakage compensates for the charge deposited on each cycle, around 33.7V, snubbing the inductive spike at about 37V (more than a diode drop above, but the duration is short).

This summer and fall, when I’ll be working on the next edition of the book, I’ll be sure to improve the instructions for the FET lab!

« Previous PageNext Page »