Monday, July 7, 2025

Debugging VCO Pitch unstability continued 4 - selected solution

I've officially come to the conclusion that I'm not able to make the noise level any better at the moment. I've ended up at a point where the noise is at around +/-3-5 cents as measured at the VCO frequency. I'll list some of the things I've tried and what my selected solution is.

What causes the noise

The main parts of the noise seems to be caused by the current running through the transistor collector and to ground. The noise follows the pulse width. When the pulse VCA CV is turned down, the noise is reduced, from +/-14 to 3 cents. 

1k collector resistor, massive noise on VCO, and it follows the pulse wave (top)

 
With pulse VCA at 0, the noise is reduced

By increasing the collector resistor from 1k to 47k, the noise is greatly reduced. The noise is still present even if the pulse wave VCA CV is turned down, but when replacing the 1k resistor with a 47k one, the noise with CV at max and CV at min are the same. I did a lot of experimenting trying to get it even lower, but nothing helped. The rest of this noise presumably comes from other parts of the waveshaper, see "Residual noise" below.

47k collector resistor, vca at max. Almost same noise level as when vca is at 0. Still traces of noise that corresponds (inversely) with the pulse wave.

 

Unfortunately, replacing the 1k resistor introduces switching noise. The switching noise is visible on the waveshaper output for other waveforms, though it isn't audible. As waveshaper output is mixed before the oscillator VCA, when the oscillator volume is turned down, the switching noise to signal ratio is kept and switching noise doesn't get any worse. Rise time for the square wave doesn't significantly change with higher value resistors.

 

Switching peaks with VCA at 0 and a 22k collector resistor

Tiny notch on the bottom of the sine wave, it moves with changes in pulse width.


The switching noise may be decreased by introducing a cap from base to ground or collector to ground. 100p and 470p caps have been tried and work well, but they also change the pulse width at high frequencies (because they slow down the switching time) which may be a problem.

100pF cap from base to ground, pulse with is narrowed.

 

 

What is NOT causing the main part of the noise

- The op amp comparator part, neither for the square wave or the sub oscillator 

- The switching spikes - no change is seen when introducing caps to prevent switching spikes.

- Moving ground to star ground does not help 

- Removing square wave probe doesn't help, so noise is not propagated by the logic probes.

- Increasing cap on the output doesn't help

 

What is causing the residual noise (the parts in sync with the DCO)

- Disabling the transistor by connecting the resistor base resistor to ground (some)

- Disabling the square comparator by disconnecting the saw (better)

- Disabling the whole waveshaper by disconnecting the saw from the input (best)  

But all in all, even with the saw input disconnected, we still get variations around +/-3 cents, though no longer in sync with the saw/square wave, so hard to tell really

Lowering the Pulse VCA CV did not change anything, so a lower initial pulse amplitude won't fix it. 

Switching noise

- Increases when collector resistance increases

- Top is only visible when pulse VCA is low

- Cap at base or collector to gnd helps but rounds off pulse and changes pulse width due to slower transition

- Using resistor divider before base helps, but increases the main noise, even when resistor divider is 100k/22k to gnd, with base at center. (Juno 6 does this). Divider doesn't have to be buffered

- Most of the peak is filtered out by the output cap (3p). Increasing the cap works but rounds off the square wave. May not be audible because cutoff is fairly high, around 200kHz with 3p/270k.

- Increasing base to 150k from 68k doesn't help


Other

- Had some smaller noise peaks on the output. A separate wire from mainboard to waveshaper for DCO saw input removed it. 

- a 50Hz noise was visible, possibly mains related 

 - It's hard to measure the noise. After updating the frequency analyzer script to show a filtered version, the cents calculations seem to have increased, so I've mainly looked at how much the noise follows the square wave. 

- PW: A bit unstable measurements - with 2.63V CV, PW at 47k is 37%. For 1k I first got 22% but then a second, restarted MCU measurement gave 34%. I think in reality the PW stays about the same (with the same output gain resistors etc, set for a correct output with the 47k resistor). The pulse width stays constant when increasing square wave from 330Hz to 8.1kHz, which means this is easily tuneable anyway.

