LFO ticking in PT2399 'Optowobbler'

Started by Ksander, September 05, 2022, 07:04:13 AM

Previous topic - Next topic

Ksander

Dear all,

I've been experimenting with variations of PT2399 schematics that are available online. My current project is partly based on the little angel chorus and a schematic available on 'circuitsalad'.

I use a CMOS 555 (7555) to generate a variable square wave. This is fed into one side of an optocoupler, which opens a path on the other side of the optocoupler with a resistor to ground. This path can be switched to modulate a part of the internal voltage divider via pin 2 ('wobble'), or to modulate the delay time via pin 6 ('warble') of the PT2399

The circuit works well on a breadboard, and therefore I transferred it 1:1 to a solderable breadboard.

Unfortunately, on the soldered version there is a slight but clearly audible ticking present in the audio signal. I've unsuccessfully tried to remedy this using various tricks that I found on the forum, including:

- running power/ground lines to the 7555 separate from the rest of the circuit, meeting only at the power jack;
- putting a low frequency RC low pass filter (470R/470uF) in the power line to the 7555;
- placing capacitors (a pair of 100uF and 100nF; either of the two; and larger single ones up to 1000uF) across the Vcc and gnd;
- small capacitor parallel to the LED (tried 22pF, 1nF);
- 100nF capacitor from 7555 pin 5 to ground;
- a different red LED or no LED at all;
- resistor 1M or 100K resistors from guitar input to ground

What I found DID work was to use a completely separate power supply for the 7555, or the roll off the volume on the guitar completely. Alas, neither of these options are of much use to make an actual pedal out of the circuit.

I would really appreciate suggestions on how I might be able to fix this!

For reference, I included a schematic and a breadboard view (as it is soldered) below:





GibsonGM

Hi Ksander, welcome!

One trick that may help is to power the 555 thru a 100R resistor followed by a large cap (say, 1000u) to ground.  Bring the 555 ground all the way back to the power supply ground (don't tie it in with any signal grounds).   Often times that will isolate the pulses of current the thing draws, which can result in the 'tick' you hear.  Should be easy to find out if it helps...
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

ElectricDruid

To be honest, I long ago gave up using the 555 or 7555 in pedal applications because of the problems you're having. The 7555 is *much* better, but the basic 555 is an absolute bear. Everytime it switches, it crowbars the ground all over the place. Anything else on the same power rails hears a massive thump.

That's a comprehensive list of fixes you posted, and covered everything I could think of and then some. Did you try them all at once?!?
Given that you've tried literally every trick in the book, I think you maybe have to think about a redesign with a different LFO.

GibsonGM

I guess he already tried the one I posted, but insufficient coffee to read them all ;)   At that point, ya - kind of out of luck...I once had this in an Easyvibe, and literally moved the LFO 8cm away onto a daughter board, which solved it. 
  • SUPPORTER
MXR Dist +, TS9/808, Easyvibe, Big Muff Pi, Blues Breaker, Guv'nor.  MOSFace, MOS Boost,  BJT boosts - LPB-2, buffers, Phuncgnosis, FF, Orange Sunshine & others, Bazz Fuss, Tonemender, Little Gem, Orange Squeezer, Ruby Tuby, filters, octaves, trems...

Ksander

Thank you both for the fast replies. I did try the RC filter in the power line, yes. And I tried all tricks separately, to see which single one might work. I guess I could start combining them. Maybe that helps, but the idea of taking the empirical approach of soldering and then desoldering (since it does not occur on the BB) all possible combinations is not very appealing...

ElectricDruid, do you instead use something like an Attiny85 to produce waveforms digitally?

duck_arse

#5
I can't see an explicit ground connection to the 7555 section on your circuit diagram. it's not via that 1N4007, is it? I'm also a little sketchy about your connections to ground on the PT2399, digital and audio ground pins.

also, add a 100nF ceramic from PT2399 pin 1 to ground, just cause. it won't solve your tikk, but it's the right thing to do. also also, add a pulldown resistor to both tip-in and tip-out.
" I will say no more "

ElectricDruid

