PWM generator

Rowan

Joined Jun 1, 2005
12
Originally posted by hgmjr@Jun 8 2005, 09:01 AM
I went over the design with a fine tooth comb. However, I am not infallible so don't hesitate to let me know if anything looks amiss.

hgmjr
[post=8297]Quoted post[/post]​

I finally recieved all the parts! You my friend, are a genius! :D

Worked beautifully!, the only problem with LED's are that they only really become visible at around the 30% duty cycle mark, and already appear at full brightness anywhere aroung the 90% mark. Would it be possible to modify the resistor values slightly to achieve a 30%-90% output variable between 0 - 10v input? However, I am very happy with it is at the moment !!!

Thank you SO much hgmjr!!!
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by Rowan@Jul 1 2005, 11:25 AM
I finally recieved all the parts! You my friend, are a genius! :D

Worked beautifully!, the only problem with LED's are that they only really become visible at around the 30% duty cycle mark, and already appear at full brightness anywhere aroung the 90% mark. Would it be possible to modify the resistor values slightly to achieve a 30%-90% output variable between 0 - 10v input? However, I am very happy with it is at the moment !!!

Thank you SO much hgmjr!!!
[post=8863]Quoted post[/post]​
Thanks for the compliment.:D You did all of the work so you deserve a big congratulations on a job well done. I just applied the knowledge that I have acquired over several decades of Electrical Engineering design.

There should be no problem modifying the component values to achieve the adjustment range you have requested. I will take a look at the circuit and recommend the component value changes needed.

hgmjr
 

Rowan

Joined Jun 1, 2005
12
Originally posted by hgmjr@Jul 2 2005, 08:19 AM
Thanks for the compliment.:D You did all of the work so you deserve a big congratulations on a job well done. I just applied the knowledge that I have acquired over several decades of Electrical Engineering design.

There should be no problem modifying the component values to achieve the adjustment range you have requested. I will take a look at the circuit and recommend the component value changes needed.

hgmjr
[post=8870]Quoted post[/post]​
All I did was follow your schematic :p Thanks alot for looking over it to adjust the resistor values. I think however I was wrong in saying from 30-90%, I had another look today and found it was more like 10% duty the LED's are just lit, and between 80-100% there's no difference in brightness. So if possible could the circuit be modified slightly to vary between 10 - 80 % duty cycles.

If you've aleady done the calc's on the 30-90% I wouldn't mind trying those out first, see how that works and then get back to you if you like.

Thanks again!!

Regards,

Rowan
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by Rowan@Jul 2 2005, 03:48 AM
All I did was follow your schematic :p Thanks alot for looking over it to adjust the resistor values. I think however I was wrong in saying from 30-90%, I had another look today and found it was more like 10% duty the LED's are just lit, and between 80-100% there's no difference in brightness. So if possible could the circuit be modified slightly to vary between 10 - 80 % duty cycles.

If you've aleady done the calc's on the 30-90% I wouldn't mind trying those out first, see how that works and then get back to you if you like.

Thanks again!!

Regards,

Rowan
[post=8882]Quoted post[/post]​
Hi Rowan,

To modify the PWM circuit to provide the duty-cycle adjustment range of 10% to 80% for the 0V to 10V control, make the following component changes:

Change R5 from 15K to 39K
Change R10 from 22K to 30K
R3 and R9 remain unchanged.

Don't hesitate to let me know if you prefer a different range.

hgmjr
 

fritzo

Joined Jul 14, 2005
5
Hi,
I plan on using the 5V single supply PWM design, being fed by the output of a DAC (0-5VDC) to then drive an IRFz44 via an ULN2003A.
I have LM358 chips in my resource box... can I expect comparable performance to the LM2903? When comparing datasheets, what values should I look for?

Thanks for making all this knowledge available in such a clear and friendly fashion!
FritzO
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by fritzo@Jul 14 2005, 04:52 PM
Hi,
I plan on using the 5V single supply PWM design, being fed by the output of a DAC (0-5VDC) to then drive an IRFz44 via an ULN2003A.
I have LM358 chips in my resource box... can I expect comparable performance to the LM2903? When comparing datasheets, what values should I look for?

Thanks for making all this knowledge available in such a clear and friendly fashion!
FritzO
[post=9067]Quoted post[/post]​
Hello FritzO,

