AN1521. Practical Guide to Implementing Solar Panel MPPT Algorithms SOLAR PANEL MPPT INTRODUCTION



Similar documents
TB3016. Using the PIC MCU CTMU for Temperature Measurement IMPLEMENTATION BASIC PRINCIPLE MEASUREMENT CIRCUIT

AN1303. Software Real-Time Clock and Calendar Using PIC16F1827 DATA INTERFACE INTRODUCTION IMPLEMENTATION INTERNAL REGISTER MAP

Recommended Usage of Microchip 23X256/23X640 SPI Serial SRAM Devices RECOMMENDED CONNECTIONS FOR 23X256,23X640 SERIES DEVICES VCC 23X256/ HOLD.

AN1286. Water-Resistant Capacitive Sensing INTRODUCTION THEORY OF OPERATION. Sensing Steps. Sensing Steps Description DESIGN

Installing and Licensing MPLAB XC C Compilers

AN1470. Manchester Decoder Using the CLC and NCO ABSTRACT INTRODUCTION MANCHESTER ENCODED DATA (AS PER G.E. THOMAS)

TC1047/TC1047A. Precision Temperature-to-Voltage Converter. General Description. Applications. Block Diagram. Features.

AN1325. mtouch Metal Over Cap Technology THEORY OF OPERATION INTRODUCTION CROSS SECTION OF METAL OVER CAPACITIVE (UNPRESSED)

AN1142. USB Mass Storage Class on an Embedded Host INTRODUCTION. USB Mass Storage Class. Overview

AN687. Precision Temperature-Sensing With RTD Circuits RTD OVERVIEW INTRODUCTION EQUATION 1:

Universal Programming Module 2

AN1492. Microchip Capacitive Proximity Design Guide INTRODUCTION CAPACITIVE SENSING BASICS SENSING

Uninstalling Incorrect USB Device Drivers

AN1332. Current Sensing Circuit Concepts and Fundamentals CURRENT SENSING RESISTOR INTRODUCTION. Description. Microchip Technology Inc.

AN1156. Battery Fuel Measurement Using Delta-Sigma ADC Devices INTRODUCTION REVIEW OF BATTERY CHARGING AND DISCHARGING CHARACTERISTICS

AN Wire Communication with PIC Microcontroller INTRODUCTION. OVERVIEW OF THE 1-Wire BUS. 1-Wire Protocol. Prerequisites

AN1275. KEELOQ with Advanced Encryption Standard (AES) Receiver/Decoder KEY FEATURES OVERVIEW. Microchip Technology Inc.

Features, Value and Benefits of Digital Control for Power Supplies

AN1857. RGBW Color Mixing DALI Control Gear. COLOR MIXING USING RED, GREEN, BLUE AND WHITE LEDs INTRODUCTION HARDWARE

AN1543. Using MRF24W with PIC32 Internal Program Flash Memory For EZ_CONFIG_STORE ALTERNATIVE LOW-COST SOLUTIONS OVERVIEW SCOPE

AN1353. Op Amp Rectifiers, Peak Detectors and Clamps INTRODUCTION BASIC RECTIFIERS. Choosing the Components. Positive Half-Wave Rectifier.

TC7660. Charge Pump DC-to-DC Voltage Converter. Package Types. Features. General Description. Applications. Functional Block Diagram TC7660

Touch Through Metal. mtouch Metal Over Capacitive Technology Part 1

PIC18F26K20/46K20 Rev. B2/B3/B5/B6 Silicon Errata and Data Sheet Clarification

AN905. Brushed DC Motor Fundamentals INTRODUCTION PRINCIPLES OF OPERATION. Stator. Rotor SIMPLE TWO-POLE BRUSHED DC MOTOR. Microchip Technology Inc.

PIC32 Microcontroller Families

Designing A Li-Ion Battery Charger and Load Sharing System With Microchip s Stand-Alone Li-Ion Battery Charge Management Controller

MPLAB XC8 GETTING STARTED GUIDE. MPLAB XC8 Getting Started Guide

AN1767. Solutions for Radio Frequency Electromagnetic Interference in Amplifier Circuits WHAT IS ELECTROMAGNETIC INTERFERENCE (EMI)

MCP73X23 Lithium Iron Phosphate (LiFePO 4 ) Battery Charger Evaluation Board User s Guide

AN1465. Digitally Addressable Lighting Interface (DALI) Communication TERMINOLOGY PHYSICAL LAYER DALI FREE-FORM LAYOUT. Topology FIGURE 1:

Peripheral Brief: Programmable Switch Mode Controller (PSMC) 1, 2, 4, 8 PSMCXTMR CLR PSMCXPR = Period. Event PSMCXPRS. Rising.

AN1265. KEELOQ with AES Microcontroller-Based Code Hopping Encoder INTRODUCTION DUAL ENCODER OPERATION BACKGROUND FUNCTIONAL INPUTS AND

Timers: Timer0 Tutorial (Part 1)

AN1066. Microchip MiWi Wireless Networking Protocol Stack INTRODUCTION CONSIDERATIONS TERMINOLOGY FEATURES

Section 15. Input Capture

MPLAB Code Configurator User s Guide

28-PIN DEMO BOARD USER S GUIDE

AN1861. Bluetooth Smart Communication Using Microchip RN4020 Module and 16-bit PIC Microcontroller BLUETOOTH SMART COMMUNICATION INTRODUCTION

