Short circuit problem in ATS design [schematic provided] - Page 1
Forum section: electronics / projects

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 01:01:04 am
content: hi everyone... I work on an automatic transfer switch project and I nearly completed everything.simulation in Proteus works nicely, PIC program functions well... BUT when we wired the circuit some kinda short circuit happened!Schematic is in the attachments.- in schematic, there are 2 identical circuits (MOC+TRIAC connected to an AC source) and there's a PIC controller to make the triggering.- the trial made manually so no chance of triggering both triacs.- both circuits behave greatly alone.- every source is connected to 4-diodes full-bridge rectifier + 100uF/400v filtering cap + a voltage divider for measurement using PIC. Those work great alone.Now, when we connected all the circuit... the +5v charger for the MOC low-voltage side power source got burned! and a triac blown up!I'm not sure what actually caused this thing... someone of the group connected the filtering cap backwards and this burned the whole 4 diodes (peak-inverse-voltage exceeded?) and so I guessed that this was the cause of the whole problem cuz I wasn't around when they tried it.^is this the true cause of it?gimme any recommendation you have... any AN... anything.I'm in a hurry now cuz we have about 1 month for this problem and the documentation.thanks a lot.

author: amspire
author_rank: Super Contributor
timestamp: April 06, 2013, 04:19:48 am
content: Quote from: VEGETA on April 06, 2013, 01:01:04 amSource for what? I hope your AC source does not include a rectifier and capacitor.Is it the power supply for the PIC that just divided down from rectified mains? That means the PIC is dangerously live.If that is the case, I hope the pic wasn't connected to your PC via Pickit or any other mains powered device at the time you powered it up. Earthing a circuit directly powered from the mains is a recipe for blowing things up.

author: Niklas
author_rank: Frequent Contributor
timestamp: April 06, 2013, 05:45:14 am
content: What is the voltage on those two AC sources on the right hand side of the schematics?Are they 230/240 volts?Same phase or separate phases?Triac ratings? Sensitive trigger?Does the circuit work until you trigger either of the MOCs and then fails instantly?I hope that the 5 V side ground is not the same as the neutral on the AC side. Use separate symbols and skip the ground symbol on the AC side if it is not PE. I created some extra power ports, named L1, L2, L3 and N, to use in a three phase supplied project.The blown diodes were probably caused by high current due to wrong capacitor polarity instead of reverse voltage.Some snubber cap+resistor, both in series, connected in parallell with the triac might be needed to prevent false triggering. 100nF X2-rated and a 330 ohms resistor as a starting point.

author: David_AVD
author_rank: Super Contributor
timestamp: April 06, 2013, 06:33:45 am
content: This seems to be the 4th thread about the same project.https://www.eevblog.com/forum/projects/triac-switching-using-moc-driver-issue-with-pic/https://www.eevblog.com/forum/projects/automatic-transfer-switch-design-with-schematics-and-code/https://www.eevblog.com/forum/microcontrollers/rms-voltage-calculation-usin-pic16f877a-with-c-code/

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 01:06:18 pm
content: other 3 threads where mine but they were talking about code issue, not hardware.Quote from: Niklas on April 06, 2013, 05:45:14 am1/2- they should be about 220v rms to be enabled. and source 1 is the primary.3- about phase... they are single phase and we don't care about sync. or other things but we use Zero-Crossing MOCs.4- Triac can handle such ratings, it's BT138/BT139... sensitive? when voltage reaches a certain threshold say 200v rms, PIC will activate the source and source1 is the primary in case of both above threshold... ALL these functions works well in software and simulation.5- about the circuit... one source circuit works fine but when we connect both of them at the same load (lamp) and activate only 1 MOC (i.e. one source, the other is open circuit) the short happens... and this is manually triggered so no software issue.I'm going to do another test today, any recommendations I should take?Blown diodes: yes, you are correct. I figured out that it's because of reverse polarity but i was confusing about current or voltage.about snubbing: I don't see that they are needed, anyway, it's not gonna be fast triggering or so... and it worked well without it when 1 circuit at a time.Quotethe ac source is connected to a rectifier and a capacitor and a voltage divider as i described, even if it's not in the schematics.we didn't connect the PIC yet.I don't see why it's so dangerous... PIC will read about 3.8v most of the time and it will rarely exceed this value, even if there was a sudden increase in the means voltage.the voltage divider is 115k and 1.47k which gives about 3.8v when 311v-peak (220v rms) and it will output 5v only when means voltage be 280v rms which is totally impossible.about grounding... I only put that ground between the 2 sources for simulation to run properly._______when we try the circuit today, what steps should we do? we are using breadboards currently and only 1 source available.Important note: In lab, when my partners tried all above, they used a labvolt kit which have a 3-phase AC source... they connected 1 variable voltage source to source1 and a constant voltage source for source2 but from the same kit... Is that correct?

