7 Transistors Triangle Wave Generator

RichardO

Joined May 4, 2013
2,270
You can also get quads and hexes, but I don't know if they are matched. Theoretically, they are, just because they are on the same piece of silicon, but they aren't specified like the matched pairs are.
Or possibly a HFA3096 -- too bad it only has 2 PNP's and 3 NPN's. Take a good look at the Ft and junctions capacitances! Other HFA series parts have some potential too such as the HFA3102.

http://www.intersil.com/content/dam/Intersil/documents/fn30/fn3076.pdf
http://www.intersil.com/content/dam/Intersil/documents/fn36/fn3635.pdf

Be warned that these parts are pricey and not always readily available. :-(
 

Thread Starter

iimagine

Joined Dec 20, 2010
511
Finally, my breadboard arrived! I decided to just test out this circuit with the 1nF and 2n3094's. I did not bother to match transistors HFE because I just wanted to see if it would osc at all. Took out my DMM and did some measurement and this is what I get:

Voltage = 5.70V
Output = 1.45V :mad:
R1/R2 = 1.01V
R3/R4 = 0.73V :confused:
Q4 Collector = 1.08V

LTSpice Simulation:

Voltage = 5.70V
Output = 2.7V
R1/R2 = ~1.04V
R3/R4 = ~2.86V peak
Q4 Collector = ~2.3V peak

Anyone have any thought? Do I really need to match those current mirror bjt's at this point? Is this the proper way of measuring or do I really need to use an oscilloscope (As I dont have one here, but my brother does :)) Any input is much appreciated.
 

Thread Starter

iimagine

Joined Dec 20, 2010
511
I need to borrow that oscilloscope then :cool: Anyone that have an oscilloscope willing to test this out? :) It could be fun and useful for your next project!
 
No i mean the good old CRO, forget all about those pc based/pocket scopes, they are crap!! Get yourself a Cathode Ray Oscilloscope. These are sold on ebay for next to nothing.
 

RichardO

Joined May 4, 2013
2,270
Do I really need to match those current mirror bjt's at this point?
Short answer: Yes.

Longer answer:
Welcome to the real world...
The 2N3904 transistors can have a device to device variation in beta of as much as 4 to 1! One device might have a beta of 100 and the next might have a beta of 400. This is the _best_ that you can expect. If the devices are at different temperatures or collector currents then the difference can be even more than 4 to 1.

An alternative to matching is to use resistors in the emitter circuit of each of the current mirror transistors. I would start at a value of somewhere around 100 ohms for a collector current of a milliamp -- use less resistance for larger collector currents and more for smaller collector currents.
 

RichardO

Joined May 4, 2013
2,270
Is this the proper way of measuring or do I really need to use an oscilloscope
You may be able to limp along by reducing the oscillation frequency to the audio range and applying the signal to an audio amplifier line input. You should add an emitter follower to prevent the amplifier from overloading your oscillator output.

A 10 uf timing cap should get you to about 7 KHz. A tantalum cap is best but an aluminum electrolytic will work. I would not recommend going over 100 uF since electrolytic caps can get very leaky at high values.

Good luck.
 

Thread Starter

iimagine

Joined Dec 20, 2010
511
Well I matched those current source bjts. They are now ~5 hfe diff. I also matched Q5/Q6. The result is very much the same. I dont have a higher value cap at the moment but with the components value I'm using right now, I'm expecting a freq around 12khz. I will try the emitter follower method as RichardO suggested (very clever by the way :D) but as of the moment I dont think its osc at all, what I think is that both Q5 and Q6 are on at the same time, how this is possible ? I dont know :confused:.

To be continue....I'm not giving this up yet
 

Thread Starter

iimagine

Joined Dec 20, 2010
511
Well, my hantek6022BE PC based oscilloscope arrived! I went right ahead to test the circuit, using:
Q1/Q2 = MPSA93 Matched hfe to ~7
Q3/Q4 = 2n3904 Matched hfe to ~7
Q5/Q6 = MPSA42 Matched hfe to ~7
Q7 = 2n3904
R1/R2 = 100k/10k
R3 = 470k
No R4, I wanted top peak at ~5v
C1 = 1nF

It does oscillate! :D However the waveform is unexpected :confused: I will investigate this at a later time
Any suggestion or comment is appreciated
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Edit your .asc file to represent your current circuit, and upload it.
You should also take a picture of your actual circuit and upload it.
 

RichardO

