StompFLO & OneShot in a box

Started by Matthew Sanford, July 14, 2023, 09:48:36 PM

Previous topic - Next topic

Matthew Sanford

Plan now is to use lm358 on this, I think it goes close to 0v (or close enough) if I understand the data sheet, plus it has an MFB topology which should do.

Went with the points from StompLFO data sheet active filter, so

fo = 664Hz
A(fo) = 1
C = 10n

Put it for both, but may change A(fo) to 1, meaning Rin = 910, Rg = 580 (Rf the same), then keep the second to a gain of 1 so the peaks stay the same.

Data sheet scheme and my plan. Hope to get time tomorrow, if not then this weekend




"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

That's looking like it's getting there. But one question: Why bandpass MFB?

I'd have thought you wanted this instead:

http://sim.okawa-denshi.jp/en/OPtazyuLowkeisan.htm


Matthew Sanford

To be honest, I'm not sure where to pole should lie. I know the rate of the LFO is very low, representing the frequency of the waves, but then was seeing very high kHz and MHz for the sample and output, but maybe those are internal so it is the low frequency we want? Based on what you said, that's become my new assumption, so I'll scrap the data sheet thing and do the other...maybe I can ditch the hpf off the other, but...

So from working the page you sent, and running the calculator multiple times, I get the attached. I was trying to aim Q at 0.63 for both, but reducing gain shot it way up, but maybe that doesn't matter, just a steeper slope to the highs right?

1st. (For -Vlfo and feed second)
Fc = 890
Gpk = -10
Q = 0.44

2nd (+Vlfo)
Fc = 890
Gpk = -1
Q = 1.61


"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

Matthew Sanford

I tried it with that schematic created from that site, with +input to 0v both sides went 0-0.6v and were stalling on the top. I put 1/2 vcc (+9v as vcc) as bias and inverter started inverting, about 8v-4v. Changed to 2.5M/1M creating 1.7v Vbias. I realized the 10k pulling in the LFO combined with the 1k Rin to make gain 10k/11k, so Rf changed to 22k - after all that, 5.5v - 0.6v -Vout. 2nd (invert to +) was 0-0.6v, so Vbias there and making Rf 22k gives 0.59-4.66v, but stalls and creeps to 0.53 before coming back up at a faster tick before stalling a bit at 4.66v. -Vout was stalling on 0.6v too, not sure why it likes that level ;)

I'm thinking to try the band pass one with Rg swapped with Cin to make the hpf portion into LPF (if I'm understanding it correctly) and see how it does, after all it wanted Vbias in the first place....maybe speaks to lm358 NEEDING Vbias, cause it helped the other site scheme which wanted it to earth.

Any ideas why the voltage stalls? I was thinking the 0v Vbias going 0-0.6v was maybe the inverted signal going below ground so instead being an absolute value, but I don't know.

Oh! Of note I'm feeding Vbias in with a jumper, did try 1M but didn't seem to make a difference there.
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

I don't understand what you mean about highpass and lowpass. What I *thought* you were trying to do was get the LFO output both ways up: e.g. inverted and non-inverted. That's not the same as highpass and lowpass. Stay away from highpass and bandpass, I can't see how they're the right solution to *any* problem you're having!

The reason for putting a lowpass fileteer on the output is that the output signal is a high frequency pulse train, ("PDM") not an analog signal. PDM stands for "Pulse Density Modulation" and effectively, the amount of pulses in some time period X gives you an idea of what the analog output level is supposed to be. A lowpass filter does that re-integration for you and gives you back the analog signal without the pulses. Once you've got that, getting the inverted version is just a a question flipping it with a a simple inverting buffer op-amp (literally a pair of 10Ks around an op-amp).

The confusion arises because for some things, you can use the pulse output directly (this is what the transistor driver is doing). For example, for LFO LED outputs, the pulse output gives a much better control of LED brightness than the filtered LFO voltage, because LEDs respond to *current* not *voltage* and because our eyes aren't quick enough to see the flickering of the pulses - instead we see "few pulses" as "dim" and "many pulses" as "bright", which is exactly what we're after. Similarly, anything that is driven by an LED (like a vactrol!) is better driven directly from the pulses, not from the filtered LFO voltage.

HTH,
Tom

Matthew Sanford

#25
The MFB on the data sheet was bandpass which I didn't pay attention to (MFB info on a that data sheet got me excited!), and you referred me to that other site. It's calculations asked component value not fc, q, etc, but I think I got it worked out except the stalling.