Quote from: Ksander on September 05, 2022, 10:20:56 AM
ElectricDruid, do you instead use something like an Attiny85 to produce waveforms digitally?
Yep, I do!
If you're into programming your own chips, the code is on my website and it's free for personal use, so buy a few blank chips and go for it:

https://electricdruid.net/electric-druid-chips-the-next-generation/

If not, you can buy one already programmed:

https://electricdruid.net/product/stomplfo/
https://smallbear-electronics.mybigcommerce.com/ic-electric-druid-stomplfo/

Alternatively, there's quite a few threads around here about programming such a thing on Arduinos/AVR/PIC if you want to have a go yourself.

Ksander

Quote from: duck_arse on September 05, 2022, 11:46:53 AM
I can't see an explicit ground connection to the 7555 section on your circuit diagram. it's not via that 1N4007, is it? I'm also a little sketchy about your connections to ground on the PT2399, digital and audio ground pins.

also, add a 100nF ceramic from PT2399 pin 1 to ground, just cause. it won't solve your tikk, but it's the right thing to do. also also, add a pulldown resistor to both tip-in and tip-out.

Thanks for taking the time to review the schematic! It wasn't (isn't?) 100% accurate. The diode was indeed part of the 7555 ground connection, as part of a proposed 'fix', which didn't solve the ticking... It has since been replaced with a direct connection. The 100nF from pin 1 to ground is actually included, across the out and ground of the 78L05, but wasn't in the schematic. I added the pulldowns as per your suggestion, but this didn't solve the problem either unfortunately.

I started adding all the possible fixes simultaneously, which does seem to attenuate the ticking at least a bit. I forgot to add that I also tried a dedicated 78L05 for the 7555, which didn't solve the problem either. I'll keep at it for now. If it doesn't work out, I'll try an Attiny85 too!

anotherjim

If turning the guitar volume down cures the ticking, it suggests to me that it gets in by radiation to the input to the PT2399 pin16. Oddly though, you have a very low input impedance with that 10k R32 which is only really suitable for things with active outputs - not passive guitars.
The input cap C1 is the wrong way around. The guitar electronics go to ground so the negative plate of the cap goes to the input jack tip.
It may be down to layout problems sometimes at the bypass switch and how you run things like LED wires. Screened cable for the input jack connection can help.

duck_arse

#9
shoot-thru current, maybe look that up. I seem to recall one of the timing resistors limits the shoot-thru, but then stuffs up your max-min freqs. small cap, big rrrs, something like that.

I like yer modulation variation switch, wish I'd a thought of that when doing a wobbled delay. no room for mod on the current mess on my breader.
" I will say no more "

Ksander

Thanks for spotting the mistake. I fixed the orientation of the cap, and (re-)tried adding a 1M resistor from the input to ground. Didn't fix the ticking, unfortunately.

I'll look into the shoot through current thing, but have actually already dug up an arduino and an attiny to make a digital oscillator. Still need to learn how to program this though...

anotherjim

You can reduce the current taken by the timer. Your C11 is large at 10uF, if you make it 1uF then increase the pot and timing resistors x10. Same speed range at 1/10th the current.
There is a fast transient "glitch" that occurs due to LED switching. You have x2 of them driven off the timer. It can be mitigated with a low-value cap across each LED. Try what you have 10n to 100n.

niektb

Quote from: Ksander on September 06, 2022, 03:40:11 PM
I'll look into the shoot through current thing, but have actually already dug up an arduino and an attiny to make a digital oscillator. Still need to learn how to program this though...

I think we can help you with that!
Electrosmash's website seems down but I found a copy of the PT2399 analysis here: https://electro-music.com/forum/phpbb-files/electrosmash__pt2399_analysis_181.pdf
Also this is a very useful schematic, courtesy of Electric Canary's Bontempo:


