Help using a operational amplifer as a 2 position latch circuit

sghioto

Joined Dec 31, 2017
5,379
ak, I would have to disagree with your second paragraph. Parallelling inverters is a common way to increase output. I have used such a circuit to control a small dc motor for years without a problem. The circuit looks clean on a scope and most likely a single pair of inverters could drive the motor if they only run at 4 ma. I do agree the CD40106 would be a better choice, I didn't have one on hand to breadboard so went with the 4069 to test.
Steve G
 
Last edited:

BobaMosfet

Joined Jul 1, 2009
2,110
1. Overdriving the input stage of an opamp does not start when the input voltage exceeds one of the power rails; it starts when the input voltage exceeds the input common mode voltage range, which could be several volts less than the rails. The LM358 input voltage range is asymmetrical - the low end extends below the low rail (*incorrectly* marked GND on the datasheet), while the high end is almost 2 volts less than the high rail. So while pulling the input down to GND is within the input stage's range of linear operation, pulling it up to Vcc exceeds the linear operation range and can cause various results depending on the specific opamp involved, including having the output completely change state. With the resistor on the high side, it limits the current into the input stage during overdrive; that current could be excessive and cause damage to the device.

2. If the output is low and the current limiting resistor is a pullup to Vcc and is equal to the feedback resistor, then the non-inverting input voltage is approx. Vcc/2, same as the inverting input. This will cause ambiguous operation or oscillation. This also is possible if the output is high and the input resistor is to GND, but less likely because the output voltage range does not swing as close to Vcc as it does to GND, so in this case the non-inverting input always is less than Vcc/2.

ak
This is a clever little circuit. The entire operation of the circuit relies upon R3 to override the non-inverting input. Without which it would not sustain an output signal one-way or the other. The inverting input, set at a reference voltage of 500mV, gives the OpAmp a reference to climb toward upon start, otherwise it wouldn't work at all.
 

AnalogKid

Joined Aug 1, 2013
10,986
The entire operation of the circuit relies upon R3 to override the non-inverting input. Without which it would not sustain an output signal one-way or the other. The inverting input, set at a reference voltage of 500mV, gives the OpAmp a reference to climb toward upon start, otherwise it wouldn't work at all.
Referring to the circuit in post #15:
1. R3 does not override anything. As a resistor connected to a low impedance voltage source, it *sets* the non-inverting input voltage level as equal to the output voltage but at a much higher impedance. It is the switches, with their vastly lower resistance, that override it.
2. The inverting input reverence level is 50% of Vcc, not 500 mV.
3. The start-up state of the circuit is random. This is addressed in later posts.

ak
 

AnalogKid

Joined Aug 1, 2013
10,986
Here is a first pass at the 555 version mentioned in post #28. It powers up with both outputs low. Each 555 needs a decoupling capacitor.

Note - CMOS 555's are much better at these long time delay periods than the original bipolar parts. Also, the CMOS output stage does not have the bipolar part's cross conduction current spike.

ak
OpAmp-Latch-4.gif
 
Last edited:

MrAl

Joined Jun 17, 2014
11,389
Hi,

Some cute ideas in this thread i think. I have not been able to read them all yet though.
But what is striking about the op amp circuit is that a more typical latch is made from two cross coupled inverters, but all thta is is a high gain amp with a gain of 1 or more with the feedback connected to the input, which means we have a gain of at least 2 and that constitutes an amplifier that oscillates as a sine modulated by an increasing ramp. That leads the output to saturate either high or low, and that stops the oscillation plus keeps the output in that one state. So it does make up a latch. We just have to force the input to be another value to get the output state to change, which is similar to the way a cross coupled pair of inverters works as a latch.
The only drawback i guess is that we have to use the whole op amp which could be made from 20 transistors. There are multiple transistor IC chips that can be turned into latches also but we have to use at least 2 transistors per latch anyway.
 

AnalogKid

Joined Aug 1, 2013
10,986
The need for a full H bridge eliminates a lot of transistor array parts. My fav is the ULN2003/4. Two sections make an excellent set-reset ff that can sink 1/2 A at 50 V. But no source...

Actually, there's a thought. If the DC source were 24 V for a 12 V motor, then 1.5 K collector loads would source 8 mA at 12 V. A single ULN2804 would get you 4 circuits in one chip.
Hmmm ...

ak
 

BobaMosfet

