Pure sine wave inverter in 15 minutes or “power electronics for everyone”
What is power electronics? Without a doubt – it’s a whole world! Modern and full of comfort. Many imagine power electronics as something “magical” and distant, but look around – almost everything that surrounds us contains a power converter: power supply for a laptop, LED lamp, UPS, various regulators, voltage regulators, frequency converters (FC) in the ventilation or elevator, and much more. Most of this equipment makes our lives comfortable and safe.
Development of power electronics for several reasons is one of the most difficult areas of electronics – the cost of error is very high, and the development of power converters has always attracted hobbyists, DIYers, and more. Surely you wanted to build a powerful power supply for some project of yours? Or maybe an online UPS for a couple of kW and not go broke? Or maybe a frequency converter for your workshop?
Today I will tell you about my small open project, or rather a part of it, which allows anyone to step into the world of power electronics development and still stay alive. As a demonstration of the possibilities I will show how in 15 minutes to assemble a voltage inverter from 12V DC to 230V AC with sine at the output. Intrigued? Let’s go!
Reasons for the project
Over the last couple of years designing power inverters makes up about 90% of my orders, the main effort goes mostly to software development and layout, circuit design + final board trace of the total cost is usually not more than 10-15%. Here comes the realization that the layout process, which includes software development, must be somehow reduced and optimized.
There are at least two ways out: you can buy ready made solutions, e.g. from Texas Instrumets or Infineon. However they are usually customized for a certain task and cost from $500 to $5000, moreover there is no guarantee that you will get similar order and most probably this investment will not pay off. The second option – do it yourself, but doing it thoroughly is almost the same as the launch of “+1 revision of the iron”, which will result in additional costs for the customer. If you do not do it thoroughly, then, as usual, everything will be on the nose and somewhere something will fall off and while the layout, components and timing. After a while, I noticed the most obvious solution. It is so simple and obvious, that I was wondering why TI or Infineon had not made it yet. Now I will tell you about my “enlightenment”.
Let’s look at some of the most popular power converter topologies:
- All topologies include the basic components – capacitors, transistors and inductance (choke or transformer). These are the 3 whales of power electronics;
- Transistors are included everywhere in the same way and form what is called a “half-bridge”. Almost all converter topologies are built from it;
- The option of including the “half-bridge + capacitor” bundle does not change in all topologies. The type of inductance and the inclusion options of half-bridges change.
From this we can conclude that having some standard module in the form of a bunch “half-bridge + capacitor” you can build any converter, adding only the necessary choke or transformer. Therefore, the obvious solution to simplify prototyping was to create such a module:
Struggle between good and evil
Unfortunately the limited number of hours in a day and banal laziness dictate their conditions. The need to make this module I came a year ago, but the implementation was constantly postponed under the slogan – “next weekend I’ll definitely do it!
Perhaps the idea would have remained on the shelf if not for two events. First, two customers came to me in one month, and each wanted a complex and interesting converter, and most importantly, they were willing to pay very good money. Most importantly, they were ready to pay very well. (Although, considering they were from Europe, maybe it was still cheap for them)) Both projects were interesting to me, for example, one of them was “3-phase voltage regulator with galvanic isolation (sic!)”, that is 3 phase PFC + 3 bridge inverters (phase shifted) + synchronous rectifier + 3-phase inverter. It’s all SiC powered and very compact. All in all I took two big orders, each of them with ~800 man-hours and a deadline of 6 months. I ended up being “forced” to look for ways to optimize.
Secondly, I was unexpectedly contacted by the guys from PCBway, many of whom are likely to have ordered boards from them, and they offered to collaborate. They are very active in supporting open hardware projects, i.e. the very initiative of CERN – Open Source Hardware. Cooperation is simple, understandable for both sides – they provide me with free boards for my projects, and I open them, and lay them out on their site, in other places as desired. That was an extra motivation for me, and the main thing is that my conscience is clear, because I’ve been ordering boards from them for prototypes and for serial production for several years now, while telling my friends and partners about them. Now I get a bonus in the form of free boards for small projects, I can write more often on the hbr)).
And then the ice was broken, it was decided to create not just the previously described module, but a whole kit of power electronics developer and make it open and available to everyone.
At the beginning of the article I mentioned that I would only talk about one part today – the half-bridge power module. It alone allows you to build a converter simply by screwing on a control circuit such as a STM32-Discovery, Arduino, TMS320, TL494 or whatever you own. There is no linkage to any platform or IC at all.
Only this is not the whole project, but part of it)) What does the finished power converter consist of? First of all the power part, to make it work you need a control module, to understand what is happening you need an indication, and to understand what is happening from a safe distance and an interface, such as Modbus RTU or CAN.
As a result, the overall structure of the project looks like this:
Probably in the future I will also write a program for calculating transformers and inductors, both conventional and planar. So far. Different parts of the diagram in rough draft already implemented and tested in two projects, after small revisions they will also be written articles and sources will be available.
Half-bridge power module
Now it is time to take a closer look at today’s protagonist. The module is universal and allows to work with Mosfet and IGBT transistors, both low voltage and high voltage switches up to 1200V.
- Galvanic isolation of the control (digital) side from the power side. Isolation breakdown voltage is 3 kV;
- Upper and lower key are independent, each has its own galvanically isolated driver and galvanically isolated dc/dc;
- A modern driver from Infineon – 1EDC60I12AHXUMA1 – is used. Open/close pulse current is 6A/10A. Maximum frequency is 1MHz (tested to 1.5MHz stably);
- Hardware current protection: shunt + Op-Amp + comparator + optocoupler;
- The maximum current is 20A. Limited not by the keys, but by the size of the heatsink and the thickness of the copper polygons.
The 1st revision of the module is mentioned in the article, it works perfectly, but there will be a 2nd revision where purely design flaws will be fixed and connectors will be changed for more convenient ones. After finishing the documentation, I uploaded the gerber to PCBway and after 6 days the courier knocked on my door and delivered the precious gadget:
Another week later, it finally arrived
on the dogs accessories from a fine domestic store. Eventually everything was assembled:
Before moving on, let’s look at the circuit diagram of the module. You can download it here – PDF.
There is nothing complicated or magical here. You can solder them one at a time and the usual half bridge with 2 keys at the bottom and 2 at the top. The driver as above wrote from the family 1ED, very wicked and immortal. There is an indication everywhere on the power supply, including +12v on the dc/dc output. The protection is implemented on the AND logic element, in case of over current the comparator will output +3.3V, they will light up the optocoupler and it will pull one of the AND inputs to ground, which means a log.0 setting and the PWM signal from the drivers will disappear. AND with 3 inputs is used on purpose, in next revision I plan to make also protection from overheating by heatsink and to put error signal there too. All sources will be in the end of the article.
Assembling the inverter prototype
For a long time I was thinking with what to demonstrate the operation of the module, so, that it would not be too boring, and useful, and not too difficult, so, that anybody could repeat it. So I decided on a voltage inverter, the kind they use to work with solar panels, if something goes wrong on the low-voltage side – no big deal, and on the high-voltage side – just when you turn it on do not stick your hands in there.
By the way, MAP Energy rivet just such, here is an example of even a commercial implementation of this idea. The job of the inverter is to form from a DC voltage of 12V alternating sinusoidal form with a frequency of 50 Hz, because that is what the usual 50 Hz transformer is used to work with. I use some kind of Soviet one, like OSM, 220V winding is factory and used as a secondary, and the primary ~8V is wound with a copper busbar. It looks like this:
And this monster is only 400 watts! The transformer weighs about 5-7 kg by feel, if you drop it on your foot, you won’t get in the army for sure. Actually this is the disadvantage of inverters with “iron” transformers, they are huge and heavy. Their advantage is that these inverters are very simple, do not require any experience to create and of course they are cheap.
Now let’s connect the modules and the transformer. Actually the module for the designer should look like a “black box” which has 2 PWM inputs and 3 power outputs: VCC, GND and the half-bridge output itself.
Now from these “black boxes” let’s represent our inverter:
Yep, only 3 external elements were needed: transformer + LC filter. For the last one I made the choke simply by winding the wire from the module to the transformer on a ring of Kool Mu material, size R32 with permeability 60, inductance about 10 µHN. Of course the choke should be calculated, but we need it in 15 minutes)). In general if you drive something like this for 400W, you need a ring of size R46 (this is the outer diameter). Capacitance is 1-10 μF film, that’s enough. Actually as economy you can not put a capacitor, because the capacitance of the transformer winding is healthy… in general, the Chinese and MAP have done so)) The choke looks like this:
It remains to put the test load on the output, I have a pair of 20W LED bulbs (nothing else was at hand to illustrate), they themselves eat 24W, the efficiency however. My transformer has about 1A no-load current. With the battery will consume about 5A. As a result we have such a test bench:
Also in the layout is used battery Delta HR12-17 on 12V and 17A*h. We will control the converter from STM32F469-Discovery debug board.
Initially I was going to use my STM32VL-Disco, received at an exhibition back in 2010, but it so happened that it was destined to die just on this layout when all the code was written and the prototype was already running. I forgot about the oscilloscope probes and combined the 2 grounds, amen to that. In the end everything was rewritten on the STM32F469NIH6, this particular debug was at hand, so there will be 2 projects: for F100 and for F469, both tested. The project is built for TrueSTUDIO, the eclipse version from ST.
In my other article I told in details how to create a sinusoidal signal, how to write code and stuff like that. You can read it here.
Have you read it? Want to build it? Here is your project:
Note that I put two sine signals on one half-bridge (module) and two 50 Hz signals on the other. And one diagonal is “red+yellow” and the other is “blue+green”. In the article above it is written in detail, in case you don’t understand it. Now, once the signals are applied, throw on both half-bridges +12V and GND from the lab power supply. Immediately battery is not advised, if somewhere wrong, it can burn something. Protection on the board saves from overcurrent, but not from obvious bugs, when plus and minus mixed up, but the lab unit saves. 12V and 1A is enough for the tests. You take the probe of the oscilloscope, its earth wire to the output of the first half-bridge, and the probe itself to the output of the other half-bridge and there should be a picture:
Where is the sine you ask? The point is that the resistance of the oscilloscope input is big and it is not a load, so the current does not flow and the sine does not come from there. I made a 90 ohm load from 10 ohm resistors and connected 9 of them in series. I hooked the load to the half bridge outputs and got this picture:
Is it the same for you? So it’s time to connect the choke, transformer, load and try to start. Achtung! This breadboard must not be switched on with no load because the output can be up to 350. 380В. To avoid this, you need the load or the OS. The latter we will not have, it’s a topic for a separate article, you can as an option attach simple P-regulator, the project template you already have.
Of course this output is not stabilized and will float 230V +-30V, for the tests will do, in another article, finalize the layout when I decide to tell about P and PI regulators and their implementation.
Now you can enjoy the result of the work, and if necessary, you can stow everything in a box and even use it in the household or at the cottage to provide yourself with light and other delights.
You probably noticed the delay between the “click”, i.e. powering up the Discovery and turning on the lights – this is the time it takes for the MC to initialize. This delay can be reduced if you write to the register one digit at a time, rather than split the register entry into a bunch of lines. I did it just for clarity. Although, it’s not a problem, with code in HAL delay is 3 times longer and people somehow live with it))
Before I forgot, the sources of the project:
- Schematic diagram – PDF
- BOM – Excel
- Gerber-files – RAR
It remains to see how it is with the temperatures on the board, there are no hot spots. 5-6A is not much, but if you have a through current or some other serious fault, it is enough to turn the board into a kettle:
As you see the hottest element is the dc/dc module for galvanic isolation. It heats up to 34 degrees. The transistors themselves and the heatsink have ambient temperature after 30 minutes of inverter operation))
Acknowledgements and plans
In the near future I plan to write about DSP board and not to write about debugging, but already from a “specialized” module. The 2nd revision boards for it have already come from the same PCBway, I’m waiting for the components and write about it at once.
I hope you liked the article and the idea. In the future on the same modules I will show how to assemble frequency converter, mppt controller, and maybe something else interesting. If you have any questions, then feel free to ask them in the comments or in the PM, if you suddenly do not have a full-fledged account, I will try to answer all questions.
Now a small thank you to PCBway, it’s really good that they support open source movement. Maybe soon hardware guys will even catch up with software writers in quantity and quality of open source projects.
12 to 220 and 220 to 12 volt voltage converter with your own hands
Sometimes a car voltage inverter is incredibly useful, but most products in stores either lack quality or do not suit the power, but at the same time they are not cheap. But after all, an inverter circuit consists of the simplest parts, so we offer instructions on how to assemble a voltage converter with your own hands.
The Case for the Inverter
The first thing to consider is the loss of electricity conversion, released in the form of heat on the circuit keys. On average, this value is 2-5% of the rated power of the device, but this figure tends to grow due to improper selection or aging of components.
Heat dissipation from semiconductor elements is of key importance: transistors are very sensitive to overheating and it is expressed in the rapid degradation of the latter and probably their complete failure. For this reason, the base of the enclosure should be a heat sink – an aluminum heat sink.
Among radiator profiles a usual “comb” 80-120 mm wide and about 300-400 mm long will do well. The shields of field effect transistors – metal spots on their back surface are attached to the flat part of the profile with screws. But even with this is not easy: electrical contact between the screens of all the transistors of the circuit should not be, so the heat sink and mountings are insulated with mica films and cardboard washers, while on both sides of the dielectric pad with metal-containing paste is applied thermal interface .
Determine load and procure components
It is extremely important to understand why an inverter is not just a voltage transformer, and why there is such a diverse list of such devices. First of all, remember that when you connect a transformer to a DC current source, you get nothing at the output: the current in the battery does not change polarity, so the phenomenon of electromagnetic induction in the transformer does not exist as such.
The first part of the inverter circuit is the input multivibrator, which simulates the mains oscillation to perform the transformation. It’s usually built with two bipolar transistors, able to swing the power keys (for example IRFZ44, IRF1010NPBF or more powerful IRF1404ZPBF), for which the most important parameter is the maximum allowable current. This can be up to a few hundred amps, but in general you just multiply the current value by the battery voltage to get an approximate number of watts of output power without taking into account losses.
A simple flip-flop converter with IRFZ44 power switches
The flicker frequency is not constant and it is a waste of time to calculate and stabilize it. Instead the current at the transformer output is made DC again with a diode bridge. Such an inverter can be suitable for powering purely active loads – incandescent lamps or electric heaters, stoves.
On the basis of the obtained base it is possible to assemble other circuits, differing in frequency and purity of the output signal. Selection of components for the high-voltage part of the circuit is easier: the currents are not so high, in some cases, the assembly of the output multivibrator and filter can be replaced by a pair of microcircuits with appropriate strapping. The capacitors for the load network should be electrolytic, and for circuits with low signal level – mica ones.
The converter variant with the frequency generator on K561ТМ2 chips in the primary circuit
It is also worth noting that to increase the final power you do not need to buy more powerful and heat-resistant components of the primary multivibrator. The problem can be solved by increasing the number of converter circuits connected in parallel, but each of them will need its own transformer.
Parallel connection of the circuits
Struggling for a sinusoidal output – let’s look at the typical circuits
Voltage inverters are now used everywhere as motorists who want to use household appliances away from home, as well as the inhabitants of autonomous dwellings, powered by solar energy. And in general we can say that the complexity of the converter device directly determines the width of the range of current receivers that can be connected to it.
Unfortunately, pure “sine” is present only in the main power grid, it is very difficult to achieve conversion of direct current into it. But in most cases it is not required. To connect electric motors (from a drill to a coffee grinder) a pulsating current of 50 to 100 hertz without smoothing is enough.
LEDs, LED lights and all kinds of current generators (power supplies, chargers) are more critical to the choice of frequency, because it is at 50 Hz their circuit is based. In such cases, you should include in the secondary vibrator microcircuits, called pulse generators. They can switch a small load directly, or act as a “conductor” for a series of power keys of the inverter output circuit.
But even such a clever plan will not work if you plan to use the inverter for stable power supply of networks with a mass of heterogeneous consumers, including asynchronous electric machines. Here pure sine is very important and only frequency converters with digital signal control can do this.
The Transformer: Selected or Made by Yourself
To assemble the inverter, we are missing only one circuit element, which performs the transformation of low voltage into high voltage. You can use transformers from personal computer power supplies and old UPS, their windings are just designed to transform 12/24-250 V and back, it only remains to correctly determine the leads.
Still, it is better to wind the transformer with your own hands, the good thing is that ferrite rings give you the opportunity to do it yourself and with any parameters. Ferrite has excellent electromagnetic conductivity, which means that losses during transformation will be minimal even if the wire is wound by hand and not tightly. In addition, you can easily calculate the number of turns and the thickness of the wire with the calculators available online.
Before winding, the core ring should be prepared by removing the sharp edges with a file and wrapping tightly with insulator – glass cloth impregnated with epoxy glue. Next, the primary winding should be made of thick copper wire of the calculated cross section. After the required number of turns are dialed, they must be evenly distributed across the surface of the ring at regular intervals. The leads of the winding are connected according to the diagram and insulated with heat shrink.
The primary winding is covered with two layers of lavsan tape, then the high-voltage secondary winding is wound and another layer of insulation. An important point – the “secondary” must be wound in the opposite direction, otherwise the transformer will not work. Finally, a semiconductor thermal fuse must be soldered in the gap to one of the leads, the current and temperature of operation of which is determined by the parameters of the secondary winding wire (the fuse housing must be tightly taped to the transformer). From the top of the transformer is wrapped with two layers of vinyl insulation without adhesive base, the end is fixed with a coupler or cyanoacrylate glue.
Mounting the radio elements
It remains to assemble the device. Since there are not many components in the circuit, you can place them not on the printed circuit board, but by mounting them to the radiator, that is, to the body of the device. The pins are soldered to a monocore copper wire with a sufficiently large cross section, then the junction is reinforced by 5-7 turns of thin transformer wire and a small amount of solder PIC-61. After the connection cools down, it is insulated with a thin heat shrink tube.
Circuits with high power and complex secondary circuits may require a printed circuit board, on the edge of which the transistors are placed in a row for free attachment to the heat sink. Glass fiberglass with a foil thickness of at least 50 µm is suitable for making a printed circuit board, but if the coating is thinner, reinforce the low voltage circuits with jumpers of copper wire.
Making a printed circuit board at home today is easy – the Sprint-Layout program allows you to draw stencils for circuits of any complexity, including double-sided boards. The resulting image is printed by a laser printer on high quality photo paper. Then the stencil is attached to the cleaned and degreased copper, ironed, and the paper is washed with water. The technology is called “laser outsource” (LUT) and is described in detail on the web.
Copper residue can be etched out with ferric chloride, electrolyte or even table salt, as the methods are plentiful. After etching soldered toner should be washed off, the mounting holes should be drilled with a 1 mm drill bit, and all tracks should be tinned with a soldering iron (under flux) to tin the copper of the contact pads and to improve the conductivity of the channels.