diy solar

diy solar

DIY inverter software upgrade to combat heavy shading

fourtytwo

New Member
Joined
Jul 13, 2021
Messages
46
Hi all, I have a completely DIY setup (excluding the bought panels) that has been running since 2015. We moved house this year and the new location is definitely sub-optimal, ground mount with bad shading from buildings and trees especially now in winter. I have looked at many options like optimisers etc but such things can be expensive to construct for a DIY person, magnetics being particularly difficult and of course the whole enclosed in a waterproof case.
I have decided instead to have a go at the inverter software instead to change the control algorithm from a simple hill climb MPPT to do a periodic full scan of panel voltages to see if the hill climb has found the wrong peak! An example simulation is enclosed that shows a hill climb starting from maximum voltage will arrive at ~24W/118V output whilst a full scan shows a much better peak of ~110W/28V. You might think that simply reversing the direction of hill climb would solve the problem (start from lowest voltage) but peaks will appear in different places depending on the nature of shading that varies a lot.
As a large input capacitor is used to reduce 100hZ ripple if the load happens to be AC a target voltage change takes a while to come into effect at low insolations so the steps of the scan cannot be very fast, in this case I have chosen 1.28 seconds giving a scan time of about 30 seconds for 5V steps across the range. If a scan is performed every 10 minutes about 5% of generating capacity is lost however the gain from using the right peak is huge. 5V steps are adequate as the new target voltage would be passed to the existing hill climber as a new starting point that it will then fine tune.

So that's my story of what I will be working on this winter and hopefully produce a result soon enough to get more use out of the winter sun.

Sorry plot only downloadable pdf as png was no good!

Edit : Pic showing partial shading added.
 

Attachments

  • P1170412.JPG
    P1170412.JPG
    793.5 KB · Views: 10
  • P1170573.JPG
    P1170573.JPG
    776 KB · Views: 9
  • MPP_plot1DC.png
    MPP_plot1DC.png
    15 KB · Views: 7
Last edited:
How sad, blew up the inverter while testing (the new anti-shading software) today uhuhuhu
Unfortunately blew up half the primary side bridge requiring apparently unobtainium IRFB4227's (except chink fakes) but fortunately found a guy in France with some genuine ones.
I have done this before in exactly the same way, build the code for debug and breakpoint it! This is on a PIC24EP256MC206, I selected don't freeze on break for the PWM but nevertheless something nasty must have happened to the PWM outputs :mad:
Serves me right I thought I could get away without demounting the entire inverter for a bench test (not that it would have stopped the blowup but it MIGHT have reminded me not to breakpoint active inverter code).
So inverter offline for a while but were not getting much sun here in north Lincolnshire at the moment anyway!
I guess I should put a DON'T BREAKPOINT notice on the inside of the inverter cover to jog my failing memory lols.
 
At last the replacement mosfets arrived UK post strikes allowing, replaced and waiting inverter re-installation to test. No more software breakpoints, even put a label on inside door of enclosure!

