Inverting Op Amp Circuit Troubles

Thread Starter

suprasteve

Joined Sep 22, 2018
6
Hi Everyone,

This is my first project I've built the circuit and it's not working as I expected and have reached the point where I need some help.

Long story short, I am trying to build a circuit that will take a signal (hopefully either square or sine) with zero crossing of +/-6V and invert it (gain of -1). This is for an automotive application where my input is coming from a speed converter box that adjusts frequency and does level shifting to a zero crossing signal of a factory square wave signal.
I bought some components in and tried them out:

LT1057CN8 Op-Amp (+/-10V~18V) : http://www.analog.com/media/en/technical-documentation/data-sheets/10578fd.pdf
RD-0512D DC-DC Converter (+5V to +/-12V) https://www.recom-power.com/pdf/Econoline/RD.pdf
USB Phone charger to supply +5V to the DC-DC Converter.
two 1k Ohm resistors

setup and circuit looked like this:



First time I tried this it looked like no inversion happened but the output signal changed to an odd shaped square wave with about +1V and -3V instead of the +/-5V input. The negative side of the square wave developed an upward slope as well. This probably OK as the ECU I am trying to supply should only care about zero crossings but I was expecting an inversion...

The first time I checked my DC-DC output it showed +2V and -22V output. I did some more troubheshooting, tried switching + and - on the op amp etc. and seemed to make things worse. Now my DC-DC converter seems to just be putting out +24V. and 0V on the V- pin.

Does this circuit look OK to you?
Am I missing some components?
Does this sound like my DC-DC or other converter has been damaged?

Any help (in layman's terms!) would be greatly appreciated!
 

ebp

Joined Feb 8, 2018
2,332
The DC-DC converter is an isolated type. The common for the output is pin 5 - this is the common or "ground" for your op amp circuit. The input and output signals will be relative to this pin. Pin 2 is the negative of the input. It is isolated from pin 5, but there is no problem with connecting the two together as long as that doesn't conflict with something elsewhere that isn't shown.
 

Ylli

Joined Nov 13, 2015
1,086
Do you have pin 5 of the DC/DC converter (output common) connected to ground?

The breadboard wiring does not match the schematic. The op amp pin 3 is not grounded on the breadboard, and Rin is connected in parallel with Rf. We can talk about the proper way to terminate the unused op amp section later.
 

ebp

Joined Feb 8, 2018
2,332
You should always use "decoupling" capacitors, also called "bypass" capacitors for the power supplies. A commonly used value is 0.1 µF (100 nF). Ceramic types are best for this purpose. There should be one from the positive supply pin of the amp to circuit common and another from the negative supply pin to common. The connections should be as short as possible. On a breadboard, if you use one of the bus strips for common, try to place one cap between the 5-hole strip for V+ for the amp to the common strip and the other, even if it bridges across the top of the IC, from V- to the common strip (or vice versa, as best suits). With low-frequency circuits you can usually get away with using a power strip on each edge of the breadboard for common and connect them together with a short, direct wire.
 

Thread Starter

suprasteve

Joined Sep 22, 2018
6
Do you have pin 5 of the DC/DC converter (output common) connected to ground?
Ahh no. Nothing is connected to Pin 5 right now. it's floating.

...The op amp pin 3 is not grounded on the breadboard...
I see that in the picture now too. sometime after I took this picture, I connected pin 3 of the op amp to the upper right power strip negative. This strip was connected to +ve and -ve wires of the +5V USB power supply. Sorry, I had forgotten about that! but based on the other comments it sounds like this pin 3 should be connected to the COM pin of my power supply, not negative of the input?

Rin is connected in parallel with Rf.
I have RIn joining the positive rail on the bottom left corner (that I am connecting signal input to) to b5. Rf connects c5 to c4-which should be Op-amp pin 1...the output? I think that's the way it's supposed to be?

The DC-DC converter is an isolated type. The common for the output is pin 5 - this is the common or "ground" for your op amp circuit. The input and output signals will be relative to this pin. Pin 2 is the negative of the input. It is isolated from pin 5, but there is no problem with connecting the two together as long as that doesn't conflict with something elsewhere that isn't shown.
ok...think I am starting to get it. please see my replies above - COM pin connected to pin 3 of the OP amp?

You should always use "decoupling" capacitors, also called "bypass" capacitors for the power supplies. A commonly used value is 0.1 µF (100 nF). Ceramic types are best for this purpose. There should be one from the positive supply pin of the amp to circuit common and another from the negative supply pin to common. The connections should be as short as possible. On a breadboard, if you use one of the bus strips for common, try to place one cap between the 5-hole strip for V+ for the amp to the common strip and the other, even if it bridges across the top of the IC, from V- to the common strip (or vice versa, as best suits). With low-frequency circuits you can usually get away with using a power strip on each edge of the breadboard for common and connect them together with a short, direct wire.
Ok I'll see if I can get ahold of one - I assume the main function of this is to clean up the signal or is there another purpose?

I think somewhat good news... before reading these messages I tried the circuit again and got some different results. Apparantly testing the DC-DC by itself with no load produces weird results.. just a few minutes ago, with an active input signal I was seeing I think somewhat good news:

DC supply + output: +10 with RMS of 15.62
DC supply - Output: -14.91 wit hRMS of 14.91

both the signal input and signal output were showing -2.1VDC with RMS of 5.36. They were both in phase together.


Thanks for the replies so far!
 

ebp

Joined Feb 8, 2018
2,332
The output-side COM pin of the DC-DC converter must connect to "ground" for your amplifier circuit. The non-inverting input of the amp goes to ground and the input and output signals are "referred" to ground, so the ground of the speed sensor box connects to the ground of the amplifier circuit and the output is measured between the amp circuit ground and the output pin. Some people prefer to call it "common" rather than "ground" to distinguish between some that is just local and something connected to earth ground, but just calling it ground is extremely common.

You circuit will work without the decoupling capacitors, but there may be some aberrations around the output transitions. The caps act as local charge reservoirs that help to overcome the inductance of the power supply wiring. Some things perform very badly if they don't have local decoupling,

some resources at TI
http://www.ti.com/analog-circuit/circuit-cookbook.html
http://www.ti.com/lit/slyt701 (covers lots of commonly encountered problems)
Unfortunately IC Op Amps for Everyone, edited by someone who is an AAC member (but doesn't seem to show up very often) appears to be no longer available at TI, I suspect because some of the devices used in the circuits in it are obsolescent. It is a very good reference and I think can still be found on the web. It was a free download when it was available, so I don't imagine TI will get bent out of shape if you get a copy from elsewhere.

You can also find lots of really good info at the Analog Devices website
 

Thread Starter

suprasteve

Joined Sep 22, 2018
6
Thank you for the information

I just tied the op amp Pin 3 and COM of the DC-DC together and connected them to the speed converter box's ground (which is also my car's chassis ground).

The results are in the pictures attached. The last picture shows both channels overlaid. and how closely they line up - nearly identical. Both input and output look the same, so it's not inverting. I tried flipping the op amp - and + IN A to see if i had made a mistake but the results are the same. Is it possible I have damaged the DC-DC or amp in my process? Is there anything else I can check?

Always the chance I am using the scope wrong. I would assume the scope would not automatically shift the signal on the x axis...
 

Attachments

Last edited:

ebp

Joined Feb 8, 2018
2,332
I don't understand what the black wires hanging off each end of the breadboard are for. It looks like you have the resistor that should go to the input and the output of the amp connected to the same power strip. Usually the lengthwise strips are continuous from one end to the other, but some do have a gap in the middle. Since the red and blue lines don't have gaps, I assume there is no electrical gap. I would discourage use of those strips for anything other than power supply connections. It is [EDIT - had left out the not] not wrong to use them for other things, just tends to make things a little more error prone.
 
Last edited:

AlbertHall

Joined Jun 4, 2014
12,345
Always the chance I am using the scope wrong. I would assume the scope would not automatically shift the signal on the x axis...
If you are only using one channel of the scope it absolutely will put the edges of the signals in the same place. That's what the trigger circuit is designed to do.

You need to use both channels, one for the input and one for the output, in order to see the time relationship of the two signals.
 

crutschow

Joined Mar 14, 2008
34,281
You need to use both channels, one for the input and one for the output, in order to see the time relationship of the two signals.
Alternatively, you could connect the Trigger input of the 'scope to the input signal (and set the 'scope to trigger from that).
Then you will see the difference between the input and the output.
 

