P2-Based Solar MPPT Charger
JRoark
Posts: 1,215
in Propeller 2
On a whim I decided to see how much smoke I could make creating a P2-based MPPT solar charger. Nothing huge or fancy, just an amp or two at <30 volts input with 12 volts output using "perturb and observe" tracking.
Has anyone walked this path before and has code to share? If not, I'll roll my own and eventually post it, but I figured I'd ask before I started melting expensive parts.
Has anyone walked this path before and has code to share? If not, I'll roll my own and eventually post it, but I figured I'd ask before I started melting expensive parts.
Comments
You may want a diode on the output for testing, to prevent the battery from feeding current into the circuit. In fact, I think an output diode is required unless the code has some checks to make sure the converter doesn't run in reverse and boost battery voltage to something very high. Otherwise, a solar charger is not likely to melt because the solar panel is current limited. A current limited lab supply works as well, but transition from constant voltage to constant current is sharper than a PV panel and this causes some trouble with the MPPT algorithm.
The MPPT algorithm runs every ~half second.
For anyone who comes along later, Saucy's code references Microchip AN1521. That document is a goldmine for anyone who wants to play with MPPT. It's located here: http://ww1.microchip.com/downloads/en/Appnotes/00001521A.pdf
Thanks, SaucySoliton!
The lab supply doesn't really have a smooth dP/dV derivative, but I've found the code to work ok with it after some tweaking. I added that feature: if the current is too low, reduce operating voltage. No harm there if the source is current limited. The operating voltage can't go lower than battery voltage. It would work like a non-MPPT controller in that case. It should still deliver 80% of max power or so. But having the operating voltage stuck too high is much worse because then there will be no power output. This is also the reason for the voltage constraints. Since I know the my array, I've set the constraints tight to ensure that it will generate some power even if the algorithm malfunctions.
MOSFET question: In the data sheets, NMOS enhancement mode FETs are almost always used (at least in saturation mode) with a grounded source. (Ie, the load goes between Vcc and the drain pin). Is there a reason the drain cant go directly to Vcc and the load put between the source and ground, as long as:
1). The gate voltage doesn't exceed Vgs, and
2). The gate voltage is at or near Vcc
This would imply a pretty low system Vcc (ie, under 20 volts, which is the Vds max for this particular device), but it seems like it should work. Am I milking without a bucket here?
You can use Drain to Vcc, but then VGS needs to go above Vcc to saturate the FET, and to 0V to turn off the FET.
Designs can do that, look for Bootstrap caps in SMPS designs that use 2 N-FETS for examples.
Note that Bootstrap cap designs cannot run 100% duty cycles, to achieve that you need to have a charge pump on the upper FET gate driver.
Off to figure out how those bootstrap caps work now...
Huh, I just noticed that IGBTs functionally swap Collector with Emitter labelling. I hadn't noticed that before ... which explains why I had trouble reconciling the non-saturating feature they boast. At first glance they resemble a darlington structure but it's really more like an emitter follower structure. EDIT: Err, that's a bad comparison too. It's just a tad weird how it's the BJT emitter that's being treated as a collector - and even named as such in the IGBT. I wouldn't be surprised if it's something that came from op-amp designs.
So after closing up shop (but leaving everything on the test bench running), I found absolutely everything from 160 to 20 meters was utter covfefe on my Elecraft K3S. Nothing but a roar and birdies everywhere, and we're nowhere close to anything like a sunspot period. So I went hunting...
It turns out I did indeed make a passable (sorta-sorta) 12 volt MPPT battery charger today. But in the process I made one a HECK of a broadband noise generator!
Jeeze Louise...
Edit: In hindsight, it is not really an MPPT yet, but I did get the buck converter working and the P2 is driving it, so maybe tomorrow.