MrAl

Joined Jun 17, 2014
11,474
Hello, with symmetrical I mean for example -14V for low and +14V for high, I know that you can do this with extra components because for example with an extra opamp it's simple but I was told that it is possible with one without a transistor or something else, just an opamp and something with a diode and ofc the RC and so on, so I want to find out how.

Cheers
Ok let me try this.
Take a look at the waveforms in the attachment.
In Fig 1 the wave is symmetrical in amplitude but not in time.
In Fig 2 the wave is symmetrical in amplitude but not in time.
In Fig 3 the wave is symmetrical in amplitude AND also symmetrical in time.

Which of these would you say would best describe what you want to produce?

Also, i assume that you can use one op amp and just resistors, capacitors, and diodes then for any waveform.
 

Attachments

Thread Starter

StijnC

Joined Oct 23, 2021
22
Ok let me try this.
Take a look at the waveforms in the attachment.
In Fig 1 the wave is symmetrical in amplitude but not in time.
In Fig 2 the wave is symmetrical in amplitude but not in time.
In Fig 3 the wave is symmetrical in amplitude AND also symmetrical in time.

Which of these would you say would best describe what you want to produce?

Also, i assume that you can use one op amp and just resistors, capacitors, and diodes then for any waveform.
Fig1 is what I'm aiming to do.
 

MrAl

Joined Jun 17, 2014
11,474
Fig1 is what I'm aiming to do.
Oh good that's the easiest.
Here's a hint then:
Note that it is just a PWM oscillator that happens to output a -12 to +12 volt rectangular wave instead of 0 to +12 volts. So it's not really that special.
 

dcbingaman

Joined Jun 30, 2021
1,065
Thanks in advance.
Here is a description of the original circuit with all the gory details. If you want I can provide another description for the other circuit. Hope this helps.

Notice something. If you have U3 at 0 ohms and U2 at either limit you are connecting +15V to -14V from the op amp or vis-versa! This is not a good thing. You probably want to put some resistance in series with U3 to keep that from happening. Also if you get close to the limits the pots will pull a lot of current with a lot of voltage on them causing them to get hot.
 

Attachments

Last edited:

Thread Starter

StijnC

Joined Oct 23, 2021
22
Here is a description of the original circuit with all the gory details. If you want I can provide another description for the other circuit. Hope this helps.

Notice something. If you have U3 at 0 ohms and U2 at either limit you are connecting +15V to -14V from the op amp or vis-versa! This is not a good thing. You probably want to put some resistance in series with U3 to keep that from happening. Also if you get close to the limits the pots will pull a lot of current with a lot of voltage on them causing them to get hot.
Thank you so much, if you have some time, I would love to see an explanation of the other circuit with the two diodes, it does not have to be that well written out if you don't have the time, the working principle of the circuit is enough.

Thanks in advance!
 

Thread Starter

StijnC

Joined Oct 23, 2021
22
Here is a description of the original circuit with all the gory details. If you want I can provide another description for the other circuit. Hope this helps.

Notice something. If you have U3 at 0 ohms and U2 at either limit you are connecting +15V to -14V from the op amp or vis-versa! This is not a good thing. You probably want to put some resistance in series with U3 to keep that from happening. Also if you get close to the limits the pots will pull a lot of current with a lot of voltage on them causing them to get hot.
I've read your file and I still have some questions, how is it that the frequency is changed by one of the two pots? I don't see how they have effect on the RC circuit. Just a short working principle would be great without calculations. Thank you so much!
 

MrAl

Joined Jun 17, 2014
11,474
I've read your file and I still have some questions, how is it that the frequency is changed by one of the two pots? I don't see how they have effect on the RC circuit. Just a short working principle would be great without calculations. Thank you so much!
I dont see any capacitor in that circuit [ok, found later].

But think about this...
[1] Create a fixed frequency RC oscillator to output a rectangular wave.
[2] To make that a fixed frequency PWM oscillator you will note that you have to change the trigger voltage so that you can get a variable pulse width output. Trigger voltage can be varied with a potentiometer.
[3] Then think about how you arranged it to have that given fixed frequency with an R and C. All you have to do then is change the R to change the frequency. Of course a changing R can be had with a another potentiometer.
 
Last edited:

dcbingaman

Joined Jun 30, 2021
1,065
I've read your file and I still have some questions, how is it that the frequency is changed by one of the two pots? I don't see how they have effect on the RC circuit. Just a short working principle would be great without calculations. Thank you so much!
First have U2 at its center. Now consider the fact that U3 can pull the voltage up or down away from 0V. Let us say that U3 is all the way at 20Kohm. It will push and pull the voltage limits less than if it is say 10K. The voltage limits determine how much voltage change is required before switching the capacitor from charging in one direction and charging in the other. If the voltage swing is less, the capacitor takes less time to make that transition and thus a higher frequency. When the voltage change is greater the capacitor has to charge over a larger voltage range which takes longer and reduces the output frequency. If you want to look at this in detail use LTSpice. It will make it easier to see what is going on. Or with your breadboard circuit, look at the voltage on the non-inverting input and the inverting input at the same time. This will show the charging and discharging of the capacitor along with the voltage limits hopping back and forth between two values. Hope this helps.
 