Joined Jul 1, 2009
2,110
Referring to the circuit in post #15:
1. R3 does not override anything. As a resistor connected to a low impedance voltage source, it *sets* the non-inverting input voltage level as equal to the output voltage but at a much higher impedance. It is the switches, with their vastly lower resistance, that override it.
2. The inverting input reverence level is 50% of Vcc, not 500 mV.
3. The start-up state of the circuit is random. This is addressed in later posts.

ak
1. I see what you're saying. I misused the term 'override'. To be correct, R3 causes a voltage to be continuously fed into the non-inverting input whether or not a button is pressed, otherwise the circuit would not be able to sustain a steady output one way or the other. This can be proven by simply removing R3 altogether, in which case the circuit won't even work until a button is pressed-- and held down.
2. Given your example, it appeared that the non-inverting input was 1VDC, and the inverting input was 0VDC (ground). In which case your voltage divider set the voltage at 50%-- ie. 500mV.
3. The startup state of the circuit can be argued as random because neither button is pressed, however given the fact that the output is not connected to the input in an OpAmp, and that your inverting input is at ground, due to quiescent current it will output a positive signal which is then fedback into the non-inverting input, which sustains the circuit.

Please don't think I'm arguing with you, I'm not. I agree with what you said. I'm just noting specific particulars I see and tested by building the circuit.
 
Last edited:

AnalogKid

Joined Aug 1, 2013
10,986
2. Given your example, it appeared that the non-inverting input was 1VDC, and the inverting input was 0VDC (ground). In which case your voltage divider set the voltage at 50%-- ie. 500mV.
In your response to #2, I'm not sure which schematic you are referring to. None of my schematics have a voltage divider that sets either input to 500 mV.

In the schematics of posts 15 and 29, the inverting input reverence potential is 50% of Vcc and is independent of the non-inverting input or the output state. For a 12 V circuit, the - input sits at 6 V. The + input voltage sits at the saturation voltages of the opamp.

The schematic in post #37 is essentially the same circuit. With bipolar supplies, GND is conveniently at 50% of the total power supply potential without needing any resistors to establish it. I don't see any condition where the + input is at 1 V. The current limiting resistor in series with the switches forms a voltage divider with the feedback resistor, so the + input should be at either +8 V or -8 V (-ish).

Note that in #37 the negative rail is -12 V, so the output pulls the + input way below ground.

ak
 

Thread Starter

sornjs

