dcbingaman

Joined Jun 30, 2021
1,065
Ok.
I got much better performance when I slowed it down by changing the capacitor from 0.1uF to 10uF. It appears the op-amp cannot keep up, so slowing it down helps a lot. Also the second circuit I showed will work better than the first. But even in the second circuit use a 10uF. It does not work well unless the overall frequency is fairly low.
 

Thread Starter

StijnC

Joined Oct 23, 2021
22
Hi I just built the one with the diodes and it seems to work, but the output should for example always be -14V (LOW) to 14V (HIGH). with this the circuit you sent, the average voltage is always zero, when the PWM is 100% for example its now at 0V and should be at 14V. Do you maybe have a solution for that?

Thanks in advance.
 

dcbingaman

Joined Jun 30, 2021
1,065
Hi I just built the one with the diodes and it seems to work, but the output should for example always be -14V (LOW) to 14V (HIGH). with this the circuit you sent, the average voltage is always zero, when the PWM is 100% for example its now at 0V and should be at 14V. Do you maybe have a solution for that?

Thanks in advance.
Do you have R6 and C2 going to the negative supply rail? The first one I sent out did not do that, but it is important. Did you change the capacitor to 10uF?
 

dcbingaman

Joined Jun 30, 2021
1,065
Hi I just built the one with the diodes and it seems to work, but the output should for example always be -14V (LOW) to 14V (HIGH). with this the circuit you sent, the average voltage is always zero, when the PWM is 100% for example its now at 0V and should be at 14V. Do you maybe have a solution for that?

Thanks in advance.
Are you using a 10uF capacitor?
 

dcbingaman

Joined Jun 30, 2021
1,065
Hi I just built the one with the diodes and it seems to work, but the output should for example always be -14V (LOW) to 14V (HIGH). with this the circuit you sent, the average voltage is always zero, when the PWM is 100% for example its now at 0V and should be at 14V. Do you maybe have a solution for that?

Thanks in advance.
Are you sure the negative power input to the op amp is going to the negative 15V supply? A common mistake is have the negative power rail go to ground. I am just asking because I cannot see the breadboard circuit.
 

Thread Starter

StijnC

Joined Oct 23, 2021
22
Okay I found the problem, I'm using a super cheap DSO138 oscilloscope and the button to switch from AC to DC coupling was stuck on AC. Now it shows the correct signal. Thanks a lot!
 

Thread Starter

StijnC

Joined Oct 23, 2021
22
Could you maybe provide a small explanation why this works because I don't get the whole circuit, I also tried using a diode to put the signal on the schmit trigger but that only worked for small changes in duty cycle.

thanks in advance
 
Last edited:

Thread Starter

StijnC

Joined Oct 23, 2021
22
ok, sorry about that, here is one possible solution replace R1 and R2 with a potentiometer wiper going to positive input. Replace R3 with a rheostat. The frequency and duty cycle can be set but it is not a linear relationship.

View attachment 250920
I also want to understand this so could you draw it with potentiometers so I can maybe see the mistake I made.

Thanks in advance
 

Thread Starter

StijnC

Joined Oct 23, 2021
22
I edited my schematic a bit and now I have full range of the duty cycle circuit but the frequency changes with it, what is the cause and solution to that?20211024_120038.jpg
 

Thread Starter

StijnC

Joined Oct 23, 2021
22
ok, sorry about that, here is one possible solution replace R1 and R2 with a potentiometer wiper going to positive input. Replace R3 with a rheostat. The frequency and duty cycle can be set but it is not a linear relationship.

View attachment 250920
I also got this circuit to work now, but it has the same problem as mine, at high and low % duty cycle, the frequency changes with the duty cycle.
 

Ian0

Joined Aug 7, 2020
9,817
That will always be a problem because the time period varies with the reciprocal of resistance. When you have a potentiometer to set the duty cycle the time period will be
\(
t\propto \frac {1}{R}+\frac{1}{R_{pot}-R}
\)
where R is the setting of the potentiometer, and t is not constant as R varies
The only way to achieve independent adjustment of mark-space ratio and frequency is by using a triangle-wave oscillator and a comparator.
 

Alec_t

Joined Sep 17, 2013
14,314
Try your latest circuit (post #34), but without the diode, the 10k resistor and the 30k resistor. If you use the LM358, rather than the poor old 741 op-amp, connect the unused op-amp inverting and non-inverting inputs (not outputs) to ground to avoid noise pick-up.
Hint: If you get into the habit of giving each schematic component a reference designator (e.g. R1, C2 etc), it makes it easier to discuss circuits.
 

dcbingaman

Joined Jun 30, 2021
1,065
I also want to understand this so could you draw it with potentiometers so I can maybe see the mistake I made.

Thanks in advance
Here is the original circuit drawn with potentiometers. I will try to provide a circuit description for both a little later today.

1635085612242.png
 
Last edited:
Top