Microinverter
MCINV6 - Version 6
The goal of this project was to design and make a solar microinverter designed to be used with a 12V solar panel. It converts DC power from the solar panel to AC which then passes through a transformer to get high voltage AC power 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.
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 dual MOSFET driver IC in order to eliminate any current bottlenecks from the microcontroller's weak output. 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 original plan was for the ATmega328P to run a modified version of Kurt Hutten's code. That 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. I ended up not getting a good enough input on the MOSFET's gate so I opted to use a square wave for both types of MOSFETs.
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.
This was designed to be used with the SPWM version of the code so I ended up not using this.
Output
This image shown is the microinverter's output with a 100W load attached (two 12W led light bulbs, one 5W USB power adapter, and one 50W floor fan). A toroidal transformer was used to step up the inverter's output to 230V in order to power household loads. The output voltage was fluctuating based on the connected load because the inverter doesn't have a feedback system or any way to change it's input voltage.
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