Two op-amp VCO  - Page 1
Forum section: electronics / beginners

author: bonzer
author_rank: Regular Contributor
timestamp: March 19, 2020, 10:55:27 pm
content: Hello! Please help me to understand if I got that circuit theorically right. I'm looking for your feedback.I assume for now some simplifying conditions: drain-source voltage null when mosfet is ON, R7=R6 and R2=R1=R4=2*R5 (will explain that later) and both opampspowered by V+= -(V-).It is important for me to have a symmetrical triangular wave.(by this I mean equal semiperiods for positive and negative slopes)I've never found some formula explanation online so I tried to figure out by my own how it exactly works.OUTPUT1 is a triangular wave while OUTPUT2 square wave. As it happens for the simple triangle-square wave generator, capacitor charges with direct current so its voltage rises linearly, giving birth to the triangular wave.From my conditions I find that half of Vin is always on positive input of first opamp. When the mosfet is off (output2 low level) current on R1 (Vin / 2R1) discharges the capacitor with negative voltage till it brings output1 to the half of negative output2 low level. If I can manage to have my triangular wave symmetrical I can find frequency directly by considering this semiperiod when mosfet is off.If I'm not wrong we get (Vin*Toff)/(2*C*R1)=V+ (because it charges between the two thresholds of the second opamp at output1, V+/2 - V-/2 so it gives V+)My biggest doubt is when dealing with mosfet ON. What I think is if we impose a current on the mosfet that is double of Vin / 2R1, and therefore we choose 2*R5=R1, for the ampere law on the node we have also a current coming from the capacitor equal to (Vin / 2R1)but this time it has the opposite sign of the previous one so my capacitor charges in theory with the same slope but a different sign, for an equal duration of the semiperiod.Am I right? I want to go on dealing with real mosfet but I want to be sure I got it. It's been many years since last time I dealt with similar circuits.

author: Wimberleytech
author_rank: Super Contributor
timestamp: March 20, 2020, 01:10:23 am
content: Is it a MOSFET or a JFET. You drew JFET and said MOSFET. Please clarify.With the MOSFET on, you use the Thevenin eq of R1, R5 and Vin giving the Thevenin voltage of Vin (R5/(R1+R5)) and a Thevenin resistor of R1R5/(R1+R5).The charging current is the difference in the Thevenin voltage and Vin/2 divided by the Thevenin resistance.

author: David Hess
author_rank: Super Contributor
timestamp: March 20, 2020, 06:02:22 am
content: I have used that circuit several times and it provides moderate performance up to several kHz or 10s of kHz if a comparator is used. The resistor in series with the drain/collector of the transistor is usually selected to make the transistor's series resistance insignificant.

author: Zero999
author_rank: Super Contributor
timestamp: March 20, 2020, 11:29:12 am
content: Yes, ideally a comparator should be used for the Schmitt trigger. Preferably one with a rail-to-rail output to ensure the hysteresis is symmetrical.The schematic originally posted would require a bipolar supply to work properly, as a J-FET requires a negative gate voltage to turn off. The traditional circuit uses a MOSFET or BJT.No resistor values are on the schematic. I prefer to use lower value input resistors, than the ones suggested on the schematics in the LM358 data sheets, otherwise to get the full frequency range out of this circuit the input voltage needs to nearly double the supply voltage.

author: David Hess
author_rank: Super Contributor
timestamp: March 20, 2020, 03:00:19 pm
content: I have some other comments about this circuit:1. If you are expecting accuracy, forget it. There are much better circuit to use for voltage to frequency conversion when accuracy and linearity are desired.2. I always had problems with the collector/drain capacitance of the transistor limiting performance at high frequencies so sacrifice on-resistance for lower capacitance if necessary; the common 2N7000 TO-92 MOSFET was particularly bad about this. I think in the last one of these I made, I used a 4053 analog switch for lower capacitance and got excellent results. A CMOS 74125 tri-state buffer or even better, any open drain output should work well.3. The lag in a slow comparator causes the triangle wave to overshoot at high frequencies and contributes considerably to the transfer function nonlinearity. This can be improved by placing a resistive divider between the operational amplifier and comparator, which also increases the amplitude of the triangle wave, and then adding a low value adjustable capacitor in parallel with the input resistor of the divider to add phase lead. Then as frequency increases, the increasing phase lead causes the comparator to trip earlier making up for its delay.

