triangle wave

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi everyone

I just finish my first class d amp
but althouugh I had tried using opamp ,I still cannot make a suitable triangular wave for PWM inpt .

Without using MAX038, does any good method can generate tri wave with freq 300khz and 6Vpp (+3V/-3V)? Thanks
 
The THD was 0.44 % - with mainly 2nd order due to the complementary output stage of the amp. Most of the rest (i.e the higher- and mostly odd-order- harmonics) was due to bad layout.
The triangle quality of this method is mainly depending upon the op-amp and the dimensioning of the circuit.

Regards

Charles
 
I have earlier tryed to use opamp's to generate triangle waves like hitsware suggested, but been very unsuccessful with it. Although I was using a opamp with a GBW of 70MHz, the triangle wave had very distorted spikes.

This is how I generate a very linear triangle wave with a frequency of about 400kHz (see the picture below). You can adjust C27 to change the frequency. R49 is connected to a virtual ground with Vcc/2 potential.
I have chosen to use a very fast comperator, but it's not necessary.
A slower comperator might give you softer spikes on your triangle wave, which will limit the max. linear duty-cycle a little bit.

I can't provide you with any simulations, but I'll asure you that you'll get a very clean triangle wave with this configuration.

An externally hosted image should be here but it was not working when we last tested it.
 
hi genome,

I don't have the exact values for all the components in my triangle wave generator because I worked on it last year for a school project. However, here are a couple of things that might help. i attached a hyperlink picture of the circuit I used along with the names of the op-amp and comparator.

equations:
frequencey: f = n / (4 CiRi)
peak triangle voltage: VT = 15 / n
- this assumes + and - 15V supply to both the op-amp and the comparator. if you have different supplies, change the 15 in the VT equation to whatever you have. Keep in mind both supplies must have the same DC magnitude or the triangle won't be completely symmetrical.

component selection:
The important thing about the op-amp is that it have a really high gain-bandwidth. The comparator needs to have a rail-to-rail output and be high-speed. I also attached a hyperlink to a screenshot that I captured of this circuit. you'll notice that the top of the triangle wave is not very sharp. The reason for this is that the comparator takes a long time switching from the -15V rail to the +15V rail. you can speed up this time by lowering the value of the pull-up resistor(not shown in schematic).

http://filebox.vt.edu/users/hgilmer/ecd/classdproj/trianglewave_circuit.JPG
http://filebox.vt.edu/users/hgilmer/ecd/classdproj/400khz_triangle.JPG
 
I've done some simulations on my schematic. I've added a outbuffer to improved linearty and output impedance.

This is the result:

An externally hosted image should be here but it was not working when we last tested it.

An externally hosted image should be here but it was not working when we last tested it.


I've alos attached the orcad/pspice files for those of you who want to play arround with it.
 

Attachments

  • triangle.zip
    56.1 KB · Views: 285
trihieu,

The two equations in my previous post determine the value of the resistors and caps based on the frequency and amplitude ofthe triangle wave you want. I think once you solve them, you have more unknowns than equations which is a good thing cuz that means you can start off by choosing the value of one of the resistors. I'd start with something like 10k for 'R' to keep the current low. also, you may want to simulate thewhole thing in P-Spice before actually building it to doublecheck everything. again, use really highspeed components
 
E4 together with R9 and C3 is just working as a comperator. I've placed a picture earlier in this thread, showing the actual configuration. You can brobably use LM119, LM219, LM319 or some other cheap comperator. Be aware that those comperators need a pullup resistor to work, since they have a open drain configuration. I don't know why so many conperators are made with a open-drain configuration. It really limits their rise time, and increese the current if you go for a small pullup resistor.

U1 and V3 are used to trigger oscillation in pspice and are not needed IRL. Pspice starts a simulation by calculating DC bias points. If the circuit isn't triggered by something, I'll stay in that initial state forever.

If you are going to buy some resistors for this circuit, you won't have to go for the exact values. I believe that I've chosen values from the E24 range.

The ratio between R7 and R8 controls the hysteresis voltage on the comperator. In other words the amplitude of the triangle wave.

Q1 and Q2 are current generators. The resistors arround these transistors contorls the current, which controls the slope of the triangle wave.

C1 is charged by alternately by Q1 and Q2, where dU/dt=I/C. Thereby C1 also contorls the slope of the triangle wave.

The frequency of the triangle wave is a function of the slope and the hysteresis voltage.

Q5 together with R13 is just a simple voltage follower. The triangle wave is only linear if there are no resistive loads to C1, which will give the slope an exponential character.

V2 can be made with a simple decoupled resistive voltage divider.

I believe that Orcad has a free limited version of capture and pspice, if you would like to simulate the circuit that I've attached.
That should be about all there is to say for now.

Good luck with it.

Kaspar Sinding Meyer
 
C26 is a part of a high pass filter, used to shift the DC level of the triangle wave, before feeding the pwm comperators. It plays no role in the triangle generator.

Hi,

Sorry to bump an ancient thread, but if you are still active on the forum I would love to see this schematic if you still have it - The original image links do not work and I don't have the software to open your schematic file that you posted.

I think I know the general principle of your design as I have designed a triangle generator using a Schmitt trigger made up of two comparators and an RS flip flop and two current sources made out of discrete BJTs, but I'd like to see how you approached the problem before I go ahead and build it.

Currently trying to go up to a 500kHz clock in my amp but I am having a 'mare of a time generating a clean triangle waveform at this frequency.

How did the circuit perform and what frequency did you use?
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.