duty cycle using lm339

Thread Starter

m1ch43l

Joined Aug 16, 2012
63
Hello chaps,
I've designed a circuit to vary the duty cycle for a square wave oscillator using lm339 chip. On proteus simulator, it guarantees that it'ld work in reality as expected. On the bread-board, I replicate the exact circuit as on proteus. The problem is that it doesn't oscillate.
Yes, I've checked all connections and they match their simulated one to pinpoint accuracy. Without the variable resistor, it oscillates nicely. The resistor isn't the problem bcoz I've tried it with another resistor and the result is the same.

I've attached 2 files. an image for the simulator and the actual proteus file.

Help me as fast as possible.
[is the formula for calculating FDN frequency the inverse of 2xRxC?]
 

Attachments

R!f@@

Joined Apr 2, 2009
9,918
I thin k u need a buffer at output.

Reason could be too much loading at the 339 output.

And further more a GS resistor at mosfet is not always needed . If the buffer used can go to 0V then u do not need a GS resistor. You would need gate resistor of around 10 to 47 ohms in series with the gate to the buffer output

Try to run the PWM with the mosfet disconnect and see whether it works first
 

TheComet

Joined Mar 11, 2013
88
That's not going to oscillate. I don't know why your simulation program would think it would, your OPAMP is all wrong. What you have there is just going to output whatever voltage you set with the trimmer, which will be between 0.3V and 14.7V, because you're using a negative feedback (output of the opamp is going to the "-" pin).

What you need is to look into inverting schmitt triggers with opamps:



Inverting schmitt triggers can be used to make an oscillator:



TheComet
 

Ron H

Joined Apr 14, 2005
7,063
That's not going to oscillate. I don't know why your simulation program would think it would, your OPAMP is all wrong. What you have there is just going to output whatever voltage you set with the trimmer, which will be between 0.3V and 14.7V, because you're using a negative feedback (output of the opamp is going to the "-" pin).

What you need is to look into inverting schmitt triggers with opamps:



Inverting schmitt triggers can be used to make an oscillator:



TheComet
The circuit he posted has positive feedback, which turns the comparator into a Schmitt trigger.


M1ch431, get rid of the 1.5k from gate to ground, and the circuit will oscillate.
 

Thread Starter

m1ch43l

Joined Aug 16, 2012
63
The circuit he posted has positive feedback, which turns the comparator into a Schmitt trigger.


M1ch431, get rid of the 1.5k from gate to ground, and the circuit will oscillate.
Got rid of it, still does not oscillate.

@R!f@@ by too much output loading you mean current flow from the output beyond the normalized 20mA maximum? The chip is cool and my load isn't connected to the chip output pin 1. I'm using an NMOS for that. Removing the mos from the circuit yields the same result: no oscillation.

ON MY PROTOTYPE CIRCUIT:

It now works, but with a bizzare twist. See, If I try and remove the whole resistor voltage divider from the + input, my physical circuit oscillates! what gives? It shouldn't oscilate coz there isn't any reference/threshold voltage. This lacks sense...:confused:
Furthermore, how do i get it to vary duty cycle [without some fancy way of doing it] on the circuit AS IS?:confused:
 
Last edited:

Ron H

Joined Apr 14, 2005
7,063
Try this: Use your original circuit, but without the 1.5k.

Connect the input pins of the unused sections to ground. There are 6 of them.
From page 10 of the TI datasheet:
All pins of any unused comparators should be tied to the negative supply.
Floating inputs screw up the internal bias circuit, which is shared by all 4 comparators.
 

Thread Starter

m1ch43l

Joined Aug 16, 2012
63
@Ron Removed the 1.5k so it's no longer in the circuit. It failed either case.
See attached. As I recall, see the reference voltage network [voltage divider on the positive input], my first build of this circuit albeit without duty cycle variance had resistance in the 220k range. On the simulator, it works perfectly so does my build.
Thing is, I replaced it with the variable resistor as in the previous attachment and it didn't oscillate.
Now, to find out why it fails to do so, I've decided to first go back to the original voltage divider but with 18k resistors. On proteus simulator it works but not at all on my build.

I'll try with the original resistances but in the meantime, my quiz is: what does huge resistance on the voltage divider have to do with determining the oscillation?
 

Attachments

Ron H

Joined Apr 14, 2005
7,063
@Ron Removed the 1.5k so it's no longer in the circuit. It failed either case.
See attached. As I recall, see the reference voltage network [voltage divider on the positive input], my first build of this circuit albeit without duty cycle variance had resistance in the 220k range. On the simulator, it works perfectly so does my build.
Thing is, I replaced it with the variable resistor as in the previous attachment and it didn't oscillate.
Now, to find out why it fails to do so, I've decided to first go back to the original voltage divider but with 18k resistors. On proteus simulator it works but not at all on my build.

I'll try with the original resistances but in the meantime, my quiz is: what does huge resistance on the voltage divider have to do with determining the oscillation?
You didn't mention grounding all unused inputs.
Did you do it? The simulator knows nothing about the common bias circuit, so it will work just fine. The hardware may not.
 

shortbus

Joined Sep 30, 2009
10,045
The O/Ps Zip file (won't open unknown Zip files from the web) is called " AC induction motor driver", how will this drive an induction motor?
 

Thread Starter

m1ch43l

Joined Aug 16, 2012
63
The O/Ps Zip file (won't open unknown Zip files from the web) is called " AC induction motor driver", how will this drive an induction motor?
The zipped folder is a proteus simulation file. Download it, unzip and open the proteus file inside the folder. It has the same name as the zip file you download.
My intention is to drive an inductive load or whatever load I so choose. Don't worry about the name. I'll have to get the circuit oscillating first before I can put any load at the other end.:)

@RonH, Found the problem: see the FDN link to the inverting input?
My connectivity to it is bizzare. It crossed the threshold voltage and did not turn off [no comparison occured]. Then it did! and now it's behaving. Dunno why: it just did. You pointed me in the right direction. Thanks.
(NB:/ let no one suggest that my connections were wrong or incomplete. I confirmed this before I started this thread.)

A followup please, refer to my above inquiry. what's very high voltage divider resistance on the +ve side have to do with oscillation?:confused:
Secondly, my original question regarded how to vary the duty cycle of my square wave. Prompt help is appreciated.
 
Last edited:

Ron H

Joined Apr 14, 2005
7,063
@RonH, Found the problem: see the FDN link to the inverting input?
My connectivity to it is bizzare. It crossed the threshold voltage and did not turn off [no comparison occured]. Then it did! and now it's behaving. Dunno why: it just did. You pointed me in the right direction. Thanks.
(NB:/ let no one suggest that my connections were wrong or incomplete. I confirmed this before I started this thread.)

A followup please, refer to my above inquiry. what's very high voltage divider resistance on the +ve side have to do with oscillation?:confused:
Secondly, my original question regarded how to vary the duty cycle of my square wave. Prompt help is appreciated.
High resistance on the +input will give your comparator a lot of hysteresis, which will lower the frequency. It will increase the amplitude of the triangle wave that is on the capacitor.
I wish to God you would answer a simple question! I'll ask it again:
You didn't mention grounding all unused inputs.
Did you do it? The simulator knows nothing about the common bias circuit, so it will work just fine. The hardware may not.
 

Thread Starter

m1ch43l

Joined Aug 16, 2012
63
yes, i did. At the time, it didn't oscillate but now it does. As I mentioned, the problem is unknown to me. The only thing i know is that the inverting input was not responding despite grounding all other unused input pins.
 
Top