PWM duty cycle circuit - based in input duty cycle

Thread Starter

Meltman

Joined Jan 9, 2017
3
Hello. I've been scouring the web for some time to find a circuit that can assist me in altering a duty cycle inline.

Input - PWM at a 25kHz frequency, variable duty cycle

Output - PWM at 25kHz, with modified by a percentage or amount duty cycle

Basically I'm looking for a way to have something like a pot control the duty cycle so that if it's 80% coming in, I'll reduce it by an amount so the output is 60%, and have this be effective reduction apply to the entire PWM input range.

It would probably be better if it was a multiplier rather than an add/subtract, so that if the input is 5% it's not 0 output.

Any ideas to pull this off simply, without a microcontroller?
 

MrChips

Joined Oct 2, 2009
34,628
Nasty! You will have to measure the incoming duty cycle and output the corresponding modified pulse width.
The second part is easy. It's the first part that's the killer.
 

Thread Starter

Meltman

Joined Jan 9, 2017
3
Yeah, that's correct.

I've not seen anyone do that sort of thing without going to a microcontroller.

That might be my only option. Hopefully some great ideas pop up here though!
 

crutschow

Joined Mar 14, 2008
38,320
How fast does the PWM signal change its duty-cycle?

Not as exact as measuring the duty cycle but you could low-pass filter the PWM input signal to give a analog voltage that varies with the input duty-cycle and use that analog voltage to control the duty-cycle of the output PWM circuit.
Varying the gain of the analog voltage would vary the relative duty-cycles.
Does that sound like an acceptable approach to you?
 

Thread Starter

Meltman

Joined Jan 9, 2017
3
That would actually work just fine - you're saying then use a pot in the middle to adjust the voltage before it hits the second stage of the circuit?

It doesn't have to be super precise.
 

dannyf

Joined Sep 13, 2015
2,197
Stretching a pulse training is fairly easy. One way to do it is via a diode Plus a race network.

Shortening a pulse train in real time is difficult or even impossible. As you don't know ex anti what the duty cycle is.

It is doable ex post, however. For example, convert the pulse train into voltage, and. Then use that vooktage to control the duty cycle of a separate own generator.

A simple MCU can do it.
 

crutschow

Joined Mar 14, 2008
38,320
That would actually work just fine - you're saying then use a pot in the middle to adjust the voltage before it hits the second stage of the circuit?
Yes, a pot could be used to adjust the voltage from the input PWM filtered voltage to the PWM modulator circuit and change the relative PWM duty-cycles.
The output duty-cycle will then change with the input duty-cycle but at a different rate.

How fast does the duty-cycle change?
 
Last edited:

LesJones

Joined Jan 8, 2017
4,511
Here is the basis of an idea. It would have to have the output PWM signal delayed by one cycle of the waveform. (As the falling edge of the output waveform would have had to occurred before the falling edge of the input wave form.) The idea is to have divide by 100 counter (For example) which was in a reset state at the rising edge of the input waveform. While the input waveform was high it would be clocked at 100 times 25Khz (2.5 Mhz) (Counting up) On the falling edge of the incoming waveform its contents would be parallel loaded into a second counter. On the next rising edge of the input waveform the output waveform would be set high and the second counter clocked with a higher frequency counting down until it reached zero at which point the output waveform would be set low. The amount of reduction of the pwm duty cycle would be the ratio of the two frquencies. I have not yet worked out the generation of the control signals. There would be problems if the input duty cycle was close to 100% Using a nice binary number like 128 would be better than 100.

Les.
 
Top