Solar Charger question

Discussion in 'General Electronics Chat' started by nenadilic84, Mar 7, 2011.

  1. nenadilic84

    Thread Starter Active Member

    Aug 7, 2009
    Hi, everyone I have built the solar charger using a microcontroler and a DC DC converter (PWM). I have used a MPPT (Max power point tracking) charging algorithm, and it works just fine.
    Next thing I did is add a functionality for turning on and off the consumer, for example if the battery voltage drops below certain level (11.3V)I turn off the consumer and if the battery is charged to some level (11.5) I turn the consumer on. But I have found a problem with this simple algorithm because battery voltage rises quickly without charging when the consumer is off, and falls down when the consumer is on so I have oscilations (turning on and off the consumer).
    Now my question will be how can I figure out when is safe to turn on the consumer?
    I have the information about solar panel current and voltage, battery voltage and consumer's current.
    Thank you in advance.

  2. mjhilger


    Feb 28, 2011
    Hi Nenad, and welcome to the world of control feedback damping. Control theroy gives us the tools to mathematically determine the parameters for such a situation. But since you are talking solar panel and consumer power switching; the switching is slow enough to safely allow the micro to do the work. However, your question requires a little work for a proper answer. You have already applied hysterisis into the solution; that is a great start. Now how quickly does the load (consumer) pull the voltage down? Can you model the load as a simple resistor? What about the power in while charging the batteries - can you model that (this one is trickier as the panels power is dependent on angle, cloud etc.). Bigger one is modeling the battery. If these things happen slow enough for you to measure the changes easily with a volt meter, then great. You should gather a few numbers to determine speed of recovery - just to get a feel.
    Once you have a feel - you really don't have to do the control loop math if you don't want to. Start coding your switching with some kind of timer to identify the length of time of switching and a history of say 10 events. You can then begin creating an adaptive switch point based on previous history of switching. It will become adaptive based on history because the switch point on a full sun shine day will be different than a cloudy one. You might eventually create a table which lets you look at time between the previous switches and predicts how long it believes the load can be connected. These are parameters only you can answer, but keeping the history is the step you need to implement. If you can also keep the voltages at the time of the switching (since your fixed voltage switch will not be the sole criteria) you might see a pattern emerge to view the energy flow and efficiency (I'm assuming you will eventually dump this info out for external examination).
    By looking at the history of switching events, your code will modify the switch on point to a charged state where it could supply the load say 1 hour run time. If it was less, then bump up the on point a little bit. It will still oscillate, but you are controlling the switching to acceptable levels. (Same thing happens in automatic transmission of newer cars where the gear changes are CPU controlled - like going up a mountain.)
    Hope this helps!
  3. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    Some method for detecting the level of loading on the battery would be needed.

    If a battery is discharged slowly(low amperage drain), it will show very little 'rebound', or voltage rise when current drain is stopped.

    If the battery is discharged quickly(high amperage drain), it will show a much larger rebound, and may even rise close to the voltage of a fully charged battery.

    knowing the amount of current drain can determine which situation will occur. This could be accounted for in the program/operation of the charger.

    This applies mainly to lead acid batteries, but other battery types do this as well. A 99% discharged NiCd, if checked with a volt meter will show a voltage very very close to a fully charged one. One can only tell it is discharged if a load is put on it. Then the voltage will drop almost immediately.