oscillator amplitude question - Page 1
Forum section: electronics / beginners

author: cellularmitosis
author_rank: Unknown
timestamp: March 06, 2015, 08:45:39 pm
content: I was looking at oscillators and came across this one:http://en.wikipedia.org/wiki/File:Oscillator_hartley_opamp.svgI think I can reason about how it works (one op amp pin seems the voltage across the entire LC tank, but the other op amp pin sees the voltage tapped in between the inductors, so as the tank oscillates the op amp will never be able to see the same voltage at both pins, so it keeps the oscillation going?)However, what I don't yet understand is how to reason about the amplitude. Would the oscillations simply grow until the op amp started hitting its rails? And at that point would the sine wav get really distorted?If I wanted to add amplitude control (attenuation), would I add a voltage divider on the wire which connects the mid-inductor tap to the op amp input? Or would I stack a resistor above and below the entire LC tank circuit? etc.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 07, 2015, 03:15:42 am
content: Quote from: cellularmitosis on March 06, 2015, 08:45:39 pmPrecisely!Distortion depends on how much excess gain the amplifier has, how the output pin drives the tank (CV, CC, some R + jX impedance??), and what its resulting Q factor is.QuoteThere are a number of ways you could do this.First of all, if there is a low impedance (constant voltage) node in the circuit, like an op-amp output*, you can add a resistor divider to that, and you'll be fine, within whatever limits of load impedance you have to deal with (since the load impedance acts in parallel with the resistor-to-ground in the voltage divider).*Except op-amp outputs aren't actually low impedances at high frequencies. YMMV.If not, it's very likely that the node you're attaching the attenuator or load to, will affect the operation of the oscillator itself. So, do consider adding a buffer stage first. It's not that it needs to be lightly loaded (though that does help reduce noise), it's that it needs to be stable, so the gain (and distortion) and frequency remain constant despite load variations.You can use a variable output amplifier, within certain constraints. The best example of this would be an OTA (operational transconductance amplifier -- it looks like an op-amp, but has a proportionally variable, constant-current output). If you have the input sensing the tank voltage, which is always swinging back and forth at an amplitude much higher than the input threshold (for a typical OTA, this is >>60mV), then the output will be a highly distorted version of that, namely, something near a square wave. The current in that square wave is proportional to the "programming" current.Finally, since the tank has a known Q factor (whether due to losses in its materials, or due to an explicit load resistor connected to it), that current can only ever produce an amplitude of V = I*R in the steady state.Why isn't this a problem? The "gain > 1" story -- Nyquist stability criterion -- applies to a linear system. This system is very much nonlinear, because the output is not proportional to the input, when the input is relatively large. So, the oscillation will not grow exponentially, but it will level off logistically until it reaches a stable waveform.This type of oscillator will not start up if the programming current is too low, because ultimately, the gain (in the linear region, when Vin < 10mV or so) is also proportional to programming current, and if the Nyquist criterion is not met for small signals, it certainly won't keep running when the amplitude is much higher.Which segues into another option: You can use a variable gain amplifier (meaning, one which does not go into saturation), however, you must regulate the output amplitude with a control loop. If the gain is momentarily > 1.000, the signal begins to rise exponentially; if momentarily < 1.000, it begins to decay exponentially. Around a given amplitude, the response of amplitude versus gain control resembles an integrator (it rises or falls over time, proportional to the error from "ideal value"). An unfortunate downside to this is, the time constant varies with amplitude (because you're on a different portion of that exponential curve), so it's very difficult to stabilize over a wide range of amplitudes.The variable gain type circuits do have the advantage that, by using relatively gentle stimulus, the tank is allowed to ring fairly unperturbed, so the Q factor can be high, and the noise and distortion, low.The best solution is generally a combination: use an AGC (automatic gain controlled) oscillator to establish a clean, low distortion, stable amplitude signal, then buffer and attenuate it with a separate output stage. As many as two or three amplifiers (besides the core oscillator itself) may be needed: one buffer to isolate the oscillator; another buffer to isolate the variable attenuator (which can be a digital pot, variable-gain amplifier (VGA), or regular potentiometer); and finally, a power stage to provide 50 ohm compatible output at useful levels (say, -5 to 5V or more).Tim

author: cellularmitosis
author_rank: Unknown
timestamp: March 07, 2015, 06:04:22 am
content: Whoa, so many new concepts to google for! Tim, thank you for taking the time to write such a thorough reply.I've been having some trouble getting this circuit to simulate well in LTSpice, and I suspect its because of some of the things you mentioned. In particular, after fiddling around with the component values a few times, I range from a +/- 20mV output which looks almost like a triangle wave (not enough gain bandwidth product in the LT1007 maybe?), to more like +/- 200mV with a sine wave which is still pretty distorted.The application I had in mind is to make a low noise negative rail (from a positive supply) for e.g. the negative leg of an op amp supply. I've fooled around with switching regulators and switched capacitor voltage inverters (seehttps://www.eevblog.com/forum/projects/an-evening-with-the-icl7660/), which are easy enough circuits to make, but very hard to get rid of all of the noise.So I thought I'd try an approach which fundamentally does away with all sources of high frequency noise: create a sine wave oscillator, run it through a transformer, then through a bridge rectifier and negative linear regulator (just like a traditional power supply).Since I only need a few dozens of mA, I thought I'd try a small audio signal transformer (http://www.mouser.com/ProductDetail/Murata/DA102MC/?qs=PFVRZ0XB1FZtbOj%2F5IpYAA%3D%3D&kpid=41392112&gclid=CjwKEAiAveWnBRCzjqf4zpuUkGYSJABcoZbHzusUXcMfdkyZCG52NS5UhzS0UpRpaaTjAO4HATieKRoCAITw_wcB).Looking at the LM337 data sheet, I noticed that PSRR starts to fall off above 1kHz or so, so ideally my oscillator would be somewhere in the 10kHz to 1kHz range.After progress stalled with the above op amp design, I kept googling and tried the Clapp oscillator (seehttp://www.sentex.ca/~mec1995/tutorial/xtor/xtor7/xtor7.html).I gave that a shot in LTSpice, modifying the component values to what I had on hand which would land me below 10kHz:Not bad! I thought about buffering it with an op amp, but decided I'd rather have a bit more current capability (say, 80mA to power several op amps). I googled around and decided to try a push-pull NPN/PNP combo. I ran into a problem where the lower portion of the output sine wave got clipped, and tried a few things to fix it (added a voltage divider attenuator and uneven pull-up / pull-down resistors just past the coupling capacitor), then came across this idea of using diodes for bias (seehttp://www.ecircuitcenter.com/Circuits/pushpull/pushpull.htm), and ended up with this:Looks like this might work!I guess the next steps are to figure out how low a frequency and how high an output current I can get before that little audio signal transformer will start to saturate and distort. I have a few on hand, time to start soldering!Again, thanks Tim for giving me a push in the right direction to learn more about the theory behind all of this.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: March 07, 2015, 08:59:19 am
content: A couple tricks that are misleading about the Wikipedia image:It shows an amplifier, but it doesn't say what kind. Note I distinguished between CC/CV amps. An amplifier, in a very general sense, simply amplifies; it doesn't matter what characteristic it has. Your LT1007 SPICE model, however, has a CV characteristic. Which means the tank is in parallel with a very low impedance (the output impedance of the amplifier), which reduces its Q considerably -- or to put it another way, to allow the tank to "do its own thing", it would need to be a much lower resonant impedance (Z = sqrt(L/C)). But that would also be undesirable, because too low of a load forces the amplifier into a "short circuit" operating range, which causes higher power dissipation.It's the same sort of problem as impedance matching a speaker. Yes, the speaker is 8 ohms (..more or less..). Yes, the amplifier has a [small signal] output impedance of fractional ohms (often, easily 0.01 ohms or thereabouts). Yes, you will get the most power out of it, for a given signal level (that level being perhaps a few millivolts!), when the load is matched (i.e., also milliohms -- basically a dead short..). No, you won't get full power (or necessarily even have the amplifier survive such treatment), because ultimately, the amplifier is not a linear system, and violates that premise of the power transfer theorem.But you *need* aspects related to the power transfer theorem. Real filters (bandpass, in this case) depend upon power transfer -- energy sloshing between reactances -- to do their job correctly. A poorly matched filter has a whacked out response. Which is exactly the observation here -- you get a crappy oscillator under those conditions.Most trivial solution: make it match. Put in a dumb resistor.Now, rather than a Hartley oscillator (which looks weird with an op-amp, anyway), you have an op-amp, driving a parallel resonant tank through a series resistor. And the feedback comes off the tank. No need for a tapped inductor anymore, because we have inverting and noninverting inputs on the amplifier (it should use noninverting, because the tank's phase will be in-phase at resonance, so that the loop sums to, well, 0 degrees, but that's the same as 360 degrees, isn't it?). The op-amp output will be a square wave (give or take its response time and such), and the tank voltage will be somewhat lower than the amp's peak output. If you do an AC analysis, you'll see the inductor and capacitor reactances cancel in parallel, leaving whatever loss component remains (BTW, check that the default series and parallel resistances of LTSpice "passives" are realistic!), which acts as a simple voltage divider against that series resistor. So you get a smooth sine wave (almost), the tank is able to do its job, and the frequency is reasonably accurate.And about that tapped inductor. Yeah, it works with independent inductors (just as the Colpitts works with a "tapped" capacitor), but it's best with coupled inductors. Do this in LTSpice by adding a coupling coefficient (K) statement addressing the two (or more) coupled inductors. Typically, you'd build a Hartley oscillator with anything from an air cored solenoid with the tap near one end, to a cored transformer with everything tightly coupled; k from 0.8 to 1.0 will be reasonably representative of anything in this range.The thing about transistors is this: the output is constant current. The current varies with input voltage. A transconductance device -- conductance is amps per volt, so the gain of such an amplifier is output/input, or amps/volts, a conductance.. but it's not the conductance of a single port, so it's trans. (Tran-sistors don't really trans-resist, so maybe they aren't the most aptly named. But ohm = 1/mho, so maybe it's close enough.) The other thing is, simplified block diagrams like to indicate bulk things, like "oh by the way, here's some gain", and boom there's your triangle symbol. But it leaves all the magic to your imagination -- including how the signal goes in and out (coupling capacitors??), where the DC power is introduced (resistors, inductors??), and what impedances are like, in and out (is it constant current like a transistor, or constant voltage like an op-amp?). So I think this is where that image was coming from: an abstract block diagram, not an instructional schematic. Textbooks love to lie like that, too...Anyways, doing it with transistors is a fine way, of course. The main downside you'll find -- with any simple oscillator circuit like this -- is the many ways in which it fails, often dramatically so.Since you say you're interested in power conversion... that opens up still other concerns. Like... did you know diodes aren't perfectly quiet, either? PN junction diodes exhibit reverse recovery (essentially, it keeps conducting for a little time after being reversed -- using the water analogy, compare with the mass of the moving piece in a check valve), and even those which do not (Schottky diodes), still exhibit similar effects (nonlinear capacitance), and even in the absence of that (which you can't very well test in reality, but you can easily prepare such a device in... the SPICE simulator!), the simple fact that you are performing a rectification function necessarily creates discontinuities in the waveform -- harmonic distortion.So, naturally -- although you can create a clean oscillator, it's a small part of the total performance. Which I suppose should be easy enough to expect.What might not be as expected is, ease of filtering. You kind of have two options there:- Make the operating frequency fairly high, so you can use LC filtering, and maybe an active filtering or cancelling circuit, without it being overly bulky and expensive.- But not so high, or so noisy, that you get hairy stuff in the 20MHz+ range. That shit's hard to clean up. It doesn't like to stay in wires, so you tend to need a lot of shielding and ferrite beads and arcane radio-frequency magic like that. About your only advantage is that, because the frequency is high, the components required to filter it are also small -- but you may end up needing a lot of space (for the shielding) to deal with it.- Or, make the operating frequency relatively low, so that, alright, you have to use awfully large capacitors to filter the ripple, but, you can tolerate much more ripple because you can regulate it down much more effectively with an LDO or whatever.Regulators use feedback loops, which have a dominant-pole characteristic to their feedback: at frequencies 100 times less than the internal cutoff frequency, the feedback has a gain of 100, causing errors to be reduced by a factor of 100, so that 1V ripple at the input becomes 0.01V at the output. LDOs inherently have poor high-frequency performance, but they aren't bad at lower frequencies. HDOs (for lack of a better term; conventional regulators -- like the 7805 and such) have modest performance at most frequencies, but also get much better at lower frequencies, for the same reason. The increase is not unlimited as frequency goes down, because the DC gain is finite (it levels off at some point). But reductions in the 60dB (for LDOs) to 120dB+ (for precision op-amps -- PSRR and CMRR) range are absolutely achievable.A quick alternative to a proper LDO, you can skip the voltage regulation (or place it before or after!) and use something to filter the noise. One such circuit is the BJT "capacitor multiplier" (an emitter follower with bypassed base). This can reduce noise, at any frequency the transistor can handle, by roughly the ratio of emitter resistance (very small, r_e = 26mV / Ic) to Early effect resistance (very large, usually in the range of 100V / Ic). Two or even three stages can eliminate just about anything -- to the point where, even at fairly modest frequencies, you *really need* shielding to be able to tell how quiet it really is! And, rather than directly cascading these stages, but using a chain of RCRCRC filtering on the bases instead, won't even cost you too much voltage drop.TimTim