New circuit

- 47k collector resistor 

- 68k base resistor

- 220k+33k resistor from pulse VCA CV to op amp (moves center to compensate for increased collector resistor)

- 270k feedback resistor (increases gain)

- Optional 100p-470p cap on base-gnd 

Other things to consider

- Two CV inputs on VCO to get a better CV level/less noise sensitive

- NB: Must also update square wave generator ON VCO BOARD! 

Saturday, June 14, 2025

Debugging VCO Pitch unstability continued 3

Aaaaand testing continues. NB: Most measurements are now with the VCO connected to power ground.

Reducing pw to 25% to see if it affects the noise

The noise clearly follows the DCO even when pw changes, meaning it is highly likely that a lot of the noise comes from the pulse wave generation. It is a bit delayed/rounded off though.

Turning up DCO at mixer VCO to see if noise increases

It doesn't look like it affects the noise notably

Turning up square sub oscillators 1 and 2 


It's a bit hard to tell, but it looks like the noise drops whenever the pulse wave drops, even if the output from the waveform mixer has the sub oscillator cancelling out every second drop.
With a longer sample time however, we can see that it looks like the noise rises to a higher level when the mixed signal rises too. Not quite sure how to interpret it but it does seem like the sub oscillator has some effect on the noise.

Removing the mixer pcb

Noise is highly visible even if no waveforms reach the output

Trying to measure noise on the pitch CV 

It's a bit hard to measure the noise. There are huge spikes during SPI traffic, but this is probably due to crosstalk within the Logic Pro. 

Measuring again without SPI probes (those are needed at the moment for stable 50MHz SPI)

Much better, the SPI noise is mostly gone. As a side note, the CVs become unstable as the DAC sees wrong values, for example the VCA CVs for the DCOs (probably):


Comparing DCO output and Pitch CV (with SPI probes on):

Markers 0, 1, 2, 3 are at the start of the DCO edges. It is possible to see that the noise in the pitch CV follows (albeit slightly delayed) the same pattern.

Removing the SPI probes

