# I need to vary the duty cycle between 50% and 70% of a PWM signal

So I used a comparator to compare a sawtooth signal and a reference voltage and I obtained the PWM signal at the output of the comparator. My question is what formula can I use to vary the duty cycle of the PWM signal as I like? This is the part of the circuit which adjust the duty cycle of my PWM signal.

I was thinking to use a potentiometer between 2 resistors and to vary the duty cycle by varying the values of the resistances. +/- Vps=+/-15V

Thanks in advance!

• You ask for a formula but then you say you're thinking to use a potentiometer? At any rate, if this is a dynamic case, then simply remove the pot and use the other input as the reference. See this, for example. Commented May 10, 2020 at 21:02
• Is mandatory to use a potentiometer, so that when i set it on '0' the duty cycle is 50% and when i set it on '1' the duty cycle is 70%. Commented May 10, 2020 at 21:07
• What is the range of your sawtooth?
– K H
Commented May 10, 2020 at 21:20
• Vmin=-11.75V and Vmax= 11.25V Commented May 10, 2020 at 21:22

## 1 Answer

• Work out what your sawtooth minimum voltage is. Let's call that Vmin.
• Work out what your sawtooth maximum voltage is. Let's call that Vmax.
• Now work out the voltage for 50% (half-way) between Vmin and Vmax. Let's call that V50.
• Then work out the voltage for 70% between Vmin and Vmax. Let's call that V70.

You've chosen a 1 kΩ pot so now work out the current through that from $$\ I = \frac {V_{max} - V_{min} }{1k} \$$.

Can you work out what value you require for R5 and R6 now so that the ends of the pot are held at the required voltages?

• Comments are not for extended discussion; this conversation has been moved to chat. Commented Jun 12, 2020 at 16:39