+ Post New Thread
Results 1 to 15 of 15
  1. #1
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Detection of power failure for ups

    Hi,

    am trying to build a line interactive ups, using arduino as the brain, and at a stage of building the sensors, this one is getting bit complicated, the mains voltage measurement, so I have a bridge rectifier 6v step down, with voltage divider along with a capacitor, 10k-4.7k divider with 47uf cap. this is actually taken from the sine wave inverter circuit using 16f72 that was i think a commercial inverter.
    measuring the voltages has been fine. but the time constant in above circuit is RC, 4.7kx47uf is coming to 0.22sec, i cannot reduce capacitance to an extent that time constant is close to 0.15sec after that lot of ripple, so how does the inverter do a switchover to inverter mode within 4ms ( almost all manufacturers advertise 4ms transfer time for offline inverters) that it is being advertised, i think the action of changeover happens at 4ms, then about 10 to 15ms including relay. the capacitor voltage is not going down as much in 4ms time so how to detect this. there is no missing pulse finder , no zero crossing finder in the commercial circuit.

    thank you

  2. #2
    Super Moderator
    Points: 67,706, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,844
    Helped
    3158 / 3158
    Points
    67,706
    Level
    63

    Re: Detection of power failure for ups

    Hi,

    Use a second order filter:
    Like RC-RC.

    If you choose correct cutoff frrequency, then it will have higher rippke attenuation and faster response time.

    Klaus

    The other way is to use no filter at all, give the unfiltered signal to the ADC, choose higher sampling rate and do the filtering with software.
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.


    1 members found this post helpful.

  3. #3
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Re: Detection of power failure for ups

    thank you, let me check the unfiltered option with software.



    •   AltAdvertisment

        
       

  4. #4
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Re: Detection of power failure for ups

    without capacitor a 4 milli second sample value is quite random, i mean it is expected, ranges from 165 to 220, probably it's fastest way to determine power loss condition i suppose, it works for now, so i can proceed. just wondering how commercial board simple inverter is actually implemented, if anybody know please post.

    thank you



  5. #5
    Full Member level 1
    Points: 2,184, Level: 10
    Achievements:
    7 years registered

    Join Date
    Mar 2010
    Location
    Bangalore
    Posts
    113
    Helped
    32 / 32
    Points
    2,184
    Level
    10

    Re: Detection of power failure for ups

    I have seen a commercial inverter with RC filter but the c value was 0.47MFD. They were claiming computer compatibility but the changeover delay was up to 30MS when i checked with my DSO.

    Why don't you use one more pin and feed the rectified DC directly and then sense from there ? What is your mains sampling time ?

    Or if you can average the 10MS waveform then with single pin also it can be done.


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  6. #6
    Super Moderator
    Points: 49,868, Level: 54

    Join Date
    Apr 2011
    Location
    Minneapolis, Minnesota, USA
    Posts
    12,307
    Helped
    2431 / 2431
    Points
    49,868
    Level
    54

    Re: Detection of power failure for ups

    I agree with post #5, you should monitor the waveform with no capacitor present.

    It might work to provide a fixed DC voltage through a pull-up (or pull-down) resistor. This is your 'alarm' voltage. Normally this fixed voltage is overridden by the waveform coming through the transformer.

    When blackout hits, transformer power drops to zero. Then the fixed voltage is able to come through the resistor, to be detected by your ADC.

    This method is only a concept. It does not consider neighboring low impedances, nor moments when the AC waveform crosses 0V briefly. Therefore it might work better with a rectified DC waveform.



    •   AltAdvertisment

        
       

  7. #7
    Super Moderator
    Points: 49,868, Level: 54

    Join Date
    Apr 2011
    Location
    Minneapolis, Minnesota, USA
    Posts
    12,307
    Helped
    2431 / 2431
    Points
    49,868
    Level
    54

    Re: Detection of power failure for ups

    I constructed a house voltage monitor (with 3914 dot-bar display IC). I included an audible alarm circuit which triggers if the mains AC has a glitch. I tried a few simple circuits. I'm pretty sure it drew from unfiltered AC direct from the secondary. (My notes are buried in a box somewhere.)

    The final project turned out to be more sensitive to glitches than I hoped. Occasionally I hear the beeper sound, even though there is no sign from room lights, nor from my PowerMac screen. (And usually my PowerMac shuts down at a very brief drop in power.)

    I can't be certain it's always due to momentary blackout but it suggests my detector responds so quickly that it could switch a ups in time to keep the computer going.



  8. #8
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Re: Detection of power failure for ups

    Nikhil, I have tried all different combination of RC filter to get fine DC with no lag, that is just impossible for 4ms counting no matter what, at least i could not, if you keep the capacitor at optimum value at average ripple, the capacitor cannot discharge through resistor on time for a voltage reading to be taken, i mean the percent drop of capacitor within 10ms from the discharge curve is too low to determine a power loss. so i have done the way by adding a second bridge rectifier with no capacitor, this has good values within millisecond level, am sure processor can start inverter on time 4ms plus relay turn on time. looking at 15ms max,

    the one with capacitor output am using to calculate actual voltage, and is working fine, the best resolution i can get here is 150 to 250ms. as per the discharge curve seen in scope, it took 250ms to drop from peak to about 10% low. am using this value to determine transformer tapping for stabilizer logic.

    not sure how 30ms changeover is working with commercial inverters. one of the this board thread has a full 16f72 design, it has 47uf capacitor with mains detection.

    capacitor discharge curve calculator is here http://mustcalculate.com/electronics...ddischarge.php



  9. #9
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Re: Detection of power failure for ups

    that's quite sensitive. so powermacs shut down fast, i think computer load also could be factor, a fully loaded pc smps need faster response, than a 30% load.



  10. #10
    Super Moderator
    Points: 67,706, Level: 63
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    13,844
    Helped
    3158 / 3158
    Points
    67,706
    Level
    63

    Re: Detection of power failure for ups

    Hi,

    Fast response gives:
    * sampling rate = 32 x f_mains (or other suitable sampling frequency)
    * a moving_average_filter, width is exactly one mains period time.(just one ADD and one SUBTRACT per sample)
    this gives a constant DC output value. Thus you are able to detect a power fail within a couple of ms.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Re: Detection of power failure for ups

    thanks klaus, will try to do that. not sure what means, one ADD one Subtract per sample.
    next is trying to simplify the mains sensor without a transformer, i know the resistive divider has the floating mains voltage somewhere and there is live neutral swap. anyway not going to bother anyone, i will be doing that. am not against transformer but the signal transformers are smaller, they use thousands of turns, very thin wire for primary, more prone to failure in years like 2 to 5. they run 24/7 too. i have one uv lv cut device that is in a generator control board, failed , and checked, transformer primary is out.



  12. #12
    Full Member level 1
    Points: 2,184, Level: 10
    Achievements:
    7 years registered

    Join Date
    Mar 2010
    Location
    Bangalore
    Posts
    113
    Helped
    32 / 32
    Points
    2,184
    Level
    10

    Re: Detection of power failure for ups

    Why don't you use a differential amplifier with few mega ohms resistor series to the input ? You could avoid the transformer and the hardware will support even if you want to do phase synchronization with the mains. Also the signals will be highly linear and you don't require a second pin. I use the same for my inverters.


    1 members found this post helpful.

  13. #13
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Re: Detection of power failure for ups

    hello Nikhil, i will try to check that, shall get some op amps.



    •   AltAdvertisment

        
       

  14. #14
    Full Member level 1
    Points: 2,184, Level: 10
    Achievements:
    7 years registered

    Join Date
    Mar 2010
    Location
    Bangalore
    Posts
    113
    Helped
    32 / 32
    Points
    2,184
    Level
    10

    Re: Detection of power failure for ups

    You could use LM358 or LM324.



  15. #15
    Newbie level 6
    Points: 131, Level: 1

    Join Date
    Jul 2018
    Posts
    14
    Helped
    0 / 0
    Points
    131
    Level
    1

    Re: Detection of power failure for ups

    yes same ones, need to get them, i had comparators on hand.



--[[ ]]--