08M2 PV MPPT Charge Controller

Solar Mike

New Member
Have been building solar PV charge controllers for many years, thought this project may be though provoking for some readers on this forum, designing an ultra basic controller using a 08M2, usually I post all my projects on "TheBackshed" forum and will continue to so so as they allow more images etc in posts.
So rather than repeat everything here, will add a link for anyone interested. Picaxe PV Controller

Have just sent the gerber files away to get pcb's made, so will be a couple of weeks before I get them back and can start writing some software.

24176


Cheers
Mike
 

lbenson

Senior Member
Very interesting design. I had read the linked TBS thread when originally posted, and noticed that you said that because of a shortage of pins on the 08M2, "Cannot measure the PV voltage, will have to improvise using software to determine PV is present".

I was wondering how you were going to do that improvisation, but see now that an additional design you posted in that thread uses the 14M2, which seems like it might be less restrictive. Do you still think the 08M2 will do what you want?

(Writing in Nova Scotia, not quite 45 degrees North, where there sadly seems no hope for solar.)
 

Solar Mike

New Member
With the 08M board, PV must be present if at 100% PWM, there is charge current detected...
Don't really care about the PV; all I want is max charge current for any solar variations, so mppt operation will be optimizing the PWM for max charge every second or so.
This project needed to small as possible, but should work ok, need 10 or so minimal functionality controllers for some remote batteries out in the field.

Added the 14M2 to get some extra led status indicators.

You must get some sun....

Cheers Mike
 

AllyCat

Senior Member
Hi,

You can also use C.0 of an 08M2 as an ADC input using READDAC{10}. It can be particularly useful for reading bi-directional currents as the DAC can introduce a bias. But I would consider 08M2 v 14M2 irrelevant for a circuit design of that complexity.

I'm not sure about "no hope" for solar at 45N. We have substantial solar farms in southern UK, all above 50N, but maybe the Government got the subsidy wrong (IMHO they did). However, at these latitudes the Winter months can be a major energy storage issue, or "dead loss", depending on the application.

Cheers, Alan. .
 

Solar Mike

New Member
But I would consider 08M2 v 14M2 irrelevant for a circuit design of that complexity.
Indeed; normally I use the 20 or 28X2 versions for these controllers to make use of hardware interrupt pins and much higher 64 Khz PWM @10bit resolution.

Had a read up on the READDAC{10} command, interesting...

Cheers
Mike
 

lbenson

Senior Member
You must get some sun....
I walk out my back door in July and August and think, "I'm in Paradise". But winter is a long slog, and spring? Ha, what's spring? I was raised in Virginia, where March has many nice days, and April and May and into June are lovely before it turns brutally hot and humid. When this used to be my summer home, my neighbor would say I brought the good weather up with me at the end of June.

I can't see solar doing much here, even aside from the fact that you'd want perfect placement, which I don't have.
 

premelec

Senior Member
@Solar Mike - thanks for bringing this up again! I admire your work on this while also noting that with many installations you can get pretty close to maximum power by measuring temperature and voltage of the PV panels - controlling current loading of a switching converter to keep that PV voltage in range. As PVs have become less expensive squeezing the last watts out has become less necessary though still pleasing. Using a 14M2 with 4 PWMOUTs you can, if needed, use a vernier setup where one PWM gives coarse another fine tuning of the resultant PWM signal. Mostly it isn't needed to track output by the millisecond so PICAXEs are suitable. When clouds drift by you just don't get full control...

@Ibenson solar is still working in your area despite opinions on the weather... ;-0
 

lbenson

Senior Member
@Ibenson solar is still working in your area despite opinions on the weather... ;-0
Solar works--my garden did great. But PV solar in Nova Scotia? Do you have examples? Yes, there is one millionaire who fitted out his private island with solar, but the expense was great, and I'm not sure he's there in the wintertime.

Even aside from the fact that panels appear to cost 3-4 times as much here as in Australia.
 

premelec

Senior Member
@ Ibenson - glad that photosynthesis is still working to feed you &/or give you pleasure... I note that Canada has active solar PV promotion and your apparent area probably gets about 1/2 yearly KWHr/peakWatt than my area gets - that's still a lot... suggest looking at aerial views of your area to see if anyone is using PV panels. Energy storage is an on going expensive situation... this is not the best forum for a discussion. A large part is to see how to use less than NA people may be used to... end of gardening season here in a few weeks with early nasty snow storm that broke a lot of trees...
 

lbenson

Senior Member
premelec--we had our first frost three nights ago--a month earlier than last year. I'll look further, but a yearly average won't help much in January and February. No one would deny the flood of solar input in July and August.

