200W Arduino Nano Solar GridTie Inverter

by Poldo in Circuits > Arduino

78 Views, 1 Favorites, 0 Comments

200W Arduino Nano Solar GridTie Inverter

Nano GTI.jpg

Sometime after publishing my 100W solar grid tie inverter project a person who goes by the name alin_49 left a comment saying "i am a beginner Can you convert the coding to arduino nano?"

To which I replied "Unfortunately, the Nano is not suitable for this application. You need a 16bit pwm and 12bit A to D converter to implement the phase lock loop." and this was a true statement based on how I was implementing the grid-tie algorithm.

So over the years I often thought - would it be possible to make a decent grid tie inverter using an Arduino Nano? Eventually, I decided to take up the challenge. This instructable details what I did and the good news is YES, you can actually make a fairly good grid tie inverter using the Arduino Nano!

Just a bit of caution.

This is definately NOT a beginner project. Please do not attempt to replicate this unless you have at least an intermediate understanding of electronics and experience working with grid mains. That said, this build is a proof of concept - working proto-type for educational purposes only and has not been fully tested under all possible conditions.

Supplies

At a minimum a good quality two channel Oscilloscope and digital multimeter along with a 100 to 200W resistive dummy load are required for test and calibration. I used:

  1. OWON SDS1102 Oscilloscope
  2. HP34401A multimeter
  3. 20-40pcs 10k 10W ceramic resistors all in parallel as a dummy load
  4. 0-30V 10Amp bench power supply
  5. Solar Panel - Seraphim 60 cell 255W P/N SRP-255-6PB

Challenges / Specifications

Challenges using Arduino Nano for a Solar Grid-Tie Inverter


The two main challenges when using a Nano vs the STM32F103c8 are the relatively low clock speed and longer - less accurate analog to digital conversions.

Nano clock speed (16MHz)

When compared with an STM32F103c8 running at 72MHz, almost 5x more time is needed to do similar math calculations. Inspired by this video https://youtu.be/tnfeMCyLZSo I modified the code and looked at the execution times for some common calculations using the Nano. Note: The int and float values are chosen randomly each time the test was run. Below are the average results:

  1. analogRead() - 110us (default prescaler setting)
  2. analogRead() - 16us (ADC prescaler set to 16)
  3. float * float - 9.5us
  4. int * int - 1.4us
  5. float / float - 30us
  6. int + int - 1us
  7. int - int - 1us
  8. float + float - 7.5us
  9. float - float - 7.5us
  10. map() - 40us

The increased computation time results in fewer analog samples able to be taken during each grid period. Therefore, the number of sampled parameters and calculations need to be minimized to the fewest number possible.


Nano analog to digital resolution and conversion time

10 bit resolution (0 -1023) vs 12 bit (0 - 4095)

  1. reduced resolution (harder to sense small changes in voltage and current)
  2. Minimum conversion time with acceptable error is 13us (typically 16us) https://www.gammon.com.au/adc

This limits the practical number of simultaneously measured parameters in order to get a reasonable facimile of the grid signal for direct modulation of the pwm.


Choosing the type of Grid-Tie Inverter


When it comes to grid tie inverters there are basically two types, the voltage source inverter and the current source inverter. Both types can be implemented using various topologies.

Voltage Source Inverter (VSI)

The voltage source inverter has at least two stages and normally requires several tightly controlled loops to maintain frequency, phase, voltage and current synchronization with the grid. As a result, this type inverter cannot safely be implemented using the Arduino nano. To learn more about this type of inverter I recommend you check out the instructable by a guy known as fotherby https://www.instructables.com/Grid-Tie-Inverter/ He does a really excellent job explaining this type of grid tie inverter. He details his work including lessons learned over several iterative versions.


Current Source Inverter (CSI)

The current source inverter is a single stage inverter and requires a minimum of only one loop to control current injection. Frequency / phase synchronization can be accomplished by direct modulation of the pwm from the grid sample and a zero- crossing detector for the unfolding bridge. Due to its relative simplicity this type is chosen for the project.


Minimum GPIO Required


Analog Inputs

  1. Grid voltage (required continuously)
  2. Inverter voltage (required only when NOT grid tied)
  3. DC input voltage (required continuously)
  4. DC input current (required only when grid tied)
  5. Potentiometer adjust (required only when in test mode)

Analog Comparator Inputs (Zero-crossing detector)

  1. AIN0
  2. AIN1