TCM809/TCM Pin Microcontroller Reset Monitors. General Description. Features. Applications. Pin Configurations. Typical Application Circuit

AN1467. High-Power CC/CV Battery Charger Using an Inverse SEPIC (Zeta) Topology THE ZETA CONVERTER INTRODUCTION POWER TRAIN

WORKSHOP-IN-A-BOX 2: LOW POWER SOLUTIONS DEMONSTRATION BOARD

Resistive Temperature Detector (RTD) Reference Design

Integrated Development Environment

MCP2200 USB to RS-232 Demo Board User s Guide

MCP3021. Low Power 10-Bit A/D Converter With I 2 C Interface. Description. Features. Applications. Functional Block Diagram.

AN1256. Microchip s Power MOSFET Driver Simulation Models INTRODUCTION MODEL DESCRIPTION. Using The Power MOSFET Simulation Models

LM134-LM234-LM334. Three terminal adjustable current sources. Features. Description

AN1387. Using PIC32 MCUs to Develop Low-Cost Controllerless (LCC) Graphics Solutions INTRODUCTION. Basic Graphics Definitions

AN1212. Using USB Keyboard with an Embedded Host INTRODUCTION. USB Keyboard Overview. USB Keyboard with an Embedded Host USB KEYBOARD OUTPUT REPORT

AN1307 FULL STEP MODE PHASE VOLTAGE AND PHASE CURRENT MICROSTEPPING WITH 1/4 STEP SIZE

Section 5. Flash Programming

MCP1701A. 2 µa Low-Dropout Positive Voltage Regulator. Features. General Description. Applications. Package Types

AN1160. Sensorless BLDC Control with Back-EMF Filtering Using a Majority Function SENSORED CONTROL VERSUS SENSORLESS CONTROL INTRODUCTION

Integrated Development Environment

AN2389 Application note

TABLE 1: BUCK REGULATOR

Solar Energy Conversion using MIAC. by Tharowat Mohamed Ali, May 2011

AN1426. Design Tips for the MCP3911 INTRODUCTION. Addressable Devices on Single SPI Bus. Addressable SPI for Poly-phase Meter Designs.

Analog-to-Digital Converters

MCP73811/2. Simple, Miniature Single-Cell, Fully Integrated Li-Ion / Li-Polymer Charge Management Controllers. Description. Features.

MPLAB ICD 3 In-Circuit Debugger User s Guide For MPLAB X IDE

AN645. PIC16C57 Based Code Hopping Security System PINOUT OVERVIEW FEATURES BLOCK DIAGRAM RECOMMENDED READING

Software Real Time Clock Implementation on MC9S08LG32

dspic30f3012/3013 dspic30f3012/3013 Rev. B0 Silicon Errata dspic30f3012/3013 (Rev. B0) Silicon Errata Silicon Errata Summary

MCP2515 CAN Bus Monitor Demo Board User s Guide

Introduction to SMPS Control Techniques

AN2604 Application note

MCP14A0151/2. 1.5A MOSFET Driver with Low Threshold Input And Enable. Features. General Description. Applications. Package Types

AN2680 Application note

TCP/IP Networking: Web-Based Status Monitoring

Processor Extension Pak (PEP) and Debug Header Specification

Design and Construction of Variable DC Source for Laboratory Using Solar Energy

AN709. System Level Design Considerations When Using I 2 C TM Serial EEPROM Devices INTRODUCTION INSURING BUS-FREE DURING POWER-UP

SIMPLE TECHNIQUES TO IMPROVE SOLAR PANEL EFFICIENCY USING A MICROCONTROLLER OR SOC

AN1305. Sensorless 3-Phase Brushless Motor Control with the PIC16FXXX TYPICAL MOTOR CONNECTION OVERVIEW DRIVE AND CONTROL CIRCUITRY

Description. Table 1. Device summary

Freescale Semiconductor, I

AN232. Low-Frequency Magnetic Transmitter Design ABOUT THIS APPLICATION NOTE INTRODUCTION LFMC LINK COMPONENTS

AN990. Analog Sensor Conditioning Circuits An Overview INTRODUCTION SENSOR APPLICATIONS. Target Audience. Goals. Description.

Serial EEPROM Powered for Automotive

AN956. Migrating Applications to USB from RS-232 UART with Minimal Impact on PC Software OVERVIEW INTRODUCTION. Microchip Technology Inc.

Fox-2 MPPT Unit Testing

Switch Mode Power Supply Topologies

2K SPI Bus Serial EEPROMs with EUI-48 or EUI-64 Node Identity

1.5A Dual MOSFET Driver with Low Threshold Input And Enable MCP14A OUT A OUT A OUT A IN A GND IN B

AN884. Driving Capacitive Loads With Op Amps INTRODUCTION LINEAR RESPONSE. Simplified Op Amp AC Model. Overview. Purpose OP AMP MODEL EQUATION 1:

AN1370. Smart Card Communication Using PIC MCUs INTRODUCTION SMART CARD COMMUNICATION USING PC APPLICATION

Bi-directional Power System for Laptop Computers

LM134-LM234 LM334 THREE TERMINAL ADJUSTABLE CURRENT SOURCES. OPERATES from 1V to 40V

PICkit 3 Programmer/Debugger User s Guide

LM337. Three-terminal adjustable negative voltage regulators. Features. Description

MC13783 Buck and Boost Inductor Sizing