author: bonzer
author_rank: Regular Contributor
timestamp: March 20, 2020, 05:09:41 pm
content: Thank you everybody for your answers. I'm sorry about the poor details. I want my transistor to be MOSFET and this is what I originally thought it was in the schematic.Thanks for making me notice that applying Thevenin really helps here.I'm afraid about two practical problems:To avoid problems for higher frequencies I can use comparators LM311 or LM393 but from what David said it's still not guaranteed. But is this really a problem for frequencies under 20kHz? LM311 is fast - takes 165ns of response time. Would also mosfet drain's capacitance give problems in that frequency range? It surprises me I thought these frequencies are low enough. Anyway these problems are solvable because I can try to do what David suggested.I have another problem: to be honest I've never used comparators so from what I see they give 0/5V of output despite their power source. It's not compatible because I want my triangle wave to be alternating so equal and opposed threshold voltages would simplify this. Supposing that I use LM311. I can try to work on finding these resistance values but I'm not sure I'll be able to get both negative and positive thresholds voltages. I did the circuit below so it might be wrong, I'm gonna try to understand it better later.

author: Zero999
author_rank: Super Contributor
timestamp: March 20, 2020, 10:25:15 pm
content: No, a comparator's output voltage will depend on the voltage its output pull-up resistor is connected to.I think the LM311 will be fast enough for 20kHz.The drain capacitance of a MOSFET might be too high though. Another option is a BJT, with a small capacitor, aroung 10pF, in parallel with the base resistor to speed up the turn-off time.

author: Zero999
author_rank: Super Contributor
timestamp: March 21, 2020, 12:53:27 pm
content: I think using the LM393 with one of the comparators used to directly switch the resistor, would be better than a discrete transistor and the faster LM311.Another possibility is using the LM339 quad comparator, with one of the sections used as an op-amp integrator. I've not tried simulating it, because I don't trust model's accuracy in the linear region.http://www.ti.com/lit/ds/symlink/lm339-n.pdf

author: fcb
author_rank: Super Contributor
timestamp: March 21, 2020, 01:07:17 pm
content: If you needidenticalramps up/down then you can start with a simple sawtooth generator and use the retriggering mechanism (comparator?) to toggle a flip-flip.This flip-flop can then select an output (either inverted or non-inverted). As we don't know your application or just how identical identical needs to be it's difficult to know if this is overkill.

author: David Hess
author_rank: Super Contributor
timestamp: March 22, 2020, 04:01:45 am
content: Quote from: bonzer on March 20, 2020, 05:09:41 pmIt is only a problem if you are expecting better linearity and a constant amplitude triangle wave. Up to a few kHz, an LM393 is fine as shown below where I used an LT1013 (improved precision LM358) for the operational amplifier, an LM393 for the comparator, and a 4053 analog switch. The other half of the LT1013 is an instrumentation amplifier which drives the VCO and I think I used the other half of the LM393 to drive the speaker. Since I was only going to a couple kHz, I did not bother with the phase lead linear correction.If I did that circuit today, I would use a different kind of voltage-to-frequency converter since it only needed to drive a speaker and I had no need of the triangle wave.QuoteMost comparators, including the LM393 and LM311, have an open collector/drain output so they require a pullup resistor which sets the output high voltage for whatever logic family they are driving. Some CMOS comparators however have a rail-to-rail output which is ideal if you want precise output levels. If you use an LM393 or LM311, then you have to take the pull-up resistance into account or make other provisions to control the output voltage levels.

author: Zero999
author_rank: Super Contributor
timestamp: March 22, 2020, 01:15:40 pm
content: If it's non-critical and you just want to control the tone of a speaker, just use the classic two transistor astable. Here's an example of a wailing siren I make awhile go. It has a timer, so it doesn't go on forever.

author: bonzer
author_rank: Regular Contributor
timestamp: March 22, 2020, 03:17:27 pm
content: Sorry for the delay, I was doing simulations and different calculations. Thanks for your answers they are very important for me.It's a university work, just a little project: after I get the VCO and triangle wave at the output I should use it for a triangle-sinusoidal shaper. I'll be going to work on this second block later.In this 2Hz-20kHz I think it's not essential to have a very accurate 1V/kHz relation as the main task is the shaper. I want my triangle wave to have 0 mean value (alternating). I've added some things to adapt the schematic if two comparators to my needs but I'm gonna share it later.I want to ask you for help with another problem. This is the original schematic I'm talking aboutQuote from: Zero999 on March 21, 2020, 12:53:27 pmI tried to simulate it in LTSpice (I added LM393 and NE5532 models to LTSpice) in transient mode.My problem is that when it starts running, I has some "too many steps error" . Sometimes I get it istantly other times later but anyway it looks like it's going like overclock: starts showing picoseconds in the graph and keeps on adding them slowly.I looked for a solution google but I find that it's circuit related. I also tried changing operational amplifier (for something like OP77 or LT.. which are already inside) and it doesn't help, instead when I completely remove the opamp and adjust a bit the circuit of the comparator for a test it works.

