+ Post New Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 36 of 36
  1. #21
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    re: Triangular Wave Generator

    [QUOTE=schmitt trigger;1294792]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---

  2. #22
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    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 :)

    •   AltAdvertisement

        
       

  3. #23
    Advanced Member level 5
    Points: 14,971, Level: 29
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,488
    Helped
    805 / 805
    Points
    14,971
    Level
    29

    Re: Triangular Wave Generator

    Quote Originally Posted by iimagine View Post
    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.

  4. #24
    Super Moderator
    Points: 260,253, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,447
    Helped
    13828 / 13828
    Points
    260,253
    Level
    100

    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 by FvM; 8th November 2013 at 09:05.

    •   AltAdvertisement

        
       

  5. #25
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    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.

    •   AltAdvertisement

        
       

  6. #26
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    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

    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.

  7. #27
    Super Moderator
    Points: 52,942, Level: 56

    Join Date
    Apr 2011
    Location
    Minneapolis, Minnesota, USA
    Posts
    12,949
    Helped
    2580 / 2580
    Points
    52,942
    Level
    56

    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

  8. #28
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    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
    Last edited by iimagine; 18th November 2013 at 14:00.

  9. #29
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    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

  10. #30
    Super Moderator
    Points: 52,942, Level: 56

    Join Date
    Apr 2011
    Location
    Minneapolis, Minnesota, USA
    Posts
    12,949
    Helped
    2580 / 2580
    Points
    52,942
    Level
    56

    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?

  11. #31
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    Re: Triangular Wave Generator

    Quote Originally Posted by BradtheRad View Post
    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. :)

  12. #32
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    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

  13. #33
    Advanced Member level 4
    Points: 7,632, Level: 20
    Achievements:
    7 years registered
    Venkadesh_M's Avatar
    Join Date
    Jun 2013
    Location
    Coimbatore, India
    Posts
    1,375
    Helped
    258 / 258
    Points
    7,632
    Level
    20

    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?..

    •   AltAdvertisement

        
       

  14. #34
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    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

  15. #35
    Advanced Member level 4
    Points: 7,632, Level: 20
    Achievements:
    7 years registered
    Venkadesh_M's Avatar
    Join Date
    Jun 2013
    Location
    Coimbatore, India
    Posts
    1,375
    Helped
    258 / 258
    Points
    7,632
    Level
    20

    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...

  16. #36
    Member level 5
    Points: 1,422, Level: 8

    Join Date
    Oct 2013
    Posts
    85
    Helped
    10 / 10
    Points
    1,422
    Level
    8

    Re: Triangular Wave Generator

    Quote Originally Posted by Venkadesh_M View Post
    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!

--[[ ]]--