Is the 9v Electric Mistress VCO design robust?

Started by gaussmarkov, November 23, 2007, 11:16:01 PM

Previous topic - Next topic

gaussmarkov

I have been studying the Electric Mistress VCO (voltage controlled oscillator) for some time, figuring out how it works.  It turns out there is already a helpful description by VSAT, pointed out to me by puretube, in this thread:

CE-2 Subcircuit Explanation?

I have been doing this because I have seen several forum threads about difficulties with the 9V Electric Mistress project worked out by markusw (see his 9V Electric Mistress Project thread and his PDF project file with the schem) and the fixes were diode substitutions in the VCO.  The tonepad.com schematic shows a 1N4001 where a 1N914 or 1N4148 seems to work much better.  Also, I laid out a smaller version and stobiepole builit it and ended up with the the sweeping flange cutting out over part of the cycle.  So we are trying to figure out what that is about, and I think it's a problem with the VCO again.  My guess is that the amplitude of the VCO is too low where the effect cuts out and the clock gets stuck.  My current guess at a cure is to increase the value of the timing cap from 47pF up to 68pF.

This theory comes out of doing some simulations that taught me how the VCO works and that also suggest a possible problem.  So I am hoping that by describing the simulations and my guesses I can get some help.  Here's the SPICE schematic (from LTSpice):



The LT1011 is the comparator that Linear Technologies (who distribute LTSpice) say is the current replacement for the LM311.  Based on other simulation results, I have replaced the PNP current source with an ideal current source at 10uA.  That doesn't seem to change the simulations in an important way, though the simulated current source is not so constant.  I have also replaced the LFO input with an ideal voltage source that I hold constant at various voltage levels.  Based on simulations and calculations, the range of the LFO with the RANGE pot at 50K (half way) is 0.8V to 3.0V.  So I do calculations at 1, 2 and 3 volts.

Here is the VCO output when an ideal diode is the escape valve for the timing capacitor's charge:



This kind of output works fine.  Green corresponds to 1V input, bue to 2V, and red to 3V.  The amplitude in all cases is well above 4.5V, the value that flips the clock from on to off and back again.  The exponential rise of the VCO output appears to be due to some capacitance of the comparator. 

Here is the VCO output when a 1N4148 diode model replaces the ideal diode:



Not so good.  The 1V input level does not produce an amplitude sufficient to flip the clock back and forth.  The funny extra oscillations in the 2V and 3V output may be spurious simulation problems.  I'd like to know if that's true also.  They seem to come from modelling the diode as an ideal diode in parallel with a small value capacitor.  Some of those jumps are associated with the "capacitor" in the diode firing, not the ideal diode, which is waiting to be forward biased.  I haven't run that down further than that.

But I am wondering if that issue cannot be set aside and if we can still conclude that at the bottom swing of the LFO puts the VCO in a risky territory so that for some builds component variation may cause the VCO to fail as it does in these simulations.

Simulations with a 1N4001 diode model show that none of these amplitudes cross 4.5V with that diode.  Apparently, the higher capacitance of that diode causes an even faster cycle that never gets in the zone to trigger the clock.

Returning to the 1N4148 diode, what seems like the simplest fix is to replace the 47pF timing cap with something larger, so that the capacitor charges (linearly) more slowly, giving the output more time to rise.  Adjusting the current source to lower currents seems less reliable, but I don't have a really good reason for saying that.

Any help?

cheers, gm

gaussmarkov

I should have made it clear that there is nothing wrong with the work that markusw did.  As I understand it, all of the component values have been checked against an actual EM, as well as an EH schematic.

gaussmarkov

And I should have mentioned that markusw worked on some of the simulations with me.  :icon_biggrin:

gaussmarkov

Here's a description of my understanding of how the VCO works.  Here's a graph from the same simulation setup described above except that I have fixed the input voltage on the non-inverting input at 2V.



The VCO in the electric mistress has three basic states. In the graph,

1. one state is starting at 8.953us where the current through the diode (green) is zero and the inverting voltage (blue) is below the non-inverting voltage (held constant here at 2V),

2. a second state starts at 8.911us where the inverting voltage has exceeded the 2V noninverting voltage and the output voltage (red) begins to fall, and

3. a third state starts just past 8.925us where the output voltage (red) falls below the inverting voltage (blue) and the current through the diode (green) is strictly positive (the green bump).

Here's what I understand to be going on in theory in these three states:

