Grid-interactive or grid tie inverter (GTI) is an electronic device that converts direct current (DC) voltage to alternating current (AC) voltage and that can operate in parallel with the electric utility grid. GTIs allow interconnection of renewable energy systems with the grid. The power processing circuits of a GTI have similar working principle as that of a conventional stand-alone DC-AC SMPS. The main differences are in their control algorithm and safety features. A GTI basically takes a variable voltage from a DC source, such as solar panels array or a wind system, and inverts it to AC synchronized with the mains. It should automatically stop supplying electricity to the power lines when the grid is down.
A GTI can provide power to your house and even feed an excess of the electricity into the grid.

Depending on wattage and input voltage levels, GTIs circuits normally have from one to three stages. A conceptual power train schematic diagram below illustrates the principles of operation of a three-stage grid tie inverter. Such a topology can be useful for low-voltage inputs (such as 12V) in grounded systems. The control circuits and miscellaneous details are not shown here. As I mentioned above, there are also two-stage and single-stage configurations (see examples of sinewave topologies and basic principals of a DC-AC converter). A schematic of grid tie inverter The input voltage is first raised by the boost converter formed with inductor L1, MOSFET Q1, diode D1 and capacitor C2. If a PV array is rated for more than 50V, generally one of the input direct current busses has to be grounded per National Electric Code®. The NEC® however allows some exceptions which we will discuss below. Although in theory either of two busses can be connected to earth, usually it is a negative one. It is important to remember that if DC input has a conduction pass to ground, the output AC conductors in utility-interactive configurations should be isolated from DC. In our example, a galvanic isolation is provided by a high frequency transformer in the second conversion stage.
This stage is a basically a pulse-width modulated DC-DC converter. The schematic above shows a full bridge (also known as H-bridge) isolating converter. It is comprised of Q2-Q5, T1, D2-D5, L2, and C3. For power levels under 1000 watt it could also be a half-bridge or a forward converter (for more details see SMPS types). Some commercial models use low-frequency (LF) transformer in the output stage instead of a high frequency one in the DC-DC section. With such a method, input is converted to 60 Hz AC, and then a LF transformer changes it to a required level and provides isolation at the same time. The equipment with an LF transformer has a significantly larger weight and size, but it will not inject a DC component into the load. Here is a lesser known detail: UL 1741 does allow transformerless inverters and exempts them from dielectric voltage withstand test between input and output. Therefore the isolating stage can be eliminated. It is important to note that the conductors from PV array in non-isolated designs can't be bonded to earth. NEC® 690.41 allows ungrounded configurations if they comply with Article 690.35. The transformerless inverters of course feature lower weight and cost. They are especially popular in Europe. However, because of the lack of the galvanic isolation, these models present potential electrical hazards. In such a setup if a person touches a terminal of the PV panel or the battery, he will appear under AC line potential. The transformerless systems require additional protection devices per NEC® Article 690.35 and special warning labels placed wherever energized circuits may be exposed during service.

T1 can be a so-called step-up type to amplify the input voltage. With a step-up T1, the first stage (boost converter) may be omitted. However, high turns ratio leads to large leakage inductance. This in turn causes voltage spikes on the FETs and rectifiers as well as other undesirable effects.
The regulated converter provides a DC-link to the output AC inverter. Its value must be higher than the peak of the utility AC voltage. For example, for 120VAC service, the Vdc should be >120*√2=168V. Typical numbers are 180-200V. For 240VAC you would need 350-400 VDC.
The third conversion stage turns DC into AC by using another full bridge converter. It consists of IGBT Q6-Q9 and LC-filter L3, C4.
PWM produces sinewave
The IGBTs Q6-Q9 work as electronic switches that operate in PWM mode. This topology requires anti-parallel freewheeling diodes to provide an alternate path for the current when the switches are off. These diodes are either included within IGBTs or added externally. By controlling different switches in the H-bridge, a positive, negative, or zero potential can be applied across inductor L3. The output LC filter then reduces high frequency harmonics to produce a sinewave.

Any grid tie power source has to synchronize its frequency, phase and amplitude with the utility and feed a sinewave current into the load. Note that if inverter output (Vout) is higher than utility voltage, the GTI will be overloaded. If it is lower, the GTI may sink current rather than source it. In order to allow a limited current flow into the loads as well as back into the line, and because the grid acts as a source with a very low impedance, a typical GTE is designed to work as a current controlled source, rather than a voltage source. Usually there is an additional coupling inductor (Lgrid) between GTE and the mains that acts as a shim that "absorbs" the extra AC voltage. It also reduces the current harmonics generated by the PWM. A drawback of Lgrid is it introduces extra poles in the control loop, which potentially may lead to the system instability.

In solar applications, to maximize the system efficiency, a GTI also has to meet certain requirements defined by the photovoltaic panels. Solar panels provide different power in different points of their volt-ampere (V-I) characteristic. The point in the V-I curve where output power is maximum is called maximum power point (MPP). The solar inverter must assure that the PV modules are operated near their MPP. This is accomplished with a special control circuit in the first conversion stage called MPP tracker (MPPT).A GTI also has to provide so-called anti-islanding protection. When mains fails or when its voltage level or frequency goes outside of acceptable limits, the automatic switch should SW quickly disconnect the system output from the line. The clearing time depends on the mains conditions and is specified by UL 1741. In the worse cases, when utility voltage drops below 0.5 of nominal, or its frequency deviates by +0.5 or -0.7 Hz from the rated value, GTI should cease to export power back to the grid in less than 100 milliseconds. An anti-islanding can be accomplished for example via AC undervoltage or output overcurrent detection functions. Our example depicts a system with power backup option: when contactor SW opens, the GTI will supply critical loads connected to the sub-panel. The implementation of control algorithm of grid tie inverters is quite complex and normally is done with micro-controllers. The hobbyists are often searching the web for a complete schematic of a grid tie inverter. Unfortunately, it is almost a fruitless task- a GTI is hardly a DIY project. Also note, it may be illegal to connect any non-UL approved power generator into the grid-connected wiring. In any case, the manufactures of GTIs obviously will not reveal the details of their designs. Even if you could find a complete schematic, it would be useless without the controller source code. For engineers, there is a free application note AN3095 by ST Micro. It provides a complete solar inverter circuit diagram and a design guide for a 3000 watt photovoltaic inverter, but it does not provide a source code.