Thanks for the kind words. The subject of PWMs is a fascinating one for sure. It is apparent from the large number of viewings associated with this posting that I am not the only one that thinks that.

As for your question, I took a look at the datasheet for the LM358. The LM358 is a dual operational amplifier while the LM2903 is a dual voltage comparator. The suitability of using an operational amplifier in place of the voltage comparator in this particular circuit depends on the frequency at which you need the PWM to operate. For frequencies of 2Khz or less the output switching speed of an operational amplifier is fast enough to make it reasonably effective as a voltage comparator. One drawback to using an operational amplifier in place of the voltage comparator is the tendency of older generation opamps to be limited in how close to the positive power rail the output can swing. This limitation tends to be more pronounced for these older generation opamps running on lower power supply voltages like +5V. That does not mean that this is a show stopper but this weakness can decrease the precision of the PWM output frequency and dutycycle.

I am not clear on how you plan on using the ULN2003. Can you supply some additional details on this aspect of your application? Would it be possible to post a schematic of the portion of the circuit you plan to drive using the PWM.

Bottom line, I believe I can help you come up with a +5v single supply PWM using the LM358 but if you have access to comparators, you may want to consider using those rather than the LM358. If the LM358 is all you have at your fingertips then we can proceed with using them. You can always come back and replace the LM358 with a voltage comparator if its performance is not what you need.

The best place to start is getting a few things tied down like the PWM frequency you need and the dutycycle range you require.

I look forward to assisting you with a PWM design that fits your needs.

hgmjr.
 

fritzo

Joined Jul 14, 2005
5
Originally posted by hgmjr@Jul 15 2005, 08:55 PM
Hello FritzO,

Thanks for the kind words. The subject of PWMs is a fascinating one for sure. It is apparent from the large number of viewings associated with this posting that I am not the only one that thinks that.

As for your question, I took a look at the datasheet for the LM358. The LM358 is a dual operational amplifier while the LM2903 is a dual voltage comparator. The suitability of using an operational amplifier in place of the voltage comparator in this particular circuit depends on the frequency at which you need the PWM to operate. For frequencies of 2Khz or less the output switching speed of an operational amplifier is fast enough to make it reasonably effective as a voltage comparator. One drawback to using an operational amplifier in place of the voltage comparator is the tendency of older generation opamps to be limited in how close to the positive power rail the output can swing. This limitation tends to be more pronounced for these older generation opamps running on lower power supply voltages like +5V. That does not mean that this is a show stopper but this weakness can decrease the precision of the PWM output frequency and dutycycle.

I am not clear on how you plan on using the ULN2003. Can you supply some additional details on this aspect of your application? Would it be possible to post a schematic of the portion of the circuit you plan to drive using the PWM.

Bottom line, I believe I can help you come up with a +5v single supply PWM using the LM358 but if you have access to comparators, you may want to consider using those rather than the LM358. If the LM358 is all you have at your fingertips then we can proceed with using them. You can always come back and replace the LM358 with a voltage comparator if its performance is not what you need.

The best place to start is getting a few things tied down like the PWM frequency you need and the dutycycle range you require.

I look forward to assisting you with a PWM design that fits your needs.

hgmjr.
[post=9097]Quoted post[/post]​
OK.
THere has to be a threshold where an OpAmp turns into a voltage comparator and vice versa, I had come to assume they were pretty much interchangeable. Not so!
The LM358 is just what I happen to have (know what & where it is). I have lots of other stuff but I'd have to seriously hunt & identify... a MAJOR part of the cost of things is knowing what it is, and where it is!

Statement of task:
DAC output 0...5VDC of a few milliamps that would have to be translated to 0..12VDC 8A

