Issues in designing a switchmode powersupply - Page 1
Forum section: electronics / beginners

author: ray-san
author_rank: Contributor
timestamp: December 27, 2016, 06:08:31 pm
content: Hi there, i'm trying to edjucate myself in switchmode powersupplys. I've winded my own transformer for testing purposes with a ratio of 1:1 on a ferrite core witch i have salvaged from a PC powersupply. Im driving the primary from an atmel atmega with a frequency at arround 50kHz. I hooked the scoped to the PWM output of the chip without the transformer connected and i'm getting an almost clean square shaped waveform (with quite an overshoot, but i think, its ok).Now when i'm hooking my transformer up the output, the waveform starts to getting very crippled and looks more as a loud noise than a squarewave. The same waveform i'm getting on the secondary side but with a very lower amplitude. I tryed to alter the duty cicle in a range from ~25% up ~75%.So why is this so? Can you guys give me some hints, what im doing wrong/how to do it right?

author: rob77
author_rank: Super Contributor
timestamp: December 27, 2016, 06:19:30 pm
content: without a schematic no-one can see what did you do and where might the problem be.

author: ray-san
author_rank: Contributor
timestamp: December 27, 2016, 06:28:46 pm
content: I understand your problem, but i dont have one, and i've found no good software for draw schematics which runs on linux, and hand drawing and scanning is also not an option at the time, because i'm visiting my parents during the holidays and my scanner is not sitting hereBut my circuit is very simple. As i said, i've got an atmega with a pin with PWM output, so i hooked my transformer between this pin and ground on the primary. Nothing else than my scope is connected on the secondary site.

author: janoc
author_rank: Super Contributor
timestamp: December 27, 2016, 07:00:16 pm
content: Any version of Kicad will let you draw schematics, LTSpice runs in Linux using Wine, Eagle runs in Linux, there are tons of web-based systems (like Upverter), etc.In the worst case you can always draw a picture on paper and take a photo using your phone. I am pretty sure someone around you has a phone with a camera these days.You need to do a little bit more effort if you want others to help you.

author: PA0PBZ
author_rank: Super Contributor
timestamp: December 27, 2016, 07:08:04 pm
content: Looks like your atmega does not have the power to drive the transformer.

author: ray-san
author_rank: Contributor
timestamp: December 27, 2016, 07:26:34 pm
content: Quote from: janoc on December 27, 2016, 07:00:16 pmWine is not an option for me, because i'm running linux on a pure 64bit system and wine has a lot of this old legacy 32bit dependencys. But i've made a little handdrawn circuit for you and caputerd it with my smartphones cam

author: bktemp
author_rank: Super Contributor
timestamp: December 27, 2016, 07:36:14 pm
content: You can't drive an transformer using dc. So add at least a capacitor for ac coupling, because you are driving the transformer using 0V/5V levels, therefore there will always be a dc offset.An AVR can't drive much current, maybe +/-40mA max. Your transformer has probably a much too low inductance, so the current required is much higher.The way you did use the transformer, isn't much useful for a switchmode powersupply, because the transformer only isolates the signal but does no voltage/current conversion like you expect from a switchmode power supply.Where was the ferrite core placed exactly on the power supply?Depending on the power supply topology there are different requirements on the construction of the transformer.

author: rob77
author_rank: Super Contributor
timestamp: December 27, 2016, 08:33:38 pm
content: actually you're lucky your atmega is still workingi think you should go back to square 1 and read some theory first, then try to build a simple and crude circuit. first try to understand various DC/DC converter topologies : buck, boost, buck-boost ...and then go step further and try some circuits with a transformer (push-pull, half-bridge, fly-back, forward).

author: ray-san
author_rank: Contributor
timestamp: December 27, 2016, 08:44:31 pm
content: Quote from: bktemp on December 27, 2016, 07:36:14 pmok, this might be an issue...i've done another few testings, and i recognized, the atmega gets pretty warm. Do you recommend me, to drive the transformer with a mosfet? And where is the right place for the capacitor then, if i drive the transformer with a mosfet/transistor? between pwm output and gate/base or between the fet/transistor and transformer? (I guess between fet/transistor and transformer)Quote from: bktemp on December 27, 2016, 07:36:14 pmI'm aware of that this is not a very usefull setup, its more to get the basics of a switchmode powersupply, to get a proof on concept, before i spent hours and hours on winding a transformer just to recognize that i did something wrong, probably on the lowest layer of the windings or so.I don't remember where the transformer in the supply was placed because i salvaged it long time ago. I guess from somewhere on the "high side", but it was definitly not the main transformer, because it's just to small for that. I guess, it was used to power the chips for controlling the powersupply or stuff like that.

author: bktemp
author_rank: Super Contributor
timestamp: December 27, 2016, 09:06:31 pm
content: Before building a SMPS and winding a transformer I would start by using an unmodified transformer.The first step is measuring the inductance of all windings. Without knowing anything about your transformer it is impossible to tell the correct way of driving the transformer.If it was the +5V standby transformer, it has a rather low inductance and is designed to store energy during on-phase and release the energy during off-phase (flyback converter). You should drive the transformer using a transistor.A great tool for designing transformers/inductors for most common SMPS topologies:http://schmidt-walter-schaltnetzteile.de/smpshome/

author: ray-san
author_rank: Contributor
timestamp: December 27, 2016, 09:54:09 pm
content: Quote from: bktemp on December 27, 2016, 09:06:31 pmI mainly agree with this, but they are rated for mains power/voltage. I don't want to mess around with that until i know, what i'm doing, so i decided to stick to low voltages, where i can play arround, do stupid stuff to get the knowledge how this stuff works. So in worst case i blow up a 1€ atmel or a transistor/caps few cents worth each and at least, don't kill myselfThanks for the link, i will checkout the page and hopefully find some usefull information for me

author: ray-san
author_rank: Contributor
timestamp: December 27, 2016, 11:51:53 pm
content: update: changed my circuit a little bit, now im driving a mosfet from my atmega's pwm output, which (the mosfet) is connected to the transformer.I hooked up a LED on the secondary side, and sees there, it lights up. Which means, im at least transfering some energy. But when i hook up a small lightbulb, it is not enable to power that. It may be an issue with my mosfets, because they are no logic level mosfets, they are might not "on enough" (logic level mosfets have been ordered, but didnt receive them yet), or my little transformer has to less windings or a combination of these. What do you think?The picture i attach ive got from my scope, the yellow curve is from the atmegas output, the blue one is from the secondary side of the transformeredit: i've attached a picture of a similar core, which i'm using, i've wounded 13 turns on each sideedit2: attached schematic of the circuit how it looks like now