Understanding violation of the common mode voltage range of the input in ZCD - Page 1
Forum section: electronics / projects

author: Houseman
author_rank: Regular Contributor
timestamp: September 16, 2023, 04:40:14 pm
content: Hi forum.So far so good.I am opening a new thread dedicated exclusively for a discussion on a strange behavior of an OPAMP.Previous post here:https://www.eevblog.com/forum/projects/irf540-mosfet-driven-with-pwm-signal-does-not-respond-to-high-inductive-loads/I was asking why a solenoid drive valve was acting strange and finally found that the MOSFET driver was working at 50Hz piloting a 100Hz full wave rectified 24VDC circuit.Here is how the driving circuit works as far as I have correctly understood. First Picture is attached.36Vpp AC (taken from a 230V transformer) is divided by 10 and applied to the first non inverting input of U4 circuit. with Vin4- connected to ground it is essentially a zero cross detection circuit in op-amp used in open loop configuration as a comparator.Vout is the result of every zero transition of the sinusoidal input.It should show a 50Hz 50% duty cycle output square wave in sync with the mains frequency (positive cycle 50% ON - negative cycle 50% OFF) but this doesn't happen (or at least it happens only with certain OPAMPS).LTSpice simulation (attached) shows instead (V4/4out in blue lower plot) a 100Hz 5% duty-cycle square wave in sync with the mains frequency.After snooping around I found that this first stage of the circuit was built around an opamp LM324 with maybe input latched up.Please correct me :Since U4 has Vss connected to ground its output cannot swing negatively. only between 0 and +18Vcc.INPUT POSITIVE WAVEFORM:Vin+ > Vin- => Vout=Vcc.ZERO APPROACHING PHASE:Now Vin+ < Vin- (0V) => Vout=0.INPUT NEGATIVE WAVEFORM:Once Vin+ goes below -0,6V Vcm is -0,3V right? LM324 datasheet says: The input common mode voltage or either input signal voltage should not be allowed to go negative by more than 0.3V).What happens with more negative part of sinewave applied to the input?Why does Vout immediately goes positive again?And it goes, even in simulation than in real circuit. at least with the old LM324.Does during latch up the non inverting input behaves as an inverting one making the OPAMP output going high again?The strange was that using in lab the newer LM324 (revisionB - datasheet minimum input common mode voltage is Vss=0V) or other one (ADA4522 see simulation file) was not presenting such a behaviour.Please help me to understand.Thank You so much, as always

author: magic
author_rank: Super Contributor
timestamp: September 16, 2023, 06:34:59 pm
content: It's called "phase reversal" and it's caused by the differential pair input stage working at too low common mode voltage to properly drive the next stage. The second stage is usually inverting and it will go high if output voltage of the input stage is forced too low. Usually not a problem with IN-, but if IN+ triggers this condition then you get unexpected behavior as observed.Quote from: Houseman on September 16, 2023, 04:40:14 pmLM324/358 input stage is quite complex and specific malfunction may vary from vendor to vendor, maybe even unit to unit.Quote from: Houseman on September 16, 2023, 04:40:14 pmThis is cheating. You could set IN+ to -10V and IN- to +10V and Vcm would be zero by your definition.What really matters is that neither input should go below -300mV if you want the input stage of this chip to operate correctly.

author: Houseman
author_rank: Regular Contributor
timestamp: September 16, 2023, 09:22:35 pm
content: magic, You will never know how deep I appreciate your reply.Quote.That is really what happens on the complete schematic: another inverting comparator this time with Vin+ referenced to Vcc/2.What amazes me among all, is possible that the european manufacturer of the board uses such unpredictable scenario driving the OP-AMP to the limit in order to obtain the exact effect he wants?? (100Hz 5% duty-cycle squarewave output???). Is he playing with fire or is it a practice commonly used in industry? I mean are there other cases that uses phase reversal effect as a regular basis or is it simply a not good rule to follow?Thanks again.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 16, 2023, 11:40:59 pm
content: Quote from: Houseman on September 16, 2023, 09:22:35 pmIt's a bit of both.It is using a known and predictable behaviour of a LM324 input structure to get the behaviour he desires.That's fine, provided the opamps used always behave that way. ie you would need to qualify vendordSomeone who drops in a 'better' opamp may find the circuit no longer works as expected.A part like LM324 is made by many vendors, but care is needed as a part like LM324LVfrom TI, is a low voltage design change, that specifically saysNo Phase Reversal

