Microinverter
MCINV5 - Version 5
This is a solar microinverter. It converts DC power from a solar panel to AC which then passes through a transformer to get high voltage, sinewave, AC suitable for wall appliances. The microinverter's PCB is 52mm long and 102mm wide.
You can find a link to the previous versions of this project at the bottom of the page.
This project cost me €450 and took about 250 hours of work so far. It is still a work in progress.
Assembled PCB
The PCB for the microinverter consists of 4 layers (2 for power and 2 for signals) and 28 components. Although 2 layers would have been sufficient, I chose 4 layers for the extra current capacity and thermal mass. The microinverter's primary function is to chop an analog sine wave into discrete PWM signals and use them to drive 4 MOSFETs, producing a high power SPWM signal. The 2 n-channel MOSFETs are driven using a TC4424 MOSFET driver. This signal is then stepped up in voltage and filtered to achieve a clean, high power sine wave output. The microinverter can function as either grid-tied or grid-forming without requiring any hardware changes.
To address thermal management, heatsinks are attached to each MOSFET, but since they are electrically connected to each's drain they need to be kept separate. To ensure this, I designed and 3D-printed a heatsink spacer from ABS plastic (though nylon would be preferred), which also helps maintain good contact pressure between each MOSFET and its heatsink. Additionally, the PCB includes a 4-pin fan header wired to 5V for extra cooling, which (with some software modifications and maybe an adapter) can also be used to facilitate several communication protocols (for example RS485).
Software
The ATmega328P is running a modified version of Kurt Hutten's code. The code generates a 10KHz SPWM output on pins 15 and 16 with matching square waves on pins 17 and 19. The square waves go through inversion MOSFETs to the gates of the high-side p-channel MOSFETs, resulting in each of them being active for consecutive 10ms periods. The SPWM signal goes to the gates of the faster, n-channel MOSFETs, thus modulating their output to create a high power SPWM waveform across the load.
The ATmega328P has the ability to monitor the grid's voltage curve through the board's "phase lock" circuit. In grid-tied mode, the microinverter waits until it detects a voltage peak and then activates when the voltage drops to 0, thus synchronizing with the grid at the 180° phase. In grid-forming mode, the microinverter spends anywhere from 10 to 200 cycles waiting to detect a voltage peak and then follows the previous procedure to synchronize with the preexisting grid. If a voltage peak is not detected within that timeframe then no grid exists and the microinverter proceeds to generate its own. Values are subject to change with newer versions of the code, you can find a link to the most recent version at the bottom of the page.
By default the microinverter operates in grid-tied mode. Shorting pins 12 and 13 puts the microinverter in grid-forming mode.
Filter
The microinverter's output is passed through a toroidal transformer and a low pass filter (LPF) to deliver a smooth sine wave output. The LPF uses a 1mH inductor and a 25μF capacitor to achieve a cutoff frequency of 3.2kHz. Ideally, the cutoff frequency would be lower but these were the components I had available. This is my first PCB for high voltage operation so it probably isn't very safe to use.
Output
This image shown is the microinverter's output before filtering. It is (obviously) not a sinewave. That is because although earlier results (output of MCINV3) seemed to show that the ATmega328P would be enough to drive the 10KHz signal of the MOSFETs, it turns out to be insufficient. I will have to correct that with the next version.
BOM
=> ATmega328P
=> Schottky diode
=> 1N5817 diode
=> 25V capacitor [3]*
=> 5V capacitor
=> 100nF capacitor
=> 22pF capacitor [2]
=> LM2940T-5.0
=> IRLZ44N [2]
=> FQP27P06 [2]
=> BS170 [2]
=> TC4424
=> 10kΩ resistor 1/4W [8]
=> 2kΩ resistor 1/4W
=> 100kΩ resistor 1/4W
=> 16MHz oscillator
=> 22mm heatsinks [4]*
=> 4 pin fan header*
=> M3x12 screws [4]*
=> M3x8 screw*
=> M3 locking nut*
=> M3 nylon washer [4]
=> 5V fan*
*optional