EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: TheComet on November 21, 2015, 10:43:36 pm

Title: Solar Panels - Mathematical modeling question when connecting more than one cell
Post by: TheComet on November 21, 2015, 10:43:36 pm
Hi all!

I'm working on a project at uni that involves building a circuit that can emulate the characteristics of a solar panel. I have a few questions regarding the mathematical model when connecting multiple cells together. Hopefully someone here can shed some light on this.

A single cell in a solar panel can be modelled using the following equation:

(http://i.imgur.com/vsUinzv.png)

When plotting this function it looks like in the following graphs.
In the top image: The voltage is plotted in function of current and light exposure.
In the bottom image: The current is plotted in function of voltage and light exposure.
(http://i.imgur.com/UTX1Lpn.png)

As you can see, if I re-arrange the formula so it's solved for voltage instead of current, it still produces the same 3D plot.

Now, here's my problem. I've connected multiple of these formulae to try and simulate the behaviour of multiple solar cells connected in series, but there's a catch! One of the cells is "dirty" and is only working at 50% light exposure while the other cells are working at 100%.

If the current is known, then calculating the total voltage is trivial; you just sum the individual voltages of each cell together and there's your total voltage.

If the voltage is known and you want to calculate the current of all cells in series, that's where things aren't so clear. I figured you could use an iterative approach:
1) Start with the assumption that all cells are producing the same voltage (total voltage / number of cells).
2) Plug those voltages into the equations and calculate the individual currents.
3) Calculate the average of the resulting currents and plug that back into the formulae, thus calculating the total "actual" voltage over all cells.
4) Compare the result with the desired voltage and normalize. Repeat this process until the error is minimal.

The code for calculating these plots as well as the iterative algorithm described above can be found here: https://github.com/TheComet93/bat6/blob/master/code/smooth/qt/models/pvmodel.cpp#L113 (https://github.com/TheComet93/bat6/blob/master/code/smooth/qt/models/pvmodel.cpp#L113)

Here are the results for the algorithm I explained:
In the top image: The voltage is plotted in function of current and light exposure.
In the bottom image: The current is plotted in function of voltage and light exposure.
(http://i.imgur.com/kosJW5o.png)

They aren't the same.

1) Can someone tell me/show me what the characteristic curve of a "broken" or "dirty" solar panel looks like?
2) In the second image, why does the bottom curve have that deep indent in it while the top one doesn't? Does the simulation make sense, or am I calculating garbage?
3) Is there an easier way to calculate the current of multiple solar cells (in series) when the total voltage is known?

Thanks a lot
Title: Re: Solar Panels - Mathematical modeling question when connecting more than one cell
Post by: TheComet on November 21, 2015, 11:58:12 pm
Well, after doing something else for a while I noticed my algorithm is actually wrong. I updated it and now the results are correct!

(http://i.imgur.com/9SrP4Wd.png)
Title: Re: Solar Panels - Mathematical modeling question when connecting more than one cell
Post by: TheUnnamedNewbie on November 22, 2015, 10:41:48 am
First off: Welcome to the forum! Be sure to introduce yourself in the beginners section if interested.

With those formalities out of the way:


The code for calculating these plots as well as the iterative algorithm described above can be found here: https://github.com/TheComet93/bat6/blob/master/code/smooth/qt/models/pvmodel.cpp#L113 (https://github.com/TheComet93/bat6/blob/master/code/smooth/qt/models/pvmodel.cpp#L113)



I'm afraid I can't access that github page. Don't know why, perhaps your repository is marked as private?

What solar panels are you modeling, and to what accuracy? Or is this modeling done with the purpose of training mathematical computation, not so much for doing research into behavior of chains of solar cells?

(I know you seem to have already solved the problem, but numerical models is something I've always been interested in...)
Title: Re: Solar Panels - Mathematical modeling question when connecting more than one cell
Post by: Seekonk on November 22, 2015, 02:18:06 pm
Marking this for when I can read it in detail and to give it a bump.  For several years my custom made PV control system has been constant voltage tracked by panel temperature rather than common MPPT max IV method.
Title: Re: Solar Panels - Mathematical modeling question when connecting more than one cell
Post by: TheComet on November 22, 2015, 04:10:31 pm
I'm afraid I can't access that github page. Don't know why, perhaps your repository is marked as private?

Ah, I made the mistake of linking the file on the master branch. Here's the correct link of the old code:
https://github.com/TheComet93/bat6/blob/24e3f538deae2ef24108936bf1d2cbaeba45aac9/code/smooth/qt/models/pvmodel.cpp#L113 (https://github.com/TheComet93/bat6/blob/24e3f538deae2ef24108936bf1d2cbaeba45aac9/code/smooth/qt/models/pvmodel.cpp#L113)
And here is the updated code with the working algorithm:
https://github.com/TheComet93/bat6/blob/1f6cee145010ada656cad19abab690412293c365/code/smooth/qt/models/pvchain.cpp#L33 (https://github.com/TheComet93/bat6/blob/1f6cee145010ada656cad19abab690412293c365/code/smooth/qt/models/pvchain.cpp#L33)

It's still very much work in progress, the code may be hard to read in its current state. The header files are fairly well documented if you want to give them a read.
You can clone https://github.com/TheComet93/bat6 (https://github.com/TheComet93/bat6) and run qmake in the folder code/smooth/qt to play around with the interactive 3D plots (you'll need Qt4 and qwtplot3d).

What solar panels are you modeling, and to what accuracy? Or is this modeling done with the purpose of training mathematical computation, not so much for doing research into behavior of chains of solar cells?

Currently we're using a simplified mathematical model to simulate generic panels and we're trying to understand how they behave in series/parallel. The end goal is to model existing panels from some major manufacturers. These models can then be uploaded to a custom piece of hardware we've designed which will be able to emulate the exact IV curve.

This will enable building and testing arrays of solar panels in lab conditions without having to own the solar panels themselves.

As to accuracy, we won't know how accurate we really are until we've measured some of the actual panels we've modelled.
Title: Re: Solar Panels - Mathematical modeling question when connecting more than one cell
Post by: Brutte on November 22, 2015, 09:25:38 pm
Q1: Does a max(U*I) controller that drive a series of possibly shaded PV modules always face one maximal point of I*V at a time? If there would be more maximal points at some shaded conditions then local algorithm might not find the global max(U*I).

Q2: With N cells under different shaded conditions, what is the difference in power of connecting (i=1..N):
What gains/losses can be expected? Remember the modules come with Shottky diodes.