duty cycle and frequency for PWM generator with 555 timers

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
Hi. I need to design a pwm generator circuit using 555 timers with frequency levels up to tens of kHzs or even more. The problem is that I need to adjust both frequency and duty cycle (separately if possible) with a voltage reference and the famous pin 5 (CV) of the timer has caused lots of confusion for me so far. I couldnt find any source explaining quantitatively how does it affect the duty cycle and/or frequency. thats why I decided to give up on that pin and use two 555s with one operating on astable mode as a trigger generator and the other monostable 555 receives these and outputs at the frequency set by the primary timer. I thought changing the frequency and the duty cycle is now separate problems for separate timers and it would be a bit easier to achieve, taking into account the low time of the astable and the pulse width of the monostable one of course. I tried to set some rules in terms of the component values, time parameters, and SR latch characteristics. These may be wrong as they depend only on intuition and some simulations with LTspice with the internal structure of 555 in mind. My efforts has been desperate so far as both freq and d.cycle depend heavily on the component values and the condition to dictate them with source voltage limits the options, with potentiometers excluded as they require mechanical intervention. I would love to hear about any ideas on voltage based control. Thanks
 

Attachments

crutschow

Joined Mar 14, 2008
38,336
Using a 555 to generate a voltage-controlled, variable duty-cycle is problematic.
The "famous pin 5" allows only a limited and non-linear adjustment of the duty cycle.

Do you have to use just 555's?
A voltage-controlled duty-cycle circuit can be readily made using an LM339 comparator IC.
Would that be of interest to you?

Does the PWM frequency also have to be voltage controlled?
 

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
Using a 555 to generate a voltage-controlled, variable duty-cycle is problematic.
The "famous pin 5" allows only a limited and non-linear adjustment of the duty cycle.

Do you have to use just 555's?
A voltage-controlled duty-cycle circuit can be readily made using an LM339 comparator IC.
Would that be of interest to you?

Does the PWM frequency also have to be voltage controlled?
Yes, the frequency has to be voltage controlled.
No, I agree that the 555 timer is not the best choice for the desired operation, I am working on this as an alternative. The other form includes LTC6992 but again I need to imply voltage dependency and had some problems. Heres that version if you have time to check. https://forum.allaboutcircuits.com/threads/voltage-dependency-for-pwm-generator-frequency.202338/
I have heard about the LM339 comparator IC yet I still have to read about it to work with. Thank you sm.
 

KeithWalker

Joined Jul 10, 2017
3,603
It would be much simpler to use an ATTiny85 chip with two 10K potentiometers. No other components would be needed. The frequency and duty cycle can be set by the software.
 

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
It would be much simpler to use an ATTiny85 chip with two 10K potentiometers. No other components would be needed. The frequency and duty cycle can be set by the software.
I am not really familiar with the chip you mentioned and for this design I am limited to use analog circuitry without any software support. Thanks for the recommendation.
 

crutschow

Joined Mar 14, 2008
38,336
So what is the accuracy, linearity, stability needed for setting the PWM frequency and duty-cycle with voltage controls?
Those values are needed to determine if a particular design is adequate to do the job.
 

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
So what is the accuracy, linearity, stability needed for setting the PWM frequency and duty-cycle with voltage controls?
Those values are needed to determine if a particular design is adequate to do the job.
I am really sorry for poor description of the design. This is for a training project and the specifications was not thoroughly demonstrated to me either. This PWM generator will be used in a braking chopper circuit with an N channel MOSFET. When the source voltage exceed some predetermined treshold PWM generation gets enabled and the frequency & the duty cycle is adjusted accordingly. We will work with 10s and maybe 100s of kHzs. There might be extras like separate enable pins for PWM generation block and setting n upper treshold of duty cycle for pwm generation like %50 and etc. If I correctly refer to "linearity" needed as the closure of voltage frequency dependency model to linearity, I use direct voltage division and referencing through the source so it is determined by the components' behavior I GUESS. About the accuracy, I gave up on a previously designed model composed of opamps and comparators(a traditional square wave generator integrator structure) as the error was up to %4 for frequencies 0-2kHz. So lets say the desired accuracy is +-%2 max for frequency and duty cycle, for the range 10-100kHz.
 

crutschow

Joined Mar 14, 2008
38,336
Below is the LTspice sim of a circuit using a 555 timer with voltage control of both frequency and output duty-cycle.
It uses a voltage-controlled current-mirror to vary the frequency, and a voltage-controlled comparator circuit to adjust the duty-cycle.

The top sim shows the variation in frequency from about 10kHz to 100kHz for a Freq input of 0.3V to 3V (yellow trace).
The bottom sim shows the variation in duty-cycle from 0% to 100% for a DC input of 0 to 3.5V (green trace).

The circuit should be fairly stable as long as the supply voltage is stable, but you may have to test it to see if it meets your accuracy requirements.
If necessary, you may have to add a stable regulator for the 5V supply.

1723049085429.png

1723049293587.png
 
Last edited:

Papabravo

Joined Feb 24, 2006
22,058
I would suggest that you start by building a triangle or sawtooth oscillator.
The basic circuit is charging and discharging a capacitor with a constant current source. If you use the same resistor value "R" for both charging and discharging the waveform will have equal rates of charging and discharging. This implies a symmetrical waveform with equal rise and fall times.
 

crutschow

Joined Mar 14, 2008
38,336
Below is a circuit similar to the one in post #8, but uses the LM339 to generate the sawtooth, eliminating the 555:

The top sim shows the frequency changing from about 10kH to 100kHz for a Freq input of 0 to 3V.
The bottom sim show the PWM duty-cycle varying form 0% to 100% for a DC input of 0V to 3.5V.