EDIT 20/12 : Gahhh should have bench tested it but the gear takes a while to setup, anyway on re-installation the trafo made a nasty buzzing noise that on investigation proved to be a blown up IRS2113 driver chip! Strange thing is when these go usually the chip is physically damaged (cracked & burnt) and they short out vcc, but this one looks undamaged and no vcc shorts. Still ordered a new one (£10) at least obtainable in the UK...... (in the pic it's down below the fets rhside bottom).
P.S. Note to self, always put these in a socket as this one will be soon.
 

Attachments

  • P1170665.JPG
    P1170665.JPG
    782.2 KB · Views: 22
Last edited:
Full marks for designing and building all your own equipment !

Winter is never a good time for us, and in the end the only real solution is to acquire more solar panels, and locate them so at least some are able to get a bit of direct sun at different times of the day.
 
If shade is always on bottom of array not left, then rotating panels to landscape orientation could be better.
That way, all the shade is on one diode-bypassed section, rather than all three within a panel.

Is your blowup due to bad firmware? Is it possible to interlock in hardware so transistors aren't enabled in a damaging configuration?
Or was it just stress exceeding what the part can take? Maybe something where firmware or hardware could do a timeout allowing only brief overstress?
 
Full marks for designing and building all your own equipment !

Winter is never a good time for us, and in the end the only real solution is to acquire more solar panels, and locate them so at least some are able to get a bit of direct sun at different times of the day.
Thank you, I think you do the same (design & build) am I right ?
Problem with more panels is I have nowhere to put them, out front they would get "borrowed", the roof is all small bits and pieces as well as not being in a good state so I am left with the back yard only and my neighbours have a huge hedge........ not good for solar :(
 
Yes, I design and build all my own electronics, solar controller, inverter, battery monitoring and management.

If you have tall stuff all around, all you can really do is try to raise your panels somehow.
All your panels do not need to be mounted together side by side, just aiming in a similar direction, then connected in series.
Roof mounting has several advantages, including making your panels a bit more complicated to steal.
 
If shade is always on bottom of array not left, then rotating panels to landscape orientation could be better.
That way, all the shade is on one diode-bypassed section, rather than all three within a panel.

Is your blowup due to bad firmware? Is it possible to interlock in hardware so transistors aren't enabled in a damaging configuration?
Or was it just stress exceeding what the part can take? Maybe something where firmware or hardware could do a timeout allowing only brief overstress?
The shade has various shapes, sometimes leans in from the right (East) sometimes from the left (West) & sometimes from the bottom (South), so yup I had thought of landscape but also I would run out of space that way around.

Probably someones firmware! If your familiar with micro-chip PIC microcontrollers & debugging with a PicKit3 the blowup occurs when you hit a breakpoint (anywhere), as far as I can see it should not but it does and I am done with loosing mosfets and drivers when it happens so have no desire to try narrow down the problem, so I have to do my debugging by other means, mostly scope triggers in the code and outputting values to dacs observed by a scope, slow & time consuming......

As for stress the mosfets are IRFB4227's that from memory have a 150A surge rating BUT if the pwm were to stop with mosfets enabled, with a primary inductance of 1600uH and no appreciable DC resistance destruction occurs very very quickly (supply voltage ~120V). Unfortunately overcurrent is handled also by the inbuilt pwm hardware of the microcontroller so if that has gotten into some kind of lockup there is no protection, it goes without saying that fuses would be to slow. The only way to save the mosfets in hardware would be to implement an external (to the microcontroller) overcurrent latch and drive signal gating, this would also increase the drive skew probably requiring a deadtime increase but yes it could be done, or I just never breakpoint the code!!

Unfortunately I have found just about every microcontroller advanced pwm has one or another drawback so this PIC one generally behaves itself better than most except in this one circumstance. TBH if I was starting again I would almost certainly do my own pwm in a small pld rather than rely upon the vagaries of microcontroller implementations.

Sorry for the rant, its just been troublesome for a long time :)
 
Yes, I design and build all my own electronics, solar controller, inverter, battery monitoring and management.

If you have tall stuff all around, all you can really do is try to raise your panels somehow.
All your panels do not need to be mounted together side by side, just aiming in a similar direction, then connected in series.
Roof mounting has several advantages, including making your panels a bit more complicated to steal.
Great, there doesn't seem to be much electronic DIY in solar. I was right about the IRS2113 it was blown despite looking good.

Yup absolutely agree on the height, only got to this property last June and it was in such a state I had to spend lot's of time getting it ready for this winter. Hopefully next spring I can improve the solar installation BUT I am very limited by both the property and draconian UK regulations regarding PV mounting. There is one potential roof face I could use although it is on the very south side that has hedges etc but it does have height! Problem I have is these boundary hedges are way over regulation (6ft) height being 20ft in some places & 14 in others but so far discussion has got nowhere :(
 
Direct software control of power electronics is fraught with problems and best avoided wherever possible.
A much better and far more bullet proof approach, is to use more hardware to control the PWM and direct closed loop control and protection.
Then have your microcontroller do non time critical things with some clever but simple algorithms.

There is not much electronic DIY solar in this Forum, it seems to be "more American" to buy cheap Chinese boxes, and connect them up.
The Aussies are much more deeply into real down and dirty DIY, and much more prepared to try out new and radical ideas.
There are quite a few very inventive people in the UK as well, you are certainly not alone.
 
Last edited:
Direct software control of power electronics is fraught with problems and best avoided wherever possible.
A much better and far more bullet proof approach, is to use more hardware to control the PWM and direct closed loop control and protection.
Then have your microcontroller do non time critical things with some clever but simple algorithms.

There is not much electronic DIY solar in this Forum, it seems to be "more American" to buy cheap Chinese.
The Aussies are much more deeply into real down and dirty DIY, and much more prepared to try out new and radical ideas.
Like all things there are many different approaches that simply pop out of fertile minds without being better or worse. In this case this is a GTI so it has to do fast multiplication, sine synthesis, phase lock, PID power control & MPP tracking, certainly not impossible in hardware but fairly heavy on the chip count. So I went the micro route partly due to the high level of integration now available not just of digital peripherals such as pwm but also analogue comparators, op-amps, adc's & dacs. On the whole it is successful, this basic design has been working since 2018 but unfortunately I exposed a weakness through thoughtless debugging (OK I forgot it blew up when you dared to breakpoint it).... lesson learned :)

Your right about electronic DIY, it's like what happened to the radio hams, they all started buying kit instead of making it, that has become self serving as component supply is now so difficult even I get tempted sometimes but am determined to persevere because I enjoy it!
:)
 
