Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sawtooth generator (3 transistors) behaviour

Status
Not open for further replies.
I now see my mistake.

Let me think out loud,...
Current through diode must be equal current through resistor, because (almost) no current flows into opamp inverting input.
As both opamp inputs are equal voltage ("virtual ground"?), because of the negative feedback, voltage at inverting input must be equal Vin.
Did I say something not correct?

Yes, you were right :)
 
ETO_LM555_SAWTOOTH_GENERATOR_LED_ARRAY_Iss01.00_2015_12_04.PNG
 
Last edited:
spec, thanks for your ideas.
Is the assumption that voltage between inputs is (almost) zero, valid only when using negative feedback?

I'm still experimenting with ramp generators.
I know that this circuit is not the one that is found on most books, but I'm trying to figure out why it does not work.

Even though under simulation it manages to work, I built the circuit (using 741 opamps), and it doesn't. It "almost" works. The ramp output is clipped below 2.5V, and I see the "missing" spike (mirrored up) on R7-R8 node, (U1 + input) which theoretically is fixed by the voltage divisor.

I dont know if my explanation makes any sense. I'll try to capture scope's screen.
 

Attachments

  • OscIntRamp.png
    OscIntRamp.png
    19.7 KB · Views: 205
Last edited:
spec, thanks for your ideas.

My pleasure

Is the assumption that voltage between inputs is (almost) zero, valid only when using negative feedback?

Yes. Without feedback, the inputs of an opamp can be anything subject to the opamp limits given in the respective data sheet.

I'm still experimenting with ramp generators.

I spent years experimenting and learning about ramp generators (building a scope). There are a lot of techniques involved, as you have found I suspect, and experimenting with them will give you a good feel how linear electronics works in practice and to a limited extent digital electronics too.

I know that this circuit is not the one that is found on most books, but I'm trying to figure out why it does not work.

On the contrary, the integrating Schmitt trigger oscillator is a classic and widely used in various forms. Incidentally, the integrating oscillator has many advantages compared to the differentiating type.

And the integrator in the second part of your circuit is also a classic- you will have fun with that circuit.

At first look your circuit is well thought-out and executed, but some details may need sorting. I haven't checked

Even though under simulation it manages to work, I built the circuit (using 471 opamps), and it doesn't. It "almost" works. The ramp output is clipped below 2.5V, and I see the "missing" spike (mirrored up) on R7-R8 node, (U1 + input) which theoretically is fixed by the voltage divisor.

The two main reason for your problems are the 741 opamp (I assume you meant 741 and not 471 as in your post) coupled to the low supply rail of 5V. The 741 was revolutionary when it first came out and was the standard opamp for many years. But to be quite honest, it is now history. One of its main shortcomings is its limited input voltage range and output voltage swing. With a single supply rail of 5V it has no chance of working.

A better low priced common opamp for your work would be the dual LM158, LM258, LM2904 and quad LM124, LM224, LM324, LM2902. In general terms, the individual opamps are all the same across all those chips. If you want a top opamp for your work go for the OPA192 series. May I suggest that a good way forward at this point would be to focus on just the LM158 family- get the data sheet and learn about every parameter listed- get to know the chip inside out. Quite soon, it will be automatic for you to know what it will do and what it won't do.

A further suggestion: if you are investigating linear circuits you need at least a 9V supply. Also have available -9V. Plus and minus 12V would be much better, and plus and minus 15V would be ideal. I would go for plus and minus 12V though.

I haven't analysed your circuit further- there is no need. You are on the right track.

I dont know if my explanation makes any sense. I'll try to capture scope's screen.

Perfect sense! No need to capture on scope screen.
 
Last edited:
Spec, you were totally right (again :) ).
Increasing rail voltage to 7V still exhibited the same behaviour (in a reduced form)
But a voltage of 7.8V works quite well (still not using dual supply, but ground as -Vcc).
Even using 741 opamp.

Vcc7.8V.png


Yellow : U2 output (square).
Green : U1 - input.
Blue : U1 output (ramp).
Magenta: U1 + input (voltage divisor).


