Hi,
I am in process of implementing MPPT based charge controller and thus have gone through the TI reference design PMP7605.
Some part of the code used in reference design is NOT clear to me.
I am using lead acid battery and normally these types of battery should be charged in 3 steps.
<1> Constant Current <2> Constant Voltage and <3> Reduced Constant voltage i.e. Float charge
Switching from one mode to other depends on threshold voltage and type of battery used.
MPPT Part is clear to me but once battery threshold is reached for 2nd step, i am feeling difficulty in understanding the code for 2nd and 3rd step as i am NOT able to correlate it with the theory.
Code is written below:
/**********************Needs to be changed with different Batteries************************************/
unsigned int CC_LIMIT = 300; // 210 - 10A, 300 - 15A, 350 - 20A
unsigned int CC_TO_CV_LIMIT = 305 ; // 305 - 14.2 , 610 - 28.4
unsigned int FLOAT_VOLTAGE = 295 ; // 295 - 13.8 , 590 - 27.6
unsigned int BATTERY_CUTOFF = 220 ; // 220 - 10.2 , 440 - 20.4
unsigned int BATTERY_RECONNECT = 240; // 240 - 11.2 , 480 - 22.4
/******************************************************************************************************/
/* Once CC limit or CC_To_CV_limit are exceeded,variable MPPT_Loop is reset and there after this function will be called instead of MPPT function
* Here duty is adjusted such that CC_Limit,CC_To_CV_Limit,Float voltage are all maintained according to the battery state */
void Battery_Charge_Profiling (void)
{
if ((Battery_Voltage <= CC_TO_CV_LIMIT)&& (!CV_Mode_ON))
{
if (Battery_Current < CC_LIMIT)
{
Duty--;
if (Duty < 30)
{
Duty = 30;
CC_Loop_Exit_Counter ++;
if (CC_Loop_Exit_Counter > LOOP_EXIT_LIMIT)
{
MPPT_Loop = 1;
MPP_Loop_Exit_Counter = 0;
CC_Loop_Exit_Counter = 0;
POB_Direction = 1;
Duty = 210;
}
}
}
else
{
Duty ++;
if (Duty > 680) Duty = 680;
CC_Loop_Exit_Counter = 0;
}
}
else
{
CV_Mode_ON = 1;
Charging_Voltage_Reqd = CC_TO_CV_LIMIT;
if (Battery_Voltage < Charging_Voltage_Reqd)
{
Duty--;
if (Duty < 30) Duty = 30;
}
else
{
Duty ++;
if (Duty > 680) Duty = 680;
}
if (Battery_Voltage < FLOAT_VOLTAGE - 20)
{
CC_Loop_Exit_Counter ++;
if (CC_Loop_Exit_Counter > LOOP_EXIT_LIMIT)
{
MPPT_Loop = 1;
MPP_Loop_Exit_Counter = 0;
CC_Loop_Exit_Counter = 0;
POB_Direction = 1;
Duty = 210;
}
}
}
}
NOTE: I am NOT able to understand the BOLD part of the code.
Please help.