I just meant on the data sheet schematics, if I flip positions on the Rg and Cin prior to inverting input, so then C->0v and Rin to inverting input, that should flip it from HPF to LPF and make that bandpass MFB into a lowpass MFB. Not sure if the calculation would be the same but change fo to fc. So with that having target points to set is a bit easier than picking component values and riddling or rearranging their equation...on that, is "s" for seconds?

Thank you for explaining the various frequency info, I understand it as high frequency digital signals we want filtered out, low frequency analog we wish to keep. That makes sense.

So end goal is inverted and non-inverted signals going to TS jacks with a TRS having one each on ring and tip (might be useful...), and the vactrol controlled resistance in both directions on TS jacks and a TRS with both (to do voltage dividing the other end). I know now the vactrols will come from the npn, not buffers, thank you on that.

I'm realizing the scheme you'd referred me too is likely split supply not single, hence necessity of Vbias. Now I am wondering if the stalling at the ends of voltage range of output is due to Vbias not being set at 1/2Vcc, so it gets nervous at the edge? Though like that it gave ~! 4v range which topped 3v higher than desired (4-8v), so maybe the gain setting could help fix it.

Thinking I should put big Lin pots to adjust gain and Vbias to get ~0-5v in a smooth way, then measure and use those values. I'll get back to it...

Edit for add'l questions:

If I raise the input to 10k straight with 100k feedback resistor, it sets fc at 281Hz (over the 25Hz max of StompLFO), will that reduce backwards interaction with the Stomp? It hadn't been starting quite right each time, not consistently anyway...

With the input disconnected, I read a little over 3v, I'm guessing due to Vbias. Is it wise for that to end up at 2.5v to try to better center it at 0-5v out?

If both are set to 10k/10k (unity buffer) it gives 890Hz fc and 1.6 q, figure I should try that?

Removing the jack I had off the npn helped get it going, still have a resistor floating off it though. Is that a possible cause of the seeming interaction making the LFO not exactly go smoothly?

I think I need to draw out the whole thing and post, I'm realizing the words formed from my thoughts may not only be confusing to just me...
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

Quote from: Matthew Sanford on July 20, 2023, 05:44:23 PM
The MFB on the data sheet was bandpass which I didn't pay attention to (MFB info on a that data sheet got me excited!), and you referred me to that other site. It's calculations asked component value not fc, q, etc, but I think I got it worked out except the stalling.
If you scroll down a bit, you can enter Frequency and Q, and it'll give you the Rs and Cs instead of the other way around. There's both things on the single page. Sorry, I didn't make that clear.

I often start at the bottom, putting in the freq and Q that I want, and then see what it gives me. And then I tweak the values by hand and enter them in the top part to see if I can get something more "useful" that still gives me the right freq and Q. For example, the calculator might have chosen very low R values, but I might want a higher impedance, so I might try multiplying Rs by ten and then adjusting Cs to get the freq back in the right place. Or it might have chosen some stupid R value than no-one's ever heard of (AKA the "E96 series"!!) and I might put in E24 values and see if I can't get close enough with that and some E6 caps. It's a process of successive approximation, guesswork and a certain amount of luck! But that tool is invaluable and I use it a lot.

Quote
I just meant on the data sheet schematics, if I flip positions on the Rg and Cin prior to inverting input, so then C->0v and Rin to inverting input, that should flip it from HPF to LPF and make that bandpass MFB into a lowpass MFB. Not sure if the calculation would be the same but change fo to fc. So with that having target points to set is a bit easier than picking component values and riddling or rearranging their equation...on that, is "s" for seconds?
No, this is the "S domain", which sounds like something Thor or Dr Strange falls into in a Marvel movie, but is actually a load of maths related to filter theory.

Quote
Thank you for explaining the various frequency info, I understand it as high frequency digital signals we want filtered out, low frequency analog we wish to keep. That makes sense.
Excellent! Glad it helps!

I'd like to add one thing to what I said earlier:

