This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MPPT based battery charging profile management using msp430g2553

Other Parts Discussed in Thread: TIDA-00120

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.

  • Hi Amit,

    I will attempt to loop in the author of TIDA-00120 to help answer your question.

    Regards,
    Ryan
  • Thank you..!!
    your help is really needed at this time..!!
  • Amit,

    This is a multistage battery charge profile implementation. 

    When a battery is discharged condition, the current allowed to go into the battery is CC_Limit (usually C/10 for lead acid battery). During this time if the solar panel is able to feed lot of current, code controls the current to protect the battery ignoring the solar panel capability. But if the current available through solar panel is lesser than CC Limit , system try to operate in MPPT.

    When we reach the specific voltage limit (CC_TO_CV Limit), (14.2 V for 12V battery ), The code controls the duty such that the voltage at battery terminal is maintained constant, Here the current keeps on decaying as the voltage is maintained constant. While doing this when the current drops below C/100, Battery has entered in trickle charge mode where the voltage which is kept constant is reduced to lower level (~13.8V for 12 V Battery) to support the trickle.

    Jasraj    

  • Hi,

    Thank you for the reply. I am desperately waiting for the discussion.

    As u explained that once constant voltage is reached current will start decaying and output of regulator should be constant, since it is in constant mode.

    But if we see the part of the code where constant mode operation is used, duty cycle is getting changed continuously. If duty cycle is changing then how come the output of buck regulator is constant. Ultimately, duty is controlling the voltage. Moreover, to move from constant voltage mode to reduced constant voltage mode (trickle), condition should be applied on the battery current (c/100) instead of battery voltage. Am i right, or am i missing something...!! 

    That's why i am still NOT bale to understand the part of the code written below.

    SEE THE PART OF THE CODE BELOW..!!

    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;
    }
    }

    Thank you in advance.

  • Amit,

    The Duty cycle keeps changing around the set point (standard hysteritic control). This is because We have to keep the output side as constant and keep in mind that the input side is solar which is varying. Overall it is going to try to keep the output voltage constant around CC_TO_CV_LIMIT.
    When we need to implement the trickle, we can change Charging voltage needed = Float Voltage.

    The exit (from charging in above code) is marked when code understand that the available voltage is even substantially less than float voltage.

    Hope this clarifies. Also, It is perfectly fine to change the code per your needs if specific functionality you dont need in your system.

    Thanks
    Jasraj
  • Hi,

    That means i could understand that the trickle mode around float voltage is NOT implemented in this code.
    STEP 1> MPPT i.e. CC MODE
    STEP 2> once CC_CV_LIMIT is reached then CV_MODE = 1 and thus voltage is maintained around 12.2 volt and here after current starts to decay.
    STEP3> BUT if current reached around c/100, mode switches to trickle charging around FLOAT VOLTAGE (which is NOT implemented here but can be incorporated)

    The exit (from charging ) is just a feature of the charging mechanism for better implementation.
    Am i right...!!!

    Now if i want to incorporate TRICKLE CHARGING also along with this what i need to change/ add in the code.
    Any suggestion..??

    Thank you..!!
  • Yes, Amit,

    Its two stage profile right now. To make it 3 stage (to support trickle charge), you can add one more section in CV (if, else) section as below.
    Get in CV -> Look for Current -> if current is >c/100 go to CV (already there ) else go to trickle charge.

    Please modify the code per your need. The code given here is for a reference purpose and created mainly for evaluating the design and hardware components in MPPT system.

    Thanks,
    Jasraj
  • Thank you so much..!!
    That's why i got confused as there was NO trickle charge implemented here.

    Thank you again for your detailed explanation.
  • How, and by what means can I calculate the duty ratio of my transistor during the absorption and float mode in a manner to achieve a constant charging voltage with a maximum threshold charging current?

    Thank you