author: Strada916
author_rank: Frequent Contributor
timestamp: April 06, 2013, 02:58:23 pm
content: Looks like the triacs are get triggers from each other through the bottom 330Ohm resistors. Build the circuit test it with low voltages like a transformer as a AC source like 12VACIs the load purely resistive? if so no need for a snuber unless you are going to connect some sort of reactive load ie (capacitive or inductive)

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 03:36:02 pm
content: Quote from: Strada916 on April 06, 2013, 02:58:23 pmwell, you seem to have a good note.If BOTH triacs get triggered always then it's gonna be a short right? here, the 2 sources will be active at the same time and at the same load... what exactly is going to happen? this is the problem right?so, if I moved the bottom 330ohm to be connected between the Triac gate AND the Neutral of the source (i.e, not from the load to gate) will it gonna work properly?we don't have any transformers or so right now...

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 03:54:56 pm
content: I tried the attached schematic here in Proteus and it worked well, so I don't know what to do.Strada916 said both triacs get triggered together and Proteus says they aren't... ^_^

author: Strada916
author_rank: Frequent Contributor
timestamp: April 06, 2013, 04:49:04 pm
content: experimenting is the only way to learn. remove the two 330ohm resistors connecting to load and triac see what happens. Simulation is based on math model not always correct. experiment. experiment .

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 04:51:49 pm
content: Quote from: Strada916 on April 06, 2013, 04:49:04 pmbut in the datasheet the 330ohm exists.I tried to remove it in simulations but didn't work (got slow).

author: Niklas
author_rank: Frequent Contributor
timestamp: April 06, 2013, 05:25:57 pm
content: As Strada916 said about simulations, they are only as good as their models. Real components are far from ideal and together with wiring and circuit board, they situation is not exactly improved. I would advice you to use snubbers across the triacs and perhaps also a plastic film capacitor, X2-rated and a couple of uFs, between L and N on the supply side of the triac. Real world line voltage contains transients and you have to deal with it.What happens with the voltages across the triac that you are not triggering? Phase difference between the two supplies will cause differencies in voltage and when you trigger one triac, the load voltage will jump from being N to being L.Also consider the switching sequence. Can you guarantee that triac 1 is fully switched off before you trigger triac 2? The zero crossing functionality allows triggering within a certain voltage window, about 20 Volt I think. Worst case is when you have to wait for the first triac to shut off in combination with just missing the triggering window for triac 2. That will result in a missing half period of supply for the load.Have you considered high voltage IGBTs and diodes in a bridge setup, just like in trailing edge dimmers?

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 05:44:59 pm
content: does subbing work with 10uf and 1k res? and, what exactly does it do?currently, I do manual switching which guarantees that t1 is totally off. PIC program waits 10ms to trigger."What happens with the voltages across the triac that you are not triggering?"I assume it's open circuit, right? if the triac is not triggered, then it should be open... is that not true or what?... now, if I remove 330ohm, will it work? but in datasheet they said I should put it.

author: C
author_rank: Super Contributor
timestamp: April 06, 2013, 07:15:50 pm
content: QuoteLook close at your setup, In the process of turning on one of your outputs you could be creating a loop that creates what you are calling a shortExample:1. you can put two dc supplies in series to create a higher voltage, but only one can be grounded.If you are using two phases from the labkit you could be creating a phase short.Chance of this happening is less if you use only one phase of one labkit.QuoteexampleIf you were to take the positive High voltage side of your AC and create a voltage 3.8 volts less and connect these two to the pic. The pic will see 3.8v, BUT the pic will also be floating at positive High Voltage. Touching pic would be the same as touching the high voltage. If anyone forgets to treat the pic as if it was high voltage, someone gets hurt.C

author: kxenos
author_rank: Frequent Contributor
timestamp: April 06, 2013, 07:31:13 pm
content: But if it is the same load why would you want to use 2 opto and 2 triacs, each driven by an other pin of the same uC?? Why don't you just use a single circuit and do the ORing in code???

