Is the connection to GND correct in the circuit? - Page 1
Forum section: electronics / beginners

author: deralbert
author_rank: Contributor
timestamp: January 24, 2023, 10:06:20 pm
content: Hello, I generated a circuit for a SMPS (flyback topology) using Pi Expert from Power Electronics and then rebuilt it in Altium Designer (with small changes).At the moment I have the following circuit (see [Modified_SMPS_TNY286PG.jpg]). In the original Pi Expert circuit, there was explicitly no GND at all (see [Original_SMPS_TNY286PG.jpg]). But I know that there must be at least one GND and that's why I added one at the most logical place: at the "minus" of the AC input, near the pin 1 of the connector J1.Then I thought it would be very inconvenient to have a single GND while designing the PCB and hence added two more GNDs, in the middle and on the right of the circuit. It is still the same GND, right? Since I don't feel quite confident with the real electronic, I would like to ask: Is it allowed to do it so? Is my circuit still correct?Thank you.

author: Benta
author_rank: Super Contributor
timestamp: January 24, 2023, 10:18:12 pm
content: "I would like to ask: Is it allowed to do it so? Is my circuit still correct?"Only if you want to kill someone.What you mean by "Ground" is properrly called PE or "protective earth" and has no place anywhere in your circuit.The primary side (before the transformer) is controlled by the power company should be left as "L"/"N".The secondary side is supposed to float and have no reference to PE or any other potential.You know just enough to be very dangerous.

author: magic
author_rank: Super Contributor
timestamp: January 24, 2023, 10:25:07 pm
content: Quote from: Benta on January 24, 2023, 10:18:12 pmTo be fair it's not clear what exactly OP meant to do. So...Quote from: deralbert on January 24, 2023, 10:06:20 pmWhat makes you think you need "a ground"?What do you mean by "a ground"?What physical thing would this schematic symbol turn into when the PCB is built?Quote from: Benta on January 24, 2023, 10:18:12 pmWell, there are people who don't even know that much

author: wraper
author_rank: Unknown
timestamp: January 24, 2023, 10:26:45 pm
content: You broke the circuit since you shorted things that must not be shorted. Basically it's fine to place GND anywhere since it's just an arbitrary reference point. You can put GND in multiple places to instead of drawn connections to reduce their number. For the sake of PCB layout, it's better to just place GND on the negative output as you generally don't want an automatically drawn ground plane on a high voltage side. Also C4 ratings suggest an X type cap which is not suitable there. You need Y1 capacitor or two Y2 caps in series if your circuit does not connect output to mains earth terminal.

author: wraper
author_rank: Unknown
timestamp: January 24, 2023, 10:34:31 pm
content: BTW you forgot to connect primary winding. And you D6 should be a Schottky diode for efficiency.

author: magic
author_rank: Super Contributor
timestamp: January 24, 2023, 10:37:23 pm
content: Quote from: wraper on January 24, 2023, 10:34:31 pmIf we are getting that pedantic, I might add that the optocoupler is reversed.The LED side (1,2) belongs on the secondary, the phototransistor (3,4) on the primary.

author: wasedadoc
author_rank: Super Contributor
timestamp: January 24, 2023, 10:38:12 pm
content: Other errors are that the 100 Volt rating of the input diode bridge is inadequate and you have swapped the input and output sides of the optocoupler. Why did you change C5 from 1kV to 5kV?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 24, 2023, 10:53:16 pm
content: Ground for what? If you're not doing SPICE simulations (and I don't think there's TNYxxx models available..?) it doesn't matter. Name them whatever you want. They're just names in the netlist fed to the PCB layout.The three connections shown short out the FWB and low side choke, making an explosion. I assume you mean to pick just one of the three shown?Semantically speaking, "ground" might prefer being the negative side of the regulator and related stuff, since all the voltages in that area will be measured with respect to that, or similarly for the output side, for the same reasons. These will serve well as ground planes, and as planes also the reference plane for EMC purposes. Hence the capacitors between them, and inductors away from them -- well, C4 connects to DC+ but C2 connects that in turn to DC-.This won't mean anything to you though as a beginner. In short, for practical purposes, "ground" is whatever we want to take as reference, usually having properties like covering a large area or making many connections.Tim

