#14 Transient Simulation Hang on Hysteric Circuits

Stefan Jahn

I have been trying to demonstrate a hysteric circuit.
The basic inverting opamp hooked up backwards version
(noninvering hysteric latch) -- a positive feedback
resistance of 10R from output to +in, a 1R resistance
from an AC source to +in, and -in grounded.

changing ratios of resistance allow the circuit to
incorrectly act as an inverting amplifier for almost a
cycle before it drops to a rail voltage.

changing the ratios to anything useful results in a
simulation hang.

contact info included with simulation


  • Non-Inverting Hysteric Opamp Latch.

  • Logged In: NO

    After a bit more testing, it seems there are some oddball cases:

    R1 = R2 = R3 = 50; V1 = V3 = 0V; V2=Umax=15V

    Set R4 = 5Ohm
    Circuit incorrectly behaves as an inverting amplifier.

    Set R4 = 500 or 5000 Ohm
    Circuit behaves as expected.

    Set R4 = 100 or {400, 250,490} Ohm
    Simulation hangs.

    Set R4 = 500; V1 = 2V or {10V, -15V, 7.5V}
    Simulation Hangs.

    Set R4 = 500; V1 = 15V
    Simulation works as expected.

  • Logged In: NO

    After some extra investigation, I noticed that measuring the
    voltages at the OpAmp's input terminals gives incorrect
    values. noteably, the input terminal follows the input
    voltage, even though the output is held at 15V and the
    current input is 0V. this should put 7.5V on the
    non-inverting terminal. Instead, it is held closer to 0V.

    I glanced at the source code for the opamp model. Is it
    possible that the simulation is trying to force a value to
    appear on the input?

  • Stefan Jahn
    Stefan Jahn

    Logged In: YES

    Hello! Thanks for the report. I was playing around with
    the schematic you sent. When the simulation appear to hang
    you can try changing the transient simulation parameters.
    For R4=100 I used e.g. Start=1ms, Stop=50ms and
    Points=1003. In most cases it is just about changing the
    Points parameter by +/-1 or +/-2. It appears that we
    smaller R4's the hysteresis becomes larger. That means
    with R4=5 it is so large that it appears to be inverting.
    Is this considered a bug anyway?

    Right now I do not know how it all behaves with the current
    (CVS) implementation because there have been some changes.
    We'll see in the next few days.

    Also with "hanging simulations" you can try playing with
    all the other properties of the transient simulation, e.g.
    Integration Method, InitialStep, etc.

  • Logged In: NO

    any positive disturbance on +in should cause the output to
    go positive. with a small resistance in the positive
    feedback path, the +in terminal will be held even stronger
    at +Umax, requiring an even larger input signal to evenually
    pull +in negative.

    Also, as i've mentioned, the voltage at the non inverting
    input is not correct -- I'm farily sure the code is trying
    to force a voltage on both the input and output terminals.

    I have a feeling that a relaxation oscillator would also not
    work. I have made a schematic, but it seems not to simulate.

    Thank you for you're suggestions on changing the number of
    simulation steps. I do enjoy qucs.

  • Logged In: NO

    relaxation oscillator somewhat works. both circuits are
    fairly dependent on start, stop, and step times. from my
    understanding, the high positive feedback case should not
    create an inverting amplifier but rather a very strong latch.

    so it would seem that there are only two issues -- the odd
    simulation times, and the odd transistion of the nonlinear
    circuit into a linear circuit.

  • Stefan Jahn
    Stefan Jahn

    • assigned_to: nobody --> ela
  • Stefan Jahn
    Stefan Jahn

    Logged In: YES

    Hello! I'll think about the "wrong voltage on non-
    inverting input" issue. Probably you can explain it a bit
    more in detail writing to my private email...

    On the other hand I found that when using the Euler
    intergration methods most of the non-convergences (stalling
    simulation) disappear. Just try it...

  • Logged In: NO

    I think the problems stems from the opamps assumptions on
    linearity. In my relaxation oscillator, the circuit
    underwent an erroneous RC decay from 0V to -Umax, then,
    once the simulation couldn't maintain a linear-mode
    interpretation, the circuit began the classic square wave

    Once the circuit entered the oscillations, the voltages on
    all terminals was correct. so it seems that my earlier
    comments about forceing voltages on the inputs might have
    been hasty.

    but there is still the issues of the incorrect fallback to
    a linear operation, and many circuits which exploit the
    opamp's output going to +-Umax will fail with jacobian

  • Frans

    • status: open --> closed
    • Group: --> v1.0_(example)
  • Frans

    this bug is very old. please reopen if still applicable