MGC3130 Hillstar Development Kit User s Guide

AN4368 Application note

How To Use Microchip.Com

AN3265 Application note

Description. Table 1. Device summary. Order codes. TO-220 (single gauge) TO-220 (double gauge) D²PAK (tape and reel) TO-220FP

Evaluating AC Current Sensor Options for Power Delivery Systems

Transcription:

AN5 Practical Guide to Implementing Solar Panel MPPT Algorithms Authors: INTRODUCTION Mihnea Rosu-Hamzescu Sergiu Oprea Microchip Technology Inc. Using a solar panel or an array of panels without a controller that can perform Maximum Power Point Tracking (MPPT) will often result in wasted power, which ultimately results in the need to install more panels for the same power requirement. For smaller/cheaper devices that have the battery connected directly to the panel, this will also result in premature battery failure or capacity loss, due to the lack of a proper end-of-charge procedure and higher voltage. In the short term, not using an MPPT controller will result in a higher installation cost and, in time, the costs will escalate due to eventual equipment failure. Even with a proper charge controller, the prospect of having to pay 30-50% more up front for additional solar panels makes the MPPT controller very attractive. This application note describes how to implement MPPT using the most popular switching power supply topologies. There are many published works on this topic, but only a tiny portion of them show how to actually implement the algorithms in hardware, as well as state common problems and pitfalls. Even when using the simplest MPPT algorithm with a well-designed synchronous switching power supply, it can be expected that at least 90% of the panel s available power will end up in the battery, so the benefits are obvious. The topology presented in this application note is an inverse SEPIC, but the techniques used here can be applied to buck, boost and SEPIC converters. The buck converter is a special case, since it has a linear voltage transfer function when operating in Continuous Conduction Mode (CCM). This simplifies things a lot, and the MPPT controller can be implemented by operating directly on the converter duty cycle. The other topologies have a nonlinear voltage transfer function, and operating directly on the duty cycle will yield unpredictable results, especially at high duty cycles. In this case, the algorithm modifies the solar panel operating voltage by using a proportional integral (PI) control loop, which steers the voltage to the desired value. SOLAR PANEL MPPT The main problem solved by the MPPT algorithms is to automatically find the panel operating voltage that allows maximum power output. In a larger system, connecting a single MPPT controller to multiple panels will yield good results, but, in the case of partial shading, the combined power output graph will have multiple peaks and valleys (local maxima). This will confuse most MPPT algorithms and make them track incorrectly. Some techniques to solve problems related to partial shading have been proposed, but they either need to use additional equipment (like extra monitoring cells, extra switches and current sensors for sweeping panel current), or complicated models based on the panel characteristics (panel array dependent). These techniques only make sense in large solar panel installations, and are not within the scope of this application note. Ideally, each panel or small cluster of panels should have their own MPPT controller. This way the risk of partial shading is minimized, each panel is allowed to function at peak efficiency, and the design problems related to converters handling more than 0-30A are eliminated. A typical solar panel power graph (Figure ) shows the open circuit voltage to the right of the maximum power point. The open circuit voltage (VOC) is obviously the maximum voltage that the panel outputs, but no power is drawn. The short-circuit current of the panel (ISC) is another important parameter, because it is the absolute maximum current you can get from the panel. 03 Microchip Technology Inc. DS00005A-page

AN5 FIGURE : SOLAR PANEL CHARACTERISTICS DS00005A-page 03 Microchip Technology Inc.

AN5 The literature on this subject generally agrees that the maximum amount of power that can be extracted from a panel depends on three important factors: irradiance, temperature and load. Matching panel and load impedances with a DC-DC converter makes sense, because for example, if you have a 5V/A load, and a 0W panel that has the MPP at 7.5V/.5A, connecting the load directly will not work. Considering a simple resistive load, and the short-circuit current of.5a, the panel will only be able to provide about 3V/.A, or less than 4W out of 0W. Temperature mainly changes the panel voltage operating point, while irradiance mainly changes the panel operating current. Figure shows the effect of different irradiance levels on the panel voltage, current and power. There are a few MPPT algorithms that can be easily implemented using an 8-bit microcontroller. FRACTIONAL OPEN CIRCUIT VOLTAGE The maximum power point voltage has a linear dependency on the open circuit voltage VOC under different irradiance and temperature conditions. Computing the MPP (Maximum Power Point) comes down to: FRACTIONAL SHORT CIRCUIT CURRENT The MPP can also be determined from the short-circuit current of the panel (ISC), because IMPP is linearly related to it under varying atmospheric conditions. EQUATION : I MPP = k I I SC Similar to fractional open circuit voltage, the constant must be determined for each type of system. Determining ISC is more challenging, because doing so from time to time not only increases power loss and heat dissipation, but also requires an additional switch and current sensor. Obviously, this increases component count and cost. The simplest implementations do not require microcontrollers, but for better accuracy and to solve problems related to partial shading, more processing power is necessary to sweep the panel current from 0 to ISC, and memorize the output voltage profile. EQUATION : V MPP = k V V OC The constant k depends on the type and configuration of the photovoltaic panel. The open circuit voltage must be measured and the MPP determined in some way for different ambient conditions. Usually, the system disconnects the load periodically to measure VOC and calculate the operating voltage. This method has some clear disadvantages, temporary loss of power being an obvious one. An alternate method would be to use one or more monitoring cells, but they also need to be chosen and placed very carefully to reflect the true open circuit voltage of the system. Although this method is quite simple and robust and does not require a microcontroller, the constant only allows a crude approximation of the MPP. Other algorithms will significantly increase the top power drawn from the same PV installation. 03 Microchip Technology Inc. DS00005A-page 3

AN5 PERTURB AND OBSERVE (P&O) FIGURE : P&O ALGORITHM START P k > P k-? P k > P k-? YES NO NO YES Increase operating voltage Decrease operating voltage P&O is one of the most discussed and used algorithms for MPPT. The algorithm involves introducing a perturbation in the panel operating voltage. Modifying the panel voltage is done by modifying the converter duty cycle. The way this is done becomes important for some converter topologies. Looking at Figure makes it easy to understand that decreasing voltage on the right side of the MPP increases power. Also, increasing voltage on the left side of the MPP increases power. This is the main idea behind P&O. Let s say that, after performing an increase in the panel operating voltage, the algorithm compares the current power reading with the previous one. If the power has increased, it keeps the same direction (increase voltage), otherwise it changes direction (decrease voltage). This process is repeated at each MPP tracking step until the MPP is reached. After reaching the MPP, the algorithm naturally oscillates around the correct value. The basic algorithm uses a fixed step to increase or decrease voltage. The size of the step determines the size of the deviation while oscillating about the MPP. Having a smaller step will help reduce the oscillation, but will slow down tracking, while having a bigger step will help reach MPP faster, but will increase power loss when it oscillates. To be able to implement P&O MPPT, the application needs to measure the panel voltage and current. While implementations that use only one sensor exist, they take advantage of certain hardware specifics, so a general purpose implementation will still need two sensors. P k = Current power reading P k- = Previous power reading DS00005A-page 4 03 Microchip Technology Inc.

AN5 INCREMENTAL CONDUCTANCE FIGURE 3: INCCOND ALGORITHM START V = V K - V K- I = I K - I K- P = P K - P K- V = 0? YES NO YES P V = 0? I = 0? YES NO NO P V > 0? I > 0? NO YES NO YES Decrease operating voltage Increase operating voltage Decrease operating voltage Increase operating voltage RETURN The incremental conductance algorithm uses the fact that the panel power curve derivative (or slope) versus voltage is 0 at MPP, positive on the left side and negative on the right side of the MPP. EQUATION 3: dp dp ------ ------= = 0 0at at MPP dv dv dp ------ 0 left of MPP dv dp ------ 0 right of MPP dv The power derivative can be also written as: EQUATION 4: dp div IdV VdI ------ = ------------- = -------- + -------- = I+ V------ di dv dv dv dv dv I+ V di dv ------ I + V ------ I V So the first bundle of equations () can be rewritten as: EQUATION 5: I dp I ------ ------ = = -- 0 at MPP VdV V I I ------ -- left of MPP V V I I ------ -- right of MPP V V The main idea is to compare the incremental ΔI conductance ( ΔV ) to the instantaneous conductance I ( V ). Depending on the result, the panel operating voltage is either increased, or decreased until the MPP is reached. Unlike the P&O algorithm, which naturally oscillates around the MPP, incremental conductance stops modifying the operating voltage when the correct value is reached. A change in the panel current will restart the MPP tracking. Depending on the ambient conditions, the same functionality may be achieved by using the initial equation ( ΔP ). ΔV 03 Microchip Technology Inc. DS00005A-page 5

AN5 The basic incremental conductance algorithm uses a fixed step size for the panel operating voltage updates. Using a bigger step size will speed up tracking, but may also cause the algorithm to oscillate around the MPP instead of locking on. Implementing the incremental conductance algorithm requires the voltage and the current output values from the panel (two sensors). Because it needs to keep track of previous voltage and current values, this algorithm is usually implemented using a PIC device or a DSP. DS00005A-page 6 03 Microchip Technology Inc.

AN5 MPPT HARDWARE PLATFORM FIGURE 4: MPPT SCHEMATIC AMP_VDD 4 8 U.3 V- V+ R k C 0pF R3 00k U. _ + 6 5 B 7 MCP6V0 (Part ) R6 00R ISENSE_IN R 0R00 R 0R00 C uf AMP VPV J-VPV VPV VPV R3 k BAT4 K A C8 0uF C7 0uF C6 0uF C3 0uF C9 0uF C5 0uF C4 0uF C4 0uF C5 0uF C9 MCLR VCC PGD-ICD PGC-ICD NO CONNECT J 34 5 6 BUT +5V PGD/FAULT PGC/ISENSE_OUT NC0 C uf C6 00nF IC HIGHDR BOOT PWM PHASE FCCM VCC LOWDR 8 Q 7 65 C C7 0uF C8 0uF SI454 SI454 4 MCP468 0uF +5V 34 5 67 8 R4 0R C uf 5 6 7 8 3 WE 744363* 0uH 4 VOUT J-OUT WE 744363* C5 0nF 3 0uH Q C30 0uF C0 0uF C 0uF C9 47uF C0 47uF R5 0R00 R6 0R00 U. R7 3 + A 00R MCP6V0 (Part ) R5 00k C3 R7 k R4 k VPV +5V PGC/ISENSE_OUT 34 5 6 7 VDD RA5 RA4 MCLR/VPP/RA3 RC5 RC4 RC3 PIC6F503 VSS RA0/ICSPDAT RA/ICSPCLK RA RC0 RC RC 4 3 0 98 PGD/FAULT PGC/ISENSE_OUT VSENSE_IN SCL SDA ISENSE_IN 0pF - C6 00nF B 3 4 BUT J3-BUT D R8 LED VOUT R9 k VIN_DIV R8 30k R 3k C7 nf VOUT_DIV VPV +5V U VIN VOUT 3 (TAB) (TAB) MCP790_DB C8 nf _SEL R0 0k C4 4 C3 uf 0uF DIV_ NC0 BUT LED AMP_VDD VSENSE_OUT 03 Microchip Technology Inc. DS00005A-page 7

AN5 For demonstrating and testing the MPPT algorithms in this application note, the synchronous inverse SEPIC (ZETA) hardware platform presented in AN467, High-Power CC/CV Battery Charger Using an Inverse SEPIC (Zeta) Topology, was used. The NCO peripheral of the PIC6F503 is used to generate a high resolution 5-bit fixed on-time PWM for the control scheme. In general, the implementation is similar to a DC-DC converter with current and voltage sensors on the input side (solar panel). If battery charging is implemented on the same platform, then another set of current and voltage sensors is required on the output side. FIGURE 5: PV CURRENT SENSOR C 0pF R3 00K VPV R K U. 6 B 5 7 R6 00R ISENSE_IN J-VPV R 0R00 R 0R00 For best accuracy, a high-side sensor should be used, but this complicates things and requires a specialized chip. It is easier to use a low-side shunt and an inverting amplifier, but the microcontroller and amplifier current is added to the measurement. Microchip s MCP6V0 is perfect for this task due to the high amplification that is required to keep power dissipation at a minimum. This amplifier only has uv of voltage offset. Even without any prior calibration, we can expect 5% of current measuring accuracy (all resistors %). Since most of the switching noise is amplified along with the current shunt voltage, it is recommended to reduce the amplifier bandwidth. Because the prototype used for testing the algorithms relies on a proportional integral (PI) loop to regulate voltage and current, and the loop update rate is khz, the corner frequency is set around 7 khz. Having a properly filtered signal is very important because algorithms like INCCOND are easily disturbed by noise and their performance degrades. Normally, for the MPPT, it is desirable to have a very fast update rate and a small increment step. This way, tracking accuracy is improved (small increment), and the speed loss is countered by the high update rate. In practice, this is not always possible. FIGURE 6: VPV R R9 3K K PV VOLTAGE SENSOR C7 VIN_DIV nf DS00005A-page 8 03 Microchip Technology Inc.

AN5 The current shunt amplifier amplification, ADC resolution and noise will dictate the lower limit of the step size. This is why the current shunt amplification needs to be large enough, so that the output for the maximum allowed current will be close to the ADC input voltage limit. The test board was designed to work at 8A input current with a 5 mohm shunt. Current shunt amplification is 00, so the maximum output value is: EQUATION 6: 8A*0.005Ohm*00 = 4.0V Please note that the maximum output value of the amplifier should allow enough headroom for the PI loop to quickly handle overcurrent conditions. The ADC reference is 5V with 0 bits of resolution, making this a good choice. The current resolution is given by the ADC resolution and, in this case, is about 0 ma. When measuring, a few bits of noise is expected, so choose the MPPT step accordingly. Regarding the panel voltage sensor, the divider ratio should be chosen depending on the panel open circuit voltage, which is the maximum panel voltage. On the testing board, the ADC reference is 5V and a 36-cell panel was used. This means VOC should not go above V (36 * 0.6V). Also, one must think about maximizing voltage resolution, so a /5 divider was chosen, allowing a maximum input voltage of 5V. The voltage resolution depends on the divider ratio and the ADC resolution, in this case about 5 mv. MPPT SOFTWARE IMPLEMENTATION The PIC MCU used for this prototype is an 8-bit device without a hardware multiplier, so the computational power is limited. This makes everything extremely attractive from a cost standpoint, but also makes the implementation more challenging. Having a multi-step battery charger and an MPPT controller running on the same chip is a challenge due to the following issues: Device must regulate output current Device must regulate output voltage Device must track the panel MPP Device must run a battery-charging state machine Device has limited computational power and must run only one regulation loop The algorithms presented in this application note track the maximum power point by modifying the panel operating voltage. This solution is not topology-dependent and is the best solution overall. Modifying the converter duty cycle directly only works well with the buck topology, which has a linear voltage transfer function. EQUATION 7: 5V -----------*5 = 0.0044V 03 The MPPT update rate is also limited by several factors. The most important thing is the PI loop update rate, which should be significantly faster than the MPPT update rate. Obviously, this is important because between MPPT updates the PI loop must have enough steps to be able to steer the panel voltage to the new value. The implementation used to test the algorithms runs the MPPT update at 40 Hz, while the PI loop runs at khz (5 times faster). The board input capacitance will have an important contribution to the MPPT accuracy in low illumination conditions. While input capacitance is good for limiting current ripple, it will also slow down panel voltage variations. This is extremely important for tracking at low-power levels. Too little capacitance will cause stress to the components (high-voltage ripple remember the inverse SEPIC has discontinuous input current), but too much capacitance will cause the panel voltage regulation loop in Tracking mode to be unable to reach the set point between MPPT updates. 03 Microchip Technology Inc. DS00005A-page 9

AN5 THE MAIN PROGRAM LOOP CODE EXAMPLE : _ Initialize_Hardware(); while() if(t0if) T0IF = 0; if(but_cnt) but_cnt--; if(track && mppt_calc) mppt_calc--; if(second) second--; read_adc(); if(!track) if(battery_state!= FAULT) cc_cv_mode(); if(!cmode) pid(vout, vref); else pid(iout, iref); else if(increment >= dmax) track = TRACK_DELAY; if(mppt_calc < MPPT_AVERAGE) f_vin += vin; f_iin += iin; if(!mppt_calc) mppt_calc = MPPT_INTERVAL; #ifdef MPPT_PO mppt_po(); #endif #ifdef MPPT_INCCOND mppt_inccond(); #endif pid(vinref, vin); if(vout > vref iout > iref) track--; dmax = increment; if(!track) Init_State_Machine(); else track = TRACK_DELAY; if(!second) second = SECOND_COUNT; if(!track) Battery_State_Machine(); DS00005A-page 0 03 Microchip Technology Inc.

AN5 The main program loop structure is similar to the one used in the CC/CV battery-charging code attached to AN467. The MPPT tracking code is added to the basic output regulation code and battery-charging library. This implementation uses the fact that the device can either track the panel MPP, or regulate the output (but not both of them at the same time). The variable track shows whether the device is tracking or regulating the output. While tracking the panel MPP, a number of input voltage and current samples are summed together for noise reduction, and then fed to the selected MPPT algorithm. The MPPT algorithm modifies the input voltage reference, and the PI loop steers the panel operating voltage to that reference voltage. The PI control loop needs to run many times faster than the MPPT algorithm, so that the panel voltage has enough time to stabilize. Observe that the set point and feedback terms fed to the PI function are reversed, because increasing the duty cycle causes the panel voltage to decrease. If the output voltage or current are over the set limits, the Tracking mode ends and the control loop starts regulating output. This means that the panel can provide more power than the battery (or load) can absorb. The converter duty cycle is memorized when the Tracking mode ends. Normally, the output voltage is fixed so when the panel voltage goes down, the duty cycle needs to be increased to maintain the output. If the duty cycle is increased above the memorized value, then the panel voltage has fallen below the MPP. This is a very simple and easy way of knowing that the main loop needs to return to the Tracking mode. Other methods could use output current or voltage as indicators. If in Regulation mode, but not able to reach the set voltage or current, it is clear that the panel is not able to provide enough power for the load, and the main loop needs to switch back to Tracking mode. In systems which use batteries to store energy, it is unavoidable to waste energy, if the panels provide more power than the batteries and load can absorb. In grid tied inverter applications this is not an issue, as all the available energy is pumped into the power grid. One other important thing is that the battery state machine will only update in output Regulation mode. In Tracking mode, neither the output voltage, nor current limit is reached, so the charge termination protocols will not function properly. Even in low light conditions (slow charging), if the battery reaches the constant voltage stage, charge will be terminated as soon as the current falls under the threshold. To avoid keeping the cell or battery at high voltage, which is known to cause damage in the long run, another termination condition can be added to terminate charge if the current is too low, but the voltage is over a certain threshold. This is mostly required to protect Li-Ion chemistry batteries, since lead-acid is much cheaper and more tolerant to abuse. Important variables and defines used here: - Variable track shows if the main loop is tracking MPP or regulating output. True means it is tracking. The define TRACK_DELAY is a debouncing value for switching between tracking and output regulation. While in Tracking mode, the output voltage or current needs to be over the set limits for a number of TRACK_DELAY main timer ticks before switching over. - Counter mppt_calc is the number of main loop timer ticks between MPPT updates. The counter is initialized using the define MPPT_INTERVAL from Hardware.h. - MPPT_AVERAGE defines the number of samples averaged for use in the MPPT function. Always the last MPPT_AVERAGE samples before the MPPT update are averaged together. This is important because the first few samples after the update may contain transient values, as the PI control loop tries to steer the panel voltage to the set value. - The variables f_vin and f_iin hold the averaged input samples for input voltage and current, used in the MPPT function. - Defines MPPT_PO or MPPT_INCCOND tell the main loop which of the MPP tracking algorithms to use. Perturb and observe and incremental conductance algorithms are available in this implementation. - The variable vinref holds the current operating voltage set for the panel. The PI loop tries to steer the panel voltage towards this value. 03 Microchip Technology Inc. DS00005A-page

AN5 PERTURB AND OBSERVE MPPT IMPLEMENTATION CODE EXAMPLE : void mppt_po(void) power = (long) f_vin * (long) f_iin; if(power < l_power) updown ^= ; if(!updown) vinref -= MPPT_STEP; else vinref += MPPT_STEP; l_power = power; f_vin = 0; f_iin = 0; Implementing a P&O algorithm in software is quite simple and in most cases, the difficulty comes from correctly designing the hardware platform. The fun thing is that it can also be easily adapted to wind turbines. The algorithm calculates the power drawn from the panel using the averaged readings of the input voltage (f_vin) and current (f_iin). The power value is memorized at each iteration and is compared to the calculated power. If power has decreased, the algorithm changes direction. The MPPT step is user definable. For this algorithm, simplicity and robustness are the main advantages, but because the panel operating voltage naturally oscillates about the MPP, some of the available power is lost. INCREMENTAL CONDUCTANCE MPPT IMPLEMENTATION CODE EXAMPLE 3: void mppt_inccond(void) long delta_i; long delta_v; long delta_p; power = (long) f_iin * f_vin; delta_p = power - l_power; delta_i = (long) f_iin - fl_iin; delta_v = (long) f_vin - fl_vin; if(delta_v) ineq = delta_p / delta_v; if(ineq > 0) vinref += MPPT_STEP; else if(ineq < 0) vinref -= MPPT_STEP; else if(delta_i > 0) vinref += MPPT_STEP; else if(delta_i < 0) vinref -= MPPT_STEP; fl_iin = f_iin; fl_vin = f_vin; l_power = power; f_iin = 0; f_vin = 0; DS00005A-page 03 Microchip Technology Inc.

AN5 The incremental conductance algorithm is a bit more complicated to implement but it has the advantage of locking on the MPP. For the calculations, in addition to the last power value, it is required to memorize the last voltage and current value. The power ( P), current ( I) and voltage ( V) differences are calculated. If using the second form of the incremental conductance equations, it is not required to calculate the panel power. The instantaneous and difference values for the current and voltage are used, but in this case, proved to yield poor results. Even with filtering, the current readings were noisy enough to cause the incremental conductance ( ΔI ) to change sign erratically. ΔV This confused the algorithm and caused it to get stuck in many cases. To avoid this issue, the initial form of the incremental conductance equation was selected, which uses power and voltage for the calculations. For negative power-voltage slopes, the panel operating voltage is decreased and, for positive slopes, the panel operating voltage is increased. Even if some extra calculations were done, this yielded adequate results and the algorithm tracked maximum power correctly. When the voltage difference is zero, the slope is not calculated (zero denominator), and the algorithm stops tracking. If the current difference ( I) is not zero, tracking is resumed. Some improvements can be added that will not allow the algorithm to oscillate about the MPP due to noise. For example, instead of using the panel voltage readings in the calculations, the set reference value can be used. If the PI loop works correctly, this should be the operating voltage. This modification, together with a form of dead-band for the power-voltage slope value and current difference value, will ensure locking on the MPP. Only variations of the input current with a modulus greater than a preset value will cause the algorithm to resume tracking. CONCLUSIONS Using MPPT with solar panel installations has clear advantages. The initial investment is smaller because smaller panel wattage is required (very little potential power is wasted), and adding correct battery-charging algorithms will also decrease operating costs (batteries are protected and last longer). MPPT algorithms are simple enough, but implementing a working MPPT controller is not a simple task, because it is required to know the particularities of the underlying switching converter. Many of the so-called scientific papers published on this topic simply use computer simulations instead of real hardware, and the readers find themselves lacking vital information. In particular, the coexistence of the MPPT algorithm, the output regulation loop and the battery-charging state machine is a very interesting topic, which is often overlooked. By carefully defining the transition conditions between tracking and regulating, one PI-type loop is used to perform either MPPT or output regulation. The battery state machine is less processor-intensive and runs in parallel with the output regulation loop. This way the whole control algorithm, plus the battery-charging library, runs on a 4 MIPS 8-bit PIC MCU with kwords of Flash. This application note presents two MPPT algorithms implemented on a synchronous inverse SEPIC converter. The same code can be used with minimal tuning on other topologies like buck, boost or SEPIC. By utilizing the techniques presented in this application note, it is possible to optimize the cost and extend the life of any solar powered application ranging from a few watts to two hundred watts by adding MPPT. REFERENCES AN467, High-Power CC/CV Battery Charger Using an Inverse SEPIC (Zeta) Topology (DS0467): http://ww.microchip.com/downloads/en/appnotes/0467a.pdf PIC6(L)F503 4-Pin Flash, 8-Bit MCU Data Sheet (DS4607): http://ww.microchip.com/downloads/en/device- Doc/4607A.pdf A Synchronous Buck Power MOSFET Driver (DS083): http://ww.microchip.com/downloads/en/devicedoc/083a.pdf MCP6V0//3 300 A, Auto-Zeroed Op Amps Data Sheet (DS058): http://ww.microchip.com/downloads/en/devicedoc/058c.pdf MCP790/MCP79 70mA, High Voltage Regulator Data Sheet (DS075): http://ww.microchip.com/downloads/en/devicedoc/075b.pdf 03 Microchip Technology Inc. DS00005A-page 3

AN5 NOTES: DS00005A-page 4 03 Microchip Technology Inc.

Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular Microchip Data Sheet. Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions. There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property. Microchip is willing to work with the customer who is concerned about the integrity of their code. Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as unbreakable. Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our products. Attempts to break Microchip s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act. Information contained in this publication regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer s risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights. QUALITY MANAGEMENT SYSTEM CERTIFIED BY DNV == ISO/TS 6949 == Trademarks The Microchip name and logo, the Microchip logo, dspic, FlashFlex, KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART, PIC 3 logo, rfpic, SST, SST Logo, SuperFlash and UNI/O are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor, MTP, SEEVAL and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. Analog-for-the-Digital Age, Application Maestro, BodyCom, chipkit, chipkit logo, CodeGuard, dspicdem, dspicdem.net, dspicworks, dsspeak, ECAN, ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial Programming, ICSP, Mindi, MiWi, MPASM, MPF, MPLAB Certified logo, MPLIB, MPLINK, mtouch, Omniscient Code Generation, PICC, PICC-8, PICDEM, PICDEM.net, PICkit, PICtail, REAL ICE, rflab, Select Mode, SQI, Serial Quad I/O, Total Endurance, TSHARC, UniWinDriver, WiperLock, ZENA and Z-Scale are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries. SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. GestIC and ULPP are registered trademarks of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries. All other trademarks mentioned herein are property of their respective companies. 03, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. ISBN: 978607764 Microchip received ISO/TS-6949:009 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Company s quality system processes and procedures are for its PIC MCUs and dspic DSCs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchip s quality system for the design and manufacture of development systems is ISO 900:000 certified. 03 Microchip Technology Inc. DS00005A-page 5

Worldwide Sales and Service AMERICAS Corporate Office 355 West Chandler Blvd. Chandler, AZ 854-699 Tel: 480-79-700 Fax: 480-79-777 Technical Support: http://www.microchip.com/ support Web Address: www.microchip.com Atlanta Duluth, GA Tel: 678-957-964 Fax: 678-957-455 Boston Westborough, MA Tel: 774-760-0087 Fax: 774-760-0088 Chicago Itasca, IL Tel: 630-85-007 Fax: 630-85-0075 Cleveland Independence, OH Tel: 6-447-0464 Fax: 6-447-0643 Dallas Addison, TX Tel: 97-88-743 Fax: 97-88-94 Detroit Farmington Hills, MI Tel: 48-538-50 Fax: 48-538-60 Indianapolis Noblesville, IN Tel: 37-773-833 Fax: 37-773-5453 Los Angeles Mission Viejo, CA Tel: 949-46-953 Fax: 949-46-9608 Santa Clara Santa Clara, CA Tel: 408-96-6444 Fax: 408-96-6445 Toronto Mississauga, Ontario, Canada Tel: 905-673-0699 Fax: 905-673-6509 ASIA/PACIFIC Asia Pacific Office Suites 3707-4, 37th Floor Tower 6, The Gateway Harbour City, Kowloon Hong Kong Tel: 85-40-00 Fax: 85-40-343 Australia - Sydney Tel: 6--9868-6733 Fax: 6--9868-6755 China - Beijing Tel: 86-0-8569-7000 Fax: 86-0-858-04 China - Chengdu Tel: 86-8-8665-55 Fax: 86-8-8665-7889 China - Chongqing Tel: 86-3-8980-9588 Fax: 86-3-8980-9500 China - Hangzhou Tel: 86-57-89-387 Fax: 86-57-89-389 China - Hong Kong SAR Tel: 85-943-500 Fax: 85-40-343 China - Nanjing Tel: 86-5-8473-460 Fax: 86-5-8473-470 China - Qingdao Tel: 86-53-850-7355 Fax: 86-53-850-705 China - Shanghai Tel: 86--5407-5533 Fax: 86--5407-5066 China - Shenyang Tel: 86-4-334-89 Fax: 86-4-334-393 China - Shenzhen Tel: 86-755-8864-00 Fax: 86-755-803-760 China - Wuhan Tel: 86-7-5980-5300 Fax: 86-7-5980-58 China - Xian Tel: 86-9-8833-75 Fax: 86-9-8833-756 China - Xiamen Tel: 86-59-38838 Fax: 86-59-38830 ASIA/PACIFIC India - Bangalore Tel: 9-80-3090-4444 Fax: 9-80-3090-43 India - New Delhi Tel: 9--460-863 Fax: 9--460-863 India - Pune Tel: 9-0-566-5 Fax: 9-0-566-53 Japan - Osaka Tel: 8-6-65-760 Fax: 8-6-65-930 Japan - Tokyo Tel: 8-3-6880-3770 Fax: 8-3-6880-377 Korea - Daegu Tel: 8-53-744-430 Fax: 8-53-744-430 Korea - Seoul Tel: 8--554-700 Fax: 8--558-593 or 8--558-5934 Malaysia - Kuala Lumpur Tel: 60-3-60-9857 Fax: 60-3-60-9859 Malaysia - Penang Tel: 60-4-7-8870 Fax: 60-4-7-4068 Philippines - Manila Tel: 63--634-9065 Fax: 63--634-9069 Singapore Tel: 65-6334-8870 Fax: 65-6334-8850 Taiwan - Hsin Chu Tel: 886-3-5778-366 Fax: 886-3-5770-955 Taiwan - Kaohsiung Tel: 886-7-3-788 Fax: 886-7-330-9305 Taiwan - Taipei Tel: 886--508-8600 Fax: 886--508-00 Thailand - Bangkok Tel: 66--694-35 Fax: 66--694-350 EUROPE Austria - Wels Tel: 43-74-44-39 Fax: 43-74-44-393 Denmark - Copenhagen Tel: 45-4450-88 Fax: 45-4485-89 France - Paris Tel: 33--69-53-63-0 Fax: 33--69-30-90-79 Germany - Munich Tel: 49-89-67-44-0 Fax: 49-89-67-44-44 Italy - Milan Tel: 39-033-746 Fax: 39-033-46678 Netherlands - Drunen Tel: 3-46-690399 Fax: 3-46-690340 Spain - Madrid Tel: 34-9-708-08-90 Fax: 34-9-708-08-9 UK - Wokingham Tel: 44-8-9-5869 Fax: 44-8-9-580 China - Zhuhai Tel: 86-756-30040 Fax: 86-756-30049 /9/ DS00005A-page 6 03 Microchip Technology Inc.