I plan to drive a peltier junction cooler (12V 8A) with a 1kHz approx/min. pulse train. (those things don't like to thermally cycle.) Doing pwm in software would overwhelm the lowly 8051... BUT this one has a DAC output (0-5V) which I can use to control this fantastic external PWM generator we are about to concoct! The ULN 2003 (just a darlington) would boost the logic level signal to drive a FET.
I could run the LM358 on the 12V rail as long as the input level (0...5VDC) and output level (0...~5V?) can be satisfied. I think the 2003 can compensate somewhat for shortcomings like the LM358 not going rail to rail.
This is NOT a high precision problem.
Duty cycle: I'd need OFF, ON, and not too wild in between .

The peltier could be run on 0...12VDC strictly analog fashion. I know less about analog than digital thus this strange excursion into PWM.
See, the same controller already does PWM on the heater unit (12V 3ohm) with the CPU feeding the 2003 driving the IRFz44 (overkill but works)... at about 200Hz.
Those things I am familiar with.
I have circuits that convert 8 bits to PWM but they require more ports than I have ,plus glue logic and whatnot.
Of course now that I am writing this it would seem that doing it all analog might be the most elegant. As I said, I have DAC output 0-5V of a few milliamps that would have to be translated to 0..12VDC 8A. I don't know how to get from one to the other... PWM seems to be the easiest for this particular genius.

I entered the schematic into OrCAD PSpice and have been doing battle with... all kinds of quirks. No successful run yet, novice me.

Thanks very much for your response.
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by fritzo@Jul 16 2005, 12:50 AM
OK.
THere has to be a threshold where an OpAmp turns into a voltage comparator and vice versa, I had come to assume they were pretty much interchangeable. Not so!
The LM358 is just what I happen to have (know what & where it is). I have lots of other stuff but I'd have to seriously hunt & identify... a MAJOR part of the cost of things is knowing what it is, and where it is!

Statement of task:
DAC output 0...5VDC of a few milliamps that would have to be translated to  0..12VDC 8A

I plan to drive a peltier junction cooler (12V 8A) with a 1kHz approx/min. pulse train.  (those things don't like to thermally cycle.)  Doing pwm in software would overwhelm the lowly 8051... BUT this one  has a DAC output (0-5V) which I can use to control this fantastic external PWM generator we are about to concoct!   The ULN 2003 (just a darlington) would boost the logic level signal to drive a FET.
I could run the LM358 on the 12V rail as long as the input level (0...5VDC) and output level (0...~5V?) can be satisfied.  I think the 2003 can compensate somewhat for shortcomings like the LM358 not going rail to rail.
This is NOT a high precision problem.
Duty cycle: I'd need OFF, ON, and not too wild in between .

The peltier could be run on 0...12VDC strictly analog fashion. I know less about analog than digital thus this strange excursion into PWM.
See,  the same controller already does PWM on the heater unit (12V 3ohm) with the CPU feeding the 2003 driving the IRFz44 (overkill but works)... at about 200Hz.
Those things I am familiar with.
I have circuits that convert 8 bits to PWM but they require more ports than I have ,plus  glue logic and whatnot.
Of course now that I am writing this it would seem that doing it all analog might be the most elegant. As I said, I have DAC output 0-5V of a few milliamps that would have to be translated to  0..12VDC 8A.  I don't know how to get from one to the other... PWM seems to be the easiest for this particular genius.

I entered the schematic into OrCAD PSpice and have been doing battle with... all kinds of quirks.  No successful run yet, novice me.

Thanks very much for your response.
[post=9101]Quoted post[/post]​
Duty cycle: I'd need OFF, ON, and not too wild in between .
This qualifies as the best description of a circuit I have ever encountered. I love it.

Let me stress that I don't mind putting together a PWM circuit to drive the Peltier device if you prefer that as a solution. I just thought I would put this circuit on the table for you to consider. It seemed to represent a simpler way to skin this electronic cat given the devices that you have lying around your lab.

With your requirements in mind I started thinking about a straight-forward way of driving your Peltier device. I did a little searching around on the Internet to get a clear picture of the resistive characteristics of a Peltier device and it seems to be a fairly low resistance device on the order of an ohm or less.

It occurred to me that you may be able to get away with a simple voltage to current converter. I cobbled together this circuit as a first effort since I am not totally up on the particulars of driving a Peltier device.

For your consideration I offer the following circuit. It includes a very rough Theory of operation to assist you in getting a feel for the circuit's basic operation. The circuit is fairly generic so with a basic grasp of op-amps it should not appear too daunting.

[attachmentid=790] Amended to correct the error noted by fritzo

I think you can get away with applying an adjustable DC current to the Peltier device. With this circuit you will be able to vary the current from 0 to 8 Amps. One thing to look out for is that the IRFZ44 will most likely need a good heatsink attached to it as it is going to need to dissipate around 6 volts time 4 amps or 24 watts under the worse-case scenario. Also I seem to remember that the Peltier Device works more efficiently when a heatsink is attached to it's hot-side. Though I have not shown any decoupling capacitors, it would be a good idea to put a 0.1 ufd rated at 25 volts or more between the positive power terminal on the op-amp and ground just to keep supply noise from getting into the signal path.

Anyway, Let me know what you think. I don't mind putting together a PWM circuit to drive the Peltier device if you prefer that as a solution. I just thought I would put this circuit on the table for you to consider. It seemed to represent a simpler way to skin this electronic cat.

Please don't hesitate to ask any questions you have. I want to make sure you understand that I don't mean to impose this solution on you if you prefer the PWM approach.


Good Luck,
hgmjr
 

fritzo

Joined Jul 14, 2005
5
Originally posted by hgmjr@Jul 17 2005, 09:23 AM
Let me stress that I don't mind putting together a PWM circuit to drive the Peltier device if you prefer that as a solution. I just thought I would put this circuit on the table for you to consider. It seemed to represent a simpler way to skin this electronic cat given the devices that you have lying around your lab.


With your requirements in mind I started thinking about a straight-forward way of driving your Peltier device. I did a little searching around on the Internet to get a clear picture of the resistive characteristics of a Peltier device and it seems to be a fairly low resistance device on the order of an ohm or less.

...
Please don't hesitate to ask any questions you have. I want to make sure you understand that I don't mean to impose this solution on you if you prefer the PWM approach.
Good Luck,
hgmjr
[post=9118]Quoted post[/post]​
Thanks very much - indeed simplicity should win the day. I'm game , I just don't know that much about analog.

In the text accompanying the schematic you wrote:
The voltage developed across resistor R4 feeds into the positive terminal of op-amp U1-2.
The schematic shows it going to the negative terminal U1-2.
I assume this is a typo.

I'm surprised at the apparent driving capability of the OpAmp - much more than my little processor it seems. (which is why I had put a ULN2003 in there)
I'll let you know how I do.
Thank you very much again!
fritzo
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by fritzo@Jul 17 2005, 11:13 PM
Thanks very much - indeed simplicity should win the day. I'm game , I just don't know that much about analog.

In the  text accompanying the schematic you wrote:
The voltage developed across resistor R4 feeds into the positive terminal of op-amp U1-2.
The schematic shows it going to the negative terminal U1-2.
I assume this is a typo.

I'm surprised at the apparent driving capability of the OpAmp - much more than my little processor it seems. (which is why I had put a ULN2003 in there)
I'll let you know how I do.
Thank you very much again!
fritzo
[post=9131]Quoted post[/post]​
Hi Fritzo,

Good catch on that mistake in the text. That's what happens when I get too anxious. I went back to the posting and corrected the mistake.

As for the drive ability of the opamp, the input impedance of the MOSFET is in the megaohm range so not much current is needed to drive the MOSFET. You will notice that the opamp is powered off the +12V power supply. I took that approach to insure that the opamp would have plenty of output voltage swing available to drive the gate of the MOSFET. I looked at the datasheet for the IRFZ44 and I believe I noticed that it is fully on with a gate to source voltage of around 4 volts.

I look forward to your feedback on how well the circuit meets your requirements.

Good Luck,
hgmjr
 

Rowan

Joined Jun 1, 2005
12
hgmjr mate you are a legend. I used two LM393's to create a RGB PWM circuit (one half of the LM393 for the triange wave generation part, then that fed into the other half, and the two comparitors in the other 393 to get Red, Green and Blue LED's to light up at different brightnesses). Using an 8-bit AO chip it means I can get about 2mill different colours (128*128*128) I think. I created a program with a colour dropped on it, can scroll around there and get many different colours (looks best with a diffused RGB LED). I now want to get my hands on some of those LED bars which have about 100 ea Red, Green and Blue LED's in them and try it out!
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by Rowan@Aug 1 2005, 01:06 AM
hgmjr mate you are a legend. I used two LM393's to create a RGB PWM circuit (one half of the LM393 for the triange wave generation part, then that fed into the other half, and the two comparitors in the other 393 to get Red, Green and Blue LED's to light up at different brightnesses). Using an 8-bit AO chip it means I can get about 2mill different colours (128*128*128) I think. I created a program with a colour dropped on it, can scroll around there and get many different colours (looks best with a diffused RGB LED). I now want to get my hands on some of those LED bars which have about 100 ea Red, Green and Blue LED's in them and try it out!
[post=9365]Quoted post[/post]​
Congratulations! I'm glad to hear that your project has turned out to be a resounding success.