author: Niklas
author_rank: Frequent Contributor
timestamp: April 06, 2013, 08:20:34 pm
content: Quote from: VEGETA on April 06, 2013, 05:44:59 pmI would say no. Too high resistance and I am not sure about how "fast" the capacitor is.Quote from: VEGETA on April 06, 2013, 05:44:59 pm10ms is not enough, you need more than 20 ms. Read about the worst case scenario I wrote about earlier. The triac is not turned off immediately when the PIC control signal goes low.Quote from: VEGETA on April 06, 2013, 05:44:59 pmIn the case of a single supply everythings works fine, but with dual supplies with different voltage phases you can get into trouble. The other triac might see enough voltage between its gate and the load to actually trigger. Some triacs are more sensitive and need less voltage/current to trigger.Quote from: VEGETA on April 06, 2013, 05:44:59 pmDon't remove the resistors unless you wish to burn some more components.One question: Have you considered relays? Heavy duty ones with 400 Volts rating.

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 08:29:07 pm
content: Quote from: C on April 06, 2013, 07:15:50 pmso touching PIC is dangerous? I don't know why is that, voltage is low and so is current. Anyway, it will be in an enclosure so no one will touch it, plus I will note that in the manual/documentation.__I should use AC voltages so no DC sources will be connected. I want a solution to that problem.___"kxenos"it's an Automatic Transfer Switch, which will switch between 2 power supplies/sources.can you post a schematic of your circuit?ORing in software? my software works correctly and there's a condition where it should just cut off both sources.another way to state the problem: I want an interlock circuit or any clue to make it.we just tried the circuit again and figured out that one of the triacs is broken (shorted)...we put another one and it seems to work but the 7805 regulator outputted about 3.3-3.4v instead of 5! so the MOC3062M trigger will bot happen right? they say in the datasheet that min current is 10ms and the Rin is 330 or 470 ohm...

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 08:33:51 pm
content: "Don't remove the resistors unless you wish to burn some more components.One question: Have you considered relays? Heavy duty ones with 400 Volts rating."I removed the resistor WITH it's whole wire, so I didn't make it short circuit but totally remove it. Someone above said that this resistor makes the other triac triggered... do you agree?no one recommended me about relays... though someone said solidstate relays might work.

author: kxenos
author_rank: Frequent Contributor
timestamp: April 06, 2013, 09:47:18 pm
content: My bad! I looked the schematic too quickly.But the thing is, if you want to select power source you should better do it with relays like they do in UPSs etc. The other thing I would recommend is to replace the LEDs with appropriate resistors to drive the optos with the correct If and if it works correctly then add the LEDs in a better way.