author: magic
author_rank: Super Contributor
timestamp: September 17, 2023, 06:58:17 am
content: Quote from: PCB.Wiz on September 16, 2023, 11:40:59 pmBe careful, I have heard that TI sometimes lies and their "free from phase reversal" opamps may still phase reverse if you forward bias their internal input protection diodes - exactly as happens in OP's circuit.BTW, the risk is reduced if you include a Schottky diode which limits negative voltage to -300~400mV. It could still be a problem if the chip is hot and forward voltage of its internal diodes is reduced. A more elaborate circuit could limit input voltage to something very close to zero.Quote from: Houseman on September 16, 2023, 09:22:35 pmI'm talking about internals of the chip. In LM324 there are two stages, both inverting. But the first stage stops being inverting when you pull the inputs too low because its output voltage can't go higher than 2 diodes above the lowest of IN+ and IN- and at some point this simply isn't enough.Quote from: Houseman on September 16, 2023, 09:22:35 pmWait, does it mean that you found a commercial product which requires phase reversal to work correctly?It doesn't seem common, and LM324 is perhaps not the best chip to try it. I once tried to understand exactly how phase reversal works in this chip and I remember that it was quite hard to predict what exactly will happen for a few reasons:1. it seemed to depend on whether the Vbe of NPNs or PNPs is higher2. it possibly involves parasitic transistors, not shown on the schematic and not really intended to exist, but nevertheless real3. some but not all vendors include mysterious diodes between GND and both inputs, they may be involved in suppressing effect #2AFAIK no LM324 vendor guarantees that phase reversal won't occur nor that it will.Linear designed the LT1006 which is free of phase reversal down to -1.5V and therefore easy to protect, but more expensive.In simpler opamps like TL072 or RC4558 phase reversal should work quite reliably. The exact threshold may vary from part to part, but simply grounding the noninverting input guarantees a positive output. With some care, I think it should be possible to build logic circuits using TL072 as a NAND gate.

author: Houseman
author_rank: Regular Contributor
timestamp: September 17, 2023, 08:58:40 am
content: Got it. Thanks ypu both!Now I am trying to obtain the same result (5% duty cycle 100Hz squarewave in sync with the 50Hz mains) using the same circuit topology and LM324B.So, letting the op-amp in safe region, I full wave rectified the AC, divided level to obtain 3,6V, set a reference at the negative input to the comparator so that it goes high for the required duty cycle at the bottom of the rectified wave, by using Vcc available reference source suitably divided (around 0,6).Schematic and LTSpice simulation is attached.Apart from the need to add probably a bit of positive feedback for some hysteresis (don't know how), I obtain at the end a "sawtooth" (it's actually exponential) that is not perfectly in sync with the input waveform.It's obviously slightly leading the sine input waveform.Is there a way to delay artificially the right amount of time in order to reach zero at the same moment? sawtooth zero straight line should start in sync with zero crossing of the sine.Thanks

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 17, 2023, 09:00:54 am
content: Quote from: magic on September 17, 2023, 06:58:17 amI did find thishttps://static4.arrow.com/-/media/arrow/files/pdf/1119-on-semiconductor---spice-up-your-projects-with-state-of-the-art-amplifier-and-comparator-models.pdfHere onsemi saysQuote

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 17, 2023, 09:04:50 am
content: Quote from: Houseman on September 17, 2023, 08:58:40 amA small amount of C added across R2 should nudge things right.

author: Houseman
author_rank: Regular Contributor
timestamp: September 17, 2023, 09:55:40 am
content: QuoteMan You are a genious!Of course! I so delay the sinewave adding a cap in between.Thank You so much!