A sine wave at 25Hz is just a sine wave at 25Hz, because it's a pure wave. Other waveshapes likes squares or ramps have a *lot* of harmonics, going up in frequency from whatever the base frequency (call it "f") is. The harmonics are at 2f, 3f, 4f, 5f, 6f, etc. So a 25Hz ramp wave has harmonics at 50Hz, 75Hz, 100Hz, 125Hz, 150Hz, 175Hz, etc etc. The good news is that the higher you go, the lower the level of the harmonics gets. But nonetheless, the filtering has to make some compromise between preserving the exact shape of the waveform and reducing high frequency noise - some of the high frequency content will be the sharp edges of our waveforms (in the cases where those waveforms *have* sharp edges). However, in practice in pedals, we rarely need super-sharp edges and actually slowing down sharp edges into slight slopes often helps reduce "ticking" and other similar LFO-related problems. The StompLFO does a degree of this already in the firmware, so its Square Waves and Ramp waves don't have super-quick transitions from low to high with a lot of high frequency content. My choice of cutoff filter frequencies around 1KHz was a compromise to balance good waveshape with low noise. I went lower for the passive filter (since the performance isn't likely to be as good) and a bit higher with the active filter.

Quote
So end goal is inverted and non-inverted signals going to TS jacks with a TRS having one each on ring and tip (might be useful...), and the vactrol controlled resistance in both directions on TS jacks and a TRS with both (to do voltage dividing the other end). I know now the vactrols will come from the npn, not buffers, thank you on that.
Ok, thanks. I think I wasn't entirely understanding where you were trying to get to, but you want all the options! Fair enough! If it's worth doing, it'd be helpful if it covers all the bases, right?!?

Quote
I'm realizing the scheme you'd referred me too is likely split supply not single, hence necessity of Vbias. Now I am wondering if the stalling at the ends of voltage range of output is due to Vbias not being set at 1/2Vcc, so it gets nervous at the edge? Though like that it gave ~! 4v range which topped 3v higher than desired (4-8v), so maybe the gain setting could help fix it.

Thinking I should put big Lin pots to adjust gain and Vbias to get ~0-5v in a smooth way, then measure and use those values. I'll get back to it...
Dunno. I still think the "hitting ground" problem needs to be considered, but whether that's what you're seeing now, I couldn't say.

Quote
Edit for add'l questions:

If I raise the input to 10k straight with 100k feedback resistor, it sets fc at 281Hz (over the 25Hz max of StompLFO), will that reduce backwards interaction with the Stomp? It hadn't been starting quite right each time, not consistently anyway...

With the input disconnected, I read a little over 3v, I'm guessing due to Vbias. Is it wise for that to end up at 2.5v to try to better center it at 0-5v out?

If both are set to 10k/10k (unity buffer) it gives 890Hz fc and 1.6 q, figure I should try that?

Removing the jack I had off the npn helped get it going, still have a resistor floating off it though. Is that a possible cause of the seeming interaction making the LFO not exactly go smoothly?

I think I need to draw out the whole thing and post, I'm realizing the words formed from my thoughts may not only be confusing to just me...
Yeah, sorry, but I think we need a solid schematic to be able to answer any of this. I'm not following you. It's late here though, so that might just be my fault!

Matthew Sanford

Quote from: ElectricDruid on July 20, 2023, 06:51:48 PM
If you scroll down a bit, you can enter Frequency and Q, and it'll give you the Rs and Cs instead of the other way around. There's both things on the single page. Sorry, I didn't...
Whoa hey now! I think it went away after I searched the other way, and please no apologies necessary ever as you sir have my highest esteem!
Quote
But that tool is invaluable and I use it a lot.
I can now see why. Putting in 664Hz and 0.63 Q gave R1&R3 as 6k2 (they went otherway with 6.2k! Waste of an extra character!), R2 10k, C1 68nF, C2 15nF, all pretty reasonable values. I'll try this way. I was wondering on the poles it reflects, one at 632, other at -494 but basically ignored in the result of fc 632. When both are positive it seems to return the average.
Quote
No, this is the "S domain", which sounds like something Thor or Dr Strange falls into in a Marvel movie, but is actually a load of maths related to filter theory.
Well....not Thor...but maybe Mr. Ant and the Pimms...
Quote
The harmonics are at 2f, 3f, 4f, 5f, 6f, etc. So a 25Hz ramp wave has harmonics at 50Hz, 75Hz, 100Hz, 125Hz, 150Hz, 175Hz, etc etc. ....I went lower for the passive filter (since the performance isn't likely to be as good) and a bit higher with the active filter.
Ok, so 644Hz gives up to 25f in harmonics, and balance between shapely (or not crunched or missing parts I'm guessing) waves and low noise.
Quote
Fair enough! If it's worth doing, it'd be helpful if it covers all the bases, right?!?
Truly that's my main goal in this, cover all the bases. Breadboarding is great, right, cause you can switch everything around! But when the components are pretty set on value for many uses, it's really the routing of signal that breadboarding allows but this all tied down in a box with bigger holes that are easier to plug stuff in to with our reader glasses on. Not to say my eyesight isn't 20/20, but ever since 2020, nothing and everything is much clearer...ok, that sentence had nothing to do with itself! (but yet I'll leave it...)

Quote
Yeah, sorry, but I think we need a solid schematic to be able to answer any of this. I'm not following you. It's late here though, so that might just be my fault!
Solid schematic is the way. I'll get there.
I did put it back on and was messing then put it back old values and it was topping 1.8v with the inverter not inverting, so maybe I treated the chip poorly? Good thing I have 100 possibly the correct chip for super cheap coming from Amazon, will get back to it. Well, I am going to use the new values returned by using the values I want to set it up with for fc and Q and see if it cooperates... lord of the S-Domain hear my prayer!

I want to try adding the StompLFO chip (PIC16Fblahblahblah) into LibrePCB and make a nice clean looking schematic there, plus once it is all together correctly that will make a PCB layout and send it to PCBWay so I can get some to build a couple and share from there. Plus I get Gerber files, I didn't realize the connection between electronics and baby food, but babies do love phones so why question it!

Still, any of that will be posted here for assessment by those who know, you know?

And thank you again Druid!
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

Matthew Sanford




The prospective schematic, untried as of yet. I may put Vbias to1/2VCC, we'll see. Basically what I was working but with the values posted before. I'll work it this weekend.
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

Matthew Sanford

New plan. I tried the op amps, was close but not quite right and doing things here and there would get me static output voltage, often around Vcc/2, so I said what do I need to send the voltage for anyway? If I want it I can make another to use waves of resistance to send voltage through an npn or what not and maybe filter it too.

So it will be +/- Rout on TRS with a TS for each. I know it'll be one out no matter what...hmmm....that additional box to split it to many is sounding more plausible...

Anyway, new schematic


"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

Quote from: Matthew Sanford on July 23, 2023, 02:37:44 PM

I don't think that's going to work because the +Rout and -Rout LEDs are connected between 5V and Ground, irrespective of what the transistor does. It *might* work if the Vf of the two LEDs is >5V, but it looks dodgy to me. Effectively you've got two LEDs and a 1K resistor in series across the 5V power rails. That's not what you're after.

Also what's going on with the RGB part? Looks like you have more vactrols in there too?

Matthew Sanford

For the RGB that is what I was thinking, but might do it differently.

You're tight on the other, the positive was about right but not really unless depth was turned down, otherwise sits around 770r. The invert was just dark
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

Matthew Sanford

So thinking on it, 5v-~3fv with the LFO feeding the other side 0-5v leaves -3 to 2v, not counting other issues. I'd thought the mirrored bases after 10k would be ok, but I guess small resistance in traces could make it a divider? You mentioned 1k in series with LEDs, I assume 2 470r between 5v and 0v (with LEDs in middle, disregarding the LFO in center) being their sum?

Thinking maybe 9v instead of 5v, leaving 2-5v would work better. Not sure if I should do separate 10ks to feed each npn, or maybe emitter from first to feed second base, or even more 2N3904 (or 2222, I have a lot) for each thing. Maybe that's best, separate npn drivers?

Was going to do the separate vactrols on RGB to reduce the resistance to ground, rather than reverse voltage. The ones I made with silicone tape are all topping 20M and low end 196r, 420r, 750r, and 940r.

I'll get back to it later
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

Matthew Sanford

After working to get LFO +/- voltage and feeding vactrols, I realized I could build a separate circuit to plug the LFO to for voltage side...with cap filtering. Was going to do a diatribe at the end about op amp and npn phase splitting learning time, realizing jotting component changes AND measurements is better than memory dependence, and more...may still (so many measurements!), but I'm on a phone.

Here is how I am boxing up v.1 with a StompLFO, make another for a One Shot, work the schematic in LibrePCB or KiCAD and get PCB designed - a bit of learning there. I tested with 3 LEDs per side (0v, 5v) then one diy vactrol on each side w/Offset min/max:

0v-> 210R - 1M7 (+LFO)
+5v-> 480R - 4M6(-LFO)

The -LFO side did after a bit slowly rise to such great resistance, it says 20-30ms response, but maybe that's 1k/30ms...

The pics. v.1 schematic, the thought on LFO voltage out, and the measurements when adding more emitter ground resistors on the end of the line.










"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

I'm glad if it's working better, but it's still weird, sorry. :icon_eek:

You've got a 1K5 from the transistor's emitter to ground. But then you've also got a 2K2 and a 470R *connected to the same point* down to ground. So the net result is that they're all in parallel. You could equally well just change the value of the 1K5 to something smaller. How much smaller? Well, let's have a look. Here's the "parallel resistors" formula:

1/Rp = 1/R1 + 1/R2 + 1/R3

Rp is the effective resistance value of the three in parallel. So we've got:

1/Rp = 1/1K5 + 1/2K2 + 1/470R

1/Rp = 0.0006667 + 0.0004545 + 0.0021277

Rp = 1 / (0.0006667 + 0.0004545 + 0.0021277) = 307 ohms.

Call it 330R, it's close enough and we know you have lots of those on hand from the rest of the schematic!

That's just simplifying what you've done though. I think there's better ways, but it's 1am here, so it'll have to wait till the morning.

Matthew Sanford

It is weird and could use cleaning up. You can see what 3k3 (overall about 321R) instead of 2k2, and I think my crossed out stuff was a 10k instead (345R). So it's really close for great differences....and closer to 300R might be best, maybe a trim pot with a small one. I was figuring, though being the emitter resistor it also functions as a voltage divider with the 5v coming through the 330R after LEDs, I guess 4.3v instead. I would figure that voltage is also affecting (biasing?) the LFO going both back towards the 5v and through LEDs going to more 330Rs to ground - would it divide that voltage too? If so, and if the voltage does sum, I guess it'd all add up to the same, though I guess that 5v in would push back towards the emitter too. To mush supposition in my head...

Funny about the 330s, I've got 6 left besides the ones on the breadboard...well, the tangle, probably some in there.

I am figuring on the other side I'll do similar TRS/pot set up, and divide pot value 90/10, 50/50, or 10/90 for A,B, or C respectively, and put corresponding resistor values from wiper to each end. In that regard I think what I'm putting out should give a fairly balanced response, and if the +/- go to each side they should work it well together.
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

Matthew Sanford

Just to finish up, I ordered some E48 series and used the 300r (297r actually) and both sides go down to 400ish and up past 4M. I don't think it's exactly even...though maybe, the inverted side slows down into the M resistance, but I've been using ramp up wave, so maybe that's why it takes it's time at the end.

Anyway, I'll find a new box to fit it. 9 out, 3 stereo and 3 each of the two sides. I do have one ldr leg going to TRS-S and S on each TS jack, so not sure yet if it will cross if they're in different things, but we'll see. First box and build the pedals for it to abuse or put TRS into my boss pots.


"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

Matthew Sanford

Was working with it as set up but was never quite right, plus after boxing it the inverted side was just full the whole time, think I should've put additional resistors on the +5v side. Was having fun with swtc2 tone and gain on a Distortion +, but before boxing that I figured I'd give CV another try, plus Ron (Amptramp) got me thinking on his bit of brilliance on opto-isolation. I haven't separated it to two separate power supplies as suggested for ground separation...would separate 68Rs from the wall wart with their own filter caps and grounds only joining at the supply entry to the board count?

Anyway I made this with LM358s and PC817s and it works great once I realized a unity differential inverter works with 5v (from StompLFO power rail) through R to power. The non-invert side gives 0-5+v (hard to tune it exactly), invert gives 4.2-0.64v, but pretty smoothly. Plan is to set secondary op amp on each chip to a voltage follower and pull a CV from each side (maybe 2?) through a 1k for output resistance.

It'll mean some rework on the boxed thing but I think the board has space, plus without the vactrols. Making me excited for doing a stereo inv/non-inv out as sleeve will be ground instead of one side of each vactrol linked (though I'd thought it might do strangely joining separate nodes on circuits). For the receiving side I'd thought I might get away with having 1 jack be able to drive multiple vactrols, so I could put a two TS jacks per effect with switches to share to non-inverted and inverted CVs across multiple by flicking a switch. Probably want trim resistors too on the line back to sleeve/ground to control led brightness.

Thoughts? Could each drive multiple ins, maybe just 2 lm358s with outs each side of the second? Any glaring issues, or should I get an LPF in the middle to shape/filter?



"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx

ElectricDruid

I don't see why you need to repeat the work done by IC1.1 and IC2.1 with IC1.2 and IC3.1.

Can't you just connect the unlabelled inverter to the IC2.1 output and be done with it? It saves you two opamps and nearly half the components!



Matthew Sanford

You are right there, of course. I got a decent sized breadboard and excitedly threw it all together-to be honest my thought was the second op amp would have a follower after, the thought being to pull at least one CV out from each, but maybe one could handle 3? On the first op amp I set up two as the transfer balance isn't quite the same when inverting.
"The only knowledge is knowing you know nothing" - that Sew Crates guy

Controlled Chaos Fx