Once you get your large LED array operating, maybe you can post a jpeg to show us some examples of the colours it can produce.

Good Luck,
hgmjr
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by Sparky@Aug 1 2005, 09:50 AM
Rowan you are correct, he is a legend! Not only is he a legend, he's an electronic deity.
[post=9370]Quoted post[/post]​
Thanks sparky,

The money in the amount requested has been deposited in the account you gave me. :lol: :lol: :lol:

hgmjr
 

charcle

Joined Mar 12, 2006
4
I need a guide here. Can someone tell me can a 12V PWM circuit generates an output between 0 to 10V. Actually I need to generate about 4 different output between the range. Can I control it using potentiometer or ...Any suggestion or recommendation.Thanks
 

hgmjr

Joined Jan 28, 2005
9,029
Originally posted by charcle@Mar 12 2006, 01:13 PM
I need a guide here. Can someone tell me can a 12V PWM circuit generates an output between 0 to 10V. Actually I need to generate about 4 different output between the range. Can I control it using potentiometer or ...Any suggestion or recommendation.Thanks
[post=14909]Quoted post[/post]​
I am not totally clear on what your requirement is.

Can you provide some additional details on what you are trying to do with the PWM circuit?

hgmjr
 

charcle

Joined Mar 12, 2006
4
Ok..here its all about. A PWM circuit with input 12V @ 24V. Generate voltage between 0 to 10V(output). Here is my question..
1. Can I generate voltage 4V.
2. Can I generate voltaage 7.5V too..(not in the same time)
3. How can I change the voltage output?

