I’ve just cracked the solution to a problem that has been sitting in the back of my mind for the past few weeks. The problem is as follows: I want to make my current oscillator design (which can provide square and triangle wave outputs) variable in its pulse width. The method that I came up with would also allow me to skew the triangle wave output to give me a variable triangle/saw wave knob, skewing to ramp up and ramp down varieties. This is a setting I have seen on plenty of synths, and I felt that it wasn’t impossible to do by some slight tweaks to my design.
About 1.5 weeks ago I was on a night out, and upon arriving home I drunkenly ordered some diodes and banana jacks+sockets which I thought would be the solution to my woes. The banana connectors weren’t related to this issue, but were born out of a desire to make my synth designs more modular. The diodes, though, I reckoned were exactly what I needed to solve my oscillator issues! The image below was ripped from a website online, and illustrates an opamp based relaxation oscillator.
The capacitor charges and discharges via R (one can safely assume that no current flows through the opamp terminals, as they appear at very high impedance), R1 and R2 set the voltage boundaries that the capacitor charges/discharges according to, by combining ground and the output signal in a certain ratio (described by their relative values). A square wave can be found at the output of the opamp (labelled V0), and a triangle wave can be found (at a much lower voltage) from the inverting input of the opamp (labelled VC). This triangle wave is then amplified, and the two waves are then sent to a 1P2T switch: single pole, double throw. This is just an A/B switch, with the triangle represented when the switch is flicked in one way, and the square when it is flicked the other way.
Googling didn’t really give me any solid answers about solutions to my PWM issue, but I thought that I could use diodes between R and C to affect the charge and discharge time of C independantly. I thought I might run into differences of frequency, but also presumed that if I kept the total resistance of the two resistors the same as R was, then the frequency wouldnt change, just the duty cycle. My assumptions were correct; wiring up two diodes in parallel (facing opposite directions) and then swapping R for two pots of the same value meant that I could achieve the PWM and tri/saw skew without affecting total frequency if the pots were turned together but inversely at the same rate. That means, all I need is a dual gang pot with each pot wired inversely to achieve smooth alteration of pulse width and tri/saw skew !!! This was a breakthrough. The only issue is: R in my previous circuit design was where I altered the frequency, but now I can’t use that point to alter the frequency as the charge and discharge rates are affecting the skew. Further testing needs to be done to see whether a pot in place of R1 or R2 will affect the frequency but leave the amplitude unchanged. If that is indeed the case, then life is bliss and everything is going swimmingly.