Advice using opamp with AC

Discussion in 'Analog & Mixed-Signal Design' started by anishkgt, Dec 17, 2017.

  1. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    A little about my circuit, it detects the zero cross on the AC sine wave and triggers two Thyristors in a back-to-back configuration which switches on a MOT(Microwave Oven Transformer) at the peak of the sine wave, which is the typical way to switch on inductive loads to avoid inrush currents. I also have two taps on the secondary to measure the voltage during a weld to calculate the Weld current. All these are initiated at the press of a button which am hoping to automate when the electrodes touch a conductive material like here, nickel strip.

    I have this design below, which i hope somebody could verify. Should i use a dc reference or an AC reference for the opamp.
    CS-1.png
    Thanks !
     
  2. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    I would use a DC Reference of 1/2 VCC and work with that. You have an AC signal going in and you show a single supply op amp so how would the output go negative?

    Ron
     
    anishkgt likes this.
  3. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    The opamp is used as a comparator just to monitor the voltage variation. The idea here is when the secondary is shorted there would be a voltage drop at the primary and when this voltage drops that would disable the optocoupler and trigger the thyristors via MUC like an arduino UNO R3.
     
  4. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    This is your comparator chip. Now look at the applications section of the data sheet with a focus on page 8. Take a look at Table 1. Also take note of the output resistor and why it is there.

    Ron
     
    anishkgt likes this.
  5. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Thanks for that but am a little new to this when using opamps as a comparator hence these specific questions. The voltage at the inverting pin is around1.05Vac and when a voltage drop happens it would come down to 0.5Vac. That would make a difference of 0.55Vac, so hat does this value mean for the opamp ? Basically i would just need the output to read HIGH or LOW.

    I went through page 8 you asked me to and i see a resistor at the output with 5v supply, what is that for ?
    appNote.PNG
     
    Last edited: Dec 17, 2017
  6. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    Starting there and using this data sheet if we look at 8.2 Functional Block Diagram take note of the output pin. The output pin is the collector of a transistor, NPN type with the Emitter going to Ground and the collector just hanging out there. Now way back on page 3 they mention; Open Collector/Drain Output. What that means is that instead of outputting a signal of a specific voltage or current, the output signal is applied to the base of an internal NPN transistor whose collector is externalized (open) on a pin of the IC. The emitter of the transistor is connected internally to the ground pin. So we need what is commonly called a Pull Up resistor tied to the output and VCC or nothing happens.

    Next you may want to give this a read;Home / Operational Amplifiers / Op-amp Comparator as they give a good overview. You can't just use an AC signal as a reference and you just can't run signals which go above and below zero into a single power supply op amp. My guess is this is a continuation of your Spot Weld project and to know when the jaws are closed. You would do better to rectify your open circuit voltage and when the jaws close catch it on the way down.

    Ron
     
  7. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Thank you Ron, Appreciate it.

    Yes its part of my Spotwelder project and there is no such thing as "on the way down." or a jaw as such, just bare wire with copper terminals at the end. Its either closed or open.

    Could you please explain why we should have a rectified voltage and not just the bare AC. I mean its just variation that we are after and moreover the output does not have to go the negative rail just a HIGH (+5v) or a LOW (0v).
     
  8. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    A single-supply comparator, which is what you have, is occasionally required to use AC coupling to detect sine waves or square waves. This is what you are attempting to do. These comparators are often required because of the differences in ground potential between two different modules. Whenever AC coupling is involved in single-supply circuitry, negative voltages become a concern. Excessive negative voltages on comparators or operational amplifiers can cause the comparator to trip erroneously or to become stuck at unpredictable levels and in some cases simply burn up the comparator. Proper highpass filtering and DC offsetting are required for reliable operation.

    Your drawing reflects a reasonably high, something like 17 VAC so I would think about just using a simple cheap full wave bridge to rectify that signal and then just use a divider input into the comparator. However, since this is your project you can try whatever you choose to try. I am merely making suggestions. The idea is you have something like 17 VAC which at some point is going to quickly go away and all you want to do is detect when it goes away.

    Ron
     
  9. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Thanks Ron.

    That is something new so are AC signals rectified or RC filtered always or is it project specific ? Should it be near to pure dc or just having it rectified with a bridge rectifier like this one without any caps be ok ? Would there be enough noticeable change for the op-amp to detect after rectification ?
     
  10. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    Yeah, while I would like a 100 forward voltage the 50 should be fine. I would likely just hang a 100 uF cap out there. Since you are just looking at a voltage going from 17 volts to zero or close to zero that should be fine. Figure you rectify about 17 VAC so you will have a small diode drop on the conducting diodes for alternate half cycles of your AC. Then after the rectifier the cap will charger to the peak value or roughly 15 volts * 1.414 = 21 volts. I would use a 4:1 divider and set your comparator around a 2.5 volt trip level. Since when those jaws close the voltage will pretty much go from yes to no detecting the drop is really not an exacting science, it's there or it isn't. :)

    Ron
     
  11. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    would this be something close to what i should be looking for ? am i missing something more ? The voltage there would be around 1.5vac and on shorting the secondary it would be around 0.5vac. How did you get 17vac ? The inverting pin is only connected to the live pin on the mains the neutral remains un-connected.
    CS.jpg
     
  12. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    Place the bridge on the out of the triac (pin 3) and make the reference for the comparator DC, just place a divider between 5 V and GND. You also do not need 1 Watt resistors and you don't want R37 in there since you are working into a high impedance comparator. All you need is a simple comparator circuit. Finally before actually making a PCB make sure you try everything on a breadboard or similar.

    Ron
     
  13. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Thank you Ron.

    I am trying to simulate the same on LTSpice. i get 1.66v constant dc voltage at the open circuit connected to the mains in series to a MOT but i don't get expected output when i change the ac voltage to 0.5v.
    cs.JPG
    CS_Sim.JPG
     
  14. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    D3 is having a bad time of things as your AC source V3 is across D3.

    Ron
     
  15. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Hmmmm thanks Ron.
    how do I get that resolved ?
     
  16. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Nope no change either or is it something to do with the specific opamp used here ?
    CS_Sim.JPG
     
  17. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    Here is a rough example of what I had in mind. I ran 5 cycles of the AC signal. I added a resistor to discharge the filter cap. I used an LM339 because I had one in my library

    Comparator Test.png

    When Vsignal goes away Vout goes high in the example. You can configure your comparator however you wish. I attached the .asc file.

    Ron
     
  18. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Thank you Ron. Practically when reducing the ac voltage shouldn't we see a change in voltage at the out pin of LM339. I tried reducing the voltage of the ac signal to 1.05 and 0.5 which happens practically but i did not see any change and is 2.5 ref a bit too high as during open circuit the voltage is 1.05 and at short it drops down to 0.5

    Sorry if i am asking too much questions. Just trying to understand.
     
  19. Reloadron

    Distinguished Member

    Jan 15, 2015
    3,513
    1,570
    When the AC voltage is reduced part of the problem is the forward voltage drop of the diodes. The Vf (forward voltage drop) of the diodes is about 1 volt so on alternate half cycles the Vf drop will be about 2 volts (1 V per conducting diode). The way around this would be what is called a Precision Amplifier" or "Precision Rectifier" circuit.. Initially I thought your open circuit AC voltage was much higher. Adding a precision rectifier circuit while not very complex does increase the parts count and complexity a little.

    Ron
     
  20. anishkgt

    Thread Starter Member

    Mar 21, 2017
    179
    7
    Thank you Ron.

    I've been thinking of the same as i had already implemented this in the same project. Just wanted a cost effective one such as just using a bridge and cap and sending that signal to an ADC of an arduino and do the remaining in the code.
     
Loading...