Author Options:

How to square wave ---> triangle wave? Answered

Currently I have developed a flyback driver that is a semi-cross between a classic ZVS circuit and a 555 type driver, mainly just using a few comparators (one to create a triangle wave and 2 others to respond to the upper and lower peaks and drive MOSFETs. This allows me to create a modified sine wave with adjustable duty cycle.)

This topology is even more powerful than the ZVS driver at 12V, as I got some INSANELY thick arcs!! However the MOSFETs get a little too warm, and I was forced to use sil pads to galvanically isolate the drain from the CPU heatsink. They seem to have really poor thermal characteristics as the heatsink stays cold while the transistors get uncomfortably hot within seconds!!

To make this thing operate at the resonant frequency of the flyback, I think I will a feedback coil that would get "squared up" using a resistor and zener diode. I need to convert that signal into a triangle / sawtooth wave of fixed amplitude. A simple RC type circuit is not too suitable because as the frequency goes up or down, the amplitude of the voltage across the capacitor changes proportionally.What circuit will allow me to convert a square wave directly to a triangle wave of fixed amplitude????


I know there are IC's available that do just that, convert one waveform into another but I can't think on any useful number for a datasheet right now.
Maybe your approch to the problem can be simplyfied?
What you do right now is basically a very scaled down version of a levitating induction heater.
So maybe it pays off to take a sneak at some schematics for those to check how the feedback is handled there?
And why do you need a triangle wave? Sorry, might be overthinking but that bit got me lost here....

Your probably right. Because I want ZVS switching, and I know that can be achieved when my flyback transformer is driven at the resonant frequency. (so that the LC tank circuit formed on the primary of flyback naturally crosses the 0V mark when the MOSFETs switch over)However I also want to PWM modulate the signal to the MOSFETs. My idea is that I alternately pulse to each gate with some dead time between the mosfets, and by controlling the dead time between transitions with an audio signal I hope to acheive pretty good audio modulation. You can think of this as effectively a sort of modified sine wave driver.

So I devised a fairly simple driver that uses some comparitors driving BJT totem poles which in turn drive the MOSFET. One comparitor is triggering on the lower end of the triangle wave while the other comparitor triggers on the upper end of the triangle wave, which is why it is important for it to be symmetrical. I easily generate the 2 threshold voltages with a rheostat and a few resistors, the voltages present on either end of the rheostat are fed into the comparator's. Currently I produce that triangle wave with my 3rd comparitor wired up as a simple astable multivibrator, which is good enough. I do have weird problems with rapid random "bouncing" issues on the gate however. which may very well be the culprit of the excessive power dissipation.

If you can with your circuit than try a gate transformer.
I noticed in my heating experiments that using these tiny things actually provides much better and more reliable switching.
You are no longer required to produce a quite high current on the gate signal only the right amount of windings on the transformer.
Another really nice benefit of this when using external sources to keep the resonance is that you only need to generate one switching signal.
This is fed into the transformer and the opposite windings for the gates on it work both mosfets in total sync.
Plus, with the right driver configuration the "negative" impulse from the transformer pulls the gate shut much faster than a simple switch off.
Having said that I still think it should be possible to put the modulation onto the supply voltage for the mosfets, so instead of switching a pure DC the DC is already modulated.
Saves all the troubles of getting it to work good enough by feeding it through the gate.
It might be due to the internal and external diodes that you have audio problems too - consider the capacitance of them for the signal generation if you can (if you feed the audio through the gates).

"Having said that I still think it should be possible to put the modulation onto the supply voltage for the mosfets, so instead of switching a pure DC the DC is already modulated."

It does sort of work, but it is very quiet and distorted. how can you modulate the input voltage efficiently? (to avoid large heatsink) I added what was essentially a current transformer and forced a current through the secondary of this transformer to modulate the voltage coming out of the supply. It did not work well.


2 years ago

The basic idea is each gate has a fixed switch voltage. The timing is still RC but you will be able to hold a pp voltage. Your a good enough experimenter to make use of this...

sq-trangle wave.gif

I tried this in LTspice using a single common emitter instead of a logic device and I assumed that the 470pf capacitor is part of a feedback loop (connected to the input, that is.) I don't have a clue how this circuit is supposed to work. It seems like the square wave input is capacitively coupled into the input to either DC level shift it or distort the square wave harmonically, then with the feedback capacitor it forms some sort of integrator or something???

The sq wave becomes AC and trips the gate which stats to charge or dis-charge the 470pf until the sq wave flips the gate the other way.

The ratio of the resistors keep the voltage setting.

But won't the peak to peak amplitude triangle wave output change depending on the square wave input? This is part of a feedback loop, so it only needs to have a stable triangual wave output up to maybe 30KHz or so.

Be sure to click the pic to see whole image...

That is a nice one indeed, have to keep that in mind for my collection bin!

Then you might like this one too :-)

+1 -1 amplifier.png

Looks pretty interesting, I'll definitely give that a try. Hopefully it works with 7400 series stuff! That is the purpose of one of the inputs to the NAND gate left open?

Guess a sloppy drawing. I would tie the pin high and consider a CMOS invert gate.