Yet another triangle wave generator

Thread Starter

cmartinez

Joined Jan 17, 2007
8,257
There you go. I tweaked it a little, and it's now working within the range that I wanted (20 KHz to 200 KHz). It seems that your pot component is different from the one I have.

I had to change the comparator I was using because of its slow response. The PWM output was quite goofy, with very rounded corners and slow voltage gradients... I don't understand why your sim worked so nice at the PWM output and mine didn't. Perhaps I have an old file for the LT1018? ... I replaced it with an LTC6752 and PWM is working just fine now.

I noticed that if it were not for the ".ic V(Ref)=2.5V" directive, the Ref node would vary depending on frequency, why is that?

Also, why does the p-p voltage at the triangle wave output go down as the frequency goes down? Is there a way to fix that?

upload_2019-5-15_9-6-26.png
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,257
Stupid me, I've just replaced the LTC6752 with the same LM339 you used at the first stage, and the circuit is working just as fine. That simplifies things even more.
 

crutschow

Joined Mar 14, 2008
34,470
why does the p-p voltage at the triangle wave output go down as the frequency goes down? Is there a way to fix that?
Yes, you need a high-speed comparator for both U1 and U8 to minimize the change in the triangle voltage with frequency and give a good PWM output signal.
Try the LTC6752 or the LT1720 for both.

I increased the value of the pot U6 to reduce the load on the comparator output.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,257
Yes, you need a high-speed comparator for both U1 and U8 to minimize the change in the triangle voltage with frequency and give a good PWM output signal.
Try the LTC6752 or the LT1720 for both.

I increased the value of the pot U6 to reduce the load on the comparator output.
yeap ... the LT1720 did the trick, although the range changed from between 1.0V to 3.4V. But that's not a problem, it was more important to have the range remain the same through the entire frequency span. Adapting the comparator's input to work within that range was a piece of cake using resistors as voltage dividers.

upload_2019-5-15_11-47-18.png
 

Attachments

crutschow

Joined Mar 14, 2008
34,470
Glad it's now working to your requirements. :D

Always look at the frequency response of the devices to see if they are compatible with the required circuit response when doing a design.
Op amps in particular, don't work well as high speed comparators due to their internal frequency compensation which limits their slew-rate and response time, thus comparators are normally used for that purpose, which have no (and don't need) compensation.
Even the relatively low speed LM339 comparator is faster as a comparator than most op amps.
 
Top