Its stability/accuracy is also affected by the V+ supply voltage, so may need a stable regulator for that, if the available supply voltage is not sufficiently stable.

1723059404120.png


1723059237342.png
 
Last edited:

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
Below is a circuit similar to the one in post #8, but uses the LM339 to generate the sawtooth, eliminating the 555:

The top sim shows the frequency changing from about 10kH to 100kHz for a Freq input of 0 to 3V.
The bottom sim show the PWM varying form 0% to 100% for a DC input of 0V to 3.5V.

Its stability/accuracy is also affected by the V+ supply voltage, so may need a stable regulator for that, if the available supply voltage is not sufficiently stable.

View attachment 328764


View attachment 328763
Below is a circuit similar to the one in post #8, but uses the LM339 to generate the sawtooth, eliminating the 555:

The top sim shows the frequency changing from about 10kH to 100kHz for a Freq input of 0 to 3V.
The bottom sim show the PWM varying form 0% to 100% for a DC input of 0V to 3.5V.

Its stability/accuracy is also affected by the V+ supply voltage, so may need a stable regulator for that, if the available supply voltage is not sufficiently stable.

View attachment 328764


View attachment 328763
Thank you so much for your effort. I will try to understand the operation of both versions firstly by learning more about current mirrors. Can you describe how did you set the values to account for the frquency range here and what would change if the source is subject to frequent changes? Asking this because the source voltage may vary and the normal opertion voltage is sth like 28Volts but the PWM generation starts when the measured source voltage exceeds 36V. And lastly can you share the schematics and models please if it is okay for you?
 

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
I would suggest that you start by building a triangle or sawtooth oscillator.
The basic circuit is charging and discharging a capacitor with a constant current source. If you use the same resistor value "R" for both charging and discharging the waveform will have equal rates of charging and discharging. This implies a symmetrical waveform with equal rise and fall times.
I have already created something that relates to what you described. Below is the really simple triangular wave generator that outputs triangular waves of amplitude 10. these are subsequently compared with a reference voltage and pwm duty cycle is adjusted accordingly. The problem is that though I chose opamps with high slew rate and GBP there were always deviation from the desired amplitude by amounts up to +-0.5V and sometimes even more. Not even mentioning the distortion of the triangular waveform at some periodically following points. Selecting the comparator and opamps for integrator and summer is also an issue(tried using 365 and a few more). AND most importantly the frequency is not voltage dependent here. These were the main reasons for my search for an IC based solution.
 

Attachments

crutschow

Joined Mar 14, 2008
38,336
I will try to understand the operation of both versions firstly by learning more about current mirrors.
A current-mirror is fairly simple in operation.
In the Post #11 circuit, a constant-current is generated by the op amp proportional to the input voltage which goes through Q1. It has its base connected to the collector so it looks like a diode.
This generates a base-emitter voltage that is proportional to its collector current.
This is reflected to the Q2 base-emitter junction which then causes the same value of current to flow through it, to provide the charging current for the frequency determining capacitor C1..
Can you describe how did you set the values to account for the frquency range here and what would change if the source is subject to frequent changes?
I just experimented with the values to get the desired frequency range.
The frequency is basically determined by how long it takes for the current-mirror current to charge C1 to about 2/3 of the supply voltage.
the source voltage may vary and the normal opertion voltage is sth like 28Volts but the PWM generation starts when the measured source voltage exceeds 36V.
For a varying source voltage, I would use a regulator to generate a stable 5V for the circuit, since it only requires a few mA of current.
The regulator could be the common LM317H.

Attached is the LTspice file for the circuit.
Tell me if you need any models for that.
 

Attachments

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
A current-mirror is fairly simple in operation.
In the Post #11 circuit, a constant-current is generated by the op amp proportional to the input voltage which goes through Q1. It has its base connected to the collector so it looks like a diode.
This generates a base-emitter voltage that is proportional to its collector current.
This is reflected to the Q2 base-emitter junction which then causes the same value of current to flow through it, to provide the charging current for the frequency determining capacitor C1..
I just experimented with the values to get the desired frequency range.
The frequency is basically determined by how long it takes for the current-mirror current to charge C1 to about 2/3 of the supply voltage.

For a varying source voltage, I would use a regulator to generate a stable 5V for the circuit, since it only requires a few mA of current.
The regulator could be the common LM317H.

Attached is the LTspice file for the circuit.
Tell me if you need any models for that.
I need both opamp models for the Post #11 circuit. Also, what is the difference between the NE555 and the one you used, NE555-1? The only 555 I could find in LTspice was labeled NE555. Lastly, can you give some feedback on my other applicaiton using LTC6992 and possibly 6990 and 6994? The circuits you designed using 555 and BJTs look amazing and would do the trick but I feel like in case I need a more compact form to make it more realizable/printable those LTC labeled ICs will better perform in temperature tests with high frequencies. https://forum.allaboutcircuits.com/threads/voltage-dependency-for-pwm-generator-frequency.202338/ here is the link if you have the time for it. Thank you so much.
 

crutschow

Joined Mar 14, 2008
38,336
I feel like in case I need a more compact form to make it more realizable/printable those LTC labeled ICs will better perform in temperature tests with high frequencies.
So why are you messing with 555 and other circuits then?

I will look at your other post with the LTC6992.
 
Last edited:

Thread Starter

pumpkinpie

Joined Aug 7, 2024
37
So why are you messing with 555 and other circuits then?
I wanted to have an alternative in case the other circuitry doesnt operate in the desired way. Also hoped to gain some familiarity. Thank you for your time again.
I will look at you other post with the LTC6992.
Thanks. I am working on a 2 mode circuit but I really need to merge the frequency and duty cycle adjustment into one operation mode.
 
Top