The "strange" behaviour I was talking about in my last post, was not on + input, but on - input (scope's green waveform).

Vcc5V.png


I now suppose this (green) spike comes from the fact that 741 output can't go lower, and thus, capacitor charges positive on the input side. Right?
(ERRATA. R5 = 100 kohms and not 33 k as my schem shows).


Now I want to be able to control some parameters. First is gain.
I suppose integrator's gain is low ( around 1/3 ) because of R5/C2. Please, correct me if I'm wrong:

Integrator gain is R6/R5 for freq below
f = 1/(2*pi*R6*C2) = 0.016 Hz

Integrator gain is close to unity near:
f = 1/(2*pi*R5*C2) = 0.16 Hz

But I'm working around 1Hz.
I should make R5 15kohm to get a higher ramp output, of gain near 1.
This will be my next try.
 
Last edited:
The datasheet for a lousy old 741 opamp shows it mostly with a +15V and -15V (30V total) supply. They are all different so some will work from a 10V supply. Some might work on a lower supply voltage like yours at 7.8V.
You should design a circuit and select parts so that even an opamp with minimum but passing spec's will work in your circuit. Do not forget that an ordinary 9V alkaline battery voltage drops to 6V during its life.
 
Lesson learnt.
I replaced opamp with LM358, +12V single supply.

Now I get a nice ramp but only up to gain 0.8 (using R5 = 47k).

R47k.png


But because ramp's mid-level is not vertically centered, if using a 33k, to get unity gain, the signal gets distorted.

R33k.png


What did I do wrong, I can't see....
What can I do to center ramp vertically, so a full voltage swing is possible?

(by the way, a 33k ohm delivers a unity gain on my previous 741 circuit too, but with much more distortion; around 3 volts clipped on the low end :) )
 
The maximum output swing of an LM358 with a single supply voltage is not symmetrical. Its output cannot go as high as it can go low which causes the lower part of the triangle to be distorted.
 
Hi Elerion,

Slow down the integrating oscillator, but leave the integrator timing the same. See what happens. One thing about the LM358 is that the output stage can get up tp some antics. These are just clues.

By the way, the integrator does not have gain in the traditional sense. If you establish what the integrator opamp is being asked to do that may help. The 1M resistor has nothing to do with the integrator function per se. It is just there to attempt to keep the opamp within its operating voltage. This is a classic problem with integrators. In fact, the 1M resistor distorts the ramp by introducing an exponential function. Have you left the circuit running for a long time and monitored the saw-tooth?

Have fun.

UPDATE

Is C2 an aluminium electrolytic? If so, you are reverse biasing it and it will also be unhappy.

If you get stuck figuring what is going on, just post and I will explain. :smug:
 