author: C
author_rank: Super Contributor
timestamp: April 06, 2013, 10:05:20 pm
content: VEGETAI value my life, so when someone is connecting something to AC Power that can kill I worry.The opto isolators are there to keep that area of risk to a small area of your circuit.You statedQuoteIf this is true, and your have no isolation from the voltage divider to the PIC, you have no isolation from the sources. The opto isolators are bypassed by the quote above.The opto isolators are doing almost nothing.QuoteTo me that means shifting from source one to source two to power a load.Here in the US a house is supplied from a 230 Volt AC transformer winding that is center taped. Most of our devices use the 115 volts from one side. It is not hard to find two outlets next to each other that are connected to opposite sides of the transformer. Connecting these two outlets together will cause a massive short!Most of the world use 3 phase power. Connecting single phase outlets that are not on the same phase will create a phase short.In simple terms, your pic is running from a battery(pic's dc power source) and you are connecting one pin of that battery to AC Power.Be VERY VERY carefulC

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 10:49:53 pm
content: Quote from: kxenos on April 06, 2013, 09:47:18 pmnever mind ^_^the LEDs are just for simulation, they don't exist in real project ^_^ i put them just to see what's on and what's off.I put 330/470 ohm resistors to drive the MOC opto.Quotethe isolator is to isolate PIC control pins from the means... i.e. to drive the triacs and this is a standard driving circuit.I understand that measurement parts of the circuit is not isolated to the PIC but I couldn't find any way to do it. Do you know anything about it? I should measure voltages of the 2 sources carefully and output the RMS value to an LCD... I already made the software and it works in simulation.___up till now, no one gave any good clue about interlocking the 2 sources.___about the relay thing, the mechanical relay doesn't withstand that much current as someone told me... he said it will short out later by high current!and if any good way to do it with relays (or solid-state relays) what schematic should I follow? I never dealt with relays before.I'm sorry to tire everyone with me but I'm not much of an expert in practical stuff so... ^_^

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 11:29:56 pm
content: can you post a simple schematic about how to do it with relays? I tried a lot in Proteus ISIS but same short-circuit-like problem appears.

author: kxenos
author_rank: Frequent Contributor
timestamp: April 06, 2013, 11:54:23 pm
content: You just have to pick an appropriate relay. You can easily find cheap DPDT relays up to about 15A or more, for example:http://export.farnell.com/finder/44-62-7-006-4000/relay-pcb-dpco-6vdc/dp/1169303

author: VEGETA
author_rank: Super Contributor
timestamp: April 06, 2013, 11:59:11 pm
content: Quote from: kxenos on April 06, 2013, 11:54:23 pmcan you plz describe the operation of the circuit? I didn't understand it.

author: kxenos
author_rank: Frequent Contributor
timestamp: April 07, 2013, 12:04:47 am
content: By default the load is connected to L1/N1. When the SOURCE has a voltage over 2V the mosfet shortcircuits the relay to ground and the load gets connected to L2/N2. Plus, the LED turns on.

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 12:10:22 am
content: I need another state which the load isn't connected to any source.plus, I couldn't follow this schematic... if you make it in another software or so... it will be better.

author: C
author_rank: Super Contributor
timestamp: April 07, 2013, 12:15:48 am
content: It's always a good idea to create something as safe as possible.like wise it's a good idea to look at what could go wrong an try to prevent the wrongs from happing.First lets look at the circuit that you have posted any your statement of wanting a transfer switch.Two sources and a switch between them.your two sources could be protected with GFI's that is short for Ground Fault Interrupter.Source one has a high wattage load connected while Source two has no or very small load connected. The wires for Source one have some resistance so they drop some voltage with a high load. Lets use big numbers to make it easy to see the problem.Source One wire from source one to Load 10 Volt drop.Large LoadSource One wire from load to source one, 10 volts dropSource Two wire from source two to Load 0 Volt drop.no or small LoadSource Two wire from load to source two, 0 volts dropWhen you connect your circuit, you are connecting one of Source One's wires to one of Source Two wires. There is a 10 voltage difference in those two wires so current will flow through your circuit until the voltages are proper for the actual resistances involved. The drop on two wires involved could balance around 5 volts. By connecting one of source one's wires to one of source two's wires you have created a ground fault that will trip both GFI's.In case you do not know a GFI looks at the difference in the current flows of the two wires.To Fix this problem you need to switch both sides of each source.-------For a transfer switch to function you need to know which source has power. Not much your circuit can do if both do not have power, so it makes sense to power your circuit from the sources.If you can stand a slow transfer of power, relays makes all of the above easer. As stated your circuit switching both sides should be much faster.To be safe the circuit that measures which source has power should be isolated from the control circuit. A transformer is one way to get that isolation. Instead of measuring the source direct, you measure the source in-direct from the secondary winding. Using a transformer to lower the voltage can save power and you need to power your circuit from each source so the same transformers can serve two functions.If you are trying to build a fast transfer switch, you need to detect when the active source's voltage stops changing as it should. If your circuit is too slow then the load will miss one or more half cycles of power. For some loads this does not matter, but think about what could happen to a load. What will happen to a PIC if it's Power source drops to low even for a short time?Instead of me giving you a circuit, as I think you are trying to learn, let me give you some strong hints and lets see what you can come up with.1. Use transformers with a secondary winding having a center tap.2. design simple power supply, one cap and one regulator that uses the source(s) to charge the cap ( hint; keep this separate from #3 ).3. Design a circuit to detect the sources ( note; any caps will slow the switching speed)4. If you do not see a solution, try connecting the center taps of the two transformer secondary windings.Good luckC

author: C
author_rank: Super Contributor
timestamp: April 07, 2013, 12:25:58 am
content: kxenosIn your circuit you have a labeling problem.The L_Load should switch between L1 and L2The N_Load should switch between N1 and N2C

author: kxenos
author_rank: Frequent Contributor
timestamp: April 07, 2013, 12:29:41 am
content: @C: Corrected.No problem. What part don't you understand? The diodes are for protecting the mosfet. The mosfet functions as a switch that connects the relay coil to groung when a voltage > 2V is applied to it's gate. It's quite straight forward I think.

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 12:32:09 am
content: right now I'm too late to complete the project. So I need a circuit that I can implement in the project and Then do other things like isolating the PIC.

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 12:37:52 am
content: Quote from: kxenos on April 07, 2013, 12:29:41 amwhat I didn't understand is the relay symbol. I can't figure where is the coil and where is the switching terminals.and, there labels confused me... I'm used to Proteus more ^_^if the mosfet connected relay's terminal to ground what happens? << all I don't understand comes from relay and it's symbol.I can't figure it's type and #terminals too.

author: kxenos
author_rank: Frequent Contributor
timestamp: April 07, 2013, 12:51:37 am
content: The pin numbers in the schematic are probably not the same for the relay I gave you in the link. You will have to look up the datasheet of the relay you will use.

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 12:52:51 am
content: I tried the following circuit in proteus but output voltage seems to be cut in half (100v peak -> 50v peak).Is that what you meant?

author: kxenos
author_rank: Frequent Contributor
timestamp: April 07, 2013, 01:01:01 am
content: Does the oscilloscope need a return path from AC-? I don't know why this is happening but I'm sure in reality it will work just fine

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 01:11:02 am
content: Quote from: kxenos on April 07, 2013, 01:01:01 amso you guarantee it will work?! you tried it?how about switching both of them off? I will think of this tomorrow cuz it's too late now ^_^ but some clues are good.in my case, I need the PIC to trigger everything, so is the MOSFET really necessary? can't I just use PIC pins?about this relay, will it be able to work for too long? i.e., it's coils and contacts will function great or will it short out eventually?If this is the best and final configuration, do you have any clue about measuring voltages using PIC that have some isolation?

author: C
author_rank: Super Contributor
timestamp: April 07, 2013, 01:18:32 am
content: VEGETAThe last circuit you posted is great, It switches power just like the big power companies do.Use the same idea to switch from something to nothing to turn things off.For your source voltage check just put a transformer in between your circuitQuoteand the source

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 01:24:34 am
content: Quote from: C on April 07, 2013, 01:18:32 amThanks!! I kinda got the idea but still needs your help... at least in things I can't figure.anyway, I put AC Voltmeter and a DC voltmeter then I put 2 sources AC and DC... and from the Vmeter's readings I can say that it WORKS!!! so the problem is from the oscilloscope model in Proteus (or I didn't use it right)...AC source was 20v peak (sinewave) and AC voltmeter gave about 14.1v so 14.1*sqrt(2) =nearly 20vpeak! DC voltage reading is correct.I will try to make on/off thing tomorrow... for measurement, regardless of isolation safety, will my previous thing work without damaging PIC?

author: C
author_rank: Super Contributor
timestamp: April 07, 2013, 01:32:17 am
content: VegetaI edited previous post, you may be looking at old versionSource connected to transformerDo your full wave --- on the low voltage secondary and you an pic are safe.C

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 01:48:05 am
content: a transformer? for 220v rms AC source, what transformer should I get?and if V_in get's lower (say from 311v-peak to 250v-peak) how can I Precisely calculate V_out?note: I knew that you forgot to mention adding cap+rectifier after the transformer.

author: David_AVD
author_rank: Super Contributor
timestamp: April 07, 2013, 02:02:00 am
content: Is this a theory or real life project? If real life, I can't understand why you are playing around with a potentially dangerous circuit when you clearly don't have the required knowledge. Playing with (multiple) mains sources is not something with trivial consequences if you get it wrong. I understand that people need to learn, but you also need to know when you're operating way outside of your skill level.

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 02:05:06 am
content: I make sure everything ok before i connect AC source. Plus most of our work is in the lab.it's a real-life project... Anyway, what's your opinion about the suggested circuit?

author: David_AVD
author_rank: Super Contributor
timestamp: April 07, 2013, 02:08:32 am
content: I think that two double pole relays with their contacts connected so that one source will always have absolute priority is the only sane solution.

author: Niklas
author_rank: Frequent Contributor
timestamp: April 07, 2013, 05:49:47 am
content: Quote from: VEGETA on April 07, 2013, 02:05:06 amRegarding the type of questions you have asked so far, how can you be sure that everything is ok?

author: Strada916
author_rank: Frequent Contributor
timestamp: April 07, 2013, 10:16:12 am
content: Vegeta. I really think, for you the 2x DPDT relay option is the best way to go. I think you need someone with experience in electronics/electrical to give you some guidance on a one on one level. Best of luck.

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 02:03:20 pm
content: Quote from: Strada916 on April 07, 2013, 10:16:12 amOK, I decided to use DPDT Relay and I will connect it to another relay for turning on/off. I will post a schematic soon.

author: VEGETA
author_rank: Super Contributor
timestamp: April 07, 2013, 02:17:57 pm
content: This is the final circuit (I guess). Top DPDT relay for choosing Source1 and Source2... Bottom Relay is for activating the 2 source or not.I couldn't find any better idea for turning on/off rather that using another DPDT Relay ^_^ if anyone have any better idea, let's have it.

author: VEGETA
author_rank: Super Contributor
timestamp: April 08, 2013, 11:35:25 am
content: well, I tried the previous circuit (MOC+TRIAC one not relays) and it worked nicely! I removed the damn 330ohm that was between MOC pin4 and Triac pin 1 from both circuits and we tried it in real-life and worked nicely.someone recommended using a voltage follower OP-AMP to isolate PIC MCU from rectifier bridge and voltage divider... is that good?