Electronic – Unity-gain closed loop Miller OPAMP fails to follow the input after a few microseconds

amplifierfeedbackoperational-amplifier

I implemented a Miller OPAMP. After I have checked it reaches the desired gain and swing, I put it into the simplest form of closed loop with UNITY negative feedback. The schematic is as follows:

enter image description here

As you can see, the loop is simply a direct negative feedback. I expect the overall gain to be 1. So I am expecting the output signal is exactly the same one as the input sine. However, after a period of time, it fails. Really strange as it can follow in the few microseconds, but fail later.

enter image description here

The green curve that is covered and thus invisible is my input; the blue one is the output.

Where goes wrong and how may I fix it?

Best Answer

If the simulation suddenly changes state like this, it is probably due to numerical noise, but the design has a "resonance point". Numerical noise is really small, but it can still affect the simulation if the design has issues.

You would probably see this kind of thing in reality, if you could physically design the circuit with zero capacitance (which is impossible). A pcb naturally acts as a low pass filter for high frequency noise.

The numerical noise can be reduced by increasing cshunt (a small capacitor tied to every node, adding a capacitor to the output (thus creating a low pass filter and reducing the bandwidth of the circuit and noise).

It is really useful to understand real world parasitics and know when and where to use them in your simulation. Large resistors (<100M) can be added to simulate air, and increase numerical stability. Capacitors on the order of pF's can be added from signal to ground to simulate the capacitance of a PCB. Inductors can be added to simulate wire or pcb traces.