Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[MOVED] Triangular Wave Generator

Status
Not open for further replies.

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
re: Triangular Wave Generator

My two yen:
the flattening out of the top of the waveform looks to me like saturation...awfully close to 5 volts.
/QUOTE]

I suspected this as well, I will reduce the voltage down to half by using R4

- - - Updated - - -

Well, by introducing R4 to the circuit as originally drawn, cutting down ref voltage to half, the flat line is now gone (see attached image). Only the early effect still remains

With all components being the same as post #13.

R3/R4 = 470k/470k

- - - Updated - - -

Errr.....some how my post title is changed, and I cannot post a new respond without being seen as --Updated---
 

Attachments


iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

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


schmitt trigger

Advanced Member level 5
Joined
Apr 17, 2013
Messages
2,653
Helped
844
Reputation
1,692
Reaction score
819
Trophy points
1,393
Activity points
17,795
Re: Triangular Wave Generator

Since I cannot solve that problem, I've come up with another circuit. I will learn not to trust LTSpice from now on :)
Advice from an electronics veteran: One always learns more from a non_functional circuit than one that works.

What you should learn here, to use baseball terminology, is that computer simulations will only get you to first or perhaps second base. To get to third, one must build a breadboard circuit, and to get to home and score a run an actual, fully functional pcboard is required.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,993
Helped
13,941
Reputation
28,130
Reaction score
12,578
Trophy points
1,393
Location
Bochum, Germany
Activity points
274,002
Re: Triangular Wave Generator

I will learn not to trust LTSpice from now on :)
The simulation may be perfectly right, but you can't hold it responsible for properties of your circuit that aren't modelled, e.g. different transistor parameters (difference between typical and actual transistor parameters, incomplete models, circuit parasitics).

The problems grow, if the circuit operation depends on exact component parameters. Your previous circuit has been e.g. very sensitive to transistor current gain, an unexpected high gain caused saturation. Running a simulation with parameter variations could reveal the design flaws in this case, much better than a breadboard setup.

Not to trust any simulation is a good advice, though.
 
Last edited:

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

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


iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

First off all, I have good news! A member from another forum decided to test out my circuit in real world, and post his results. It was just as the sim predicted, waveform was almost exactly as shown in LTSpice. Apparently I have problems with my real world circuit! I dont know if it is against the rule here, otherwise, I would post his result here.

Well, I still havent rebuild my first circuit yet, as I have not the time to do so. Right now, I'm only trying to find a way to produce true linearity for my fist circuit. I like discrete stuffs, I am learning so much more about transistors this way.

Anyway here is what I came up with: Version 4 :grin:

1. No more current mirrors!
2. Sharp square wave to trigger current source.
3. Added current sense transistor Q8 to monitor and correct Q5's base current
4. Added schottky diode across Q6's base and collector to prevent it from saturating (This solved the problem of non-linear discharging)

I think I've nailed it! Although at higher frequency, changing cap to 1nF, distortion begins to show, might have to shove a little more current into it.

Anyway, thats it for now. Thanks to all who have been following this thread, and those who have been responding, helping and thus providing me encouragement to further explore.

As always, please provide feedback!

PS: Thanks to you both, 'schmitt trigger' and FvM, your words has encouraged me to further explore and understand/troubleshooting my little circuit.
 

Attachments

  • Like
Reactions: FvM

    FvM

    points: 2
    Helpful Answer Positive Rating

BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
13,479
Helped
2,668
Reputation
5,332
Reaction score
2,576
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
100,788
Re: Triangular Wave Generator

Here's a website by a fellow who also likes to construct circuits from discrete components.

You can view some articles for free (public, PA, PM).

For other articles he asks you to pay a subscription fee (ML, MO). One of them might show a triangle wave generator.

http://www.4qdtec.com/#osc
 

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

I finally assembled my version 4 together on a breadboard, using same transistors from version 1, other components value are exactly the same as on the schematic, only exception is R4, it is now changed to 220k and since I didnt have a BAT54 handy, it was omitted.

Worked on the first try!

Here is the result:

Edit: C1 = 1nF
 

Attachments

Last edited:

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

Non-linearity still exists when discharging C1 via Q6 base. If I substitute R3/R4 with a constant current source, this will limits Q6 Ic at a constant rate, thus its Ib will remain at a constant rate, this would work nicely at lower freq, but I cant seem to get rid of the current spike (red). While I understand that, this is due to voltage not develop fast enough at Q5's base when Q6 turns off, the reason for this is still unclear to me , increasing current source helps, but will slow down the discharging rate.