author: Wimberleytech
author_rank: Super Contributor
timestamp: March 22, 2020, 03:39:08 pm
content: Quote from: bonzer on March 22, 2020, 03:17:27 pmI ran the asc file without modification and it worked fine. What did you change?

author: bonzer
author_rank: Regular Contributor
timestamp: March 22, 2020, 04:38:25 pm
content: Thanks for your answer! I didn't actually notice there was the asc file.I did some mistakes I noticed them now. I kinda copied it but I put 7V of Vin and -Vcc, a negative power source for NE5532. So it gives this problem.I've just downloaded the asc file and actually it gives a good triangular wave, it's even symmetrical.The reason why I want to hold dual power supply for my operational is because I'm trying to get a triangual wave with 0 mean value. I could do a subtraction later but anyway I would have to use the second ne5532 of the DIP which would be powered with ground again for negative VEE. I'm trying to figure out a way to solve this by using some pull up resistors and dividers and combinations

author: Zero999
author_rank: Super Contributor
timestamp: March 22, 2020, 04:46:02 pm
content: Quote from: bonzer on March 22, 2020, 03:17:27 pmThe most important things are equal rise and fall times and amplitude, across the frequency range, otherwise distortion increases with the frequency, as the delay in the comparator starts to become significant.Even at 20kHz, glitches can be seen at the top of the triangle wave, when zoomed in.Quote from: bonzer on March 22, 2020, 04:38:25 pmDon't worry if the triangle wave isn't biased around 0V, as long as the rise and fall times are matched, it can be biased to 0V with an AC coupling capacitor.

author: bonzer
author_rank: Regular Contributor
timestamp: March 22, 2020, 06:52:06 pm
content: Thanks for your answer. I've just found another mistake that I did previously so now I'm ok even with the dual supply inside simulator.I was moving on with the voltage divider and I did it but now after your words I've just realised it's uselessUsing a capacitor would put all things right. My previous solution works but it's worse than yours because I also use a diode at the output of the second comparator, this way I thought I would simplify my calculations for the resistors at left, but the problem is that it introduces some assimetry in my triangular wave so I will keep on working on your solution. Now I'm doing some calculations on resistors to find the desired voltage-frequency relation.

author: Zero999
author_rank: Super Contributor
timestamp: March 22, 2020, 09:15:14 pm
content: Quote from: bonzer on March 22, 2020, 06:52:06 pmWhat sort of shaping circuit are you intending to use?Here's one I've made earlier. It isn't my design. Unfortunately I can't remember where I got it from. I've tried searing the Internet again but can't find it. Hopefully someone will recognise it.Sine shaper.ascIn real life part of R1 was a potentiometer to trim the amplitude of the input.Here's another thread:https://www.eevblog.com/forum/beginners/simple-analog-function-generator-design/msg1175040/#msg1175040

author: bonzer
author_rank: Regular Contributor
timestamp: March 22, 2020, 11:08:31 pm
content: Actually I'm not alone working on this so this second block for shaping is done by my collegue, but I will also take part so anyway thanks for this solution. I've only seen once the initial circuit and it was something like the attached image.But I'm personally more interested in your solution.About VCO: I see your solution is good when applied to the simulator. I also tried the first solution with transistor, using BJT (BC337) and it gives a peak that is a bit smooth, it's worse than your solution but I understand it better because I can chose easily resistors for frequency dependence etc...I would like to know how you decided the values on the resistors at left in your solution? It seems like you just put that big resistors to get the input voltage closer to the capacitor so the output voltage depends more on the input rather than presence of for example +V from the second comparator. Anyway I'm not sure about understanding the point, first time I saw it I was afraid about +V influence from the second comparator.

author: bonzer
author_rank: Regular Contributor
timestamp: March 23, 2020, 05:31:35 pm
content: I want to share a little improvement I've just done. For the comparator: to avoid unrealiable high voltage at the output, which is lower than the power source and depends on other things (it's usually open collector), I added a 10V zenner diode with some resistors. It works in the simulator but I don't know if it can give problems in reality.

