Sawtooth Wave Generator - Page 1
Forum section: electronics / beginners

author: ArjunSukumar
author_rank: Contributor
timestamp: October 06, 2015, 07:51:10 am
content: Hi guys, I want to generate a sawtooth waveform of the following specifications:(1) Rise from 0 to 1V; fall time <100ns(2) Ton variable from 0.1 to 1ms(3) Variable duty cycle ,D,; 1% to 50%I want to use a Howland current source to charge a capacitor, comparator to compare the voltage across capacitor with 1V, discharge through a transistor switch. A delay generator is also needed to control the Toff.Problems:(1) when I connected current source directly to the capacitor, no current flowed through the capacitor, so ramp wave was not obtained(2) i dont know for what value the delay or trigger generator, how to connect all these circuits together?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 06, 2015, 08:49:57 am
content: 1. Once the capacitor charges, the op-amp is unable to provide more voltage, and it stops charging (it's not an ideal current source, of course). If you didn't have a switch and comparator connected, this will be the final state.2. You don't want a delay -- instead, use a comparator with hysteresis, or a bistable circuit (e.g., examine the internal diagram of the 555 timer). That way, the capacitor is not discharged to an unknown voltage, but the discharge stops when the capacitor is discharged below the threshold.Tim

author: ArjunSukumar
author_rank: Contributor
timestamp: October 06, 2015, 09:15:47 am
content: thank u Tim for reply, I have some doubts. I connected a comparator to compare with 1V and a switch (transistor ) to the circuit, but then also I am getting an output of 1V constant.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 06, 2015, 09:18:45 am
content: Schematic?

author: SteveLy
author_rank: Regular Contributor
timestamp: October 06, 2015, 09:26:40 am
content: I'm not sure why your circuit is not working, but for what you describe, I'd perhaps use a pulse/rectangular wave generator with variable high and low voltage durations (i.e., a pulse wave with variable pulse duration and frequency, see 555 astable oscillator). Then AC couple the pulse wave to an op-amp integrator to get the variable rise & fall triangle wave. (I assume you want a repeating triangle waveform, not just a single pulse.)Dave describes the basic op-amp integrator in this vid (go to 36 minute mark):

author: ArjunSukumar
author_rank: Contributor
timestamp: October 06, 2015, 09:56:09 am
content: Schematics

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 06, 2015, 12:30:57 pm
content: I don't have Word handy, can you just post a PNG or something?

author: SteveLy
author_rank: Regular Contributor
timestamp: October 06, 2015, 01:41:42 pm
content: What are you op-amp supply voltages connected to?@T3sl4co1l: here's a screenshot

author: matseng
author_rank: Frequent Contributor
timestamp: October 06, 2015, 01:56:28 pm
content: Seems like your buffer/unity gain opamp U2 is not working as is should. It got about 5 volts at the input and only 0.1 at the output.

author: SteveLy
author_rank: Regular Contributor
timestamp: October 06, 2015, 02:26:03 pm
content: That's not 5V in but 100mV. Typo in the schematic. So 100mV at the output of U2 (voltage follower) is correct. The problem is after U2. Nice circuit to analyse... for those not half way to bed.

author: ArjunSukumar
author_rank: Contributor
timestamp: October 06, 2015, 03:40:21 pm
content: Power supply used is 15V for the opamps

author: ArjunSukumar
author_rank: Contributor
timestamp: October 06, 2015, 03:42:41 pm
content: I have one more doubt, can I connect a capacitor as a load to Howland current source?

author: rfeecs
author_rank: Frequent Contributor
timestamp: October 06, 2015, 09:29:52 pm
content: Your op-amp has to have both input and output voltage range down to zero volts (rail-to-rail inputs and outputs) for your current source to work, unless you have a positive and negative supply.Your comparator op amp will just turn on the transistor enough to hold the input and output at 1V. It won't oscillate.To oscillate, you need something that switches between two states: charge until 1V, then discharge until zero or some fixed delay time, then switch back to charging...

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 07, 2015, 02:30:41 am
content: You need to apply positive feedback to the last stage (the comparator stage, though it's labeled as "opamp").You also need a current limiting resistor into the transistor base, otherwise the opamp output is shorted when driving the transistor on (and causing reverse breakdown, if the op-amp has +/-15V supplies).The easiest way to do this will be adding a second switch after the transistor (i.e., a NOT gate), swapping the comparator inputs, and adding a resistor from output to +in and a resistor from +in to V6.Tim

author: ArjunSukumar
author_rank: Contributor
timestamp: October 07, 2015, 03:39:51 am
content: @rfeecswhich circuit will be useful in switching between 2 states?

author: rfeecs
author_rank: Frequent Contributor
timestamp: October 07, 2015, 04:22:26 am
content: Quote from: ArjunSukumar on October 07, 2015, 03:39:51 amLook up "Schmitt trigger relaxation oscillator"Or "astable multivibrator"For two examples of circuits that oscillate between two states

author: Joule Thief
author_rank: Regular Contributor
timestamp: October 07, 2015, 05:12:54 am
content: Quote from: matseng on October 06, 2015, 01:56:28 pm5 volts at the + input of U2 must be incorrect. The R18 / R17 divider powered by a 5.6v zener would yield a 100 mv at the input to U2.

author: Paul Price
author_rank: Super Contributor
timestamp: October 07, 2015, 11:39:08 am
content: My circuit will allow you to adj. sawtooth ontime, sawtooth offtime and thus also sets duty cycle.The op-amp is a rail to rail input/output fast slewrate dual op-amp used both as a buffer and a comparator.The RED LED should be biased for a forward voltage of approx 1.7 volts to allow the adjustment pot plus limit resistor to have a 1V drop at the shortest ontime ramp setting of 100uS.The 555 timer limit resistor plus pot should have a resistance range to allow a delay range from 2uS to 2mS with a fixed value capacitor.The transistors can be any high-beta general-purpose types such as 2N3904, 2N3906.Operation: The capacitor on the left is charged to Ton time by a constant current generator composed of the LED-PNP circuit until 1V is reached in the linear ramp sawtooth waveform. At this point the second op-amp section used as a comparator triggers the D-flipflop. The flipflop is set which discharges the timing capacitor to 0 volts by turning on the NPN transistor, and also triggers the 555 timer which creates Toff time. At the end of Toff the 555 resets to 0V output and this pulse is inverted to reset the discharge cap. flipflop and a new ramp output begins its rise again.By setting both Ton and Toff, duty cycle is also set.

author: SteveLy
author_rank: Regular Contributor
timestamp: October 07, 2015, 04:12:09 pm
content: @ArjunSukumar: Here is an excellent electronics tutorial dealing with exactly what you're trying to do:(PS. To get the circuit you're after, you just need to add another of the second op-amp stage after the third to the circuit shown on the whiteboard. But I strongly encourage you to watch the whole tutorial; the guy is great at explaining stuff and you'll learn a lot.)

author: Paul Price
author_rank: Super Contributor
timestamp: October 07, 2015, 04:34:29 pm
content: SteveLy: The video you posted does notexactlyaddress the original poster intention for creating asawtooth ramp generator, rather this is an overview of circuits fortriangle wavegeneration.

author: SteveLy
author_rank: Regular Contributor
timestamp: October 07, 2015, 04:47:41 pm
content: Well, it discusses how to create a square wave, how to turn it into a triangle, and then how to generate a pulse wave. Then going from pulse to variable rising & falling ramp sawtooth requires the exact same integrator circuit as going from square to triangle. It's the same idea: integrate the square/pulse wave to get the triangle/sawtooth.

author: Paul Price
author_rank: Super Contributor
timestamp: October 07, 2015, 04:52:11 pm
content: But to say this is a solution toexactlywhat the original poster is interested in is misusing the word "exactly", which should be only used with extreme caution in science.To compare a triangular wave generation with sawtooth generation is like comparing zebras to asses. You end up here with anhalf-assexplanation hoping to solve the original poster's request for help.

author: SteveLy
author_rank: Regular Contributor
timestamp: October 08, 2015, 07:10:57 am
content: Ok you're right, you win. Closely related but not exactly the same.

author: Paul Price
author_rank: Super Contributor
timestamp: October 08, 2015, 09:45:11 am
content: It is not about for me to win, but for the original poster to resolve and find and answer for their request for help.To llead someone away from their intention, even when done in the name of magic, is calledmisdirection.

author: Paul Price
author_rank: Super Contributor
timestamp: October 09, 2015, 10:33:07 am
content: This video also fails to resolve the requests of the original poster, since this simple circuit, ( just one of so many simple relaxation oscillator circuits that are easy to find on Youtube and the web,) does not generqte a linear ramp sawtooth but instead an exponential ramp, and fails to help the request of the original poster to control duty cycle.Misdirection.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 09, 2015, 12:55:01 pm
content: You can save the cost of one component, and obtain a linear ramp to boot, if you replace the battery with a constant current power supply.Hey, just because a battery or the wall outlet doesn't happen to be "constant current", doesn't mean it's not theoretically equally valid...Tim

author: ArjunSukumar
author_rank: Contributor
timestamp: October 10, 2015, 04:52:53 am
content: how to design a howland intergrator circuit?any text book reference for that?

author: SteveLy
author_rank: Regular Contributor
timestamp: October 13, 2015, 05:22:14 pm
content: Quote from: ArjunSukumar on October 10, 2015, 04:52:53 amNot sure about the "Howland" bit but op-amp integrators are described in most uni level electronics texts, e.g., Millman & Halkias; I've attached the relevant pages, see sec. 16-4 for the integrator. (You can find the full textbook at archive.org; it's public domain. Same goes for Horowitz & Hill's "Art of Electronics".)