Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Whats wrong with this comparator circuit?

Status
Not open for further replies.

user1453

New Member
Hi
at the moment I'm dsigning a pwm circiut for use in a project

My problem is I have an op amp configured as a comparator to output +12v when Vin is greater than Vreference and when Vreference is greater, to output 0v

The problem is that when Vreference is greater the comparator outputs 1v

Anyone have any idea why this is happening?

The first two op amps in the circuit generate the triangular wave, the third op amp is configured as the comparator

the blue line is the reference voltage
the red line is the triangular wave being compared
the green line is the output of the comparator

**broken link removed**

the program I am using it LTspice
 
Notice that you are connecting the -Vcc of U3 to the ground. Try to connect it to the -12 V rail and check it again.

Good luck!
 
with -vcc of u3 to -12v the wave formed goes for =11 to -11

The V range I was trying to get from the u3 was 11-0v

any suggestions on how to achieve that?
 
Sorry... now I see that you want 0,0 V at the output. That´s why you put the -Vcc of U3 to ground. Well, it is not possible to the output goes to 0,0 V because the saturation voltage of the internal output transistors of U3 (nearly 1,0 V above the -Vcc voltage applied to U3). To get an output voltage near to zero at the output of U3, you can connect the -Vcc of U3 to a voltage near to -1,0 V. This can be achieved with this circuit:

(-12,0V)----\/\/\/\----|<|---|<|-----(gnd)

The resistor is 1K(1/8W) and diodes are 1N4001. You must connect the -Vcc of U3 at the point where the resistor connects the diode. At this point, the voltage is near -1,2 V which compensates the saturation voltage of the OpAmp and the output for a logic level zero will be near to zero volt (in fact, around -0,2 V).
 
Notice that you are connecting the -Vcc of U3 to the ground. Try to connect it to the -12 V rail and check it again
I agree, because you are driving the +input of U3 below it's negative supply rail. The solution to this is to use a real comparitor for U3 that has a open collector output with a separate connection for the emitter of the output transistor and the - supply rail. Something like the LM311 comes to mind but with a better Vsat of the output transistor.
Why not go one step further and eliminate this whole -supply rail issue by biasing the -input of U1 (and +input of U2) to 1/2 of VCC and then use a LM339 for U3.
 
Last edited:
problem solved by using a dedicated comparator thanks for the help

voltage is now roughtl 0-11.5v

close enough
 
Status
Not open for further replies.

Latest threads

Back
Top