Author Topic: Two op-amp VCO  (Read 1394 times)

0 Members and 1 Guest are viewing this topic.

Online Zero999

  • Super Contributor
  • ***
  • Posts: 13786
  • Country: gb
  • 0999
Re: Two op-amp VCO
« Reply #25 on: March 26, 2020, 10:20:25 am »
Another thing you could try is a BJT with a capacitor in parallel with the base resistor to speed up the turn off time.

The bypass capacitor should always be used no matter what else is going on.  It considerably improves the switching time of the transistor for a given amount of base series resistance.
The trouble is when the output of U2 goes low, the base-emitter voltage will fall below the -6V rating which will damage the transistor, hence why I selected the low value of 10pF, which should be small enough to prevent this. If in doubt, diodes could be added in reverse parallel to protect against reverse voltage.
 
The following users thanked this post: bonzer

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 10643
  • Country: us
  • DavidH
Re: Two op-amp VCO
« Reply #26 on: March 26, 2020, 05:47:12 pm »
Another thing you could try is a BJT with a capacitor in parallel with the base resistor to speed up the turn off time.

The bypass capacitor should always be used no matter what else is going on.  It considerably improves the switching time of the transistor for a given amount of base series resistance.

The trouble is when the output of U2 goes low, the base-emitter voltage will fall below the -6V rating which will damage the transistor, hence why I selected the low value of 10pF, which should be small enough to prevent this. If in doubt, diodes could be added in reverse parallel to protect against reverse voltage.

The damage is only significant at low collector currents unless the transistor is part of a matched pair.  If you are worried about this, then clamp the base-emitter junction with an anti-parallel diode like a 1N4148.
 
The following users thanked this post: bonzer

Offline bonzer

  • Regular Contributor
  • *
  • Posts: 78
  • Country: it
Re: Two op-amp VCO
« Reply #27 on: March 26, 2020, 06:48:10 pm »
I want to make you notice that at low frequency (something like 0.1V at the input and 200Hz) the solution proposed by Zero999 with two comparators works bad. As you see in my attachment capacitor charging is slower than it should and therefore we have an asymetric wave.  Do you have any idea why? It's sad because at high frequency it actually works better than the simple bjt solution (but anyway adding capacitor at base helps especially in my case for 20kHz).
At low frequency bjt solution is better in this case.
« Last Edit: March 26, 2020, 06:51:57 pm by bonzer »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 13786
  • Country: gb
  • 0999
Re: Two op-amp VCO
« Reply #28 on: March 26, 2020, 08:11:00 pm »
Another thing you could try is a BJT with a capacitor in parallel with the base resistor to speed up the turn off time.

The bypass capacitor should always be used no matter what else is going on.  It considerably improves the switching time of the transistor for a given amount of base series resistance.

The trouble is when the output of U2 goes low, the base-emitter voltage will fall below the -6V rating which will damage the transistor, hence why I selected the low value of 10pF, which should be small enough to prevent this. If in doubt, diodes could be added in reverse parallel to protect against reverse voltage.

The damage is only significant at low collector currents unless the transistor is part of a matched pair.  If you are worried about this, then clamp the base-emitter junction with an anti-parallel diode like a 1N4148.
Is there any benefit to using two diodes, to get a more negative voltage, hence faster off time?

I want to make you notice that at low frequency (something like 0.1V at the input and 200Hz) the solution proposed by Zero999 with two comparators works bad. As you see in my attachment capacitor charging is slower than it should and therefore we have an asymetric wave.  Do you have any idea why? It's sad because at high frequency it actually works better than the simple bjt solution (but anyway adding capacitor at base helps especially in my case for 20kHz).
At low frequency bjt solution is better in this case.

I take it this is in the simulation, rather than in real life?

Neither circuit will work in reality with the input voltage that low because it will exceed the common mode input range of the NE5532 which is around 2 to 3V from the negative rail and isn't modelled by LTSpice. That problem can be overcome by adding a -3V power supply to the NE5532, but it will still won't work properly 100mV away from the negative rail.

At first it did seem odd that the BJT seemed to perform better closer to the negative rail, than the comparator, so I looked at the voltages around the circuit. The reason is the LM393 model has a higher saturation (on) voltage, than the BC548 model, at 18mV vs 6.55mV. I don't know if this is representative of real life with a current of just 910nA. I expect the bias currents and offset voltages of both the comparator and op-amp will cause problems at such low voltages.

SPICE will often allow you to do all sorts of silly things and will simulate perfectly. Behaviour when devices are taken outside their specifications is often not taken into account by the models. It's important to look at the voltages/currents at different parts of the circuit and check they don't exceed the device's specified operating range.
 
The following users thanked this post: bonzer

Offline bonzer

  • Regular Contributor
  • *
  • Posts: 78
  • Country: it
Re: Two op-amp VCO
« Reply #29 on: March 26, 2020, 09:37:03 pm »
I didn't post .asc file so I'm sorry but actually I did connected negative power source to the NE5532 (-15V) because I needed it. Also I used BC337. Anyway I understand strange things might happen because it's all about simulation simplifications.

I'm afraid I'm gonna have very few laboratory sessions because of many reasons and this is the reason why I want to understand as much as possible how it could probably behave in reality.
« Last Edit: March 26, 2020, 09:46:37 pm by bonzer »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 13786
  • Country: gb
  • 0999