Digital Inputs

  1. Manual grid-tie switch ON/OFF (required for test & calibration)

Digital Outputs

  1. PWM (Timer2)
  2. Grid-Tie relay control signal
  3. Unfolding bridge control signal
  4. LED Status (GRN)
  5. LED status (RED)


Inverter Main Features


Flyback transformer

  1. One stage DC to AC converter
  2. Simple PWM current injection control
  3. E55 core for higher power handling


Fault monitoring

When NOT grid tied, a detected fault will inhibit activation of the grid tie relay and when grid tied, the relay will be automatically de-energized when a fault is detected. Fault monitoring includes;

  1. Input solar voltage
  2. Grid voltage range
  3. Inverter output voltage
  4. Input power

There is a BI-LED fault status indicator using various combinations of Green, Red and Yellow along with fast and slow blink rates to identify which fault is detected


Maximum Power Point tracking(MPPT)

When using a solar panel as the DC input, a power tracking method is needed to ensure that maximum power is being harvested from the solar panel during changing weather conditions. There are many methods that can be employed in order to accomplish this. For this project we will use a variation of the Perturb & Observe (P&O) method also sometimes referred to as "hill climbing".

  1. 18V - 32V range
  2. Two step control method (Fine and Course)
  3. Adjustable frequency



Inverter Input / Output Specifications


INPUT SPECIFICATIONS (DC)

  1. PV Module 60 CELLS / 255W MAX (@25ÂșC)
  2. Continuous Input Power 255W (Max)
  3. Maximum Input Voltage 40V
  4. MPPT Voltage Range 18-32V


OUTPUT SPECIFICATIONS (AC)

  1. Rated Output Power 200W(max) @ 29VDC INPUT (min)
  2. Voltage/Range - 207VAC-253VAC
  3. Current 0.87A @ 230VAC Nominal
  4. Frequency 60Hz nominal
  5. Power Factor = 0.99 > 50W


EFFICIENCY

  1. 85% Typical

Topology

Simplified Topology.png

The topology for this inverter is basically the same as my previous 100W-Solar-Flyback-Grid-Tie-Inverter project. The main hardware differences are the the microcontroller and the flyback transformer. A comprehensive review of how this inverter works is detailed here: https://www.instructables.com/100W-Solar-Flyback-Grid-Tie-Inverter-Part1/

Since the software algorithm is what allows the Arduino nano to control the gridtie inverter, I will focus on that instead.

Relay Characterization

Relay Characterization

Connecting or disconnecting from the grid at the point where the output voltage / current is close to zero is perferred. Since the output smoothing inductor is in series with the grid, if the relay was to suddenly be "turned OFF" while current was flowing, the inductor would tend to resist the change in current resulting in a build-up of voltage which could damage the output mosfets. Turning the relay ON or OFF near zero current helps protect the mosfets and lowers the overall stress on the associated components.

When voltage is applied to the relay coil there is a delay before the relay contacts acually close referred to as "Operating Time". Conversely, when voltage is disconnected from the relay coil there is a delay before the relay contacts open referred to as "Release Time". Release time and operate time are usually specified in the data sheet as typical or maximum values. I decided to perform some in circuit testing in order to see what the actual release & operate times were.

To see the results of this testing please watch this short presentation.

Pseudo Code Review

Psuedo Code

To better understand how I implemented the algorithym to control the grid-tie inverter using the Arduino Nano, please watch this short presentation.

MPPT Analysis

MPPT
MPPT Two Step Flow.png

I built a data logger which records solar panel voltage, current and normalized irradiance while the grid tie inverter is running and performing the MPPT algorithym. The normalized irradience is the voltage output of my second solar panel wich is operating under NO Load condition. Because the A to D converter is only 10 bit as stated earlier, the ability to detect small changes in current is limited. Therefore, the sensitivity of the MPPT is also limited but I think the results are good. The results and MPPT analysis are presented in this video.

Schematics BoM and PCB ASSY

Back End Schematic.png
Front End Schematic.png
BackEnd PCB.png
FrontEnd PCB.png

Arduino Nano Code and Other Files

I coded this using the Arduino IDE and structured the code using tabs. You can find the file on my Google Drive;


https://drive.google.com/drive/folders/1e-_BTjmdY0pYAq8zci2qjRfQVNeCaP1e?usp=drive_link