Last edited:
The "strange" behaviour I was talking about in my last post, was not on + input, but on - input (scope's green waveform).

I now suppose this (green) spike comes from the fact that 741 output can't go lower, and thus, capacitor charges positive on the input side. Right? .

I forgot to answer your point above. Because the 741 is operating with supplies outside the datasheet specification, who knows what would happen, but the spikes that you see will be caused by the internal transistors comming on and going off with changes in voltage. The attached image shows the guts of a 741 so you can see how relatively complex it is. The other thing about integrated circuits is that, instead of using resistor loads, they extensively use constant current loads. Incidently constant current generators are being used more and more in discrete designs too- audio amps for example. While constant current generators have advantages over resistors they do get very upset if they do not have sufficient supply voltage.

ETO_741_schematic_2015_12_12.png
 
Last edited:
Yes, I left the circuit running for some time until stabilized.

What I knew is that the 1M resistor is there to stablish a DC gain, and avoid the capacitor to get offsets which would make the integration fail (but I'm afraid I can't go any further right now). I don't understand why an integrator does not have gain,... the gain as I understand, is given by the ratio of capacitor impedance to integrator's input resistor; it is the same topology as a simple inverting amplifier.
invert.gif

When both impedances match, the gain is just unity.

I'm using tantalum capacitors, which have polarity too, so I suspect the comment about electrolytic capacitors applies here too.
 
Yes, I left the circuit running for some time until stabilized.

That was lucky; I was expecting the output of the integrator opamp, over time, to slowly drift up or down either to the 0V or +V supply rails. Did you leave it running for 12 hours or so?

What I knew is that the 1M resistor is there to stablish a DC gain, and avoid the capacitor to get offsets which would make the integration fail (but I'm afraid I can't go any further right now).

(1) 1M resistor stabilise DC gain: No. As far as gain is concerned the 1M resistor is a nuisance and should not be there. It also distorts the linearity of the saw-tooth by introducing an exponential function.

(2) avoid the capacitor to get offsets. Yes, but does not do it very well

I don't understand why an integrator does not have gain,...

Depends what you mean by gain. If you mean voltage gain, no it does not have voltage gain as such.

the gain as I understand, is given by the ratio of capacitor impedance to integrator's input resistor

There is no voltage gain- that is the wrong dimension.

The ratio of capacitor impedance to integrators input resistance does not define any voltage gain. But what you say is getting close the modus operandi of the integrator.

is the same topology as a simple inverting amplifier.

When both impedances match, the gain is just unity.

Quite true if you have a sine wave input, and stay within the linear region of the opamp characteristic. But that is not the case for your integrator.

I'm using tantalum capacitors, which have polarity too, so I suspect the comment about electrolytic capacitors applies here too.

Solid tantalum capacitors will generally take -3V before misbehaving, but you are exceeding that. Electrolytics of any sort are odd things and should not be used as the integrating capacitor in this type of circuit. One of the major downsides is leakage current, but there are other problems.

(I am working on a bit to explain all about the integrator type that you have built. I hope when posted, that it will clarify the situation- be good revision for me too, if I can remember :()
 
Last edited:
That was lucky; I was expecting the output of the integrator opamp, over time, to slowly drift up or down either to the 0V or +V supply rails.

Yes, that's what usually happends. I need to adjust freq and amplitude carefully to get a good output.
Today I tried this other configuration, with phantastic results (much better control and nice output):

4362Fig01.gif


Spec, as for your other comments, I'll wait (eager... :) ) your explanation.

The "gain" misunderstanding comes from these webpages:
**broken link removed**
https://en.wikipedia.org/wiki/Op_amp_integrator#Frequency_response
int-mag.jpg


Low frequency magnitude response is fixed by the ratio between feedback and input resistors (red arrow) (Rf is the 1M resistor).
Practical integration (shaded in red) occurs between 3db freq and "unity gain" freq.
These freqs are determined by time constants of C with Rf and R1, respectively.
 
The top circuit is very neat- reduced component count by three resistors, reduced power consumption and arrived at a much better characterised circuit. I'm not surprised you had a better result. I bet the circuit settles down straight away too and doesn't drift up or down to the supply rails. :)
 
Last edited:
Deleted post
 
Elerion, here is the promised simple analysis of your active integrator circuit (AIC):

ETO_Elerion_active integrator_&_active_low pass filter_iss01_00_2015_12_13.png

The diagram above shows the same circuit performing two functions: low pass filter (LPF) and active Integrator Circuit (AIC)

You have already derived the formulas for the Shunt Feed Back Low-Pass filter correctly, for a sine wave input, so no need to describe that further. The characteristics for the low-pass filter are given anyway in the box below the schematic.

ACTIVE INTEGRATOR CIRCUIT DESCRIPTION

(1) Caveats

(1.1) The 1M Ohm feedback resistor has been omitted for clarity; it plays no part in the fundamental operation of the active integrator

(1.2) Assume supply voltages for the AIC of -5V and 5V with 0V being the circuit reference.

(1.3) R2= 1K Ohms, C1= 1uF

(1.4) The the input square wave changes state when the AIC output reaches -2V and 2V

(1.5) The AIC input square wave has excursions of +2V and -2V with 0 sec rise and fall times.

(2) Theory

(2.1) The relationship between charge, voltage, time, and current for a capacitor is given by:

Q = CV = IT ...(2.1.1)

Where Q is the charge in C in Coloumbs (1 Coloumb = 6.2415 *10↑18 electrons)

C = the capacitor value in Farads

V= the Voltage across the capacitor

I = the current (constant) flowing into the capacitor in Amps

T = time in seconds

Take an example:

C = 0.01F (10mF)

V = 5V

I = 0.2A (200mA)

T = unknown

From Q = CV = IT you get T= CV/I ...( 2.1.2)

Then substituting you get, T = (0.01* 5)/0.2 = 0.25 seconds (250mSec)

This tells you that if you fed a 10mf capacitor with a constant 200mA for 250mSec the voltage across the capacitor would increse linerarly, in a ramp, to 5V.

Q = CV = IT is an extreemly useful formula and you can use it for numerous situations involving capacitors.

By the way, the inverse is the relationship for an inductor:

Q = LI = VT (where V is a constant Voltage) ... (2.1.3)


(
3) Theoretical Operation of the Active Integrator Circuit

(3.1) Assume the the following initial conditions:

(3.1.1) AIC IPV = 0V

(3.1.2) AIC OP = 0V

(3.1.3) Thus the voltage across C1= 0V

(3.2) The AIC IPV Jumps to 2V in zero time

(3.3) Thus, the current through R2 jumps to R2/VIN = 2V/1K = 2mA

(3.4) In order for the AIC opamp to be at ease, it must remove an equal current current from the virtual earth point. It does this by making its output fall and generate a matching current through C1. To keep the current through C1 flowing the opamp output voltage must keep falling at a linear rate (dV/dT)

(3.5) By definition, the current flowing into the virtual earth point is constant so it follows that the current flowing out of C1 has exactly the same magnitude.

(3.6) The left end of C1 is at virtual OV and the right side of C1 has a constant current flowing out of it so from formula (2.1.2) a linear negative ramp is generated. Its aiming point is - infinity. And that is where it would go if nothing stopped its progress. Note that the opamp has no idea what voltage is on the right plate of C1, all it knows is that it must extract a constant negative current from its virtual earth point to keep its two inputs at equal voltages.

(3.7) So, practical aspects aside, the right plate of C1 could be at -100V and the AIC opamp would have no idea. It would continue making its output voltage more and more negative to extract exactly the same current from its VEP. It would do this forever if left to its own devices.

(3.8) You are probably thinking, that's all very dramatic, but you have removed the 1M Ohm feedback resistor; that would let the AIC opamp know what the output voltage is. No it wouln't: at -100V output the 1M resistor would have 100V across it so the 1M resistor wolud only remove 100uA from the VEP. The other 2mA-100uA = 1.9mA woud still be required to keep the AIC opamp inputs at 0V. In, fact the 1M resistor would only stop the ramp negative progress at -2,000V when it would exactly drain an equal curren out of the VEP as in flowing in. At that point, ignoring the fact that the 1M resistor would have arked over at about -200V, it would be dissipating 4W.

(3.9) The curent through the 1M resistor is proportional to ramp voltage and this illustraytes the exponentional function that it adds to the ramps pure linear shape. Not only does the 1M resistor do no nothing in practical terms, but it also distorta the ramp.

(3.10) Back to reality; of course, the ramp would stop abruptly when the AIC opamp output saturated, probably around -3V5 for an LM358.

(3.11) But the AIC opamp output would never saturate because of caviat (1.4)

(3.12) Assume that when the ramp reaches -2V the ISTO switches over and produces -2V at the AIC input. Now there is 2mA flowing out of the VEP so the opamp out voltage output starts rising linearly at a rate sufficient to ensure an exact 2ma flowing into the VOP and so the cycle will continuue for ever.


(4) Practical Aspects

(4.1) The AIC will operate indefinately given perfect components. As this cannot be the case, because real-life components are not perfect, the circuit is fraught with problems and almost impossible to characterise. The normal outcome, even with the 1M feedback resistor, is for the output to slowly drift towards the positive or negative supply rail and stay there.

(4.2) Your latest circuit takesd care of all the prolblems- that is why, as you say, it works so well.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top