Anyone have any suggestion?
Is there a trick to keep Q6's Ic constant without the use of a current source?

Blue line - Q6's base
Red line - current in and out of C1
 

Attachments


BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
13,479
Helped
2,668
Reputation
5,332
Reaction score
2,576
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
100,788
Re: Triangular Wave Generator

Simulating one of your earlier schematics, I notice two transistors play a role in discharging the capacitor, one in sequence after the other.

The second transistor turns on only for a brief time, at the final moment when the downward slope ends. The slope remains linear because its current flow is unchanged as compared to the preceding transistor.

From what I can see, that changeover from one transistor to the other is important for creating hysteresis action.

Could your latest schematic have a similar action, but at a greater current flow, causing the non-linearity which you report?
 

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

Could your latest schematic have a similar action, but at a greater current flow, causing the non-linearity which you report?
I have solved the problem of non-linearity (post #29), if you look at the output pic that i posted earlier, red line is the current being charged and discharged out of the cap. Earlier versions did not have constant current source biasing Q6. The problem was because of Q5's VBE is constantly changing, its Ic also increasing exponentially, causing a slight non-linearity, if you use falstad sim, it is not noticeable. In my latest version, no matter how much current, faster or slower, being fed into Q6 via CCS, the slope will always be linear, although symmetry will change, but it could be adjusted via R-sense

I have been suspecting that the change over between the 2 discharging transistors might have something to do with why voltage isnt develop fast enough at Q5 base when Q6 turns off, but I could not find any evidence to evict them :)
Anyway, I think that current spike is caused by what is known as 'early effect' although I'm not so sure. Right now the only way I could minimize this is to increase CCS into Q5

I'm trying to make this circuit more efficient by reducing unnecessary wasted current as much as possible. Parts count does not matter to me, as long as it is efficient and do its job for my discrete class D headphone amp. :)
 

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

Here is my latest work, version 6.

50% reduction in power consumption!

This is an overall improvement over all previous version, I think i'm going to stick with this new method of discharging, and charging the cap. In this version, CCS (constant current source) are all being used as reference currents to be amplified at the charge and discharge states, therefore, power consumption being used by these are only a few µA. There are still distortions to be corrected but I'm quite happy with it now.

Please help me finish this, I'm getting a little bored doing it by myself :cry:
 

Attachments


Venkadesh_M

Advanced Member level 4
Joined
Jun 26, 2013
Messages
1,375
Helped
258
Reputation
516
Reaction score
254
Trophy points
83
Location
Coimbatore, India
Activity points
6,738
Re: Triangular Wave Generator

Hi imagine nice effort but the number of transistors are going higher and higher, I cant imagine the working of the circuit with this much of transistors How did you designed it?..
 

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

Hi Venkadesh,

I have reduced the number of transistors down to 10, I know it is still a large number but accuracy and efficiency demands it! :( I'm still constantly trying different method to see if i can further improve, reducing part counts ect... :)

As for how I design it, I'm basing everything from my first circuit idea, I try to solve its problems and when I cant seem to do it, I find alternative ways of approaching, facing them. I use both falstad sim (a great little java app) and LTSpice to simulate results. Although falstad sim is some what limited and simple, it helps me visually analyzing and developing a simple circuit first and then the use of LTSpice
 

Venkadesh_M

Advanced Member level 4
Joined
Jun 26, 2013
Messages
1,375
Helped
258
Reputation
516
Reaction score
254
Trophy points
83
Location
Coimbatore, India
Activity points
6,738
Re: Triangular Wave Generator

That mean you are trialing circuits using simulator? The best option is going block by block, you can do all of them with simple blocks of square wave generator and integrator..
It will reduce your time consumption...
 

iimagine

Member level 5
Joined
Oct 23, 2013
Messages
85
Helped
10
Reputation
20
Reaction score
10
Trophy points
8
Activity points
511
Re: Triangular Wave Generator

That mean you are trialing circuits using simulator? The best option is going block by block, you can do all of them with simple blocks of square wave generator and integrator..
It will reduce your time consumption...
You missed my point...
The whole purpose of doing this is to find an alternative way of generating a triangle wave, with as much efficiency as possible, I would have just use high speed opamp/comparator otherwise. There is no purpose to redo the square wave/integrator using discrete components as that method can not be further optimized.
I want to save battery power :) go GREEN!
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top