Spikes on triangle wave in VCO - Page 1
Forum section: electronics / beginners

author: helix1
author_rank: Contributor
timestamp: December 18, 2015, 08:39:42 pm
content: I've been building the VCO as detailed in 'The Art of Electronics' v3 (schematic below). The square wave looks good, but the triangle wave has a spike on top as shown in the scope output below (2 figs, one zoomed in on).I am using all the parts as detailed in the schematic, except IC2 where I have substituted TLC2262.I am curious as to what might be causing this. I have read that square waves can capacitively couple to other signals in a circuit and am wondering if this is it. If so, how exactly is it capacitively coupling? I have soldered this circuit on stripboard - could it be coupling between tracks, or could it be coupling between leads on the top (I have tried to keep everything as neat as possible)?

author: awallin
author_rank: Frequent Contributor
timestamp: December 18, 2015, 08:57:00 pm
content: IC2 output on Ch2 of the scope please!Also +IN of IC2 might be interesting to probe.A wild guess would be that you are running IC2 off the higher VCC that IC1 uses. This makes the trigger-level all wrong and IC2 'fires' only at the top of the triangle-wave.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 18, 2015, 09:01:48 pm
content: Capacitive coupling can happen at serveral places. One is between close by lines or from parts to lines. Another type of coupling is inside components: e.g. in the MOSFET there is a gat - Drain capacitance. The desecond OP has some capacitance between the inputs in addition to the lines.The LT1077 is a rather slow low power OP - so is quite easy to be disturbed even from the output side.The plan is missing decoupling at the power supply - it is well possible to get cpupling this way to.

author: helix1
author_rank: Contributor
timestamp: December 18, 2015, 09:06:56 pm
content: @awallin, here is channel 2 as well. I've double checked and IC2 is definitely running off the 5V reference as in the schematic.@Kleinstein, the power supply is a 9V battery, if that helps.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 19, 2015, 01:29:08 am
content: Seems to me, LT1077C isn't perfectly fast, so it takes some time to respond to the change in input state. During that time, the input is coupled to the output through the 0.1uF capacitor, allowing feed-forward. A falling edge on the square wave gives a rising edge at the input, and therefore at the output, before things come under control.Of course, the same should be true of the rising edge, if even moreso because 2N7000 turning on is a fairly large event.For the integrator, use an op-amp that has GBW which includes the transition time of the square wave. That is, if the square wave transitions in ~200ns, use >10MHz GBW.If you don't have a faster amp handy, slow down the square wave using an RC filter.LT1077C is in fact rather slow, so you'll need a good bit of slowness, perhaps a series 10k resistor and 1nF to ground (which will be across the G-S of the 2N7000). Likewise, the maximum operating frequency will be in the low kHz, for a triangle that's reasonably "crisp" yet.Tim

