Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add error checks for database specs #17

Closed
janinefreeman opened this issue Sep 7, 2017 · 14 comments
Closed

Add error checks for database specs #17

janinefreeman opened this issue Sep 7, 2017 · 14 comments
Labels
enhancement pv pvsam1, pvwatts, hcpv

Comments

@janinefreeman
Copy link
Collaborator

NREL doesn't maintain the CEC module and inverter databases, but sometimes the specifications in the CEC databases are wrong. We encourage users to report the issues directly to the CEC; however, it might be nice to also have a few simple mechanisms in place to alert the user that the specs for the component they've chosen look suspicious.

For both the inverter and the modules, we could display some warnings (probably in the UI?) when specs are either not physical (negative or zero voltages, etc) or not self-consistent (voltage and current don't multiply to the same order of magnitude as power, etc). More thought is needed to figure out what we could check for, and how to best display it.

@dguittet dguittet added the pv pvsam1, pvwatts, hcpv label Sep 24, 2020
@allenlawrence94
Copy link

I may be interested in helping here. Could you point me to the workflow where the CEC data set is converted into the format used by SAM? I'm looking at this module data set. I'm wondering if might also be wise to just drop suspicious modules.

@cpaulgilman
Copy link
Collaborator

Hi Allen,

Thanks for offering to help!

The process we use to build SAM's module and inverter libraries from the data in the CEC lists is:

  1. Download the appropriate Excel file (.xlsx) from the CEC Solar Equipment Lists website.

  2. Manually process the Excel file to remove unneeded rows information and clean up some things like extraneous Greek characters, and tabs, commas and line breaks within cells.

  3. Save the cleaned-up Excel file as CSV.

  4. Run a script to convert the data in the CSV file to SAM's library format. This involves running code for each module or inverter to calculate model input coefficients from the datasheet parameters in the CEC data that are in SAM's library file but not included in the CEC data. (For example, the module coefficient generator calculates coefficients for the 6-parameter single diode module model like light current and reverse saturation current.)

  5. Run a test script to identify any modules and inverters that cause simulation problems and manually remove them from the list. In this step, we do some checks on the inverter data to try to identify suspicious ones.

I am happy to share the scripts we use and more details of the process.

We have been wanting to convert these scripts from SAM's LK scripting language to Python with the PySAM package, but have not had time to do that.

One other note is that the CEC Solar Equipment Lists website mentions that they are changing the format of the equipment lists after October 31, 2021, so we will likely need to update our process to work with the new format: https://www.energy.ca.gov/programs-and-topics/programs/solar-equipment-lists.

Thanks,
Paul.

@allenlawrence94
Copy link

Hi Paul,

I'd happily port the LK script into python. I have used PySAM to generate coefficients for the 6-parameter model in the past, so I feel comfortable picking this up. Could you share the LK scripts with me? If they aren't available on github, you can email me at [email protected].

@cwhanse
Copy link

cwhanse commented Oct 13, 2021

@allenlawrence94 pvlib includes a function showing how to access the SDK functions to run the parameter estimation code. See fit_cec_sam here; maybe helpful for this effort.

A few years back @janinefreeman and I had some discussion about rehosting the parameter generation capability outside of SAM, and to smooth over some of the cracks between the SAM parameter files and other applications making use of those files. Some of that conversation is in this thread. We set up a project here to contain a parameter generation engine but didn't get past that point. For my part I'm happy to help build and maintain that engine.

It is my opinion that a separate open-source engine translating the CEC database to model parameters would benefit the modeling community, including SAM developers and users.

@allenlawrence94
Copy link

@cwhanse - I think having a separate open source engine for this is an awesome idea! I'm mid-way through a prototype script for pv modules. Once I get in working order, how about I open a PR to pvlib/pvmodules?

Thanks for the guidance and support.

@cpaulgilman
Copy link
Collaborator

cpaulgilman commented Oct 13, 2021

Hi Paul,

I'd happily port the LK script into python. I have used PySAM to generate coefficients for the 6-parameter model in the past, so I feel comfortable picking this up. Could you share the LK scripts with me? If they aren't available on github, you can email me at [email protected].

Thanks! Here's a zip file with the LK script we use for the conversion, a SAM file with LK script we use to test the resulting parameters, and an MD file with notes and instructions. This is documented sufficiently for us to use internally, but I think should be clear enough for you to figure out. Please let me know if you need any help or have questions. I agree with @cwhanse that having this as a separate open source tool is a good idea. We are planning to release a new version of SAM in the beginning of December, so if this is ready by then we'll use it to generate the SAM libraries for that version.

sam-cec-module-library-tools.zip

Thanks so much for making this contribution!

Paul.

@allenlawrence94
Copy link

allenlawrence94 commented Oct 14, 2021

Thanks @cpaulgilman, this is super helpful. Do you also have similar scripts for inverters that you can share?

@cpaulgilman
Copy link
Collaborator

@allenlawrence94 Here are scripts for inverters:

sam-cec-inverter-library-tools.zip

The CEC is switching over to a new "Energy Commission Solar Equipment Lists Home Web App," so your scripts should probably the Excel files from the new site. At first glance, they appear be similar to the ones we have been using.

For modules, click the "Download Excel file" link at the top right of the page:

https://solarequipment.energy.ca.gov/Home/PVModuleList

And similarly for inverters, although there are three lists (hover over the "Inverters" link to see them): Grid Support Solar Inverter, Grid Support Battery Inverter, and Grid Support Solar/Battery. I think we would want the combined list with a field indicating whether it is a battery inverter.

https://solarequipment.energy.ca.gov/Home/InvertersList

@cwhanse
Copy link

cwhanse commented Oct 14, 2021

I was not aware that SAM SSC included code to calculate inverter model parameters. pvlib provides this function. It would be good to benchmark these two implementations against each other.

@cpaulgilman
Copy link
Collaborator

@cwhanse The SSC code (C++) that calculates the inverter model parameters ("coefficient generator" or "cg" in SAM lingo) is here: https://github.com/NREL/ssc/blob/develop/ssc/cmod_inv_cec_cg.cpp

The SSC code that calculates module model parameters for SAM's 6-parameter single-diode module model is here: https://github.com/NREL/ssc/blob/develop/ssc/cmod_6parsolve.cpp

These are SSC compute modules, so they can be accessed using any of the following methods:

  • In SAM, using the ssc_exec() function in SAM's LK scripting language.
  • In a Python script using the PySAM package
  • In any of the languages for which there is a wrapper in the SAM SDK

@cpaulgilman
Copy link
Collaborator

@allenlawrence94 Have you made any progress on this work? We were just updating the module and inverter libraries for SAM 2021.12.02 r1, and were reminded of how useful it would be to have this conversion process implemented in Python. Let me know if there's anything we can do to help.

@allenlawrence94
Copy link

Sorry for the radio silence @cpaulgilman! @kanderso-nrel for visibility (thanks for reminding me about this).

I have a simple (and messy) notebook that generates coefficients for the CEC modules dataset using PySAM, but I never figured out how to handle all the missing/erroneous data. I've had to shift focus away from this, but I'll clean up and push what I currently have to pvmodules in case someone else can pick up my slack before I come back to this.

@allenlawrence94
Copy link

PR here: pvlib/pvmodules#11

@cpaulgilman
Copy link
Collaborator

Scripts and instructions for the process NREL uses to generate module and inverter library CSV files from CEC Excel workbooks are here: https://github.com/NREL/SAM/tree/develop/samples/CEC%20Module%20and%20Inverter%20Libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pv pvsam1, pvwatts, hcpv
Projects
None yet
Development

No branches or pull requests

5 participants