Someone nearby has rooftop solar hot water, but in asking about I haven't heard of PV. And in any case, I'm not going to put solar panels on the roof of my 180+ year old house. I can look at an aerial view, but I could scan about 60 miles to my west-southwest without seeing even a paved road.

A "solar" cottage was highlighted recently in a news article, but they didn't mention the usage of the big propane tank visible in one of the photos.

Mike--I'll be interested to see your software, and to follow your progress (maybe on TBS).
 

Solar Mike

New Member
PCB's being made now, will get them back in approx 10 days.
Software I will post here, dont think many on TBS use picaxe's so will have minimal interest.


Currently looking at a suitable communication protocol to allow a master charger or aggregation device talk to the PV controllers in a small network to either send them the common voltage settings etc, or tell them to switch to Constant Voltage or Float operation at the same time; then ask each one for its average voltage or current etc.

A large bank of batteries may have 5 controllers connected; have noticed that there is always one that is the first or last to switch to CV or Float operation, ideally they should sort of follow each other closely.

I have a small matchbox sized pcb designed about a year ago that allows an isolated 1-wire connection to each device; probably will use some customized bit-bang method to send the info back and forth, just yet to decide how to do it, there is a mixture of CPU's so not all have sophisticated receive buffers etc.

Any ideas welcome...

Cheers
Mike
 

papaof2

Senior Member
I've been "dabbling" with solar for several years, primarily as a "Wait until daylight" option for the frequent but usually short grid outages we have and I've tried a number of commercial solar charge controllers - PWM and MPPT - some are much better designs than others. I'm interested in how "real world" usage works for your design over time.
The solar irradiation for Atlanta works as a rule of thumb for 50-100 miles out from there so we basically have 3 useful sun hours in winter and 5 useful hours in summer. The current system is a 12 volt, 420AH battery bank which is kept charged by a single 250 watt panel via an MPPT controller. With a 2000 watt pure sine wave inverter, the system powers fridge, freezer, a few LEDs and the internet for 8-10 hours - long enough for a storm to pass or until daylight and I could then go out to set up a small (1600 watt) inverter generator. The average running load is under 300 watts but you must allow for the surge watts of starting motors (fridge, freezer, etc.) which is typically 5 to 7 times the running watts but can be 10 times the running watts.
Finding a good place to put solar panels can be difficult when you have tall, old growth trees but this year's tree work includes removing a dead maple, cutting dead/damaged limbs on multiple trees and removing an oak that doesn't provide useful shade for the house. When the oak is gone, I'll have space for 1500-2000 watts of ground-mounted solar panels and we could grudginly manage with that for the long term - but still better than being in the dark ;-)
We'll never produce the amount of power we use from the grid (monthly utility details kept in a spreadsheet for more than 15 years) but another spreadsheet tells me what we can power and for how long on days with and without sun. If you want heat, use gas (LP, natural) or wood. Solar PV is not a good choice for electric heating.
I experience "solar envy" when I pass a design/contructionbusiness a few miles from us - the roof is covered with about 100 panels of estimated 250-300 watt size. I'd like to see their entire setup...
 

Solar Mike

New Member
I've been "dabbling" with solar for several years, primarily as a "Wait until daylight" option for the frequent but usually short grid outages we have and I've tried a number of commercial solar charge controllers - PWM and MPPT - some are much better designs than others. I'm interested in how "real world" usage works for your design over time.
It should be mentioned that building a mppt controller will have little advantage over a basic pwm type when the PV panel voltage is closely matched to the battery and the output power is not so high. I am only suggesting a mppt design here for my setup, which has various individual batteries using a number of differing panel types with various power outputs and voltages.

If I was building a small system and purchasing new PV panels, then basic pwm is more cost effective, as its not so complex to design and off the shelf chargers are reasonably inexpensive. PV is so cheap now that any power lost in PV-Battery mismatch can be made up by adding a another panel.

This charger could easily be turned into a PWM type if desired by shorting out the buck inductor, removing the input electro and most of the output electros.

For a larger system where we are working with charge currents > 100 amps, MPPT has many advantages is that the ripple current as seen by the battery is very low and easily controlled by software. It is not the best practice to send huge pulses of current into lead acid batteries to keep them topped up in float state as would occur with a high power PWM. The lifepo4 batteries that I mainly use probably couldn't care less about that situation, their internal impedance is so low, it would have little impact.

"papaof2": I run my home office + 1 fridge and an upright freezer off a 12v 400 AH Lifepo4 battery (4 x 3.3v cells in series) coupled to a highly modified 3.5KW inverter, 1Kw PV. its not uncommon to see surge currents >100 amps when a fridge turns on, most commercial inverters 2Kw or less would fail I think if the fridge and freezer switched on at the same time; if you want to use a low power inverter then a low frequency type is better suited as they can cope with large surges better than the HF type.