I've written some code in the past that does exactly that in arduino. If you've some experience with coding it's useful but otherwise it might be a tad hard to grasp: https://github.com/niektb/vdd_firmware
I used a small RTOS to ensure that the LFO sample rate is set to 250Hz (so it's high enough to avoid aliasing), set the PWM frequency to 31kHz and filter it out with a RC-filter to get a smooth LFO Wave.

Ksander

Quote from: niektb on September 07, 2022, 03:51:30 PM

I think we can help you with that!


Thanks for your suggestions, but I don't really know what to do with them. Also, the link does not work?

I found code on 'technoblogy' for an ATTiny85 waveform generator. I cut out the parts that I thought would be unnecessary and added a line to read the value of a pot which I use to set the frequency of oscillation. I used the arduino as an ISP and uploaded the code to the ATTiny85. The pinout was nearly the same as the 555, so I could replace it on my board with only minimal changes to other components. It works really well, and I like the effect as it is now.

However, I have only limited experience coding (MATLAB, R), and I don't really understand what is happening. If you'd be willing to provide some explanations, particularly on the shifting of bits, that would be greatly appreciated. Maybe I could make the code neater!


/*
Generating a tone using DDS
*/

unsigned int Acc;
//unsigned int Note = 857; // Middle C
volatile int Note = 1; // replaced line above for lowest frequency possible

void setup() {
 
  //use internal reference voltage of 1.1V
  //ADMUX |= (1 << REFS1); // commented out this line to use 5V Vcc as reference 
 
  // Enable 64 MHz PLL and use as source for Timer1
  PLLCSR = 1<<PCKE | 1<<PLLE;     

  // Set up Timer/Counter1 for PWM output
  TIMSK = 0;                     // Timer interrupts OFF
  TCCR1 = 1<<CS10;               // 1:1 prescale
  GTCCR = 1<<PWM1B | 2<<COM1B0;  // PWM B, clear on match

  pinMode(4, OUTPUT);            // Enable PWM output pin

  // Set up Timer/Counter0 for 20kHz interrupt to output samples.
  TCCR0A = 3<<WGM00;             // Fast PWM
  TCCR0B = 1<<WGM02 | 2<<CS00;   // 1/8 prescale
  TIMSK = 1<<OCIE0A;             // Enable compare match, disable overflow
  OCR0A = 49;                    // Divide by 400
}

void loop () {
}

ISR(TIMER0_COMPA_vect) {
  signed char Temp, Mask;
  int value = analogRead(A1); \\ added this line to read the potmeter
  Note = 3*(65535/20000)*(value/255 + 1) ; \\ 'tuned' the reading of the potmeter to get useful frequencies of oscillation
  Acc = Acc + Note; \\ I don't get this: Acc isn't anything yet; how can Note be added to it? And what is Acc? a byte?
  Temp = Acc >> 8; \\ This is a 'bitshift' operation, does it change the order bits in Acc? How?
  Mask = Temp >> 7; \\ Same as above?
  OCR1B = Temp ^ Mask; \\ Exclusive OR? This makes the output a triangle, but what happens?
}

ElectricDruid

The code uses the "Direct digital synthesis" technique. There's an explanation of this over on my website:

https://electricdruid.net/direct-digital-synthesis/

This example sets up the accumulator as an unsigned int, and that looks to be a 16-bit variable on Arduino. The sample rate is set up as 20KHz. A 16-bit variable will wrap around when the count reaches 2^16 = 65536.

Thus if the increment value is set to  2^16 / 20KHz = 3.2768 we'd have a frequency of 1Hz. Put another way, it would take 20,000 additions before the "acc" counter wraps around.

That number (65536/20000) turns up (ok, *almost* turns up) in the "Note" calculation, which makes me think it's there so that the Note value can be in Hertz. The range of frequencies is:
Min = 3*(65535/20000)*(0/255 + 1) = 3 x 3.2768 = 3Hz
Max = 3*(65535/20000)*(255/255 + 1) = 3 x 3.2768 x 256 = 768Hz

A 16-bit accumulator at that sample rate is barely large enough for LFO frequencies, so you might want to go to a 32-bit variable (24-bit is fine, but Arduino doesn't provide that option so easily).

The "Temp" downshift is a simple/quick way of getting just the upper byte of the Accumulator (e.g. reducing the value to 0-255). Shifting that down another 7 places to create the "Mask" leaves us with only the highest bit. That'll be 0 for the first half of the waveform and 1 for the second half. Since the accumulator is an incrementing count, if we XOR it with that, we'll invert the second half of the waveform so it is now a slope down instead of up. That makes a triangle.
I find the syntax a bit weird (I'd want to invert by XORing with 255, not 1) and the labels are wrong (Mask?!? we're not masking anything!) but I think that's what's going on.
For a simple 8-bit output like this, you can easily use an array to create a wavetable, and then you can have any waveshape you like. Something a bit like this:

Temp = Acc >> 8; \\ Make an array index 0-255
OCR1B = Wavetable[Temp];  // Output the relevant value from our wavetable (set up earlier!)

HTH

Ksander

Awesome, that is a perfect explanation. Thank you so much!

amptramp

A completely separate battery supply for the 555 may be in order since you seem to have an optoisolated output.

anotherjim

The OP seems to have given up on the timer option. If I understood correctly the timer is a CMOS 7555 so it should be much less ticky than the BJT 555.

The CMOS version can work with much lower currents in the timing capacitor circuit so the cap can be smaller and resistors larger. That means reduced current pulses in the power supply and ground. It's silly to copy timing values from the BJT 555 to a CMOS type as that's throwing away most of its low current advantage.

As there is an optocoupler, no part of the controlling circuits needs to share ground returns with the rest of the design - and that includes the indicator LED  and opto input. These can be grounded to the 7555 power ground

The fact that turning the guitar volume right down stops the ticking proves to me that it is picked up at the signal input since this effectively shorts the input to ground. Unless I've misread the postings or am I the only one that sees this?

Having the low 10k input impedance seriously loads down a passive guitar pickup meaning you will try to make up the loss by increasing amplifier volume - and that will also increase any noise from the circuit. I think it needs buffered input (why do so many PT2399 designs try to do without one?). This will still happen if you replace the timer with an MCU only now the noise will also include radio frequencies from the MCU clock and sample rate.


niektb

#18
Quote from: Ksander on September 09, 2022, 03:49:38 AM

Thanks for your suggestions, but I don't really know what to do with them. Also, the link does not work?


Whoops I had set the visibility to private! Should be good now!

Essentialy, what you want is to set the MOSFET (Q1 BS170) in series with your time pot (in the example the time pot is a digital version but it also works with an analog pot say 50k. Then the gate of Q1 should be connected to the PWM output of your arduino. You can also put a pot in parallel with the mosfet to get a modulation depth control (or you can do that digital ofc) like in the taptation: https://www.thetonegod.com/tech/datasheets/taptation_pt2399.pdf

Ksander

Quote from: anotherjim on September 09, 2022, 10:49:18 AM
The OP seems to have given up on the timer option. If I understood correctly the timer is a CMOS 7555 so it should be much less ticky than the BJT 555.

The CMOS version can work with much lower currents in the timing capacitor circuit so the cap can be smaller and resistors larger. That means reduced current pulses in the power supply and ground. It's silly to copy timing values from the BJT 555 to a CMOS type as that's throwing away most of its low current advantage.

As there is an optocoupler, no part of the controlling circuits needs to share ground returns with the rest of the design - and that includes the indicator LED  and opto input. These can be grounded to the 7555 power ground

The fact that turning the guitar volume right down stops the ticking proves to me that it is picked up at the signal input since this effectively shorts the input to ground. Unless I've misread the postings or am I the only one that sees this?

Having the low 10k input impedance seriously loads down a passive guitar pickup meaning you will try to make up the loss by increasing amplifier volume - and that will also increase any noise from the circuit. I think it needs buffered input (why do so many PT2399 designs try to do without one?). This will still happen if you replace the timer with an MCU only now the noise will also include radio frequencies from the MCU clock and sample rate.

I've not necessarily given up on the 7555 - I'm just trying out different things and learning about electronics and programming along the way. I really appreciated your suggestion to use smaller caps and larger resistors, which makes a lot of sense. I'll try this as well.

The Attiny85 is also a very nice solution, I am amazad by how much it can do!