3 ms·
I believe this is supposed to be the first in a series on moving from continuous to discrete optimization, but the EE in me can’t help but point out what I woul
by docfort 5y ago
I believe this is supposed to be the first in a series on moving from continuous to discrete optimization, but the EE in me can’t help but point out what I would do in this scenario. It also connects with other interesting aspects of physics.
Looking at the governing equations, you can clearly see that if R1 << R2, then the duty cycle is close to 50%.
With that done, I also would have fixed the cap to something that is available. Ignoring R1 for the moment (because I just need to ensure R2 is bigger), I solve for R2 in the frequency equation. It is approximately 72 kOhms.
I notice that a nonzero value of R1 is really there to tune the frequency. As long as R1 is much smaller than R2, then the frequency equation is more sensitive to changes in R1 than the duty cycle equation. So I can play with different small values of R1 to tune my frequency to get closer.
Finally, since I know that I’m likely using imprecise resistor tolerances, I know that I can pass if I just get close, so I might not need to be picky about R1.
In my opinion, this chain of reasoning (effective modeling, function sensitivity wrt parameters, tolerance specs) is what the lab experiment is actually about. Developing circuits that are tolerant to parameter variation is the key to real hardware products. That gives you so much flexibility in price and manufacturer and requires the designer to keep this kind of reasoning frontmost.
- WalterBright 5y agoHaha, this is just like designing a spring. You have a catalog of wire sizes, and wire materials, and an envelope. Too many unknowns, so a lot of trial and error before you start to hone in on an exact (but who knows if it is globally optimal) solution.
- kurthr 5y agoExactly, and if you know you're not going to get better than 1% metal film resistors, why search more than the discrete space. Between 10^2 and 10^6 there's only 6-96 steps per decade (12 for the standard 10% E12 series). There's less than 400x400 possible resistor values to check.
- stefanpie 5y agoI actually ended up doing some variation of this for scripts I wore for my labs. The space is actually quite small and it's not hard to brute force this problem. Once you get to more open ended designs and larger parameter spaces (like filters) it becomes a bit more challenging to brute force.
- hermitdev 5y agoOne of my degrees is in EE. This post surely took me back to some of the frustrating design labs and more unknowns than equations to solve them... I also definitely went down the route of just fixing the cap, because well, we only had like 2 or 3 of them in our parts kit, anyway. And I appreciate you mentioning the resistor tolerances because, no, you don't really have a 1 kOhm resistor. You have a 987 or 1009 or something else near 1000 Ohm resistor.
- ncmncm 5y agoThe insight that the only serious constraint is R1 << R2 is clearly the point of the lab exercise, and it might be missed entirely in numerically searching the space. But adding a flip-flop to the output to divide frequency by two yields an exactly 50% duty cycle, regardless of R1/R2, so you may then optimize for some other quality. The right question to the TA would have been about which of the specs mattered more: duty cycle? power consumption? stability against variation in parts, temperature, supply voltage, noise? absolute frequency? parts count? parts cost? Each different answer yields a different design. Nowadays a microcontroller might be best, e.g. if it meant you could get away without the resistors and capacitors.
- docfort 5y agoIn my experience, knowing what parts of a schematic can be ignored for understanding the core functionality is super important as a designer. Then I’m better able to compare two implementations that purportedly do the same thing on many different axes. Especially if I’m doing integrated circuit design as opposed to discretes. It also helps to build up conceptual complexity. For example, the post mentions briefly avoiding giant resistors for stability. Good enough rule to start out with. But eventually understanding how an op-amp does its thing using feedback is critical. Especially when comparing IC-equivalents, since now you also need to consider area as another metric of comparison. Brute force optimization avoids all of this learning, which is good in the short term (get the lab done) and bad in the long term (how to think about circuits).
- jason_s 5y agoor you throw away R1 and connect R2 between C and OUT.