author: David Hess
author_rank: Super Contributor
timestamp: March 23, 2020, 10:27:03 pm
content: Quote from: bonzer on March 22, 2020, 03:17:27 pmThat brings up another problem; sine shapers require an accurate level of triangle wave. So if you use this VCO design, you should use the phase lead compensation circuit that I suggested because it also helps control the level of the triangle wave. It just means adding 2 resistors and a trimmer capacitor.

author: bonzer
author_rank: Regular Contributor
timestamp: March 24, 2020, 10:17:04 am
content: Thanks a lot David! I'm gonna learn about it right now, seems easy.Thank you everybody for your answers. I decided to definitely use Zero999 advice! I hope it works in practice (not only inside simulator). It's way faster using that second comparator replacing a transistor. Also after I added that zener at the output I see that relation 1V/kHz is respected well, increasing precision.I want to share with you the whole diagram.

author: Zero999
author_rank: Super Contributor
timestamp: March 24, 2020, 11:13:07 am
content: Don't purely go on simulation results. David's suggestion is a good one and might be better than mine in real life. 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 RH111 model, used in the simulation attached, is similar to the LM311.

author: bonzer
author_rank: Regular Contributor
timestamp: March 25, 2020, 11:58:48 am
content: Is it necessary in your opinion to do a stability analysis? Here we have a frequency that depends on the input voltage, and to me it seems open loop. I would leave it f=kV where k is the constant that we desire and impose in the electrical calculations. Though in the end it doesn't introduce any significant constant error in the voltage to frequency conversion and k value seems to be respected. Here I have a screen of the simulation. I'm not interested in building a control loop for frequency control but only to have any idea about its behavior.

author: Zero999
author_rank: Super Contributor
timestamp: March 25, 2020, 07:59:15 pm
content: Quote from: bonzer on March 25, 2020, 11:58:48 amI'm not sure what you mean by stability analysis?As long as the loading on the comparator is the same and its propagation delay is negligible, the V/F characteristic won't change.How sensitive do you want it to be? The original schematic on the data sheet needs the control voltage to exceed the supply voltage to get the full range of the circuit, because the input resistors (R11 and R7) on your schematic attenuate the input voltage by half. If you want a wider range of frequencies, for a smaller input voltage range, then I recommend using lower values. The resistor values in my schematic give a larger value of k and the voltage required for the maximum frequency is a bit under the supply voltage.

author: David Hess
author_rank: Super Contributor
timestamp: March 26, 2020, 04:12:46 am
content: Quote from: Zero999 on March 24, 2020, 11:13:07 amThe 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2020, 10:20:25 am
content: Quote from: David Hess on March 26, 2020, 04:12:46 amThe 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.

author: David Hess
author_rank: Super Contributor
timestamp: March 26, 2020, 05:47:12 pm
content: Quote from: Zero999 on March 26, 2020, 10:20:25 amThe 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.

author: bonzer
author_rank: Regular Contributor
timestamp: March 26, 2020, 06:48:10 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2020, 08:11:00 pm
content: Quote from: David Hess on March 26, 2020, 05:47:12 pmIs there any benefit to using two diodes, to get a more negative voltage, hence faster off time?Quote from: bonzer on March 26, 2020, 06:48:10 pmI 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.

author: bonzer
author_rank: Regular Contributor
timestamp: March 26, 2020, 09:37:03 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2020, 11:12:45 pm
content: 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

author: bonzer
author_rank: Regular Contributor
timestamp: March 27, 2020, 09:25:40 am
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 27, 2020, 12:10:49 pm
content: Quote from: bonzer on March 27, 2020, 09:25:40 amI 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.pdfVCO op-amp 4007.asc(4.14 kB - downloaded 63 times.)

author: David Hess
author_rank: Super Contributor
timestamp: March 28, 2020, 04:09:27 am
content: Quote from: Zero999 on March 26, 2020, 08:11:00 pmThere should be but I have never noticed a significant difference. It might be done with power devices.

author: Zero999
author_rank: Super Contributor
timestamp: March 28, 2020, 08:47:46 am
content: 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 69 times.)

author: bonzer
author_rank: Regular Contributor
timestamp: March 28, 2020, 12:12:25 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: March 28, 2020, 02:09:09 pm
content: 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