The stepepd noise becomes more visible. It is clearly there still (though - is it there or is it on the ground of the Logic Pro? Nobody knows!

Zooming in on the CV noise

The CV noise seems to jump up and down approximately 10mV. If run through a 39k resistor, it will have the same effect as 100k/39k = 2.56*10mV =26mV would have on a 100k input (e.g. a 1V/oct input). One octave is 1200 cents, so this should result in a noise of about 31cents pole to pole. This matches well with what we see.

Still, I am not sure exactly WHERE the noise is

Moving VCO GND back to the mainboard. 

Connecting the ground of the Logic Pro to the GND on the VCO, measuring pitch CV at input to mainboard to measure more accurately what the VCO sees. Presumably, since the pitch CV summer is ground referenced, the difference between the CV and GND at this point is what the VCO sees - whether it is the CV or the GND that carries the noise. The 10mV difference is still there.

Controlling that the probes measures a silent GND

The CV probe and probe GND is now connected where the GND is tapped for the CV board. Strangely, we still see the DCO. This may be crosstalk in the Logic Pro though.

Disconnecting the output probe

This is weird, we can still slightly see the DCO but definitely not as clearly

Disconnect probes from the filter (!)

I've had probes connected to the JP6 filter the whole time (whoops). Disconnecting them changed nothing though, or not for the better at least.

Disconnecting the SPI probes again

Smaller variation but still periodic noise.

Reconnecting SPI, tapping GND and CV from same probe pair 

Did the noise go away? It's hard to tell. It does look less noisy though. We're up against the limits of what the Logic Pro can measure but it looks like using the ground probe from the same pair is a good idea.

I'd say the ground measurements are inconclusive. There is definitely noise there but I can't figure out where it gets into the measurements.

Using CV generated by my modular


The CV generated externally looks clean. It has a lot of noise, but it doesn't seem to be periodical

Using CV from modular to control VCO

Now, this was surprising! This is the worst noise so far, +/-40 cents. Perhaps the VCO VC and VCO GND both contain parts of the same noise, but of inverse phase, so it partially cancels out? 

Revert to normal but disconnect linear FM

Back to the 'normal' noise again (20 cents this time, but remember that we moved the VCO ground)

Connecting both waveshapers and VCO to power ground 


 This is also a bit interesting. The max noise is not reduced (sttill around 20/20), but there is a second signal bleeding through, modulating the noise at 7-8 times the DCO (between 2330 and 2660Hz). Also, at the negative going poles there are half the peaks. What is going on here, is this some sort of self modulation? 

 

Conclusion

We're really not that much closer to a solution here. 

Star ground from power may not be helping as other parts of the circuit will reference the noisy ground and that may even result in a higher noise since none of it cancels out. 

The noise seems to mostly follow the pulse wave, though something else may also affect it

I am inconclusive as to where the noise propagates. The one thing I haven't checked is the power lines

Noise and crosstalk on probes seem to mess with the result (and especially disconnecting the SPI probes has a great effect) though I don't think this affects the frequency modulating noise, just the measurements of noise on a signal/gnd line. The frequency modulation is still the best way to see what the VCO actually experiences.

Next

The most important thing left to try is rebuilding the comparator parts of the waveshaper, remove the original waveshapers and see if the noise is still there. If it is, we can try to isolate the noise, and if we manage to do that, try to improve it.  

Thursday, June 12, 2025

Debugging VCO Pitch unstability continued 2

Testing continues. First up:

Disconnecting all waveshaper outputs:

Disconnecting pulse, saw, saw inv, sine, triangle, sub square 1 and 2, sub saw 1 and 2. No difference in noise

Replacing trimmers with resistors (to disconnect trimmer wires, as trimmers are on the mainboard):

 

No difference. At this point, the wires still connected are +12V/GND/-12V, -5V, In center, symmetry, DCO in, PW CV and Pulse VCA CV.

Stopping the sub oscillator

First, trying to stop the sub oscillator by pulling pin 7 of IC8 to GND


 

That didn't work at all! Instead, the noise quadrupled, probably because the output of the op amp pollutes GND.

Next, by pulling pin 8 of IC8 to GND

Not really any big change there.

While still pulling pin 8 to GND, reducing PW to 0

This DOES have some effect, though we still see spikes for each period. Not sure where they're from

Combining stopped sub oscillator and pw at max

At this point both the sub oscillator and pulse wave outputs are stopped. There still is noise, but less. The spikes are gone, not sure why.

The comparator op amps (IC8B, IC1D) are still running, this is probably where the noise is coming from.

I did also try to reduce the amplitude of the DCO by running it trough a buffered 33k/100k resistor divivder. That way, I could make sure the PW would be completely disabled. Not a big change there either.

Tapping ground directly from power input, not via mainboard. Sub osc and pulse waves are running

 

This is interesting. The noise is halved. It should be quite apparent by now that this is most likely caused by noise on the GND line. Let's reconnect the full waveshaper board but without GND

With waveshaper board A fully connected but GND routed back to power input:

This is good, the noise isn't increased by reconnecting all pins

With waveshaper board A and B fully connected but GND routed back to power input:

Maybe a bit surprising, but the noise level doesn't change when reintroducing waveshaper B, as long as the GND goes back to the power input. This is very nice.

Double check how things normally are - reconnect GND back to mainboard


Sooo, the noise is back up past 10 cents, approximately +5 cents on both sides. In my first measurements the noise was around +/-20 cents, but then the VCO was running at 7k. Here it runs at 15k. Also, at some point I started synching DCO 1 and 2. Still, a bit confusing.

Plugging waveshaper straight into the main board with VCAs in place. Moving VCO off board

Again, noise is much lower, but this time the noise is back to being sort of a triangle shape. I THINK i still kept hard sync on, so this is a bit confusing. The period is still 333Hz, same as the DCO

Increasing the sample rate and VCO frequency for a better view:

The shape stays the same. Weirdly enough, the plot of the DCO is missing the bottom half, what is going on?

Part 3 wrapped up

I am still not able to completely figure out if the noise is caused by the op amp creating the clock pulse for the waveshaper, the pulse wave generator or the flip flop for the sub oscillator, though the last one seems a bit more unlikely as the noise follows the pulse, not the sub oscillator

Disconnecting all outputs from the waveshaper didn't make a great deal of change, whereas moving the GND did. I can only assume this means that the noise, at least partially, travels through the ground plane. On a side node, version 2.2 of the waveshaper used the LM311 in the sub oscillator circuit. This generated a lot of noise that affected the VCO (perhaps not from the LM311 itself but from the spike generation circuit after it? who knows. From my (unpublished) 'Testing the voice card' post:

 

If the noise is in the ground plane, it affects more than the VCO - VCA levels, filter FM and cutoff etc. But noise on these are probably less audible.

 

More to test (hey, we're up for a post number 4!)

- x Set pw to 25% and see how the noise reacts. At this point the sub oscillator should still have pw 50% so we may be able to see a difference? 

- x Connect both VCO and Waveshaper grounds to power gnd, effectively making it star ground

- x Try to measure noise on the ground plane

- Look for info on how op amp comparators may pollute the ground plane.

- Breadboard the offending parts of the waveshaper (pulse and clock generators) to see if we get the same result

- x Remove the mixer PCB and tap VCO directly

- x Enable DCO output in mixer but measure VCO at its output, is the noise even worse? 

- x Measure noise on CV 

- x Measure noise on CV without measuring SPI with same probe. 

- x Measure noise on CV relative to GND on VCO! Move GND back to Voice card 

- x Ground CV/Connect to voltage from modular synth 

- x Disconnect Lin FM input from VCO

 

Wednesday, June 11, 2025

Debugging VCO Pitch unstability continued

With PW set to zero

This mostly removes the noise. Not completely, but quite a lot better

With triangle DCO

The frequency seems to vary with the triangle wave as well
 
But when increasing the resolution and VCO frequency, we see that it is not a complete triangle, it seems to drop abruptly at the top of each DCO cycle.

Square wave is rounded

 

An observation - the frequency square wave is rounded, almost like it is low pass filtered.

Removing waveform mixer VCA

The square wave has its VCA on the waveshaper board so it is still visible  

Setting DCO to triangle, waveform mixer VCA is still removed

The triangle wave now never reaches the waveform mixer, but the square wave still breaks through. The frequency variations are almost exactly the same as what we saw when the triangle wave WAS connected, see "with triangle DCO, high resolution" above. Perhaps the triangle does in fact NOT affect the CVO.

Setting DCO to square, PW to 0. Waveform mixer VCA is still removed

 

There is still a small variation, but it is less than we saw before. However, there IS a slight up and down squarish effect here. Could it be coming from the input to the sub oscillator flip flop?

Also, there are significant spikes at the period marks. It could be that a PW of 0 is not quite turned off OR it could be from the sub oscillator circuit.

Moving waveshaper off board with jumper cables

The noise is the same as previously, distance doesn't matter

 Single DCO set to triangle

Square still breaks through

Pulse output from waveshaper board disconnected 

This is very interesting, almost not understandable. The pulse output is disconnected so the pulse wave does not reach the mainboard. But still we see the frequency noise! We also see the clicks on DCO period start.

Disconnecting the DCO input

Disconnecting the DCO from the waveshaper makes everyhing go away. Not surprising but a nice check. 

Recap

So, what we see this time is that 

- The noise is most likely only caused by the pulse wave (?), or at least not as much by triangle etc.
- The noise is present even when the pulse wave is disconnected from the mainboard
- There are heavy spikes at the start of each cycle

Theories

- The noise may originate from two sources: The saw-to-clock-pulse converter around  IC6 (LM311), and the pulse wave generator around IC1
- The noise does not travel (exclusively at least) through the pulse pin. 

Next up

- Disconnecting other waveform pins
- Disconnecting sub oscillator pins
- Disconnecting trimmer pots, replace with resistors
- Stopping the sub oscillator, with and without pw at 0
- Halving the DCO input to completely stop PW output
- Moving GND pin for the waveshaper to not return to the mainboard
- Check if flipflop stops
- Reconnect everything and move GND only.
- Move VCO offboard and do stuff suggested in the previous post.