Commissioning and Validating Renewable Energy Systems using MATLAB and Simulink - MATLAB & Simulink
Video Player is loading.
Current Time 0:00
Duration 31:13
Loaded: 0.53%
Stream Type LIVE
Remaining Time 31:13
 
1x
  • descriptions off, selected
  • en (Main), selected
    Video length is 31:13

    Commissioning and Validating Renewable Energy Systems using MATLAB and Simulink

    Overview

    In this webinar, MathWorks engineers will show how MATLAB and Simulink can be used to validate renewable energy models to help address NERC regulatory requirements, such as MOD-026 and MOD-027. As a result of the increasing number of utility-scale solar, wind and energy storage systems, regulatory requirements have recently been expanded by NERC, WECC and ERCOT to include many smaller renewable energy installations.

    Topics of Power Plant Model Validation that will be covered in this session include:

    • Overview of system-level traditional and inverter-based renewable power plant models, such as the Western Electricity Coordinating Council components
    • Performing replay of field data, such as voltage step tests or grid events, to compare the model against the measurements
    • Automatic parameter estimation to identify parameters that result in an accurate simulation
    • Creating a power plant digital twin that can be used for system performance tracking and predictive maintenance

    About the Presenter

    Jonathan LeSage is a Senior Application Engineer and Senior Team Lead specializing in the Energy Production and Industrial Automation industries and has been with the MathWorks since 2013. His focus at the MathWorks is on building models of multi-physics systems and then leveraging them for control design, hardware-in-the-loop testing and embedded code generation. Jonathan holds a B.S. and a Ph.D from the University of Texas at Austin specializing in power systems, controls, and machine learning. Prior to MathWorks, Jonathan worked at Schlumberger on downhole tools and at Applied Research Labs on microgrids and ship electrification.

    Recorded: 20 Apr 2022

    Welcome, everyone. My name is Jonathan LeSage. And I'm an Application Engineer and Senior Team Lead with the MathWorks. I've been with the company about eight years. And I've been working pretty heavily most of my time here with the power and utility industry on a number of different applications, predominantly in the renewable energy space.

    During that time, I've worked with a lot of electric utilities, equipment OEMs, a lot of regulatory bodies. And a lot of the content that we're going to be presenting today comes from those interactions that I've had with customers over the time. The topic that we're going to be exploring today is actually looking at basically the validation process, which is part of commissioning, and then also maintenance of renewable energy systems. So that could be systems like solar, like wind, and now even more so like energy storage systems at the utility scale.

    And so today we're going to look at how we can use Matlab and Simulink to actually bring data from the field into the tools and then actually validate-- basically create very accurate system level models that can be used for all sorts of studies. Grid studies, stability studies, and even fault studies for like a fault ride through situations like a low voltage event, for example.

    Now when we talk about model validation, really I kind of want to set the stage to make sure that everyone kind of understands what this process is. And so really what model validation is all about is we have real equipment in the field, either that is already out there being utilized like a solar farm or we have new systems that we want to bring online. And a lot of this equipment gets produced by different equipment OEMs or vendors.

    And they, under the hood, have a proprietary way that they're developing controls, implementing those. And for a lot of the grid planners and stability analysis groups that are looking at the grid, they need to have a standardized representation of these systems, so they can actually run models and actually do things like transmission planning, stability analysis, and other types of studies as well.

    And so what we can do is if we have access to these standardized models. And if we have access to data from the real equipment, especially if it's already in the field we can use that data to calibrate our simulation models that we have. And so for example, you see here, I have kind of example curves of active and reactive power.

    And if I was to say bring that data into Matlab and Simulink and replay it through a simulation of the equipment, which we're going to see later on. If I saw the following results, we see that this red curve is our current simulation data results for both active and reactive power. We would know OK, that this model doesn't quite accurately represent what's in the field yet.

    And so then we can calibrate that. We can use parameter estimation to automate the fitting of these parameters and get a better match. And so that's going to be the goal of today's study. And with these renewable energy systems what we'll see is there's considerably-- there's a considerable number of parameters that we have to look into. And so having an automated way or at least an option to have more of an automated way to perform this workflow is going to be very beneficial.

    Now when we talk about renewable energy systems and the smart grid, a lot of this is all based off of power electronic technology. All of the inverters enable basically a lot of these renewable energy systems to be highly efficient and to have a lot of different layers of control. Now when we talk about simulation of these types of systems, really you could model everything and down to the switching level on power electronics devices. But for certain applications, that necessarily isn't needed.

    And so depending on what you're doing, you can simulate down at the switch level. That's where you're simulating basically the full switch mode power electronics, maybe even nonlinear effects on the devices that lets you study things at that level. More often you may be looking at the converter level. So things like an average value model might be sufficient for your needs. And those are going to allow you to run much faster studies and allow you to study things like voltage and frequency regulation.

    And then lastly, there's this high-level control or the plant-level control where you're actually looking at things over the course of minutes, hours, or even days at things like peak shaving or actually participating in energy markets. And so depending on where you are and what simulation needs you have, that will kind of dictate the level of fidelity that you need for your model.

    So in Simulink and specifically the Toolbox Simscape Electrical, you can actually simulate things at different levels of fidelity for your needs. So all of those different control tasks we just talked about, you can actually simulate those all in some Simulink and with some Simscape Electrical. So it really depends on the needs that you have.

    So for example, if you wanted to study participation in energy markets, you might only need to actually simulate things at the system level where you can actually run a lot of simulations where you're kind of going over the course of hours, days, or maybe minutes as well. But if you're looking more at the converter control level, where you're looking at lower level controls like the voltage and frequency regulation, maybe you want to look at average value. Or for harmonic analysis type studies you might go to full switching-type fidelity as well.

    Now for people that are designing the equipment, equipment OEMs, so if somebody was designing the control system for a utility-scale solar plant, they're probably going to be looking in particular at these levels of fidelity, average value in full switching, that will enable them to design these control loops, to do studies for harmonic analysis, and actually see kind of these lower level effects that they need to see for the design side of things. And so if we take a look at what maybe an example solar plant would look like, we have the solar array, we've got the inverter in this case, it's three phase and then we've got a grid connection.

    If we were to kind of map that into the Simscape Electrical framework, you'll see we've got these three specific parts. We've got the solar array model, we've got this inverter, and then we've got the grid connection. So it's a one-to-one mapping. So let's hop over to Simulink and take a look at what that would look like.

    So here in Simulink, we've got this inverter model that's basically mimicking a utility-scale solar facility. I'm going to go ahead and push the run button. This is going to just start the simulation. This utility-scale plant is actually grid connected in this case. And so we've got basically the grid connected model.

    We've got the solar array rather and then the grid connection down here. We can simulate things like a three-phase to ground fault or phase-to-phase faults. And then if I go into the controls, you'll notice that we're kind of hierarchically digging into this controller. And then we'll have things like the current regulator. We've got active and reactive power.

    So again, this is kind of when we're talking about equipment designer. They may be looking at these individual loops here and designing these-- tuning the controls for a very specific application. As this is running, you'll see that this is running as an electromagnetic transient simulation or an average value simulation. So if I go into here, you'll see here's my inverter.

    And so if I go ahead, I'll pause the simulation real quick. I can Zoom into my voltage and frequency curves. And you'll notice that we're simulating the full three-phase waveforms here. I'm going to go ahead and resume this-- blow that back up. And we can do things like island this grid. So you'll see my active power drop to 0.

    My grid current is 0 produced by this plant. And I can reconnect. And then we're going to actually rethink and reconnect to the grid. So for a lot of studies, especially fault studies and for studies where you're designing the controllers, this type of simulation where you're running electromagnetic transient simulations is going to be particularly useful.

    Back to the slide here. All right. So as I mentioned, if we're performing equipment design or we want to do a faster simulation on the electromagnetic transient side, we can use these types of simulations. For our grid stability, especially for long-term studies, we want to have a more simplified system level model that we can run fast and actually use for a variety of other reasons.

    And so let's take a look at a way to model that also in some Simscape Electrical. So similar to the example that we just showed, I've got actually got a one line diagram here that represents what a utility-scale solar system might look like. We have kind of our interconnection line. This is actually we're going to tie into the larger grid.

    We may have some additional transformers, maybe even some reactive power compensation, but over here, we've got the actual solar arrays that represent the full plant that we have. Now if we were to dig into this and actually look at a way to represent this at a system level, we can break this apart into three kind of distinct components.

    So the first, very much like that other simulation that we ran, was the connection to the grid. And so this is going to represent kind of our inverter-based resource connection. So that inverter that we had in that last simulation, this is going to be a representation of that. It's going to take things like current commands and then translate them into the actual voltages and currents that are interfaced with the grid.

    In the middle here we have an electrical controller. And so this is a representation of very common controls that we see on these utility-scale renewable energy systems. And so what this is going to do is take active and reactive power commands and it's going to translate them into current commands for our inverter.

    And then at the very high level we're going to have a plant controller that's taking set points from some kind of operator and then translating those into active and reactive power set points. Now there's a lot of entities out there for the electric grid.

    So if you're in North America, you're probably familiar with the three main regions of our grid. We've got the Eastern interconnect-- Eastern interconnection, the Western connection, and then ERCOT, and then Quebec it's kind of its entity as well. But the Western interconnection has been coming up with a lot of standardized blocks to help standardized representation of all of the renewable energy that's being added into the grid there. And so these acronyms that I have at the bottom are some common representations of those components that WECC has been working on.

    So we're going to be using those components here in a little bit. All right. So with that, let's take a look at a model, system-level model, of a utility-scale solar. Now hopping back to Simulink, what we can see here is a representation of a system-level solar plant. And so just like we explained with the block diagram before, you'll notice that we have a number of those components here.

    So there's the grid connected component that represents the inverter. There's the electrical controller and then the plant-level controller. And so you'll see here that I've got a little basic HMI setup that is allowing me to interface with this plant model. And I've got some plots here showing my current voltage measurement, frequency, active and reactive power outputs of the plant.

    Right now, you'll notice that my voltage is tracking around 1 per unit. Frequency's at 60 hertz. And then I'm outputting about 0.7 per unit it looks like with a little less than 0.25 per unit of reactive power. So what I can do is I can start to actually issue commands to change things.

    So from my operator panel here, I'm going to do a bump up. Let's do a bigger voltage step test. And you'll notice that I'm actually not in voltage control right now. I'm in reactive power control. So I could actually issue a reactive power step test. And you'll notice my step here for my reactive power goes to my reference. I can step it back down maybe even to 0.

    But I could also then switch over to voltage control. And you'll notice that now my plant is going to my voltage. I can set that to 1 per unit. And then I'm actually tracking that.

    Now as this is running, what we can look at here is, if I double click on any of these components, you'll notice that we have a lot of parameters for each of these. And so under the hood, if I go into this electrical controller for example, we've got multiple basically control loops. And depending on the act-- the mode that I'm controlling, so reactive power control versus voltage control, these different loops are going to be active.

    And so because of that we have a lot of different parameters associated with these kind of system-level models. Now again, these are kind of representing general behavior of renewable energy systems. But these are very useful, because they're not vendor specific or equipment specific. They're kind of general purpose and represent a broad swath of solar, of wind, and of energy storage systems that we can use for simulation.

    Now, right now I'm just performing a simulation study. This is a little simulated grid that I'm connected to. If I wanted to actually come in here and compare this to real data, rather than actually simulating the grid, I can actually use a data replay. And so that's what we're going to see next is actually replacing this component here with the ability to replay data that we've measured from real equipment and see if our simulation actually matches reality.

    For data replay-- so replaying field data through a simulation, we actually have to pull that data into Matlab to leverage it. And so today, we're going to talk about the workflow to actually set up this replay process and then actually to perform parameter estimation to help kind of automate this. So for a quick review of a typical workflow, we've got to pull data into Matlab.

    That's going to be typically accessing files. And today, we're going to be using CSV files-- actually have recorded data from PMUs, synchrophasors, but you could also have data saved in databases like an SQL type server. That could be loaded directly into Matlab as well.

    Depending on the quality of that data, you might need to clean that up. There's a whole capability in Matlab, the base tool of filling in missing data, filling in or removing outliers and all of that. And once we've done that, we can actually build that renewable energy model using those components that we reviewed already.

    The first time you do this, you might need to build it from scratch. But from then on, you can actually use those models you've already created as templates to actually perform this validation for other models as well. So you could actually leverage them for other solar plants for example.

    Once we've got the data actually replaying through the simulation, we can either adjust parameters manually. So if we're very close to a match and we just kind of want to tweak things ourselves, you can use it. But as we saw, there's a lot of parameters in these renewable energy components so having some kind of automated or parameter estimation based approach is nice to streamline some of that work as well. And so once we've actually calibrated these models, we can then use them for other workflows.

    So of course, we've talked about regulatory compliance, transmission planning. So we can actually use these models for those types of tasks. But another interesting task that we're seeing more and more applications of is taking these calibrated models and then using them as digital twins that can either be run in hardware in the loop systems or on cloud-based systems for actually performance monitoring of the solar or wind farms.

    Now, if we flip back to the block diagram, the only difference between the simulation-based model we saw before and the data replay model is we've introduced this voltage and frequency replay block. And so instead of having a simulation of our grid here, we're actually replaying actual measured voltage and measured frequency that we recorded from the field.

    All of these other blue ports here are also data values that we have recorded that we're going to replay through the simulation. And in this case, active and reactive power here, we're going to use those as the values we want to match. So let's hop over to our Simulink model here and take a look at the simulation.

    What you'll see here is that same model, like I said, and we've just got this VF replay or voltage frequency replay block. And you'll notice right now all of these blocks are glowing red and what that really means is we haven't initialize these parameters here for all of the blocks. So I have some shortcut buttons here that are just going to run some scripts that I have.

    So we're going to load some test data. What I actually have here is an Excel file that has some data in it. I'm going to load that into Matlab. And once I load that it's going to appear here in my workspace. But while that's loading, what I want to show is what that data actually is.

    So I've got a few different steps. I've got an active power step test, a voltage step test, I've got a grid vault, and I've got columns recorded here of time, active-- and voltage references, and then active and reactive power measurements, and voltage and frequency measurements. And when I brought that in, I've brought that in as three different separate experiments. So each one is each sheet is a different data set.

    The other thing we need to load is our initial guesses for those parameters. And so I have those just saved here in a map file for this particular example. You'll notice that we've got our initial guesses for the plant controller, the electrical controller, and then the grid connection. I can just run this script and load all of that into my workspace here.

    Now if I want to run this, the last thing I need to do is perform load flow. What load flow is going to do is it's just going to initialize all these blocks so that we're starting at the values that we actually measured out in the field. So for control systems internal to these blocks, we just want to make sure the states are initialized correctly. And so once that's done, we can run the simulation here and take a look at the comparison.

    And so because we are replaying the measured voltage and frequency, what you'll see here in this scope is the blue curve, which is our measured data from the field and our yellow curve, which is our simulated response. For voltage and frequency, they're essentially right on top of each other. That's because we're just replaying measured values.

    However, what you'll see is for our active and reactive power produced by the solar plant, there is a discrepancy between what we measured from the real plant and then what the actual simulation is recording. And so this is where we can maybe come in and start to modify parameters. So again, I could do some of this manually. I could come in here and I could tweak some of these gains.

    But again, there's a lot of parameters. And so what we're going to do is we're going to go up to Apps here in Simulink. And you'll see that we have this parameter estimation tool. I'm going to go ahead just open this up directly.

    I'm going to open an existing session just to kind of speed things up for today. And what this is going to allow us to do is select parameters here and then tune that-- those this-- those parameters so that our simulated data or simulated response matches what we saw in the field by adjusting these parameters. So again, I'm going to go ahead and just rerun the simulation here in this parameter estimation interface, so we can take a look at the results.

    We'll see the discrepancy again. And again, I've just selected a few parameters. After this, I'll actually walk through the sensitivity analysis as well, which would help us identify which are the most important parameters to start with. But what I'll do is I'll just go ahead and hit estimate. And that's going to perform this validation process.

    So it's going to start running the simulation. So if I pull the scope up, once this starts, it's actually going to start running multiple simulations and behind the scenes, it's used-- Matlab and Simulink or using optimization-based approaches to basically calculate the error between these two curves here. And then they'll do small perturbations of those parameters using a gradient descent method.

    And then as it kind of calculates the best way to improve the results, it'll take a bigger step in that direction and start to improve the results here. So I'll let this run here for a second. And we should hopefully get a good view of convergence here. And while this is running, one other thing to note is that the-- right now, I'm just using a single worker or a single core.

    If I did want to speed this up even further, especially if I'm using-- or if I have a lot of parameters I'm trying to estimate for or if I have multiple data sets that I'm trying to use, you can actually distribute this onto multiple cores using the parallel Toolbox that MathWorks has. And so you can turn that on. And you'll actually run multiple simulations simultaneously.

    So you'll already see here that result looks significantly better just after a little bit of running. I can actually-- I can go ahead and stop the estimation here. And we'll see the improved result. I could let this keep running. But for today, I'll just kind of converge it there.

    And then we can see how the parameters were adjusted. And so we'll see that this REPC kig parameter was adjusted quite a bit. The other ones were adjusted more subtly.

    Now I mentioned sensitivity analysis. What sensitivity analysis is useful for is if you want to try to identify which parameter to say focus on or to start with. You could actually select 100 parameters. And then what this will allow you to do is actually generate a Monte Carlo type study of all the parameters.

    So you can specify bounds on all the parameters. You can generate how many data sets you want to run. I'll just do 10 simulations for the sake of time. It'll generate all the permutations of those parameters that you have. And then you can just hit evaluate model.

    That's going to again, just run all of these simulations. And then at the end, we can actually compute some statistics to see which of these parameters that we've selected has the biggest impact on improving the results. And so it'll allow us to rank those parameters and then select the ones of greatest importance.

    So if we started with say 100 parameters and we see that there are three to five that really impact or improve the results quickly, we can start the process with those five thus vastly simplifying the problem. So right now it's running those simulations again. We could take a look here. You can see the simulation results.

    I'll let it just keep running. And these plots are just showing kind of the histogram of the differences. It's a little hard to tell what's going on, but it's running each of those cases. And then once it's done, I'll pull up the statistics. And we should be able to see which parameters look to have the best improvement on the results.

    All right, looks like we're nearly done with the last result here. All right. Evaluation complete. What we can do is go and look at some statistics. I'll just calculate all of the standard statistics here and this is going to generate a plot showing some of the most important parameters. And so we can see in this case that the REPC ki parameter actually has a very high influence compared to some of the other ones.

    And so in this case, if we just wanted to select one parameter, that might be the one we want to adjust. So very nice efficient way to quickly run and identify which are the most important parameters to start with. All right. So we saw how we can use this parameter estimation approach to automate the process of estimating parameters.

    We did this with a single experiment. You can actually do the same process with multiple data sets. So for the sake of time, I'm not going to demonstrate this today. But I did have multiple data sets in that Excel sheet. I could pull them in.

    We can calibrate using multiple data sets. And so it's actually going to minimize the error between all of the curves of all of the experiments that you have. So that really allows you to get a robust result and robust set of parameters that mimic how the plant is performing over a wide range of operating conditions. So this is actually a recommended approach is to use more than one good test. It'll really enhance the fidelity of the parameters that you get out of the process.

    So with that, I do want to thank everyone for attending today. I gave a high level overview of how you can use electrical stimulation in Matlab simulation with Simscape Electrical to simulate multiple types of fidelities of renewable energy systems with a focus on commissioning them and validating them. We saw how you could use both the electromagnetic transient simulation, especially if you're an equipment designer, and then move on to a system-level type model, especially if you're more on the transmission planning side of the world.

    We saw how we could use parameter estimation to automate this process of estimating parameters. We use it on the system-level model, but you could actually do the same process with any level of fidelity that you have in simulation. So any data that you've recorded, you could replay that through your simulation and estimate performance. So if you're doing things like voltage ride through design and you actually have a electromagnetic transient simulation, you could do the same process with those models too.

    And then lastly, we also saw how we could use sensitivity analysis. So as we mentioned, renewable energy models have a lot of components. And so what we want to do is use a tool like sensitivity analysis to reduce the complexity of the problem that we have. And so that's what we kind of demonstrated as well.

    If you want to learn more about model validation, I do have-- we do have more information available online, including the examples that we showed today. You can access those and take a look at them. The screen that I have here is a link to a white paper that we have on not only renewable energy model validation but also traditional validation.

    So if you're looking at more traditional generation plants like a hydro or gas or coal, we have kind of examples of that as well. And so can take a look at that and go from there. All right. Thank you again for attending.