High frequency triangle signal generator with LM2903B comparators - not working

Thread Starter

LookAtThat

Joined Jun 7, 2023
14
Hi everyone!
I'm designing a class D amplifier and I want to generate a high frequency triangle signal in order to use it for the PWM. I've designed the comparator already and I used a LM2903B IC, because it works well for very high frequencies.
Now I'm trying to generate the triangle signal using the configuration from this page. I've done the calculations using those formulas for a 400 kHz, 1 V peak-to-peak signal:Q6.jpeg

I added the corresponding resistance values in the circuit and replaced the LM741s shown with LM2903B, which I know are functional models. When I try to run the simulation, I get this:
Q4.JPG

I tried this circuit again with other resistance values and LM358 op amps instead and the configuration works, it generates a 153 Hz triangle wave:
Q3.JPG

Then I left the same values and just replaced the LM358 with LM2903B and once again I get nothing:
Q5.JPG

What am I doing wrong? I suspect the value for Vsat in the calculations is not correct. I took it from the datasheet by subtracting the max input voltage range from the max supply voltage in the Recommended Operating Conditions section. But apart from that, I'm not sure.
Any help is appreciated!
 

Thread Starter

LookAtThat

Joined Jun 7, 2023
14
The LM2903 has an open collector output. It has no positive-going output drive.
You could try adding a pull-up resistor.
Don’t count on being able to make a comparator work as an op-amp.
Because the LM2903 is a comparator, and the integrator stage requires an opamp.

Edit: Ian beat me posting a response by a few nanoseconds. Like a billion.
Thanks! I'll try to look for an opamp that can handle high frequencies. Is there any particular model that I should use?

Why don’t you use a 555? You will get a good enough triangular wave on pin 6.
I had the impression a circuit like this with two opamps generates a more precise signal. But I'll definitely try with an NE555 also. Thanks!
 

Ian0

Joined Aug 7, 2020
8,947
I had the impression a circuit like this with two opamps generates a more precise signal. But I'll definitely try with an NE555 also. Thanks!
It does, but it needs a really good op-amp to get a nice triangle at that sort of frequency.
How good does it need to be?
Very good, if you have an open-loop design,
with a design that incorporates feedback, won’t the feedback take care of any nonlinearity in the triangle wave?
 

Thread Starter

LookAtThat

Joined Jun 7, 2023
14
Ok, I've found a file from TI that describes a very reliable tri-wave generator (link). Unfortunately it uses an old LM119 dual comparator for which I can't find a good SPICE model. So I've tried building a generator using an NE555 timer.
I found the following resources: video 1, video 2 and thread.
I tried building the complete circuit from video 1, but I don't get anything at the output, not even using the values shown. I checked everything and I don't know what I'm doing wrong:
poza1.JPG

So I combined the circuit shown in video 2, which generates a square wave, with the filter from video 1. I calculated the resistor and capacitor values for the square wave to have a frequency of 200 kHz and I ended up with 244 kHz. This is the value I then used to calculate the R and C in the filter.
The second circuit I took from the thread, exactly as it was shown in there. These are the results:
poza2.JPG

poza3.JPG

The first circuit has a better 50% duty cycle, but the second one has a sharper triangle waveform. Is there any way I can improve the first circuit?
 

MisterBill2

Joined Jan 23, 2018
16,612
The LM119 is the higher temperature rated comparator.An LM319 will be more available. But the LM2903 should work if you provide the correct pull-up resistor, as all have stated. The 555 is a timer that includes a comparator designed for a timer application. Thus the curved ramps.
 

MisterBill2

Joined Jan 23, 2018
16,612
Go back to the original circuit but add the 4700 ohm resistors from each output to the V+ supply and the circuit will provide a very close to perfect triagnle wave. At whatever frequency you want.
 

Thread Starter

LookAtThat

Joined Jun 7, 2023
14
Thanks for the model ericgibbs!

The LM119 is the higher temperature rated comparator.An LM319 will be more available. But the LM2903 should work if you provide the correct pull-up resistor, as all have stated. The 555 is a timer that includes a comparator designed for a timer application. Thus the curved ramps.
Thanks! I replaced the LM119s with LM2903Bs added the resistor and even the capacitors shown in the datasheet, but I still don't get anything.
poza6.JPG

I have a suspicion that the LM118 model is not good, so I made a voltage follower to test it. I don't think the model is good, I should have 4 V on the load. I also separated the grounds on the -V of the first one and the +V on the second one. I'm also not sure about the pull-up resistor for the second one. In the datasheet it shows that I should connect it to +V, but in my case that input is grounded. Should it still work if I connected it on the -V?
poza4.JPG

Go back to the original circuit but add the 4700 ohm resistors from each output to the V+ supply and the circuit will provide a very close to perfect triangle wave. At whatever frequency you want.
Thanks! I added them, but the output of both is still a flat line. Did I do it correctly? In the datasheet it says to be connected to a Vlogic, but this value can be equal to Vcc max, in my circuit 12 V, so it should work.
poza5.JPG
 

MisterBill2

Joined Jan 23, 2018
16,612
The circuit shown in post #15 has a few differences, including no negative supply required. Try removing the 1K load (R3) from the output of U2.
 

Irving

Joined Jan 30, 2016
3,548
LM7171 is a good choice for the output stage of a signal generator; +/- 5v to +/-15v operation, 4100V/uS slew rate, +/-25mA out @5v, 200MHz unity GBW and only a little more expensive than a common op-amp...
 
Top