MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

DIY logic module
MUFF WIGGLER Forum Index -> Music Tech DIY  
Author DIY logic module
nickajeglin
Hello Everyone,

I'm looking for some help with a circuit design. It's a logic module inspired by the center portion of maths. I cobbled it together from various sources (a kassutronics blog post, mutable schematics).

Here's my understanding of how it works just in case I made a really bad mistake:

CV or audio is applied to J1-J3. These go into attenuverters, which then go to output jacks J4-J6. These are normalled to send the signal to the logic stages.

OR will ouput the maximum voltage level at J9, AND will output the minimum voltage level at J8, and AVG. MIX will output a non-inverted average of the 3 signals at J7. I think I prefer the average mix configuration to straight summing the signals. It's pretty easy to unintentionally overdrive the op-amp with 3x 5Vpp signals. Dual red/green LED's give a loose visual indication of signal strength and polarity. Inserting a cable into J4-6 will remove it from the logic stages.

J3 is special in that it is normalled to +10v. This means J6 can provide +/-10v for stuff like controlling o_C etc. Patching nothing to J6 will cause the 10v attenuverter to act like a "floor" or "ceiling" voltage control for the OR and AND outputs respectively.

Here are my questions:

1) +10v normalled to a jack: 10v will be briefly connected to any cable that gets plugged in here. Things this might touch: op-amp input pins through big resistors (33-100k), opamp output pins directly (eg. J5) or through small resistors (J9).
Will this hurt either of those things? Should I add output resistors to J4,5,6? What about other modules that don't have protected outputs?

2) Choosing input resistor for 10v reference: The datasheet formulas are a function of supply voltage (+12v with some tolerance) and max/min load current. +10v goes to the attenuverter. When RV3 is at one extreme, wiper voltage is zero, so voltage drop across R8 is 10v for a max load current of about 0.2mV. At the other extreme, the 10v is applied directly to the noninverting input of U1B, and to the inverting input via R12. I think in this case current flow is nominally zero. Using formulas in the datasheet of the LM4040, I get a range of 2.5k to 15k for R29. I choose 10k because I have it laying around and to reduce waste current consumption, but maybe 3.3k is better in practice because it's already being used elsewhere in the BOM. This seems like a wide range, so I'm worried I'm making a bad assumption here. Can anyone confirm I'm doing this right? What about a hypothetical scenario where it accidentally gets shorted to the negative rail of my power supply? Does this just blow a fuse in the supply? Burn up R29?

3) LED's: Is this a bad idea? I've used this configuration before so I know it will roughly have the desired function. I also know that it will throw off 1v/oct tracking as it causes a voltage drop at the output (but so do the protection resistors). Since I'm mostly planning on using this for non-pitch related CV, tracking isn't a major concern. I could add another opamp to drive LED's but I don't want another IC for cost/space reasons.

4) Any cool ideas for the spare op-amp? My current thought is inverting one of the logic outputs, but maybe someone with more experience has a better idea.
mskala
Point 1 - momentary 10V is harmless on the op amp inputs, and on resistor-protected outputs, but it could possibly be undesirable if connected directly to an op amp output. The module susceptible to that would be foolishly designed, but such modules do exist. I'd throw on a 1k protective resistor. This will result in a slight voltage drop into the 100k input impedance of your attenuverter so that you end up getting a 9.9V reference instead of a 10.00V reference. But you probably lose more precision in the tolerances of the op amp's gain-setting resistors anyway.

2 - I'm not sure what formulas you're looking at, nor how you compute a current in "mV", but the way it looks to me is that with the wiper of RV3 at ground, you have two 100k and one 47k resistor between the reference voltage and ground. That works out to about 25k (100k parallel with 100k is 50k, then 50k parallel with 47k is about half of 50k). It'll be drawing 400uA from the reference. In any other case you have less current drawn from the reference. So the ballast resistor R29 has to supply at least 400uA plus whatever the LM4040 requires, which is going to be a minimum of about 115uA. A resistor to supply at least 515uA across 2V should be at most 3.9k. I'd choose no more than 3.3k to be safe, and if you already have that value on the BOM, great. Using 10k would not work: it will only supply 200uA , which leaves only 85uA for the circuit if the LM4040 eats 115uA.

If the reference voltage is shorted to ground, then R29 sees 12V across it. If it's 3.3k, that works out to 3.6mA, which multiplied by 12V gives 44mW power dissipation. The smallest commonly available resistors are 100mW, so this should be no problem. If it were shorted to -12V the power consumption would be four times greater, so you should probably specify at least a 200mW resistor if you think that's a concern.

3 - that's safe. The LED will not throw off the tracking because it is inside the op amp feedback loop. The op amp just has to supply a little more current to maintain its output voltage. However, your outside-the-loop protection resistor WILL throw off the tracking; if that's a concern, then you should put it inside the loop too, and probably add a stability capacitor.

I would use lower resistance values for R17 and R18. Having them so high is not good for noise; in Eurorack you are basically stuck with high values like that on op amps that take input from outside, because of the desire to keep input impedance at 100k, but U2D is being fed by the very low-impedance output of U2A and doesn't need to maintain a high input impedance of its own.