Joined May 4, 2013
2,270
OK. It looks like you have a signal at about 4 KHz. I like that because it makes testing a lot easier than at higher frequencies.

The amplitude seems way too high. It is nearly 5 volts peak to peak. I thought it was supposed to be more like 1 V p-p. Are you still using a 5 volt power supply?
 

Thread Starter

iimagine

Joined Dec 20, 2010
511
OK. It looks like you have a signal at about 4 KHz. I like that because it makes testing a lot easier than at higher frequencies.

The amplitude seems way too high. It is nearly 5 volts peak to peak. I thought it was supposed to be more like 1 V p-p. Are you still using a 5 volt power supply?
Yes, I am still using 5V supply, I removed R4 for a peak to peak of approx 0.8-5v and to slow down the freq

What I really dont get is the flat line at the top peak. The non-linear falling, dragging slope I can understand, It is because of R3 being too low, causing Q6's Ic to flow more then needed, the addition of this current slows down discharging current via Ib. However the curve at start of the rising slope is another problem I'm trying to figure out why
 
Last edited:

RichardO

Joined May 4, 2013
2,270
Yes, I am still using 5V supply, I removed R4 for a peak to peak of approx 0.8-5v and to slow down the freq
You can't get anywhere near 5 volts at the peak of the triangle wave without one of the transistors saturating. Since you now have an oscilloscope, you should go back to the smaller amplitude triangle wave and accept the resulting higher frequency. As long as you stay in the tens of kiloHertz frequencies range you should be OK.

By the way, don't forget to add power supply bypass capacitors to your prototype. I would use a 10 to 22 uF electrolytic where the power comes into your prototype and a 0.1 uF ceramic cap as near to the circuit as you can do it.
 

Thread Starter

iimagine

Joined Dec 20, 2010
511
You can't get anywhere near 5 volts at the peak of the triangle wave without one of the transistors saturating. Since you now have an oscilloscope, you should go back to the smaller amplitude triangle wave and accept the resulting higher frequency. As long as you stay in the tens of kiloHertz frequencies range you should be OK.

By the way, don't forget to add power supply bypass capacitors to your prototype. I would use a 10 to 22 uF electrolytic where the power comes into your prototype and a 0.1 uF ceramic cap as near to the circuit as you can do it.
Thanks RichardO, I will try that tomorrow and post the result
 

Thread Starter

iimagine

Joined Dec 20, 2010
511
Introducing R4 to the prototype got rid of the flat line

R3/R4 = 470k/470k

Freq is now around 8kHz

Only one problem left, the rising slope early effect

PS: I dont have any electrolytic cap handy, so still no bypass cap yet
 

Attachments

Thread Starter

iimagine

Joined Dec 20, 2010
511
Since I cannot solve that problem, I've come up with another circuit. This one is even simpler, symmetry can be adjusted via R5 (RSense); square wave can be seen at Q1's collector (much better than the previous version). The working principle is the same only the discharging method is changed

I'm going to test this one soon, hopefully it will work

I will learn not to trust LTSpice from now on :)
 

Attachments

Thread Starter

iimagine

Joined Dec 20, 2010
511
Well, I figure I should at least try to understand whats happening with my first circuit. Up on close inspection of the bottom waveform in simulator (setting R3/R4 to 470k/470k), and by probing the base of Q7, the time period when Q7's turns on and off is totally coincidental with when the non-linearity begins and end!? Although in simulation, this time period is short. Could it have something to do with Q7 using some current from Q3's collector, thus effecting its mirror Q4? I removed Q7's base from Q3's collector and give it it's own ref voltage using another voltage divider network, to my disappointment, the result waveform is the same. So what is happening here? Replacing R3/R4 back to 1Meg/1Meg seems to damped this effect down a lot but it is still there. I'm suspecting that in real world this is magnified much more, thus giving that result that i posted before.
 

Attachments

Jony130

Joined Feb 17, 2009
5,488
Hi, I decided to build your generator after I saw your pictures from you PC based oscilloscope. And those strange waveform you get.
I use breadboard and some european BJT.
Q1/Q2 = BC557B
Q3/Q3 = BC337-40
Q5/Q6/Q7 = BC548B
R3 = 2x470K; R4 = 680KΩ; R1 = 47KΩ; R2 = 10KΩ; C1 = 1nF;
A use my Rigol ds1052e and this is what I capture.


LTspice show this result


F = 35Khz
So the simulation result is slightly off, so clearly you have something wrong with your circuit or with your oscope.
 

Attachments

Top