Thread Starter

suprasteve

Joined Sep 22, 2018
6
I don't understand what the black wires hanging off each end of the breadboard are for. It looks like you have the resistor that should go to the input and the output of the amp connected to the same power strip. Usually the lengthwise strips are continuous from one end to the other, but some do have a gap in the middle. Since the red and blue lines don't have gaps, I assume there is no electrical gap. I would discourage use of those strips for anything other than power supply connections. It is [EDIT - had left out the not] not wrong to use them for other things, just tends to make things a little more error prone.
You are right, this is a major mistake. I had assumed the odd pin spacing meant that each block was not connected...but the whole strip is connected! The idea with the wires hanging off the breadboard was the lower left would be my input signal and the lower right would be the inverted signal output. but in reality I was connecting the amp signal input (prior to any resistors) directly to the amp and output.

If you are only using one channel of the scope it absolutely will put the edges of the signals in the same place. That's what the trigger circuit is designed to do.

You need to use both channels, one for the input and one for the output, in order to see the time relationship of the two signals.
I am using both channels, should be ok. Just can't seem to figure out how to use the "meter" function that gives me clear readings on DC and RMS on channel B; so I have been doing probing with channel A only. I can overlay both channels with the "scope" function.

I tried using the other side of the op amp chip last night (not knowing that the power strips were continuous!) and believe I friedthe DC-DC in the process (and smells like it too!). it's only putting out +0.8V and -1.7V despite a solid 5.0V supply - not even close to the operating range of the op amp.

I'll order up new components and add some 0.1 µF ceramic capacitors for decoupling.

Ebp, I see in that TI documentation some notes on how to properly deal with unused op amps too. This is probably what Ylli was talking about earlier. I will incorporate that into the update. Once i get the new parts, I'll post an update of the new schematic and broadboard - maybe get a nod of approval from one or two of you before powering up the first time!

Although a setback, you all have taught me so much already. Thank you so much for the support!
 

Thread Starter

suprasteve

Joined Sep 22, 2018
6
Success!

I straightened out the wiring as you all had suggested, installed a fresh DC-DC and I added two 1.69k resistors to the output so the dc-dc is putting out a minimum of 10% load like the spec sheet suggests. The result is a nicely inverted signal!

My quick road test showed the problem that caused me to start this project isn't fixed, but it's a start. thanks everyone!
 

Attachments

ebp

Joined Feb 8, 2018
2,332
Well, a happy midpoint, if not yet a happy ending. Electronics is full of what I call hooks, waiting to snag you - hence publications like the 32 little lessons things from TI. You did OK for for a first project!

Here's another ap note, quite old now, from a pretty big name in analog IC design
An IC Amplifier User’s Guide to Decoupling, Grounding, and Making Things Go Right for a Change
By Paul Brokaw
www.analog.com/media/en/technical-documentation/application-notes/AN-202.pdf
 
Top