author: helix1
author_rank: Contributor
timestamp: December 19, 2015, 12:13:59 pm
content: Thanks @T3sl4co1l that's really helpful. I will follow your suggestions and see what happens!

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 19, 2015, 04:52:33 pm
content: Just for fun, I breadboarded the circuit using a TL082 dual op-amp subbing for the two specified opamps. I subbed a 78L05 for the LT1027D and it worked fine, with the TL082 powered by the 5 volt Vreg, although the output voltages were a little low. But eliminating the regulator altogether and feeding the Vcc with 7-8 volts worked even better.I used the same component values except I had to put in around 7.34 k instead of 7.5 k for R1 (didn't have the exact value so I had to put two resistors in series). I haven't checked to see if the formula still holds but the thing responds to varying the Vin to control frequency just fine.There is just a trace of a tiny spike on the bottoms of the triangle waveform. It doesn't show up at all in "average" acquire mode with 2 averages, but can be seen (barely) in "normal" mode. Certainly there is nothing like the radical spikyness in the OP's scopeshot.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 19, 2015, 05:18:22 pm
content: With Vcc (Vref) of 8.2 volts and a control (Vin) voltage of nearly 18 volts I max out on the frequency at a bit under 3 kHz and see some spikes on the top and bottom of the triangle waveform, but still nothing like the OP's spikes.

author: Zero999
author_rank: Super Contributor
timestamp: December 19, 2015, 06:37:09 pm
content: An ordinary op-amp will work for the Schmitt trigger (IC2) but it won't be so stable as the thresholds will vary depending on the voltage drop of the output transistors.In the design posted by the original poster, a comparator with a push-pull, rail-to-rail output run of a regulated supply provides a greater level of stability, than one would get from a TL082.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 19, 2015, 07:11:46 pm
content: Quote from: Hero999 on December 19, 2015, 06:37:09 pmOf course. Nevertheless... my build works, it is stable, and it doesn't have the severe spikes that the OP's build has, even though it is just stuck together on a small breadboard and uses the single chip common-as-dirt dual opamp. Mine does have a greater DC offset on the outputs however.Some people might say that the TL082 build even works _better_ than the OP's version, since it doesn't have the spikes.

author: Kalvin
author_rank: Super Contributor
timestamp: December 19, 2015, 07:14:42 pm
content: What kind of bypass caps you have in the power rail? Are the bypass caps close to the op amp? How good is your breadboard?

author: Zero999
author_rank: Super Contributor
timestamp: December 19, 2015, 07:46:13 pm
content: Quote from: alsetalokin4017 on December 19, 2015, 07:11:46 pmYes, the TL082 is much more suited to this application.The rail-to-rail comparator can be replaced with the old LM393 with buffer transistor to lower the output saturation voltage.

author: helix1
author_rank: Contributor
timestamp: December 19, 2015, 08:14:13 pm
content: I have now checked the transition time of my square wave. It is 7.5us, which suggests a GBW of the integrator greater than 133kHz. The LT1077's GBW is 230kHz.I am also trying to find some alternative op amps I can use in my current stocks to compare with the other approaches suggested.

author: helix1
author_rank: Contributor
timestamp: December 19, 2015, 08:55:14 pm
content: I didn't have a TL082, but did have a TL072 lying about, so breadboarded up again to compare with @alsetalokin4017.The results are below, again much better than the original circuit and almost no spiking at all on the triangle wave.I am presuming H&H tested the original circuit so still can't quite understand why mine is so different. The only difference between mine and theirs was IC2, so it must have been that.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 19, 2015, 09:09:22 pm
content: Don't assume -- there's more than a few errata since the first printing of the 3rd editionTim

author: helix1
author_rank: Contributor
timestamp: December 19, 2015, 09:09:41 pm
content: And one more, just for the hell of it. The TLC2262 used as IC2 in the original circuit, this time used for both ICs. Definitely more spiky on the triangle wave, but more with the rising edge on the square wave, in contrast to my original circuit.

author: helix1
author_rank: Contributor
timestamp: December 19, 2015, 09:17:00 pm
content: The rise time for the square wave on the TL072 is about 3 times faster as well.

author: Zero999
author_rank: Super Contributor
timestamp: December 19, 2015, 09:21:04 pm
content: I've just noticed that the TL072/082's common mode range doesn't include the negative rail. It's a couple volts above that and may suffer from phase inversion when the input voltage goes too low. If nothing else, the input currents will rise drastically, at lower input voltages, making it less accurate.The TLC2262 would be better used as IC1. You could even try using it for both IC1 and IC2.I haven't built the circuit in real life, only simulated it.

author: Zero999
author_rank: Super Contributor
timestamp: December 19, 2015, 09:33:57 pm
content: The TLC2262 is not supposed to be used as a comparator. The TLV351 would be better.How about using a 555 timer for the Schmitt trigger?

author: helix1
author_rank: Contributor
timestamp: December 19, 2015, 10:10:52 pm
content: Here's the output for TLC2262 and 555 chip. Getting an extra blip on the rising edge of the square wave, and a bit more spiking on the triangle.Second output is TLC2262 and 7555 chip, which looks better.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: December 19, 2015, 10:12:34 pm
content: Put a pull-down resistor on the 555 output (or use a CMOS version).Zoom in on the 'blip', and try varying the square wave rise time with an RC lowpass filter.Tim

author: helix1
author_rank: Contributor
timestamp: December 19, 2015, 10:49:04 pm
content: So the blip was fixed by switching to a 7555 instead of NE555.Here are a few pictures of the spike at the base of the triangle waveform. The first one stays constant on an input till about 1.4V, then starts to increase in height. I have included shots at 2.75V and 5V on the input to the VCO.The oscillator goes from about 20Hz to 1kHz quite smoothly now. The only problem left is the spike.The second to last picture shows the spike alongside the rise in the square wave, which is MUCH faster now.And just for comparison, the last picture shows the spike on the top of the triangle for the LT1077, as used in the original circuit!

author: Zero999
author_rank: Super Contributor
timestamp: December 20, 2015, 01:34:04 pm
content: It's not surprising the blip was fixed by replacing the NE555 with the CMOS version.The bipolar 555 draws huge current spikes when the output changes state. Proper decoupling and layout can help to minimise any blips caused by the current spike.

author: Kleinstein
author_rank: Super Contributor
timestamp: December 20, 2015, 02:08:19 pm
content: Having a resistor (e.g. 1 K range) in the gate line of the FET could also help to reduce the spike with relatively slow OPs. It slows down the signal to the FET but keeps the square signal fast. The 7555 as a schmidt trigger is a good idea.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 20, 2015, 04:06:33 pm
content: I've now tested LM358N, HA17358, and MC1458P, all of which have the same pinout as the TL082 type. The 358 variants have spikes similar to the OP's spikes (but still not nearly as bad in amplitude), the 1458 has about the same spikes as the TL082 but the square wave has slower transitions. On my cheap, tiny breadboard the TL082 gives the cleanest triangle waveform and the fastest square wave transitions (fall time otoo 450-500 ns, risetime otoo 550-600 ns), and overall "squareness". I am not using any decoupling caps on input or near the chip itself, just duplicating the OP's circuit (but without the input voltage regulator, just powering the single opamp chip with ~8.5 V from my bench supply). The only problem is the DC offset.And of course when Vin is too low, there are some problems like loss of symmetry and phase inversion. But with Vin from (Vcc/2) to a bit over 2Vcc the thing is well behaved.

author: alsetalokin4017
author_rank: Super Contributor
timestamp: December 20, 2015, 04:14:01 pm
content: Quote from: Kleinstein on December 20, 2015, 02:08:19 pmThis actually made things a little worse for my test setup using the LM358.

author: Lee Leduc
author_rank: Regular Contributor
timestamp: December 20, 2015, 04:42:54 pm
content: This is discussed in detail in Walter Jung's book "Op Amp Applications Handbook". This book is available as a free download from Analog Devices.http://www.analog.com/library/analogdialogue/archives/39-05/op_amp_applications_handbook.htmlAttached are the relevant pages (579 through 581).