Besides from what I learn it can be ctrl by varied VR1.Is it true?
Is there any circuits that could help.
 

Papabravo

Joined Feb 24, 2006
14,702
Originally posted by charcle@Mar 13 2006, 04:13 PM
Ok..here its all about. A PWM circuit with input 12V @ 24V. Generate voltage between 0 to 10V(output). Here is my question..
1. Can I generate voltage 4V.
2. Can I generate voltaage 7.5V too..(not in the same time)
3. How can I change the voltage output?

Besides from what I learn it can be ctrl by varied VR1.Is it true?
Is there any circuits that could help.
[post=14949]Quoted post[/post]​
Let us start with 12 Volts
1. To generate 4 V the duty cycle must be 33.3%
So (1/3)*12 + (2/3)*0 = 4V
2. To generate 7.5 V the duty cycle must be (5/8) or 62.5%
So (5/8)*12 + (3/8)*0 = 7.5V
3. In any PWM scheme changing the ratio of ON time(@12V for example) to OFF time(@0V for example) changes the weighted average of the two states.

Simple Ehhh?
 
Originally posted by ub baker@Apr 12 2005, 01:11 AM
What's the simplest (smallest footprint) way to generate a PWM signal from an analog signal?

I have a circuit that works fine with a 555 and a comparator. However, I need absolutely minimal footprint, and there must be small, dedicated chips out there.

The analog input is 1~4V. The output is approx 50kHz. Preferably the duty cycle goes from 0% to 100%.
[post=6860]Quoted post[/post]​
Hi
You can use DRV10X series from Texas Instruments.

Regards
karunanithi.R
 

charcle

Joined Mar 12, 2006
4
Originally posted by Papabravo@Mar 14 2006, 11:07 AM
Let us start with 12 Volts
1. To generate 4 V the duty cycle must be 33.3%
So (1/3)*12 + (2/3)*0 = 4V
2. To generate 7.5 V the duty cycle must be (5/8) or 62.5%
So (5/8)*12 + (3/8)*0 = 7.5V
3. In any PWM scheme changing the ratio of ON time(@12V for example) to OFF time(@0V for example) changes the weighted average of the two states.

Simple Ehhh?
[post=14953]Quoted post[/post]​
yup..i could understand that..but how could i change the duty cycle??
 
Top