Showing posts with label pulse wave. Show all posts
Showing posts with label pulse wave. Show all posts

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! 

 

Update 

I tried a few more things. Moving the VCO off board, and connecting the VCO pitch CV to the CV on my modular. When running without the digital power on on the XM8 (meaning no DCOs and waveshapers running), I get a fairly clean signal - but with a 50Hz component (mains probably):

 

When I turn on digital again, I get more noise:

I've tried connecting the Linear FM back to the main XM8 board. I got no more noise (with FM disabled) but cannot test further as OSC B does not get through to the FM input because the waveshaper is missing.

Connecting the Exp FM to the mainboard introduced massive noise since the pin on the VCO board is at the summing point of the input op amp, meaning the long leads introduce noise. 

 

Sunday, October 15, 2017

Xonik Waveshaper v1.0

The wave shaper board and Noise board was sent off to DirtyPCBs for production last week. They both turned out rather nice - the waveshaper board measures 28 x 64 mm and the noise around 24 x 25 mm.

Interestingly enough, the sub oscillator circuit takes up more than half of the waveshaper due to the many options (-1/-2 octaves, saw or square wave).

I’ve tested the circuit with the DCO and got some very nice results. There are still some spikes on the sub saw waves, but while adding filter caps did reduce the spike amplitudes, it also widened their base. I’ve chosen to leave the spikes as is but have left room for the filter caps should I redecide.

The noise board requires four external trimmers - one to center the saw wave, one to trim the triangle and sine waves and two to match the saw wave parts in the sub oscillator.

The noise circuit requires an external noisy 2n3904 or, as in the Andromeda A6, 1N5237B/8.2V zener diode. It has the option of adding a trimmer to control the noise amplitude, but also has room to just use an on-board resistor if exact amplitude is not of essence.

The A6 uses an opamp to offset the noise outputs due to its internal offset center (PMID), which also acts as a filter. This is not included in my circuit.

Waveshaper board. All mixing and amplitude control must be done externaly which makes it possible to use this card both with computer control and directly with mechanical switches or potentiometers if one wants to make a mono synth without patch storage.


Here are some photos of the output when the XDCO is connected istead of a function generator:
Saw

Sub oscillator saw, one octave down

Sub oscillator saw, two octaves down

Inverse saw


Triangle
Sine
Square

Sub oscillator square, one octave down

Sub oscillator square, two octaves down

Pulse wave
The results look very good, but I have yet to run it with a amplitude calibrated DCO, so right now wave shaping is not perfect for all frequencies, only the one the waveshaper is manually calibrated for.

Monday, September 25, 2017

Xonik Waveshaper - breadboarded version

I finished breadboarding the waveshaper last night. Here is the schematics (not bug checked though) and a few photos of the output waveforms from the sub oscillator. The saw wave looks like crap but that is because I used a function generator without saw output as the source of the original wave (using a triangle wave with a very unbalanced center in place of the saw). It will look a great deal better with a real saw wave input.

Full waveshaper circuit. Note that the sub saw output has the same polarity as the input. It is also possible to get an inverted output.
Square wave (top) and square wave sub oscillator

Pulse wave and square wave sub oscillator

Saw wave and saw wave sub oscillator. Note that the spikes are artifacts created by the not-completely-a-saw-wave input (the vertical lines in the input wave are not fully vertical). This will disappear when using a real saw wave as input.

1 oct down and 2 oct down saw waves.





Sunday, September 24, 2017

Coming soon: the Xonik Waveshaper


On my breadboard today: The Xonik Waveshaper - insert a non-centered 0-10V saw wave from the Xonik DCO and you'll get the following (centered) waves:

- Saw
- Inverted saw
- Triangle
- Sine
- Pulse/square with VC-PWM and VC amplitude (no VCA needed)
- Sub oscillator with square -1oct, square -2 oct, saw -1 oct and saw -2 oct.