Re: Two op-amp VCO
« Reply #30 on: March 26, 2020, 11:12:45 pm »
One good thing about SPICE is the transistors, comparator and op-amp can be replaced with fictitious idealised models which can be tweaked. Here's an example of the circuit with a generic op-amp model, a Schmitt trigger, rather than the comparator and a voltage controlled switch instead of the transistor. I've added an 18mV voltage source in series with the switch to model the on voltage of the transistor in the LM393's output stage and it produces a similar waveform to what you posted. If Von is set to 0V or simply deleted, it produces a nice symmetrical triangle wave.

You might want to try experimenting with a MOSFET for the switch. Try one with a low drain-source and gate-source capacitance, such as the FDV301N. Note that the maximum gate voltage is only 8V, so with a 15V supply, a potential divider will need to be added before the gate, to reduce the voltage.
https://www.onsemi.com/pub/Collateral/FDV301N-D.PDF


 
The following users thanked this post: bonzer

Offline bonzer

  • Regular Contributor
  • *
  • Posts: 78
  • Country: it
Re: Two op-amp VCO
« Reply #31 on: March 27, 2020, 09:25:40 am »
Do you think that replacing the BJT or the second comparator with an analog switch for example CD4066 could solve this problem? Ensuring a really good connection to ground? It's not great using an entire 14pin DIP for only one switch but anyway if this is the best possibility I'm gonna use it.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 13786
  • Country: gb
  • 0999
Re: Two op-amp VCO
« Reply #32 on: March 27, 2020, 12:10:49 pm »
Do you think that replacing the BJT or the second comparator with an analog switch for example CD4066 could solve this problem? Ensuring a really good connection to ground? It's not great using an entire 14pin DIP for only one switch but anyway if this is the best possibility I'm gonna use it.
I wonder if the LM393 could be replaced with the CD4007? The simulation results aren't great, but I wouldn't trust them that much. You're at the point when you need to do some lab work.

There are analogue switches available in smaller packages, than the CD4066. There's the DG467 which isn't any cheaper but is faster and should be better.
http://www.vishay.com/docs/74413/dg467.pdf

* VCO op-amp 4007.asc (4.14 kB - downloaded 5 times.)
 
The following users thanked this post: bonzer

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 10643
  • Country: us
  • DavidH
Re: Two op-amp VCO
« Reply #33 on: March 28, 2020, 04:09:27 am »
The damage is only significant at low collector currents unless the transistor is part of a matched pair.  If you are worried about this, then clamp the base-emitter junction with an anti-parallel diode like a 1N4148.

Is there any benefit to using two diodes, to get a more negative voltage, hence faster off time?

There should be but I have never noticed a significant difference.  It might be done with power devices.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 13786
  • Country: gb
  • 0999
Re: Two op-amp VCO
« Reply #34 on: March 28, 2020, 08:47:46 am »
If you're going to use a bipolar power supply. You could use a -15V supply to the comparator and experiment with a J-FET. R9 just limits the forward current to J1. It could be a much higher value, but it would slow down the switching, since the J-FET still has a tiny capacitance. Try higher values, say 10M, with a 2.2pF capacitor in parallel or replacing it with a diode, such as the 1N4148. The tiny capacitance of the diode should be enough to charge/discharge theJ-FET's gate reasonably quickly.

* VCO J-FET lm393 ne5532.asc (5.21 kB - downloaded 4 times.)
« Last Edit: March 28, 2020, 11:50:20 am by Zero999 »
 

Offline bonzer

  • Regular Contributor
  • *
  • Posts: 78
  • Country: it
Re: Two op-amp VCO
« Reply #35 on: March 28, 2020, 12:12:25 pm »
Thanks for your new ideas! Really interesting! I'm gonna check them all and see what is more convenient, better working and simpler also depending on the rest of the circuit (shaping part).

I also tried to use NE555+BJT. Works well - very symmetrical but slower than with LM393+BJT.

I also tried to save on the BJT by using the output open collector from discharge pin 7 (like Zero999 did with two LM393, using the internal transistor). I take into account the possibility to have negative power supply so I used an inverting amplifier, this way I have the desired double inversion for discharge pin. Maybe I'm wrong but I think the internal bjt could work faster than a discrete so maybe this could be useful for higher frequencies. At the same time another op amp slows the whole process. It works but I don't see any improvements. Still a bit slower than LM393+BJT. Also I think this solution might work worse in practice because I used more resistances and op amps are slow etc. but I just wanted to share it with you.
I know there are tons of solutions but I don't have enough experience so it's hard for me to judge which one is better.

For now I'm still intended to use LM393+BJT, it works fast enough.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 13786
  • Country: gb
  • 0999
Re: Two op-amp VCO
« Reply #36 on: March 28, 2020, 02:09:09 pm »
It doesn't surprise me the 555 timer is slower than the LM393. Just because the simulator says the symmetry is good, it doesn't mean it will be as good in real life. Awhile ago I breadboarded the standard 50% duty cycle circuit with the CMOS 7555. The simulation would suggest a perfect 50% duty, but the breadboard circuit wasn't as good and there was some variation from device, to device, even through they had the same part number.
https://www.eevblog.com/forum/beginners/portable-low-frequency-square-wave-generator-circuit/msg2167870/#msg2167870
 
The following users thanked this post: bonzer


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf