Thursday, April 9, 2020

Distortion breadboarded

I've breadboarded two versions of the distortion circuit, both with input attenuation and output amplification to keep a 10Vpp signal almost untouched.

Pre-distortion amplification


First I did the version with pre-distortion amplification. With distortion CV at 0V the distortion circuit sees around 30mVpp. This is heavily amplified to distort.

At the other end, a second OTA amplifies the signal. The output has unity gain for a 10Vpp input when CV is around 2.5V.


Hard clipping circuit with pre and post distortion VCAs

Hard clipping, distortion CV from 0 to 5V



Soft clipping circuit with pre and post distortion VCAs

Soft clipping, distortion CV from 0 to 5V



This circuit worked pretty much as in the simulation. I do have some issues with CV feedthrough so centering is not perfect when distortion changes.

I think I have to bite the bullet this time and introduce AC coupling to get rid of this. Placing a cap in series with the 1k resistor to the distortion op amps negative pole seems to do the trick, and will function as a high pass filter as well (beware though, if not chosen correctly low frequencies will not be distorted, in fact they will be attenutated.

Distortion CV at 0V

Distortion CV at 2.5V, almost full distortion and more than double amplitude

Distortion CV at 5V, full distortion. Signal is clipped unevenly by the op amp.

Distortion CV at 2.5V, almost full distortion


Distortion CV at 5V. Very similar to half distortion.

It seems that the real life circuit sees a higher maximum input gain than the simulation. Full distortion is reached much earlier. Also, compared to the OTA in feedback loop version below, the CV response seems exponential, not linear.

OTA and parallel resistor in feedback loop


Then I tried breadboarding the OTA-in-feedback version. I had lots of trouble and could not get it working as expected at all. After much experimentation I ended up with a well functioning circuit. I then started documenting the changes, and realised what was going on: I had inadvertently put a 33k resistor in the feedback of the distortion op amp. This works in tandem with the signal fed back through the OTA, so it completely changes the amount fed back.

As a bonus, the CV control of this version seems to feel much more linear - in the other version all changes came at the start of the CV and very little later. Also, the soft clipping amplitude seems to stay very close to 5V, so in some ways it feels more "correct", the volume doesn't increase as much.

After discovering my error I simulated this circuit too and it works as on the breadboard.

PS: The distortion CV now works in reverse: 0V is max distortion, 5V is no distortion. Unity gain through the circuit is the same as above, approximately 2.5V.

OTA and 33k resistor in feedback of op amp

Soft clipping

Hard clipping, starts very soon after turning the distortion pot.


OTA in feedback loop without the 33k resistor


Now I went back to the circuit that I was TRYING to breadboard and looked at the simulation again. I think I got lost because I couldn't get it working the way I wanted to. Looking at my previous Distortion post, I realised that the hard clipping starts much later, and so the output has a higher amplitude when clipped than in my happy accident.

I then changed parts back to my original design and did some tweaking, resulting in this circuit:


OTA and no resistor in feedback. Soft clipping version


OTA and no resistor in feedback. Hard clipping version
Soft clipping

Hard clipping

Results on the breadboard for versions with OTA in feedback loop


The circuit on the breadboard have some small differences from the simulated one. The output amp uses a 120k resistor instead of a 150k to get unity gain at 2.5V CV. I left the 180pF (Low pass filter) in place, and used 1k pots instead of the resistors to ground on the OTA inputs (except for the distortion OTA in the version without resistor in the feedback.

The potentiometer settings used were:
VCA pot: 620 ohm to ground on negative input, 365 ohm to ground on positive input
Distortion pot: 479 ohm to ground on negative input,  512 ohm to ground on positive input in distortion OTA. For the version without a feedback resistor I breadboarded it as in the schematics.


All oscilloscope pictures are of a 473Hz 10Vpp input wave. Vertical resolution is 5V/square. Output VCA CV is at 2.5V which according to the simulations should give us unity gain for undistorted signals.

First, the circuit with both an OTA and a 33k resistor in the feedback, soft clipping:


Triangle wave, soft clipping selected and distortion CV is at max (5V) meaning least amount of distortion. Output is equal to input
Same as above but with distortion CV at 0V, meaning max distortion. Amplitude only changes slightly but output is heavily distorted.



Hard clipping:

Same as above, but this time with hard clipping. 5V distortion CV, No signs of clipping and still unity gain.

Again same as above, hard clipping, but with 0V distortion CV/max distortion. Heavy clipping and just slightly higher amplitude.

Without 33k resistor in feedback

Now for the circuit without the 33k resistor in the feedback loop. This didn't work very well, the clipping became very asymmetrical. This may be due to the high attenuation of the input signal? I tried replacing the resistors at the positive and negative OTA terminals with a 1k resistor but that didn't change things. Maybe an HP filter capacitor would help?

Soft clipping:

Soft clipping, max distortion CV. The signal passes unclipped but with the output VCA CV at 2.5V the amplitude is only around 7Vpp, and also not symmetrical around 0V.

Soft clipping, no distortion CV. Heavy but unsymmetrical clipping. Amplitude is almost the same as for the previous circuit.
Hard clipping:

Hard clipping, max distortion CV. Same as soft clipping, no surprises there.

Hard clipping, no distortion CV/max clipping, looks very similar to hard clipping for the other circuit except that the clipping is unsymmetrical.


Pre and post OTA breadboarded



510 ohm resistors instead of trimmer for version with 33k in feeback

I tried replacing the 1k trimmer pot on the distortion feedback OTA with two 510 ohm resistors to ground. That gave the following result:


The input is now distorted, meaning the OTA sees a too high voltage.

By measuring the position of the trimmer potentiometer for the distortion feedback OTA when signal does not clip at 10Vpp input (750 ohm), and using the resistor divider equation, I found that the distortion OTA sees +/-165mV. Going the other way, a resistor divider with 15k and 510 ohm will yield the same result. Here I have done the change:


When tweaking the potentiometer I could see that clipping starts right after I started turning the potentiometer. Since there may be production differences, an even smaller input resistor would give a litte room for trimming the input digitally. Here is the effect of 12k, a slightly smaller amplitude:



I also tried replacing the trimmer in the VCA OTA part, that heavily offset the output. It could be possible to use AC coupling here, but we would still get uneven clipping in the VCA at high gain, so it might be best to use a trimmer.

I also did see a slight distortion at minimum distortion CV, but this is probably not related to clipping.

510 ohm resistors in the simulation

In simulations though, it does not work very well:

Signal is much smaller than in the breadboarded circuit when no distortion CV is applied.






I am not sure I will do any more work on this now, I have a well functioning circuit that I will test with some "real" signals instead later (the one with the extra 33k resistor in the feedback, 12k on the input and 120k on the output).

No comments:

Post a Comment