The current triangle/sine circuit is based on the Jupiter 8 and Yusynth modular, the sub oscillator is a simplified version of the Xonik Sub oscillator. The pulse circuit amplitude control idea (but not circuit) is lifted from the Juno.


Monday, July 31, 2017

Wave centering - bias circuit

The DCO generates a wave running from 0 to -10V. To center this, I tried using two resistors and a 1uF capacitor, followed by a buffer. This works fine for higher frequencies, but at the bottom of the frequency range we get severe distortion, turning the straight lined saw wave into a slope.

Also, this arrangement won't work for Pulse signals as the pulse width has more energy at either top or bottom.

The square and pulse waves are a bit interesting as the amplitude CV does not have to run through a VCA. Instead, the amplitude is equal to the CV. This means that subtracting half the CV from the output wave will center it.

I've come up with the following, untested (and incomplete) circuit that shows my idea:



Wednesday, April 5, 2017

Juno 106 vs 6/60 DCOs

There are some differences between the DCOs in the Juno 106 and the Juno 6/60 - except for the fact that the DCOs on the 106 are integrated into a single chip.

First of all, according to the datasheet, the 106 uses an NPN instead of a PNP transistor to reset the integrator (saw wave converter).

More interestingly, the way they sum the saw wave and the pulse waves are very different.

The Juno 60 has a separate control line for the pulse wave, connected to TR2. It looks just like the one for the saw wave (TR3) so one can assume that it turns on and off the pulse output. Also, the output of the pulse is sent through D2 which will block any positive halves of the pulse (? which sort of makes sense as the saw wave is also negative only).

The 106 on the other hand, has no such control line, which means that the pulse output is always on. The pulse output has a diode to ground which I assume means that it will never be negative (?).

So how can the 106 output a saw wave and no square wave? One theory may be that if the user selects saw wave only, the pwm is set to 50%. Summing the sqare and saw waves will chop up the saw wave just as it reaches its half period, and move the remainder upwards. If the amplitude of the saw and square waves are equal, the saw wave will magically realign with its phase shifted half a period, this time centered around 0V.

DISCLAIMER: This is only my initial theory after studying the datasheets, no measurements have been made. 

But how about when both the saw and pulse waves are on? Wouldn't this mess up how the wave turns out? Since the saw wave is positive and the pulse is negative, couldn't the total amplitude end up being double?

Well, the high part of the pulse will always come at the second half of the period, thus it will never "lift" the saw wave from higher that minus half the total voltage p-p. Also, The parts that are lifted will only be lifted by 1 x the voltage p-p.

In practice, this means that if we could set the duty cycle to 0%, the output would be a saw wave that starts at 0 and drops to minus the total voltage p-p. If the duty cycle is 50%, we get a saw wave with the same amplitude centered around 0V.

This is interesting and may reveal a flaw in my assumptions. As the wave is centered around 0V by a capacitor later, summing a pulse and saw wave this way will only shift the saw wave phase! I need to check if the polarity and phase assumptions for the square wave actually holds. What happens if instead the polarity is reversed or the phase shifted by half a period?


TODO: Write about SUB OSC and level control (done by using the output from the DAC) and how the passing through a diode affects the signal (reversed in one)- one uses NPN and the other uses PNP, 60 has a resistor to GND at the transistor base. The 106 has no on-off switch for the SUB OSC, only a volume control.

Both the 106 and the 60 DCOs have their outputs mixed with noise (with adjustable volume) right before a 10uF non-polarized cap and injected into the IR3109/800170 filter chips. The mixing point has no opamp connected to it so I assume this job is done by the chips. I guess the cap is there to filter out any DC component and center the waves around 0V. I have not looked closely at this - what happens here when the frequency changes for example, will still stay centered during the transition because the amplitude is still the same?

BTW: NP in the juno datasheet means Non-polarized (capacitor). MF means metal film (resistor).  G (capacitor) may mean 2% (needed for accuracy in the integrator).