A pic based Charge Controller

Status
Not open for further replies.
Why would you connect 24v solar panels to a 12v battery and complain you only get 5A?

Its not a tipo, its is really 42v. i would be wasting a lot.
i´m not complaining. i just would like to charge as many batteries as i can during the day to have enough for the night.
I'm also aware that this panels will probably give more than enough for my needs, but why not plan ahead?

It's not the MPPT giving you the bulk of the gain, it's just the fact that it's a switching (buck) charger. MPPT is useful in the "not optimal" conditions. In optimal conditions, it doesn't make that much of a difference.

yes, i know.
i would be most happy if the joined resources of this thread would start
trying to do a good buck converter and from there refine to a good MPPT system.
Maybe some of the users will branch, doing either one or the other.
There is quite a lot of similarities between them, isn´t it?
Mainly code diferences.

Best Wishes,
Hugo Ferreira
 
OK, this IS entirely possible, and having to need only a buck not a buck-boost is a huge time and trouble-saver.

Lemme mention some design things here though. A typical buck converter is pulsed current on the input and smooth on the output. If you're running 25% duty- about right for a 4:1 ratio- then for a 5A average load, it's 20A pulses from the panel. Now if the source were a battery, then that's a 5A average load. On a solar panel, 75% of the time period the current capabilities are not used if the output is pulsed, and you get no credit for capacity not used! You can only pull 5A output pulses, and all it does is reduce panel capacity by 75%.

But, you say, of COURSE I'll put a capacitor on the panel. Good idea. But look carefully at your capacitor. It says "low ESR", 1000uf, 50v. But "low ESR" might mean 0.5ohms, easily. And under an amp of maximum ripple rating. Your RMS ripple is over 10 amps. Now you gotta consider 3 things:
1. The ESR resistance is a substantial loss of power.
2. The ESR raises the high-current charging voltage on the cap. A capacitance too low for the freq used will ALSO result in the capacitor voltage rising during the charging part of the cycle. This is pretty bad, because- remember- the whole theory of the MPPT is that you need to load the panel at a specific voltage/current point. If that voltage/current point is 47.3v at a particular light level, and the capacitor's ESR and RC time constant rise bring the capacitor/panel voltage up to 48.2v, the panel's current output charging the cap decreases significantly, as does its total power- and again, that unused capacity is simply lost.
3. The capacitors, if run NEAR their max ripple rating, get hot and their lifetime decreases- in fact, the "end of life" typically manifests as a gradual increase in ESR over time. Meaning the circuit you originally constructed is not the same after it's been run at high ripple, accelerating the increase in ESR.

This is not a big problem, though. An inductor before the capacitor will reduce the ripple substantially. This is probably going to be essential, actually, because the capacitance required to reduce panel ripple current to say +/-10% when properly modeling the panel's IV curve is probably going to require an unreasonable amount of capacitance. An inductor can definitely fix that. But look at the inductor's resistance too.

You really gotta be sure to design this in SPICE ahead of time, and run some different values of actual capacitors and inductors and transistors you looked up. In any given inductor package, there are multiple values of inductance you can choose, but in choosing the higher inductance then you get a higher winding resistance (more wire wound on the core!). So you gotta plug in some different options and see what you get. You can check ripple current on the cap too. Many (even most) transistors have a SPICE model available if you Google it! If you don't SPICE it, you're running totally blind.

Also the MPPT control is not entirely trivial, esp with the LC filter on the panel. It is possible for the code to try to adjust too fast and render it unstable. Since light levels do not change very fast, the task does not require a fast response on that end. However, on the battery side, if you're driving a large load which can drop battery voltage as it goes, then the battery voltage could potentially change rapidly, confusing an MPPT without a fast response. It's not very likely, though. For that to be a problem, the batt voltage has to rise and fall significantly, and do so often, like many times a second. That would be an "odd" situation. If you DON'T have a battery and try to drive a load directly, then this problem is very very big.
 
Last edited:
Buck Converter Feedback Sugestion

Oznog,

I agree with all that you have written.
Also i'm glad you talked about the changing ESR values of the capacitor under that kind of solicitation.
Mostly i use capacitors to filter power supllies and in timing circuits.
i had seen capacitors "behaving" inproperly but never got to know what was happening.
SMPS and Audio have never been my thing, for now.

I´ve seen the aproaches to Buck Converter around the web, but most of them are designed
for a very specific aplication:
Some light a led, some charge a battery pack, and others...
I don't recall this for beeing small. Its just that they are steady charges.

After seeing your reply i couldn't help to show you my intention.
So i seat down and layed out some ideias.

**broken link removed**

So for a description of the circuit and clarity, i'll assume a panel with Vopen of 40V, a swing center of 30V, and a lower swing point of 20v each cycle.
Also all component values or references are discusable, off course.
I just intend to shown a working principle of what i have in mind.
So please take it gently.

The MOSFET will be discharging the input capacitor on the ON time and letting it charge on the OFF times, like any other Buck Converter.

In the input there are two distinct filters, more like "hold capacitors":

- One charges at the highest voltage which cycle of the input capacitor swing and is slowly discharged by a resister to track lower next cycles at lower voltages.
It is used to know if the solar panel is charging at the full 40v each cycle.
Failing to do so, we need to extend the MOSFET´s OFF time, so it can be fully charged.

- The other capacitor will discharge to the lower voltage of the falling swing, beeing slowly
charged by a resistor to track higher voltages in next cycles.
It is used to know if the solar panel is discharging all the way to 20v each cycle.
Failing to do so, we need to extend the MOSFET´s ON time, so it can be adequatly discharged.

These values are roughly divided by 5 by a voltage divider. The AmpOp's are voltage followers just to avoid the resister loading or ADC input driving.
The voltage divider across their outputs will provide a Swing Center value. Should be the 30v, but divided by 5 will be 6v.
The voltage divider formed by R7 and R8, Center Adjust, will provide the reference for the AmpOp, to generate a Center Error.

I used a transcondutance AmpOp, to generate this single voltage but any diferencial ADC will read these values directly.
The other AmpOp will show the value of the total Output Swing.
This is necessary because swinging either from 40-to-20 or 35-to-25 will show the same swing center and of course no error.

Instead if i used two Single ADCs to read directy the High Swing and Low Swing i would have the higher
value (of 40v), the lower value (of 20v) and from there know right away if i´m correctly certered, under or above.

Some may find that hardware will take the math overhead, and reading directly the drift error and the Swing Error may be
correct data for PID routines input.
some will say that taking out the second set of AmpOp will make the circuit less prone to error and
drift and one more step to be avoited, since they´re not saving much code overhead.

An ADC at the output, preferebly with diferencial amplification, would make it widen or shorten the OFF time for respectivly high voltage or low voltage.

Inductor would be choosen for the pretended higher frequency, at the highest ON time
allowed for the highest current output ( my case 20Amp) at the lowest output voltage possible ( my case 8v, empty batteries).
Also a soft start feature.
Frequency would be software limited.
Any 5MIPS PIC could use TMR0 to fire about 300 or 200K times a secondto cycle and adjust the timer for ON and OFF times.

Best Wishes,
Hugo Ferreira
 
what next???

hello all,
new to forum love your work...
did this ever move on from the menu or am i missing some thing????
thanks..
 
Actually MPPT IS entirely trivial if integrated into a charge algorithm. The battery does your multiplication for you.

in a typical solar charger you add a state to the system: Maximum Current Tracking.

when ever the panel can not keep up with the charger demand it switches to MCT

Dan
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…