Electronic – Comparator circuit undesirable fluctuations

comparatorhysteresisrail-to-rail

I have designed a comparator with hysteresis and rail to rail operation and my output depicted in figure1.The inputs of the comparator is a sine wave signal and a triangular waveform as shown below.Vdd is 1.2V and the transistor technology is 65nm.I am little confused about the reason for the small undesirable fluctuations as shown with the red arrow in figure 1. Which is the reason of these fluctuations? How I can improve my output PWM signal to look like the figure2.

Also in figure 3,4,5 depicted the comparator circuit with the hysteresis. The input of the left transistor is the sine waveform which shown in figure 1.It's the output of the rail to rail circuit as shown in figure 6. DC analysis is shown in figure8,9,10,11,12.

Furthermore in figure 7 depicted the output sine waveform of the rail to rail circuit with small also fluctuations when I connect the rail to rail amplifier with the hysteresis circuit. Why its appear?

Thanks in advance!

figure 1

enter image description here

figure 2

enter image description here

figure 3

enter image description here

figure 4

enter image description here

figure 5

enter image description here

figure 6

enter image description here

figure 7

enter image description here

figure 8

enter image description here

figure 9

enter image description here

figure 10

enter image description here

figure 11

enter image description here

figure 12

enter image description here

Best Answer

You have hit the phase-reversal problem. Your lower rail input is limited because of the current source there. There are many techniques to fix that. The easiest is to limit the input voltage such that you do not close to the rail that is sensitive. For this you might need to switch your N-FET diff pair into an P-FET diff pair, if you have to work close to GND. Another way is to design a rail to rail input stage.