triangle wave - diyAudio
Go Back   Home > Forums > Amplifiers > Class D
Home Forums Rules Articles diyAudio Store Gallery Wiki Blogs Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

Class D Switching Power Amplifiers and Power D/A conversion

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Thread Tools Search this Thread
Old 26th March 2005, 08:02 PM   #1
ted12 is offline ted12  Singapore
diyAudio Member
Join Date: Mar 2005
Location: s
Default triangle wave

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
  Reply With Quote
Old 26th March 2005, 08:52 PM   #2
subwo1 is offline subwo1  United States
diyAudio Member
subwo1's Avatar
Join Date: Jan 2002
Location: North American Continent
Hi ted12, you can charge/discharge a capacitor with two current sources, one NPN and one PNP, driven by a square wave.
  Reply With Quote
Old 26th March 2005, 08:55 PM   #3
diyAudio Member
Join Date: Mar 2002

use faster opamps
  Reply With Quote
Old 29th March 2005, 04:28 AM   #4
diyAudio Member
Join Date: May 2002
Location: Switzerland
I once used a CD4060 (or was it 4040 ?) oscillator/divider to generate a clean rectangular. This was fed into an inverting integrator - and there you go.......


  Reply With Quote
Old 29th March 2005, 10:52 AM   #5
Pierre is offline Pierre  France
Join Date: Nov 2004
Location: Paris
What kind of THD did you obtain with that method, Charles?

Best regards,
Pierre (looking for some "dead-time" to improve my current design)
  Reply With Quote
Old 29th March 2005, 01:31 PM   #6
diyAudio Member
Join Date: May 2002
Location: Switzerland
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.


  Reply With Quote
Old 29th March 2005, 08:10 PM   #7
sovadk is offline sovadk  Denmark
diyAudio Member
sovadk's Avatar
Join Date: Sep 2004
Location: Kaspar Sinding Meyer @ DTU in Lyngby
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.

Click the image to open in full size.
  Reply With Quote
Old 30th March 2005, 09:22 AM   #8
hdoggz is offline hdoggz  United States
diyAudio Member
Join Date: Jan 2005
Location: VA, USA
I made a pretty decent triangle wave that put out 400KHz at 5V pk2pk. I used 'hitsquare's circuit with a LM311 comparator and some op-amp with a gain-bandwitdh of 4MHz.

finding the right resistor and cap values was kind of a back and forth process tho
  Reply With Quote
Old 30th March 2005, 08:28 PM   #9
diyAudio Member
Join Date: Jul 2002
Location: Boston, MA
Hi hdoggz
Would you please share your circuit?
  Reply With Quote
Old 1st April 2005, 07:53 AM   #10
hdoggz is offline hdoggz  United States
diyAudio Member
Join Date: Jan 2005
Location: VA, USA
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.

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).
  Reply With Quote


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sine wave - Square & Triangle wave generator using Transistors / OP-Amps lineup Solid State 20 9th October 2006 12:15 AM
Microphone turns triangle wave into square wave? Circlotron Analogue Source 18 25th January 2003 06:44 AM

New To Site? Need Help?

All times are GMT. The time now is 10:15 AM.

vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
Copyright 1999-2017 diyAudio

Content Relevant URLs by vBSEO 3.3.2