author: deralbert
author_rank: Contributor
timestamp: January 24, 2023, 11:10:47 pm
content: Thank you for all your answers. I will take into account all your comments (missing connection to transformer on primary side, inappropriate sizing of bridge rectifier, wrong connection of optocoupler, inappropriate sizing of the capacitor C5). Maybe a few words about me and the circuit: I am reading a few books on SMPS, including one by Sanjaya Maniktala, and I am missing the connection between the theory and practice. I do not plan to produce "my" SMPS tomorrow, turn it on and die. I just thought I'd start making something and then ask any questions I stumble across. So I can better understand the theory of SMPS.I will focus on the following questions now, because I think I'm having trouble understanding "what is a ground and where is it used?" Since my school days I have seen the GNDs from time to time in the circuits, but one never addressed when and how exactly to use them in the real circuits (well, I am not an electrical engineer either).QuoteI think, so that the current flow is possible, there should always be a "plus" and a "minus", whereby "minus" is often defined as GND. Otherwise the current cannot flow.QuoteSomething that has a potential that is almost zero compared to "Plus".QuoteI have four layers board. On the top and bottom are my components. The layers in between are both GNDs, they are both connected to the "minus" of the input. This would allow me to go directly to a GND layer in the middle through via's without drawing a wire to GND on the "minus" of circuit. In other words, I just wanted fewer wires on the PCB.Tim (T3sl4co1l) has already explained well what a GND is in reality. I would now let the thoughts go through my head and maybe ask something in this thread a little later regarding my circuit. Maybe after I have worked through all the other comments.And thanks again to all. The topic SMPS fascinates me, I deal with it for some time, but unfortunately all alone, have no friends who are electrical engineers which I could ask. A few days ago I thought to myself, it can not go on like this and have created an account here on the forum. Rather I ask stupid questions and get smart answers than if I would sit alone again with all my stupid questions.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 25, 2023, 12:46:03 am
content: Keep in mind that voltage is always differential i.e. measured between two points. The choice of ground is arbitrary for an ideal circuit, and has some freedom in a practical circuit. (This should've been emphasized in your "school days", but if it's been a while, it may bear repeating.)As for SMPS, build all you want at low voltage -- something in the 12V 1A range, perhaps going up to 24V or more, or down to 5V or less, etc. You can try out all the topologies: boost, buck, flyback, forward, etc.; you can try out all the control schemes (and build them yourself from datasheet block diagrams, when detailed enough -- peak and average current mode controls are good starting points e.g. UC3843). At worst, you may blow up a few components, uh, wear safety glasses in case a transistor or electrolytic capacitor explodes, that's about the worst that can happen -- and other than that, get a few breadboards so you don't mind melting holes in one from time to time (inevitably you'll misstep on the control, a transistor fails and sucks all the power, overheats, and, well, that happens).Search around, there's... well, there's a lot of noise relative to any particular topic, and even a lot of bad answers in good topics, but good threads can be found, discussing operation and design of things like this. Textbooks aren't even bad, being more of a slog to read through, often dense or abstract, but at least informative.Tim

author: Zero999
author_rank: Super Contributor
timestamp: January 25, 2023, 11:32:09 pm
content: Mains powered switched mode power supply ! = beginner project!To state the obvious: mains voltages are very dangerous and it's easy to kill yourself, or someone else, if you get this wrong.As mentioned above, voltages are relative and 0V/earth/ground is just a reference from where all the voltages are measured relative to. There can be many grounds in a circuit, which serve as different references. In the example of a mains powered switched mode power supply, there's might be several grounds: mains neutral, protective/safety-earth/ground (quite often the same voltage as protective earth, but not always) which is purely there to provide protection against electric shock, the return (normally negative) side of the rectifier and the 0V of the secondary. They should have different net names and symbols, to ensure they're not connected together.

author: deralbert
author_rank: Contributor
timestamp: January 27, 2023, 09:14:57 pm
content: Yes, you are right, the "SMPS" topic may not be the easiest for beginners, but I think I can handle it step by step.And as I said in one of my earlier messages, I do not plan to build/produce the pcb to this circuit tomorrow. I just wanted to start working with it. With this, I immediately notice what I know and what I don't know.At university, I minored in electrical engineering. I did listen to some lectures such as Linear Electrical Networks, Electrical Machines and Power Converters, Generation of Electrical Energy, but they were extremely theoretical. Now I do have an idea what an impedance is, how to work with Bode diagrams and draw them, what an operational amplifier is... But otherwise I can't do much, especially not much practical. Well, the German education system has its own advantages and disadvantages and I don't want to criticize this system here at all, but unfortunately, this is a bitter reality of German universities. You are bombarded with theory, you can calculate something on paper, but when it comes to reality, you are left to your own and have to teach everything (or at least the large part) yourself. That's what I'm doing now.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: January 27, 2023, 09:23:18 pm
content: It's little different here; academics is focused on academics the world over. Not doing any labs on those subjects might be peculiar, but it depends on exactly the scope of those classes I guess. Most students are expected to learn practical material on the job; the theory lays groundwork for subsequent learning.Taking the time to do it yourself is excellent, of course!One upside to that [not getting very practical], if rather minor, is since the practical material would change from decade to decade as products go obsolete and new and more advanced products replace them, academics don't need to keep track of every little thing, or try and keep up with R&D to anticipate their curricula. Likewise, students don't get saddled with outdated curricula that instructors fail to update.Well, I say that, but I still had to sit through control theory / root locus methods...Tim

author: tooki
author_rank: Super Contributor
timestamp: May 29, 2023, 09:19:34 am
content: Quote from: deralbert on January 24, 2023, 11:10:47 pmIn your schematic, you have thepositiveoutput of the bridge rectifier connected to primary-side GND. If you build your board like that, all the input caps will explode and you'll likely fry the IC.

author: Simon
author_rank: Unknown
timestamp: May 29, 2023, 09:29:19 am
content: You should not be attempting this given your level of understanding. Do some work with circuits that involve multiple grounds and isolation in the extra ow voltage range (less than 50V) first, then consider something like this after you have mastered a bit of power electronics.

author: tooki
author_rank: Super Contributor
timestamp: May 29, 2023, 09:45:52 am
content: Quote from: deralbert on January 24, 2023, 10:06:20 pmI strongly agree with Zero999 and Simon that this is absolutely not something a beginner like you should be doing. It's evident from this thread and the other one that you aren't ready for this yet, there are too many important things you don't know, and the problem is that you don't have enough experience to know what things you need to know, but don't know yet.

author: rstofer
author_rank: Super Contributor
timestamp: May 29, 2023, 04:51:46 pm
content: A commercial power supply is about $15. While designing an SMPS may be interesting, it is not a reasonable thing to actually build when you can buy one off the shelf with all the safety regulations certified:https://www.amazon.com/s?k=19v+0.5a+power+supply

author: TimFox
author_rank: Super Contributor
timestamp: May 29, 2023, 05:40:03 pm
content: Besides the important safety questions, I would make one point and reinforce another point made above."Otherwise current will not flow"--simple counterexample is a plastic-cased battery-operated flashlight, where current flows through the bulb despite no ground connection whatsoever."Spice simulation"--Spice defines node 0 as "ground", and requires that every node have a DC path (even through several G\$\Omega\$) to that special node to calculate the initial conditions.However, sources and voltage measurements can be connected between any two nodes.

author: deralbert
author_rank: Contributor
timestamp: May 29, 2023, 07:39:23 pm
content: I sometimes do so that I learn something and parallel already ask the questions on this topic. In retrospect, I often see for myself how "stupid" some questions were. I'd rather get a constructive answer quickly and ask why this way and not another way, than if it takes me a long time to understand something (or not understand it after all).I also ask different people at several forums or anywhere else. In parallel, I also try to understand myself why someone gives me a specific answer.I have no plans to sell my SMPS or make any money from it in any way. I don't plan on using it either (at least not now). I only pursue educational purposes.Thank you for your concerns for me (really, this is not meant badly or sarcastically). But as I mentioned before (possibly in another thread), because of security you don't need to worry. Nothing bad can happen in my test setup, neither to me, nor to anyone else.I have corrected the errors on the circuit from this thread, just did not update the thread. I ordered the PCB and assembled it. It worked, but not optimally. After about 15 minutes of operation, C7 was damaged and the voltage at the output was not stable. As it turned out later, I made a mistake in the sizing of the transformer, which caused a lot of problems for the switcher. The layout of PCB was also not very good. Now I try to do better.

author: Simon
author_rank: Unknown
timestamp: May 29, 2023, 08:12:24 pm
content: sorry but no. You need to work on smaller portions of the problem first. So have you made a non isolated buck converter yet?

author: deralbert
author_rank: Contributor
timestamp: May 29, 2023, 08:22:00 pm
content: Only in theory. I didn't make a PCB for it, only dimensioned the components.(In case someone reads this topic, there isa "newer" onewith the updated circuit. I honestly don't know how this topic suddenly came up again after two or more months.)

author: Simon
author_rank: Unknown
timestamp: May 29, 2023, 08:25:40 pm
content: then make it! you are the one saying that you need to mirror the theory with practice. Now you are trying to make a circuit where you don't understand the concept of ground and you have skipped the basics. It is when you make things for real that you learn the gotcha's that you will then have learnt from for the more complicated stuff.

author: deralbert
author_rank: Contributor
timestamp: May 29, 2023, 08:29:36 pm
content: I will definitely do that in the near future.