Combination of astable multi vibrator, Integrator, Comparator gives the PWM circuit. But if the frequency of operation is to be variable, then it becomes difficult, as it is necessary to change the knobs of frequency adjustment and resistors of the integrator to be adjusted to match with input frequency in addition to the duty cycle knob.
Op-Amp as Duty Cycle Controller
To simplify this requirement, Voltage Controlled Oscillator is used as above. This is provided by the manufacturer in the data sheet of LM 324 IC. By making some modifications and adding a few components, we can design a PWM circuit for motor speed control or Light brightness control etc.
Simulation of Op-Amp as Duty Cycle Controller
The square wave whose frequency can be adjusted with the frequency knob, is converted to a triangular wave. The Duty cycle adjusting knob is used to vary the duty cycle (which is Red line on the triangular wave form in the above image).
When the instantaneous triangular wave voltage is lesser than the dc voltage of duty cycle knob, the output is in High state and vice versa. This can be reversed by reversing the V+ and V- inputs of the output stage Op-Amp.