Square wave generator

Thread Starter

om3n

Joined Sep 8, 2023
12
Hi

I'm trying to build a square wave generator with a 1000hz frequency and a variable output voltage of ~10v± that can handle a load of ~100mA

I'm using an op-amp (LM675T) and controlling the output voltage with a potentiometer.

I've got an voltage booster with split powersupply that's got 12V± (turned down to 10.6V atm to power the circut. It can handle 300mA output.


The square wave is nice at full voltage and at lower voltages (0-3v) but everything in between that got an shark fin on the wave.

How do I fix this?

I add a photo of the base circut I'm using

PS. At the images I used an potentiometer to adjust the HZ to see if it made any differences. Ds.

Screenshot_20230909_003202_Chrome.jpg
20230908_231342.jpg20230908_231401.jpg
 
Last edited by a moderator:

KeithWalker

Joined Jul 10, 2017
2,930
You are only showing us a part of the circuit. How is the amplitude control connected and how is the load connected? What are you using for the reference of the oscilloscope that is displaying the wave-forms?
 

WBahn

Joined Mar 31, 2012
29,512
You say that the power supply has been turned down to 10.6 V atm. What does the "atm" mean?

You show a couple of scope shots but you give no indication of where the voltage is being measured or what the difference is between them.

You talk about a potentiometer and how changing it is impacting the performance, but you give no indication of where this potentiometer is in the circuit or how it interacts with the circuit you are showing.

You then talk about using (another?) potentiometer to change the frequency, but don't show how that is connected into the circuit. You also say that you used it to see if it made a difference, but don't give any indication of what difference, if any, it made. Both scope shots are at just over 450 Hz.

Keep in mind that we are not mind readers. We can only go off of the information you provide.

Are you operating the opamp with adequate heat sinking?

Please show the complete schematic for the circuit, as tested, and give more complete information about how you are making the measurements you are showing the results of.
 

ronsimpson

Joined Oct 7, 2019
2,797
Op-amps are not built to be driven to full output. It looks like you are using an audio amplifier.
When the output of an amplifier gets very close to +V or -V the thing gets slow.
When the supply voltage gets too small the amp probably gets slow.
 

WBahn

Joined Mar 31, 2012
29,512
The opamp he is using is intended for high current output (3 A type currents), so if he is only pulling 300 mA, that shouldn't be causing any issues (provided it is adequately heat sunk). It has a no-load supply current of about 18 mA typical but that can be as high as 50 mA, so with about 21 V across the rails, that about 400 mW typical and potentially over 1 W.

I'm concerned that he might be pulling a lot more current than he thinks, if he is using a potentiometer to adjust the output voltage while delivering 300 mA to a load.

It doesn't look like an audio amplifier, but is rather intended for things like servo motor control.
 

Thread Starter

om3n

Joined Sep 8, 2023
12
Sorry for leaving some question marks, here is a complete schematic of the circuit I built.
I couldn't find the right Op-amp, but you get the idea. I found the specs of the split power supply I'm using, and the datasheet said like the picture (but I truly don't know for sure if it's true)

Iv'e just added RV2 to adjust the frequency to see if the behavior is the same.
I also tried different op-amps with the same result.

I know an op-amp isn't built to drive a load, but the LM675T should handle such a small load without a problem, the 100mA is for a brief second then it drops.

Circut.png
 

Attachments

Last edited:

Thread Starter

om3n

Joined Sep 8, 2023
12
You say that the power supply has been turned down to 10.6 V atm. What does the "atm" mean?

You show a couple of scope shots but you give no indication of where the voltage is being measured or what the difference is between them.

You talk about a potentiometer and how changing it is impacting the performance, but you give no indication of where this potentiometer is in the circuit or how it interacts with the circuit you are showing.

You then talk about using (another?) potentiometer to change the frequency, but don't show how that is connected into the circuit. You also say that you used it to see if it made a difference, but don't give any indication of what difference, if any, it made. Both scope shots are at just over 450 Hz.

Keep in mind that we are not mind readers. We can only go off of the information you provide.

Are you operating the opamp with adequate heat sinking?

Please show the complete schematic for the circuit, as tested, and give more complete information about how you are making the measurements you are showing the results of.

The 10.6V "atm" is that I changed a resistor to reduce the original 12v, in the datasheet they refer to this if you want to adjust the output voltage. But I tried with a different power supply with the same behavior.

Yes, I got a heat sink on the op-amp and when I touch it, it's not even warm.
 

michael8

Joined Jan 11, 2015
377
It's going to be hard to get 100mA output current through RV1 (2K)...

If I was doing and only planning on making one or a few my first choice would be to have a separate oscillator from the power output stage.
 

Thread Starter

om3n

Joined Sep 8, 2023
12
It's going to be hard to get 100mA output current through RV1 (2K)...

If I was doing and only planning on making one or a few my first choice would be to have a separate oscillator from the power output stage.

Do you mind explain? I'm pretty novice on this.

Would it be beneficial to have a smaller or bigger trimpot on the output?
 

BobTPH

Joined Jun 5, 2013
8,111
Do you mind explain? I'm pretty novice on this.

Would it be beneficial to have a smaller or bigger trimpot on the output?
It would be better to have no potentiometer on the output. The oscillator should be a separate opamp and the potentiometer should adjust the gain of the power amp stage.

You don’t want 100mA going through the pot. Why? Consider the pot at the midpoint. It is acts like 500Ω, so:

V = I R = 500 x 0.1 = 50V.
 

Thread Starter

om3n

Joined Sep 8, 2023
12
It would be better to have no potentiometer on the output. The oscillator should be a separate opamp and the potentiometer should adjust the gain of the power amp stage.

You don’t want 100mA going through the pot. Why? Consider the pot at the midpoint. It is acts like 500Ω, so:

V = I R = 500 x 0.1 = 50V.
Do you got any reference schematic I can look at to understand better what you mean?

If I understand it correctly, I would use one op amp to generate the frequency and another op amp to controll the output voltage?
 

LowQCab

Joined Nov 6, 2012
3,584
What is a "Voltage-Booster" ?
Your Schematic shows 2 different Current-ratings for the Plus and Minus Supplies,
or, is this the observed-Current draw when the Circuit is running ?
An unbalanced Power-Supply can make the Circuit do strange things.
A "soft" Power-Supply is also undesirable,
having at least 1-Amp of Current available would be a bonus,
especially when using the LM675T Audio-Amp.

Is this a temporary Oscillator for "testing" another device or Circuit ?,
or is this a part of a larger more permanent project ?

Does the Frequency need to be adjustable ?,
and if so, over what Frequency-range ?

Please describe your Load in detail,
is it Capacitive, Inductive, or purely Resistive ?

The LM675T is an Audio-Amplifier with some "semi-funky" Circuit requirements for stable operation,
I would suggest using a better suited Op-Amp for your requirements.
Do You need a suggestion for a different part-number ?
.
.
.
 

BobTPH

Joined Jun 5, 2013
8,111
Do you got any reference schematic I can look at to understand better what you mean?
Use the same circuit you have for the oscillator, but change the pot on the output to 10K.

Then wire the power opamp as a voltage follower with input from the pot.
 

Thread Starter

om3n

Joined Sep 8, 2023
12
What is a "Voltage-Booster" ?
Your Schematic shows 2 different Current-ratings for the Plus and Minus Supplies,
or, is this the observed-Current draw when the Circuit is running ?
An unbalanced Power-Supply can make the Circuit do strange things.
A "soft" Power-Supply is also undesirable,
having at least 1-Amp of Current available would be a bonus,
especially when using the LM675T Audio-Amp.

Is this a temporary Oscillator for "testing" another device or Circuit ?,
or is this a part of a larger more permanent project ?

Does the Frequency need to be adjustable ?,
and if so, over what Frequency-range ?

Please describe your Load in detail,
is it Capacitive, Inductive, or purely Resistive ?

The LM675T is an Audio-Amplifier with some "semi-funky" Circuit requirements for stable operation,
I would suggest using a better suited Op-Amp for your requirements.
Do You need a suggestion for a different part-number ?
.
.
.
The voltage booster with split powersupply got an input of 9v and an output of +12v and -12v
I know it's not that powerful, but I need it to as small as possible.

I have tried to connect two 9 volt batteries so I get a split powersupply, but the square wave looks the same.

This is more of a "showcase" kind of circuit, the product is usually implantated in other products.

The frequency will be fixed at 1khz but the voltage needs to be adjusted from 0-10 or 0-12v

The load is kinda of resistive only, but it keep its charge like an LCD.

I take any suggestions you got!

The circuit needs to be as compact as possible, like a matchbox exkl battery, so I'm trying to keep it as simple as possible and just adjust the voltage with a trimpot.
 

WBahn

Joined Mar 31, 2012
29,512
The 10.6V "atm" is that I changed a resistor to reduce the original 12v, in the datasheet they refer to this if you want to adjust the output voltage. But I tried with a different power supply with the same behavior.

Yes, I got a heat sink on the op-amp and when I touch it, it's not even warm.
I still don't know what "atm" means. When I see that, the only thing that comes to mind is "atmosphere", a unit of pressure.

What resistor did you change?

Provide a link to this data sheet you are talking about.
 

WBahn

Joined Mar 31, 2012
29,512
The circuit needs to be as compact as possible, like a matchbox exkl battery, so I'm trying to keep it as simple as possible and just adjust the voltage with a trimpot.
But you are making the classic mistake of thinking that a voltage divider (which is how you are using that trimpot) can somehow supply arbitrarily large currents.

If you want to pull 300 mA out of that trimpot, then the total current going through it needs to be at least about 10x that, or 3 A. With a 2 kΩ pot, even when the output is 10 V, you are only getting 5 mA of current through the pot. That is the MOST that you can get to the load. That likely explains why your signal seems to work best at the extreme ends of range, because that's when the effective resistance of the pot, as seen by the load, is very low.

Voltage dividers are really only useful for signal processing purposes on low-power signals. They are great for producing things like references.
 

WBahn

Joined Mar 31, 2012
29,512
Not to mention that the opamp he is using can provide at most 20mA.
There's a disconnect between what he says he is using in the physical circuit (the LM675T) and what is in his schematics (a 741 in the first post and a LM833N in a later post). He likely doesn't have the sim model for the opamp he is actually using. His scope traces are for the physical circuit. But unless he gets the right sim model, his sim results are going to be pretty meaningless if he is operating the opamp (in the sim) outside of its specs. There's no telling how well the sim will match to what that opamp will do in the real world, let alone how well it will match up to what some other opamp will actually do.

As others have said, he needs to partition the problem into pieces. Produce a sufficiently clean fixed-frequency, fixed-amplitude square wave as a reference. Then generate a low-power square wave that has adjustable amplitude from that. Then feed that into a power output stage.
 

Thread Starter

om3n

Joined Sep 8, 2023
12
But you are making the classic mistake of thinking that a voltage divider (which is how you are using that trimpot) can somehow supply arbitrarily large currents.

If you want to pull 300 mA out of that trimpot, then the total current going through it needs to be at least about 10x that, or 3 A. With a 2 kΩ pot, even when the output is 10 V, you are only getting 5 mA of current through the pot. That is the MOST that you can get to the load. That likely explains why your signal seems to work best at the extreme ends of range, because that's when the effective resistance of the pot, as seen by the load, is very low.

Voltage dividers are really only useful for signal processing purposes on low-power signals. They are great for producing things like references.
atm = at the moment

This is why i asked here for advice, how would you do to make it work?

Even with dubble 9 volt battery's the output looks the same, and a 9 volt battery got like 500mah, so it should be more then enough for this application.

So how to make it right? an op amp as a voltage follower or?
 

Thread Starter

om3n

Joined Sep 8, 2023
12
There's a disconnect between what he says he is using in the physical circuit (the LM675T) and what is in his schematics (a 741 in the first post and a LM833N in a later post). He likely doesn't have the sim model for the opamp he is actually using. His scope traces are for the physical circuit. But unless he gets the right sim model, his sim results are going to be pretty meaningless if he is operating the opamp (in the sim) outside of its specs. There's no telling how well the sim will match to what that opamp will do in the real world, let alone how well it will match up to what some other opamp will actually do.

As others have said, he needs to partition the problem into pieces. Produce a sufficiently clean fixed-frequency, fixed-amplitude square wave as a reference. Then generate a low-power square wave that has adjustable amplitude from that. Then feed that into a power output stage.

Yes correct

The first post was a picture of the first schematic I found, to make a square wave generator of an op amp and in that guide he was using a LM741, the secound picture is what I draw, but in the sim program I couldn't find the correct op amp

And whatever amp I'm using in the Sim, the output of the Sim looks nothing like the real circuit.

How do I make this right?
Do you mind draw a schematic to illustrate the correct way?
 
Top