if I wanted to adopt your triangle wave circuit in my own pwm circuit to compare it with a sine how do I increase the frequency to 5000hzOpamp circuits always have a reference voltage that is a bias voltage. In this circuit it is at half the supply voltage so the square-wave and triangle-wave can swing symmetrically with equal up and down amplitudes, using the symmetrical opamp I used.
The 47nF timing capacitor is charged by and is discharged into the 5.6k resistor. The current in the resistor is constant and is determined by the square-wave amplitude provided to the resistor by the first opamp (0V plus 0.7V and the supply voltage minus 0.7V).
My PWM circuit compares the triangle-wave to a DC voltage, not a sine-wave.
My description before wrongly said that the triangle-wave drives the Mosfet gate. Actually, the triangle-wave is compared to a DC voltage and the output of the comparator drives the Mosfet gate.
Also I want to ask you used a voltage devider to create the refremce voltage but I want to ask if I powered it with a 12V and I need to use a 6V reference can one use a 7806 regulator.the reason am asking is in the case of a bubba oscillator where we input half vcc will using a regulator be ok since o use a12V power source or i could use a potentiometer as a voltage divider.