You can do all that in firmware if you want, but hardware/PLD/FPGA ought to be used to interlock FETs and shut off based on time, temperature, etc.

I've used a DDS chip and analog control loop (settings by DAC) when I needed a sine wave (RF), and I suppose that could get into a bad state. Others after me used DSP & FPGA in an alternate system. I keep asking to see the performance but the former employer hasn't shared that with me.
 
All firmware would be a pretty heroic project !

I think it could be broken down as Hedges suggested into some separate functional blocks, which might usefully simplify things.
 
You can do all that in firmware if you want, but hardware/PLD/FPGA ought to be used to interlock FETs and shut off based on time, temperature, etc.

I've used a DDS chip and analog control loop (settings by DAC) when I needed a sine wave (RF), and I suppose that could get into a bad state. Others after me used DSP & FPGA in an alternate system. I keep asking to see the performance but the former employer hasn't shared that with me.
I think you said RF, so your talking about a very high frequency compared to grid power of only 50/60hz, when you have microcontrollers capable of hundreds of mips you dont need hardware for low frequency waveform synth. I examined and tested the micro's pwm very carefully before using it and had it failed like several others I would have used a PLD/FPGA BUT it passed every test I threw at it EXCEPT I did not test it's reaction to debugger breakpoints because it simply never occurred to me!
 
Last edited:
All firmware would be a pretty heroic project !

I think it could be broken down as Hedges suggested into some separate functional blocks, which might usefully simplify things.
Thank you, it was! I have a habit of setting myself seemingly impossible goals even though I am long since retired

The only thing I would add is I cannot see the difference between multiple chips to achieve a function and multiple modules of code, surely it's the same division of a problem into manageable portions
:)
 
Last edited:
Its not always that simple.
Analog has some advantages, its often faster, it works continuously and seamlessly, and it can be made to do several things simultaneously.

Its all very well while the train of bits and bytes is running smoothly along the rails, but the unexpected glitch or brownout can ruin your whole day.
Your watchdog might only bark, after the smoke has been released.
 
Yes
Its not always that simple.
Analog has some advantages, its often faster, it works continuously and seamlessly, and it can be made to do several things simultaneously.

Its all very well while the train of bits and bytes is running smoothly along the rails, but the unexpected glitch or brownout can ruin your whole day.
Your watchdog might only bark, after the smoke has been released.
I am sorry I was a bit guilty of over-generalizing there, I didnt mean to exclude analogue and indeed one of the attractions of this micro was it's analogue peripherals and indeed they were not good (or numerous) enough for all functions so there are even real op-amp chips on the controller board along with some dac chips etc so in no way is it a single chip solution but it is as close as I could get to it within reason. I don't want to sound like a digital preacher either in fact the main current averaging loop is entirely analogue as I would have needed a true DSP to put it into the digital domain that would certainly be an over-complexity compared with a dual op-amp and handful of discreet components.

This is slightly like being at work where we were always chewing the cud on the why's and wherefores of different ways of doing things, an enlightening experience :)
 
As a simple comparison of the power of analog vs. digital,

What code would you use to digitally perform function of the following circuit? :)



1671738861400.png
 
As a simple comparison of the power of analog vs. digital,

What code would you use to digitally perform function of the following circuit? :)



View attachment 125851
It's a simple 1 pole low pass filter, well known in DSP circles so I dont see the point of your question, perhaps you need to invest in a book on DSP principles. I have many many filters of different sorts in my code.
 
Back
Top