1. When the inverting input is below the non-inverting (blue below 2V), then the comparator output pin is allowing the output voltage to grow towards the positive rail, pulled up by the 10K resistor R4. The pattern is exponential. The actual difference in voltage at the inputs does not matter, just that the inverting voltage is below the non-inverting voltage.

   a) There is no current through the 1N4148 because it is reverse biased. As a result, two sides of the VCO circuit are operating independently. 

   b) The current flowing through the pull-up resistor at the output is going into the output pin of the comparator.  It appears that the comparator output is behaving like the lead of a capacitor connected to ground and the voltage is growing exponentially.

   c) On the other side of the circuit, a constant current charges up the 47pF "timing" capacitor C1. In the process, the current source is raising the voltage of the inverting input. The charging of the capacitor linear because the current is constant.

2. In the second state, which is quite brief, the inverting input voltage has risen above the noninverting (blue above 2V) and the comparator switches to providing a ground for the circuit so that the voltage built up at the output during the first stage falls rapidly.

3. The third state starts when the output voltage drops below the inverting input voltage (red below blue) so that the diode becomes forward biased.  The capacitor C1 discharges through the 1N4148 diode and that causes the inverting voltage to fall below the non-inverting again (blue below 2V), reverse biasing the diode so that its current returns to zero.

Now the process returns to state 1.

The reason this is a VCO is that the higher the input voltage at the non-inverting input the longer it takes for the inverting input side of the circuit to rise above the input voltage so the period of a cycle gets longer.  Because the non-inverting voltage goes up linearly, the period is related linearly to the voltage input.  And because frequency is the inverse of the period, frequency falls inversely with the voltage input.

I think the importance of the diode is how much it allows the capacitor to discharge and that this is primarily affected by the capacitance of the diode. The more discharge, the longer the capacitor charging time.

The VCO amplitude can be affected by frequency. At relatively high frequencies, there is less time for pulling up the output and so a lower amplitude. At lower frequencies the oscillation is rail to rail.

R.G.

I would guess that the VCO operation is sensitive to the comparator input parameters and comparator gain, as well as being sensitive to the diode discharging well.

I think it would be interesting to try a couple of things. First, I would put a few millivolts of hysteresis on the comparator. Maybe a 1M feedback from comparator output to + input and a 1K to 4.7K resistor in series with the input voltage. That will prevent the comparator from short-cycling by reinforcing its tendency to switch. Also, I would try a 1N58??  1A Schottky diode for the diode. 1N4148 is not a high current diode, and 1N4001 is not fast. A 1A Schottky is both fast and high current.

I don't know this will work, just speculating.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

gaussmarkov

Quote from: R.G. on November 25, 2007, 11:10:42 AM
I would guess that the VCO operation is sensitive to the comparator input parameters and comparator gain, as well as being sensitive to the diode discharging well.

I think it would be interesting to try a couple of things. First, I would put a few millivolts of hysteresis on the comparator. Maybe a 1M feedback from comparator output to + input and a 1K to 4.7K resistor in series with the input voltage. That will prevent the comparator from short-cycling by reinforcing its tendency to switch. Also, I would try a 1N58??  1A Schottky diode for the diode. 1N4148 is not a high current diode, and 1N4001 is not fast. A 1A Schottky is both fast and high current.

I don't know this will work, just speculating.

I really appreciate your response, R.G.  Thanks very much for taking the time.  The great thing about these problems is that they give you a chance to learn something.  When everything slaps together the first time, that feels good but there's a lot less motivation to figure out the circuit.  I've learned a lot but I was stuck and your input helps tremendously. 

I don't have a 1N58?? yet, but I'll get one and try that.  Also, the hysteresis adjustments.  I have seen stuff about hysteresis but overlooked it.  Now I will learn about that, too.  :icon_cool:

Again, thanks a ton.   :icon_wink:

PerroGrande

Adding hysteresis to a comparator or a similar circuit creates two different transition points, depending on the direction of the transition.   The transition point for a positive-going signal (low-to-high) is a few millivolts lower than that for a negative-going (high-to-low) signal.  This avoids comparator "chop" for a signal that is right at the "hard" transition point.  In other words, the threshold is different depending on the output state of the device.

gaussmarkov