4 - a comparator might be fun; just something that takes the mix output and turns it into a sharp-edged gate signal suitable for use with envelopes, oscillator sync, and so on. Many of those modules can't trigger on a relatively slowly-changing level.
nickajeglin
Thanks so much for the advice mskala! This is incredibly helpful.

I especially appreciate the help with setting up the LM4040. I did do some op-amp calculations in a basic electronics class, but I forgot about the idea that the voltage at the inverting and non-inverting terminals are essentially the same. That made me look at the resistor network wrong, so I definitely had the current requirement off.

I mostly compute current in mV by writing to fast oops


Quote:
The module susceptible to that would be foolishly designed, but such modules do exist.

I resemble that statement. very frustrating Depending on where I cribbed schematics from, lots of my earlier DIY stuff is missing resistors on the outputs. What mechanism would actually cause the damage in this case? I went through the TL07xx datasheet and didn't see anything that seemed to address applying voltage to the output. Concerning output protection+tracking: when you say to add a stability cap, where should it go? Ie. what is it meant to stabilize?

Thanks again, you've given me a lot of great advice that I can apply to other modules as well.
cygmu
nickajeglin wrote:
I went through the TL07xx datasheet and didn't see anything that seemed to address applying voltage to the output.


Under "Absolute maximum ratings" the datasheet says

Quote:

Duration of output short circuit Unlimited


and there is a note which says

Quote:

the output may be shorted to ground or to either supply


So with a TL072 there is nothing to worry about, but other op amps may be less forgiving.
mskala
nickajeglin wrote:
Quote:
The module susceptible to that would be foolishly designed, but such modules do exist.

I resemble that statement. :bang: Depending on where I cribbed schematics from, lots of my earlier DIY stuff is missing resistors on the outputs. What mechanism would actually cause the damage in this case? I went through the TL07xx datasheet and didn't see anything that seemed to address applying voltage to the output. Concerning output protection+tracking: when you say to add a stability cap, where should it go? Ie. what is it meant to stabilize?


I'm not sure a TL072 would have a problem with being shorted into +10V at all. They're quite rugged chips, and as cygmu said, they're rated for unlimited-duration shorts into ground. A short into +10V when the op amp is trying to drive its output to let's say -10V might possibly put more stress on it than a short into ground, but I've done some pretty bad things to TL072s and never actually seen one blow up from this sort of thing. The resistors we see on the outputs are more to prevent oscillation and to protect the other thing when the TL072 is mis-patched to some other module's output, than to protect the TL072 itself.

However, other op amps exist that may be more sensitive, and a module can be badly designed in other ways than by having an op amp output exposed to the outside world. For instance, some people may expose microcontroller logic outputs designed only to produce 0 to +5V. If you shorted one of those into a low-impedance +10V supply it might overload the protection diodes built into the microcontroller. In your specific design, though, your +10V reference is limited in its current capability by R29 and that's probably going to prevent it from damaging other things.

A stability or compensation capacitor would normally go directly between the op amp's output and inverting input, like C1 in your mixer. The idea is to prevent the op amp from being able to go into parasitic oscillation at high frequencies. I'm not sure you really need C1 - this kind of thing is more necessary at module outputs where people might plug in long cables. The current-limiting resistors on outputs serve a similar purpose when they are outside the feedback loop, by separating the cable capacitance from the op amp's feedback; but if you put the resistor into the loop in an effort to improve voltage accuracy, it'll no longer have this effect and you may want to add a capacitor to replace it. I wrote a Web log article on this topic here: https://northcoastsynthesis.com/news/understanding-stabilization-capac itors/
nickajeglin
Thanks both, you guys rock! Having experienced people explain my mistakes really helps me get better faster.

I did see the "output short circuit duration" section in the datasheet, but I guess I didn't have enough context realize it was what I was looking for.

And thanks for the article mskala, the way you're explaining things clicks nicely with the way I understand them. I'm trying to get a solid understanding of how and why these things work so that I can progress from copying schematics to actually assessing performance requirements / component constraints and designing circuits to fit.

I really like the idea of using the spare op-amp for a comparator to get interesting gate/trigger patterns, so now I'm trying to design that section from scratch. I hope you won't mind glancing at it when I'm done.
MikeDB
I would use the spare opamp to buffer U20 from the LEDs - i.e. drive the output jack from U20 and also the input of the spare opamp, then output of the spare opamp to the LEDs. Although the LEDs won't distort the signal significantly, it reduces the effect to zero.
euromorcego
nickajeglin wrote:

I really like the idea of using the spare op-amp for a comparator to get interesting gate/trigger patterns, ...

indeed, a comparator is a good idea. With a comparator after a three input attenuverting mixer, you can all kinds of interesting logic operations.

You could also add an inverted output to the mixer, no op-amp needed, you just need the signal after the first op-amp.
MUFF WIGGLER Forum Index -> Music Tech DIY  
Page 1 of 1
Powered by phpBB © phpBB Group