Thread Starter

StijnC

Joined Oct 23, 2021
22
First have U2 at its center. Now consider the fact that U3 can pull the voltage up or down away from 0V. Let us say that U3 is all the way at 20Kohm. It will push and pull the voltage limits less than if it is say 10K. The voltage limits determine how much voltage change is required before switching the capacitor from charging in one direction and charging in the other. If the voltage swing is less, the capacitor takes less time to make that transition and thus a higher frequency. When the voltage change is greater the capacitor has to charge over a larger voltage range which takes longer and reduces the output frequency. If you want to look at this in detail use LTSpice. It will make it easier to see what is going on. Or with your breadboard circuit, look at the voltage on the non-inverting input and the inverting input at the same time. This will show the charging and discharging of the capacitor along with the voltage limits hopping back and forth between two values. Hope this helps.
Ah yes, now I see, thanks! if you could also give a short explanation like this one about the other circuit with the diodes, that would be very kind.

Thanks in advance.
 

MrAl

Joined Jun 17, 2014
11,474
Ah yes, now I see, thanks! if you could also give a short explanation like this one about the other circuit with the diodes, that would be very kind.

Thanks in advance.
If you follow the steps i suggested in a previous post you will actually learn to do these things yourself. it will pay off in the future when you are asked to design something.
It's up to you of course whatever you want to do.
Good luck.
 

dcbingaman

Joined Jun 30, 2021
1,065
Ah yes, now I see, thanks! if you could also give a short explanation like this one about the other circuit with the diodes, that would be very kind.

Thanks in advance.
I will try to send something out on how the second circuit works. I will not be available to do that until Friday. Thanks
 

dcbingaman

Joined Jun 30, 2021
1,065
Ah yes, now I see, thanks! if you could also give a short explanation like this one about the other circuit with the diodes, that would be very kind.

Thanks in advance.
Well, it looks like I should have some time tonight to get this second circuit description in. Here is the second circuit for reference during the circuit operation description::

1635383686922.png
For starters let both potentiometers be at the center of their range. The circuit starts off with C2 not charged. With C2 not charged, negative 15 volts will be on U2 inverting input and a positive voltage will be on the non-inverting input and the output of the opamp will be around 14V.

Because the capacitor is not charged observe that D1 will be forward biased and D2 will be reverse biased. Because the pot is at the center of its range, C2 will start to charge with a time constant of R*10K (half of 20K). It will charge towards 14V minus the diode drop or about 13.3V target voltage. This is not the trip voltage only the target voltage. The trip voltage will be the same as the previous circuit as R8 and R6 act exactly the same as a 20K pot centered at 10K on each leg. Thus it will charge up to 4 2/3 Volts.

When it reaches 4 2/3V the op-amp output will switch to -14V this will reverse bias D1 and forward bias D2. The capacitor will now start to charge toward the negative voltage of -13.3V. The trip voltage now changes to -4 2/3V the capacitor will continue to charge in this direction until it reaches this trip point. Then the process will repeat.

Let us see what changes to U3 does. U3 can vary from 20K to 0K this will make trip voltages ranging from +/-3V to +/-14V. Notice at 14V the capacitor can never reach this trip point of 14V being it is only driven by 13.3V (same applies to the negative rail) and the frequency in that case is zero.

This is similar to the last circuit. If U3 as a high resistance value it will pull the center away from 0V less strongly causing a required change in voltage of the capacitor that is much smaller. This will result is less time and an increase in the PWM frequency. The opposite is also true, the smaller the resistance of U3 the more it will pull the trip point voltages away from 0V and the longer it will take the capacitor to get to each trip point reducing the frequency.

Finally let us look at changes in U4. Say U4 is set at 0.2 then the bottom of U2 will conduct current via D2 during the time the op-amp output is -14V. Notice though the RC value is 10uF times 0.2*20K or 4K. Notice this RC time constant is smaller then when centered and the PWM output will spend less time with D2 on and more time with D1 on, thus changing the PWM output to more positive voltages than negative voltage. The same is true if say U4 is set to 0.8. Now the opposite will happen and the op-amp will spend more time in the negative voltage of -14V than the positive voltage of +14V.

A final observation: The period of the PWM (that is the frequency) will not be effected by the position of U4! Only the duty cycle will be effected by U4. I can prove this mathematically.

Let the total resistance of the pot be equal to k ohms. Then the lower leg resistance is:
kp

and the upper leg resistance is:
k(1-p).

where p is the pot position normalized to 0 to 1.

The time constant for charging and charging in the opposite direction is the sum of both of these which is:

C2*Rupper+C2*Rlower which is mathematically just: C2*kp+C2k(1-p) where p is the pot value from 0 to 1.

Notice: this becomes:

C2*kp + C2k - C2kp after distribution of terms. Notice the first and last term cancel leaving:

Sum Of Time-constants= C2*k where k is just the entire resistance of the potentiometer.

Thus the period and the inverse (the frequency) does not change with changes to U4, only the duty cycle: that is the PWM time.

In summary:
changes in U4 position only change the duty cycle, while change in U3 position only change the frequency.

Hopefully this make sense. If not ask me for more clarification.
:)
 
Last edited:
Top