author: bonzer
author_rank: Regular Contributor
timestamp: April 01, 2020, 10:37:25 pm
content: I'm back to it sorry but I really can't completely lean on components etc when talking about triangle wave symmetry so I tried to figure out a way to do a "closed loop 50% dutycycle control" . I did this circuit. It looks complex but I know a way to save on an operational.Basically what it does is trying to adapt charging current of capacitor to be equal to the discharging. It first finds average value of the output square wave, then it compares to the right average value and the error is sent in place of ground signal. This way it's negative when a faster capacitor charging is needed and positive otherwise. I made some tests making it intentionally assymetrical (changing R2 value) and it works but not for all frequencies. Sometimes it works bad. Also it's difficult to simulate in high frequency because it gets sometimes: I need to get to the steady state (late start time) and at the same time it should be precise because it's high frequency so it is computationally hard. I don't now to make it less accurate for transient voltage. Here at 200Hz low frequency as you see it doesn't work properly. Gives dutycycle 50% but wrong triangle wave. At other frequencies like 1kHhz it worked good.In real world maybe it would never work, I don't know. Do you have any idea about this?

author: fcb
author_rank: Super Contributor
timestamp: April 02, 2020, 04:09:52 pm
content: bonzer, what are you actually trying to achieve? where are you using this circuit?

author: bonzer
author_rank: Regular Contributor
timestamp: April 02, 2020, 05:06:04 pm
content: A VCO to triangle wave that should go into a shaper. I initially cared only about Voltage to frequency conversion and proportionality but now I bother about symmetry as it really could influence my final sine quality. So even if there's a little like +-5% error on frequency to voltage linearity, I could care less as long as it's fall and rise times are equal.Also I don't want spikes but using capacitors or how someone here suggested lead phase compensation should help.I've just had a new simple idea about building the VCO. If I try it and I'm finally convinced, I'll post it here

author: Zero999
author_rank: Super Contributor
timestamp: April 02, 2020, 10:35:54 pm
content: Quote from: bonzer on April 02, 2020, 05:06:04 pmThe simulations posted here show very good symmetry, as long as the control voltage isn't taken too close to the negative rail. It's true the triangle wave isn't perfectly centred around 0V, but that's easily done with AC coupling.Another thing you could try is changing the Q1 to common base configuration, which should increase the switching speed, at the expense of operation down to 0V, since the saturation voltages of both Q1 and the comparator's output transistor are added together and the comparator can't have a negative supply rail, below 0V.VCO LM393 NE5532 com base.asc(5.64 kB - downloaded 48 times.)

author: bonzer
author_rank: Regular Contributor
timestamp: April 06, 2020, 05:21:49 pm
content: Thanks for all your answers. I couldn't find any other more symmetrical solution to ensure 50% duty cycle so nevermind, I hope it's gonna work like in the simulator, it is symmetrical enough.Last thing I want to point out: I've just added that phase lead compensation between integrator and comparator but I don't know what capacitance to put there. I put a random 22pF value because I checked the simulation and it really helps in high frequency. Also I put those resistances because I want it to be from +10V to -10V, because those zenners give me +5V,-5V of threshold voltage. (Notice that this solution is slightly different from the previous ones because I tried to use both positive and negative thresholds by putting those zenners that way. )My question is: how to properly do in this case lead phase compensation and chose capacitor value? (I don't understand because it is not a sinusoidal waveform but triangle...)

author: Zero999
author_rank: Super Contributor
timestamp: April 07, 2020, 09:50:21 am
content: Quote from: bonzer on April 06, 2020, 05:21:49 pmYou seem to be confusing symmetry with DC bias or lack of thereof. A symmetrical triangle wave will have equal rise and fall times and be linear i.e. consist of straight lines. The DC bias is whether it's centred around 0V or a DC voltage. For example, a perfectly symmetrical 1kHz triangle wave, with a peak amplitude of 2.5V peak and 6V of DC bias, will oscillate between 3.5V and 8.5V, looks like this:The circuits posted here all produce fairly symmetrical waveforms, unless the input voltage is taken too close to zero, with varying amounts of DC bias. The circuit you've posted there will have a low level of DC bias, but still won't be perfect, as the breakdown voltages of the zener diodes won't be perfectly matched in real life.The DC bias can be removed by AC coupling the output from the oscillator.

author: gerry
author_rank: Newbie
timestamp: August 06, 2020, 06:59:57 pm
content: hi can you post the schem for this last circuit??

author: Zero999
author_rank: Super Contributor
timestamp: August 07, 2020, 01:21:30 pm
content: Quote from: gerry on August 06, 2020, 06:59:57 pmI did, but the forum lost it. It's where it says [ Attachment Invalid Or Does Not Exist ] . Unfortunately I can't remember which schematic I used to get that waveform.