Cheers
Mike
 

Solar Mike

New Member
Have finally started building the prototype, writing the software and doing some tests with various inductors. PCB had no errors on it, so a good start.
here is a photo showing the test setup.
24300

Using a variable psu with current limit control to simulate a PV panel, set to 30v, load is a 12v battery with a 10 amp water cooled load. Was curious to see the effects of various inductor types, so made several and can plug them in using XT60 connectors. Current through the buck inductor is measured across a precision 0.01 ohm resistor, hand held digital scope shows the inductor ripple wave form, was aiming for approx 15% ripple in the design.
So far all testing has been done at approx 10-12 amps load, the inductor in the photo has 2 amps ripple which is pretty good. Will have to make another load to test at higher currents, 12 amps is giving 92% efficiency. Nothing really gets hot on the pcb, input cap 3300uf 160v gets to about 35c after an hour, the heatsink is barely warm, inductor 30 or so degrees.

Code was tricky to write, using an 8 pin device there are limited measurements that can be done, working on the theory for maximum power out of the panel using the charge current for control, always aiming for a max current about a pwm duty cycle point that moves up and down to to track the panel output. Seems to work pretty well with accurate voltage and current control.
Tested this afternoon on a 150 watt panel outside with bursts of bright sun, clouds etc, tracks very well and quite fast. Code as currently working attached.

More photo's look on the BackShed, see link in first post.

Cheers
Mike
 

Attachments

Solar Mike

New Member
Have completed more tests at higher charge currents, with 20-22 amp loads for an hour. Altered the software to allow loads above 20 amps and added another hot water element 10A load @12V to give a total of 20A + the battery charge rate.

Changed the inductor to T200-26B with 26 turns 2mm dia wire, note this is a bit light should be 2 wires not 1, so copper losses are higher than expected.

Heatsink gets a little warmer than previous, certainly < 40c, input cap gets approx 45c (its 105c rated) nothing else on the pcb really changes temperature, the output caps not even warm, the inductor as expected gets to 45c odd with the light gauge wire.

Inductor AC ripple is now 4A or 20% ripple as per design for 26 turns. Input voltage remains at 30V, so will work ok on a 300W panel.

Efficiency is 90% @20 amps and 30 volts input, with a PWM duty cycle of approx 50%, the higher voltage mosfets currently used would be more efficient if lower voltage types used if it was going to just charge a 12v battery.

Calculations show the above inductor will work over the design spec of 35 amps ok without saturation, if the thicker wire is used, input voltages up to 61vmp (2 series panels) will also work, however the input cap probably would get too hot and have to be uprated to a lower esr type.

Last test, I tried opening the output circuit breaker to the battery and @20A load to see what would happen to the sudden unloaded output voltage, it should rise; and did to 32V before the software shut down the pwm, no drama, did it twice to make sure.

So quite pleased, works as designed; I will be building a number of them for 12v small batteries 100W or so panel and a 24v version for my UPS that I have rebuilt with Lifepo4 batteries.

Will make up the other version next using 14M2 CPU.

Cheers
Mike
 

lbenson

Senior Member
Nice job. Thanks for reporting, and congratulations. I'll be interested to see what additional you do with the 14M2.

Am I correct in thinking that the "output circuit breaker to the battery" that you opened is shown in the photo, and is 2-poles so you're breaking both +V and 0V?
 

Solar Mike

New Member
Yes both +- battery and load connections broken by a double pole CCB, not shown in the photo; connect to the watt meter cable.
When opened under load, the output cap voltages rise to 30 odd volts very quickly, cpu winds back the pwm, to its lowest setting, the load current is zero and it turns off the pwm completely, then output voltage drops to nothing before the Pic can restart as the delay period between measurements is too long, so shuts down.

There is excessive output capacitance 8 x 470uf, will reduce to 4 caps. The battery is in effect a near infinite capacitor, so behavior is not same as building a step down buck PSU.

Mike
 

Solar Mike

New Member
Update: Have made a couple of changes, T200-26B core, rewound with 2 parallel strands 2mm dia wire, 26 Turns; replaced the 3300uf 160V main cap with a better quality 10,000uf 80V with lower esr; taken off 4 of the output caps, so now there are 4 x 470uf 35V on board, noting these are very low esr types @1.8 amps ripple rated, removed the 12V psu module as not required when using a 12v battery.

Tested running 20 amps for a hour, main cap doesnt heat up so much, inductor mildly warm, nothing on the pcb gets hot, so I will use these changes for the battery chargers. Have made few mods to the software and still doing so, will post final code here along with pcb gerber files if anyone wants to make one.

Cheers
Mike
 
Top