Quote from: PerroGrande on November 25, 2007, 03:28:39 PM
Adding hysteresis to a comparator or a similar circuit creates two different transition points, depending on the direction of the transition.   The transition point for a positive-going signal (low-to-high) is a few millivolts lower than that for a negative-going (high-to-low) signal.  This avoids comparator "chop" for a signal that is right at the "hard" transition point.  In other words, the threshold is different depending on the output state of the device.

hey, thanks for chipping in!  i see what you mean.  the positive feedback resistor moves the transition point depending on the state of the output.

on another item, even though i do not have a schottky diode in my possession i can still simulate.  :icon_wink:  i wonder if i should pay attention to a constant reverse bias current that the sims show through a 1N5817 diode model.  that ends up dominating the constant current source over the entire time the diode is reverse biased and feeding the capacitor at a faster rate.  poking around, i do not see a reference to this behavior.

thanks for the help!

gaussmarkov

another thought that i had about all of this was to adjust the output coming from the LFO.  there is a voltage divider and an divided negative feedback amplifier after the LFO and before the VCO.  these can be adjusted to raise the floor on the LFO signal hitting the VCO.  would this be a better solution?  here's the LFO and subsequent amplifier stage that i have been using:



it seems strange that the original design appears not work to work for all in simulation.  i keep wondering whether this is a problem with simulations in general, my particular simulations, or with a weakness in the design.  i know ...  :icon_rolleyes: ... it's probably my simulations.  except that actual builds run into problems, too.  and, yes, there could be mistakes there as well.  all i can say is that i have worked on this a long time before posting.  :icon_confused:

PerroGrande

I've experienced similar issues with simulations -- especially when oscillators are involved.  For example, I fed it the simple phase-shift LFO from the Improved EA Tremolo schematic and it simply would not simulate the oscillation.   Same was true for a simple multivibrator circuit -- unless I "helped" it with a kickstart circuit or switch, it wouldn't start.  I've taken to including some sort of a startup circuit in just about every simulation that involves oscillation.  I think this has something to do with the fact that by default all components of the same variety are identical -- so "starting" is difficult.

gaussmarkov

Quote from: PerroGrande on November 25, 2007, 07:49:46 PM
I've experienced similar issues with simulations -- especially when oscillators are involved.  For example, I fed it the simple phase-shift LFO from the Improved EA Tremolo schematic and it simply would not simulate the oscillation.   Same was true for a simple multivibrator circuit -- unless I "helped" it with a kickstart circuit or switch, it wouldn't start.  I've taken to including some sort of a startup circuit in just about every simulation that involves oscillation.  I think this has something to do with the fact that by default all components of the same variety are identical -- so "starting" is difficult.

me, too.  :icon_biggrin:  this actually makes sense sometimes.  no oscillation is also a theoretical equilibrium in some oscillation circuits that i have seen.  but it's not a stable equilibrium and a small perturbation will send the circuit to a stable equilibrium in which it is oscillating.  i guess in the imperfect real world the oscillations always get started because some little thing (or big thing) perturbs the system and off it goes to the stable, oscillating equilibrium.  the exactness of zero in the simulation world can keep this from happening.

i have an example handy: the phase shift LFO on wikipedia (RC_Phase_shift_Oscillator) in LTSpice:



you can see i perturbed the + input that is supposed to be grounded.  and i waited 9.5 seconds before collecting data.  if everything starts at zero, then it can stay there.  no differential across the inputs of the ideal op amp means no output and everything can just sit at 0V ground, except of course the power supply.  and that's what LTSpice will give you unless you start at some other initial value than zero volts somewhere in the path of the oscillation.

in the case of the 9V electric mistress VCO, i worry that something else is going on.  like maybe the diode models don't work well at high frequencies, particularly those diodes that are not typically used for frequencies on the the order of several MHz?  this is just a guess.  i really don't know whether to believe those funny little oscillations in the blue and red lines for the simulations with the 1N4148.   :icon_confused:

gaussmarkov

re: Schottky diodes.  the fairchild semi datasheet says that a 1N5817, 1N5818, or 1N5819 diode has a "reverse current  @ rated VR" at "TC=25C" equal to 0.5mA.  if that is the right order of magnitude for current through the diode when reverse biased, then i suspect this won't work as a sub for the 1N4148 because the design seems to set the constant current source that feeds the timing cap at only about 10uA.  increasing the timing cap could correct for the 1N58?? reverse current, i suppose.  the original electric mistress flanger had a 470pF timing cap ... and, if i am calculating correctly, a much higher current supply.