Joined Dec 29, 2017
29
Thanks again gentlemen. It's been about a year and I am now beginning the process of obtaining components and building some of these units.
I recently found out that after I left the "old" model railroad club they decided to operate more like real railroads.
They decided to operate the "Main Line" using "Dispatch" to control all mainline turnouts (you might call these things "Switches" since they change the direction of a train or maintenance equipment that need to use the railroad to get to where they need to maintain the railroad. It so happens that if the Turnout Control Ground is controlled through a SPDT electrical switch, one of two sets of Push Buttons and Controlled Capacitors can be used (the set selected by the SPDT switch). I don't think I found out about this when I installed the original system.

Care free operation, railroad main line turnouts controlled locally as originally installed. Dispatch control does "not" work",
These main line turnouts may be where two mainlines converge or where turnouts allow movement to storage tracks of many types.

Dispatch operation, railroad main line turnouts "can not" be controlled locally, only by the dispatcher has control.

I noted a question concerning

This same system was not used on or "yards" where train cars and engines are stored since storage may be over turnouts and random or "normal" turnout positions may cause problems to turnouts, tracks or rolling equipment. These model railroad turnouts were controlled with toggle switches. Real railroad yard switches were controlled locally, manually.

Question, I noted where some are concerned if problems may happen if both pushbutton switches are pressed at once.
If an OFF-MOM push button is used. Is the MOM overruled by "fingers"
I think I might need to know what "MOM" means.
In conclusion, Thanks all!!!
 
Last edited:

Thread Starter

sornjs

Joined Dec 29, 2017
29
I believe I messed up.. The club would have had to do more to have Local and Dispatch operations.
I do believe they used the SPDT toggle switch; but, I believe they would have had to install separate circuits as well as run wires from these circuits to the motors. I'll check with the some club members and see if anyone knows what was done.
 

djsfantasi

Joined Apr 11, 2010
9,156
I believe I messed up.. The club would have had to do more to have Local and Dispatch operations.
I do believe they used the SPDT toggle switch; but, I believe they would have had to install separate circuits as well as run wires from these circuits to the motors. I'll check with the some club members and see if anyone knows what was done.
One feature of Circuitron switch motors is that there are several simple ways to wire them. Using a 12V supply, all they need is a DPDT switch and a minimum of two wires to each switch machine. No electronic circuitry is necessary.

There is no issue of “memory” nor startup problems, as the physical switch position resolves both.

With a bipolar supply, ±12V, a SPDT switch is all that you need. You can run a bus for ground to all machines and one control wire from its associated control (toggle) switch.

I’m not sure what advantage you hope to gain by using an electronic solution. Perhaps you could let us know.
 

eetech00

Joined Jun 8, 2013
3,858
Thanks again gentlemen. It's been about a year and I am now beginning the process of obtaining components and building some of these units.
I recently found out that after I left the "old" model railroad club they decided to operate more like real railroads.
They decided to operate the "Main Line" using "Dispatch" to control all mainline turnouts (you might call these things "Switches" since they change the direction of a train or maintenance equipment that need to use the railroad to get to where they need to maintain the railroad. It so happens that if the Turnout Control Ground is controlled through a SPDT electrical switch, one of two sets of Push Buttons and Controlled Capacitors can be used (the set selected by the SPDT switch). I don't think I found out about this when I installed the original system.

Care free operation, railroad main line turnouts controlled locally as originally installed. Dispatch control does "not" work",
These main line turnouts may be where two mainlines converge or where turnouts allow movement to storage tracks of many types.

Dispatch operation, railroad main line turnouts "can not" be controlled locally, only by the dispatcher has control.

I noted a question concerning

This same system was not used on or "yards" where train cars and engines are stored since storage may be over turnouts and random or "normal" turnout positions may cause problems to turnouts, tracks or rolling equipment. These model railroad turnouts were controlled with toggle switches. Real railroad yard switches were controlled locally, manually.

Question, I noted where some are concerned if problems may happen if both pushbutton switches are pressed at once.
If an OFF-MOM push button is used. Is the MOM overruled by "fingers"
I think I might need to know what "MOM" means.
In conclusion, Thanks all!!!
Hi

If you're referring to the circuits in post #65 and #66, theoretically, nothing would happen. The motor is polarity sensitive. So if both switches are pressed at the same time, the same polarity is applied to both motor connections and the motor does not move. However, both circuits rely on Identical charge times for the RC combination that sets the initial state of the timer or logic outputs during power up (or during simultaneous button presses). That might be a problem...

In the context of a pushbutton, MOM = momentary. The button contact opens or closes only while pressed.

eT
 
Last edited:

eetech00

Joined Jun 8, 2013
3,858
I believe I messed up.. The club would have had to do more to have Local and Dispatch operations.
I do believe they used the SPDT toggle switch; but, I believe they would have had to install separate circuits as well as run wires from these circuits to the motors. I'll check with the some club members and see if anyone knows what was done.
Hello,

:confused:Your statements are somewhat confusing.

I think you're using Dispatch synonymous with "remote". But I don't understand the connection (no pun intended:D) with the remaining statements.:(

eT
 

djsfantasi

Joined Apr 11, 2010
9,156
“Local” and “Dispatch” are railroading terms describing modes of train operation.

On a siding, any track switches, other than those connected to the “main line” are often operated locally, by having a train crew member move the switch position to select the track on which the train will move. This is “Local” operation.

“Dispatch” controls the track switch position from a centralized office. One such office is called an Interlocking Tower, where two or more main lines are controlled. Typically, all track switches on the main line are controlled by Dispatch. Railroads do not want trains on the mailing stopping. Hence, the track switches are set in a centralized office. As such, your interpretation that
Dispatch == Remote​
is a fair interpretation. But one might say that all model railroad switch position control is done remotely (with one possible exception, but I’m not going to get into that).
 

eetech00

Joined Jun 8, 2013
3,858
“Local” and “Dispatch” are railroading terms describing modes of train operation.

On a siding, any track switches, other than those connected to the “main line” are often operated locally, by having a train crew member move the switch position to select the track on which the train will move. This is “Local” operation.

“Dispatch” controls the track switch position from a centralized office. One such office is called an Interlocking Tower, where two or more main lines are controlled. Typically, all track switches on the main line are controlled by Dispatch. Railroads do not want trains on the mailing stopping. Hence, the track switches are set in a centralized office. As such, your interpretation that
Dispatch == Remote​
is a fair interpretation. But one might say that all model railroad switch position control is done remotely (with one possible exception, but I’m not going to get into that).
Thank Djsfantasi...

I'm familiar with (real) RR traffic control systems...In my former life, I used to design them..:D
I just didn't understand the relationship of the TS's statements...

eT
 
Top