Simulate Renewable Energy Systems from Months to Microseconds
Overview
In this webinar, we will show how Simscape can be used to develop renewable energy systems and how we can map computational tools to different stages of a technology development cycle. Through examples of a Type 4 wind turbine and a photovoltaic (PV) power system, we will show how to:
- Characterize renewable energy systems using look-up tables.
- Run quasi-steady simulations over months of system operation to gain insight on longer term energy production.
- Use ideal power converters to gain insight on functional response over a broad operational envelope.
- Use power converters with full switching to assess the impact of harmonics on system operation.
- Integrate different components into a system and develop management systems to achieve an overall operational objective.
- Design maximum power point tracking (MPPT) control systems for the wind turbine and PV system.
- Prepare a model for real-time simulation and/or deployment as a digital twin.
About the Presenters
Graham Dudgeon is Consultant Product Manager for Electrical Technology at MathWorks. Over the last two decades Graham has supported several industries in the Electrical Technology area, including Aerospace, Marine, Automotive, Industrial Automation, Medical Devices and Power & Utilities. Graham’s technical experience covers - Transmission & Distribution, Grid Integration, Renewable Energy, Power Conversion, Motors & Drives, Microgrids, Electric Aircraft, Electric Ship and Electric Vehicle, with an emphasis on system modeling and simulation, control design, real-time simulation, machine learning and data analytics. Prior to joining MathWorks, Graham was Senior Research Fellow at the Rolls-Royce University Technology Centre in Electrical Power Systems at the University of Strathclyde in Scotland, UK.
Nils Hornik is Senior Application Engineer for Electrical Technology at MathWorks. Nils technical experience covers a broad range of application areas including techno-economic optimization, power systems and power electronics simulation, renewable grid integration, decentralized power systems and algorithm development. Nils gained an MSc in Electrical and Computer Engineering from the Technical University of Munich.
Recorded: 22 Aug 2023
Hello, everyone, and welcome to this webinar, where we are going to simulate renewable energy systems from months to microseconds. My name is Graham Dudgeon. I am Consultant Product Manager for Electrical Technology at MathWorks.
And my name is Nils Hornik. I'm Application Engineer for Energy Production.
Here's our agenda for today. I'll begin by talking about how MathWorks software supports all stages of technology development. Next, I will talk about how we simulate from months to microseconds, using a renewable energy system as our example, with specific consideration on the engineering task at hand and how we adjust model fidelity to map to the timescales of interest.
I will focus then on the full AC/DC-to-AC power conversion with both converters for free dedicated fidelity levels, ideal, switched-linear, and subcycle average. And we'll talk about the benefits and tradeoffs for each of the stages.
And in the final section, I will discuss how we can prepare models for real-time deployment and, in particular, what model constructs and simulation settings we can use to give ourselves the best advantage for moving to a hardware-in-the-loop environment. We will then end with a summary.
MathWorks' mission is to support all stages of energy system technology development, from early-stage feasibility through to in-service operation. We do this by aligning computational software against different phases of a technology development cycle. The value comes from our software helping engineers focus on engineering tasks and by supporting the transfer of rigorous and defensible engineering information throughout the development cycle.
The way we help engineers focus on engineering is through the creation of a bridge from idea to implementation. The bridge has five foundational elements-- analytics, statistics, optimization, and AI; system design and control design, which is where we're focused today; real-time testing; rigorous verification and validation; and algorithm and simulation deployment.
The definition of Technology Readiness Levels, or TRLs, helps guide us in understanding and helping address the different engineering questions that are asked at different stages of technology maturity. The common element across a technology development cycle is a simulation model of your system. And that simulation model displays different characteristics depending on where you are on the TRL scale and what engineering question you are looking to answer.
The key value of the energy system simulation for TRL mapping is adjustable model fidelity. For example, at the earliest stages of development, we may use simple energy balance models, which lend themselves to techno-economic optimization, where we optimize system architecture and component sizing based on both engineering and cost constraints. Relevant timescales for techno-economic studies can range from months to decades.
Armed with architecture information, detailed design is then conducted. And this stage can include consideration of timescales from seconds to nanoseconds, with these smaller timescales being driven by the need to capture the effects of power electronic switching. As we track through to in-service operation, we may again be looking at longer durations, particularly when we're looking to optimize system operational behavior.
Energy system development needs more than electrical stimulation. For example, we're seeing an increasing emphasis on the integration of thermal management with electrical systems. Simscape is our platform for physical system modeling and simulation. Simscape supports a broad range of physical domains, as well as providing application-specific design workflows.
For example, we released Simscape Battery last year, which provides workflows specific to battery system development. I'll also add that Simscape supports adjustable model fidelity, meaning Simscape is effective in providing modeling support through a technology development cycle. For example, Simscape Electrical supports quasi-steady simulation for investigating system response over months and years through to detailed simulation of power electronic switching at the microsecond and nanosecond level.
Integrated modeling of physical domains helps our customers see the whole picture. In this customer example, an electrothermal system model was developed that provided information on the mission-level impact of adjusting the operational set points of system components.
The development, test, and deployment of algorithms for embedded targets is enhanced through model-based design. Model-based design emphasizes the use of a simulation model to develop your algorithms. And from the simulation model, you can generate production-quality embedded code that deploys straight to target. The systematic testing of algorithms is supported through the rigorous verification and validation, which includes support for designing against technical standards, such as IEEE 1547.
In this customer example, model-based design was used to demonstrate simulated grid response using the code that runs in the actual power plant controller. This is an example of simulation-based grid code compliance, which enhances the overall value of model-based design, as you can effectively test a broad range of operational scenarios across different grid codes.
In this section, we'll consider how we map model fidelity to timescales ranging from months to microseconds. I'm going to use a type 4 wind turbine as my main technology here, but I'll be adding other technologies as we go to show you system-level considerations. But let's start with the turbine itself, the mechanical turbine.
So I have a MATLAB live script here, which you're seeing. And I'm just going to use this as the basis for working through this. So I'm going to go through each section, open up some models, talk about certain things as we go. But we begin with the turbine model itself.
Now, this turbine-- this rotor hub is available within Simscape Driveline. And I'm going to be using this and integrating it as we go. But the first thing we can do is we can run sweeps. So we can sweep through wind speed, turbine RPM, and pitch.
I'm not going to show you that here, because it takes time to do it. But the objective of doing these sweeps is to then generate static values relating the wind speed and turbine to the power. And this is what we have here.
You can see that we have the figure on the right. Let me just run this section and then pop out this figure. So we'll take a look at it in a little bit more detail.
So what I have here are the curves going from 5 meters per second to 18 meters per second against turbine RPM and power. And the maximum power for each wind speed is the top of the curve. So what I've done here in red is I've tracked out the maximum power point tracking curve. And so I have now access to data tables, lookup tables, which I can use for all my modeling effort, actually, going from months through to microseconds. And I'll touch upon that as I go.
So step one-- get the data, and we now have access to lookup tables. Now, if I'm thinking of timescales over months, I might be looking at how much power production we expect to see over a month at a certain location. I have an example here where I've got some TMY3-8760 data-- so one hourly data over a year, 8,760 hours in a standard year.
In this case, it's Boston Logan Airport. So let me just run this section and bring the system up and show you what's going on here.
So what I want to do is look at electricity production over the year on a one-hour basis-- so an 8760 simulation. So I have my wind profile from Boston Logan. I put it through the maximum power point tracking lookup table, which gives me the maximum power. If all things are going well, what's the maximum power I would expect from the turbine for that given wind?
I then have a controlled active and reactive power block. It feeds into a transmission line, then to a utility grid. Now I'm just going to simulate this. And I'll talk a little bit more about the setup of this for an 8760 simulation.
So there we go. It's already run. Let me actually show you the results in the Data Inspector. So I'm using the Simulation Data Inspector here. I can look at active power over the year. And I can just zoom in on various pieces just to show you-- one-hour time steps over the year.
So how did I set this up in terms of Simscape Electrical? Well, let's go to the Solver Configuration. On the equation formulation, there's two options-- frequency and time and time.
Time is full EMT simulation, full-waveform simulation. Frequency and time allows us to select a specific frequency. So in this case, the grid frequency is 60 hertz. And then I can start adjusting the sample time. And it's like a phasor simulation. So it focuses on magnitude and phase at different time points as we go.
So I've set the sample time to be one hour. Equation formulation is frequency and time. And that's then what enables me to run a very efficient and effective 8760 simulation.
We can also add other components or other systems into this before going to full system modeling. We can look at components and how they might be affected by our other components in our system. This example I have here is an electrolyzer model.
So we have an electrolysis unit that's available in Simscape Electrical. You can see here it's-- I won't go into too much depth about this, because this is not my area. But it has the electrical connections. And we also have appropriate thermal modeling, thermal liquid, and moist air as well. So this is a truly multidomain model that we have here.
Now, the level of fidelity of this model means that we can simulate this at 600-second time steps. It's a slow enough acting unit that 600 seconds is appropriate. And the question we might ask ourselves here is, well, for a given wind profile-- say, Boston Logan-- how much hydrogen might I produce from that wind turbine?
This is fairly crude thinking because we'd have other components in our system-- batteries, solar, et cetera. But what would happen if we just had that wind turbine in Boston producing electricity and driving an electrolysis unit?
So let's just run this. So, well, it's 600 seconds now rather than 3,600 seconds for our time step. But it's still a fairly fast simulation, as you can see. I'll just bring up the Simulation Data Inspector.
And we can look at the mass of hydrogen being produced by this unit through the year-- fairly stylized in this particular example. But it shows you what can be done when we're considering different levels of fidelity, different timescales, and different modeling architectures. So we have some idea about how much hydrogen we can produce in Boston Logan only from wind.
Then we'll start thinking about going to seconds to minutes. So we're starting to compress our timescales a little bit and thinking about the modeling constructs that are appropriate there. So I've now got a full architecture for a type 4, and I'm going to control it through maximum power point tracking. Let's just bring this up, and I'll talk about a couple of things.
Now, I've already introduced you to the frequency and time, or the phasor-type modeling. And we're going to maintain that here on the grid side because we're at 60 hertz, and phasor is a reasonable approach here to capture-- and seconds to minutes, we can use phasor effectively here.
On the machine side though, you can see I've got a permanent magnet synchronous generator and an AC/DC converter. Now, because this is a type 4 turbine, we are subject to variable frequency, variable speeds. So the PMSG is going to have a range of frequency.
So phasor simulation is not appropriate for this side of the system. So we're going to use full EMT, full-waveform simulation. But we're not switching power electronics.
Let me just go under AC/DC. And in this particular case, I've just got a basic average value rectifier, an ideal rectifier. And then I've got a buck-boost converter here-- so simple architecture, but I just want to make some points with this.
I'm controlling the power flow. So I'm getting power commanded from the MPPT lookup table to control my converter. I'm getting the RPM for a given wind speed for what should my RPM be. And that's being fed into the mechanical pitch control system.
And let me just run this-- so 1,300-second scenario, a fairly stylized scenario. But you'll see how quickly this runs. I want to make a couple of points about this.
So you can see it's gone past 500 seconds already. I want to focus on time steps. So let me go into the phasor side.
And if I double-click-- so frequency and time, I'm stepping at 0.1 seconds in this case, so a fairly big time step. This construct here is actually just an ideal power transfer from DC to AC side. On my machine side, let me hunt down the Solver Configuration. It's in the gearbox.
0.01 seconds. So you might be thinking, well, that's full-waveform. 0.01 seconds, that seems too big. Well, for this particular scenario, I've only got six pole pairs on my PMSG.
So I'm going to have a low electrical frequency. And that's what enables me to have that bigger time step. Let me just show you the voltages. I'll just zoom in. Let's go to the highest frequency here.
It's relatively low electrical frequency because I've only got six pole pairs on a low mechanical speed. So you might be thinking to yourselves, well, of course you've got a fast simulation. You're at 0.01 seconds. It's not really representative.
For this type of study, you can certainly go to low pole pair values. It doesn't affect your ultimate power output. But if you do want to start capturing the frequencies more appropriately, let's just go up to 60 pole pairs.
And if I'm at 60 pole pairs, let's go back into my Solver Configuration. And I can go to 1 millisecond in this case. So I'm obviously choosing the step time as a function of the electrical frequency.
And let's just run this. So we've now got 10 times the electrical frequency that we had before. Simulation is going to slow down a bit, but you can still see it's very fast. It's still much faster than real time.
I'll just stop it there, and we'll take a look. And we'll do a little comparison, actually. So here's the voltages. I'll make them green.
The beauty of the Simulation Data Inspector is it archives your simulation runs. So I'm going to go to the previous one, which was slow-- it had a lower frequency, or a slower frequency. And you can see there the difference-- so appropriate timestep for the electrical frequency that's under consideration. And, of course, the higher electrical frequency would be more appropriate for a detailed design.
All right. I'll bring this one down, and let's move on to the next example.
Next example I have-- I've hung off an electrolyzer onto this system, just doing some basic studies on the power flows and the power sharing, hydrogen production. If I go into this AC/DC, there's a couple of things that I just want to point out.
My very simplistic power split-- I've got 30% of the power going into the grid, 70% going to the electrolyzer. This is basic. If I was putting together a proper management system, my management system would be deciding what would be happening here. But this is just to show you how you can readily add different components at different levels of fidelity. So let's just run this and then just take a look at a couple of results.
So there we go. You can see we've still got a very rapid simulation here. I'll just stop it here, and we'll just take a look at some of the results.
Hydrogen production and-- let's see-- power to the grid-- there's power to the grid. Because of the scale-- let me just get rid of the hydrogen-- so power to the grid and power to the electrolyzer. So 70% of the power is going to the electrolyzer, 30% to the grid. So we're seeing what we expect to see.
Next, I'm going to add our solar array and representation of energy storage.
So we have our type 4 with EMT on one side, phasor on the other. So I'm doing DC to phasor on my solar and energy storage. I just want to show you what I have here for the solar.
I've created lookup tables that relate irradiance to duty cycle and irradiance to cell current. I've done that as part of an exercise similar to the turbine that I showed earlier. But I had a solar system, and I ran it over a range of different operational profiles to generate these lookup tables.
So I've maintained the boost converter, but I'm running it in a quasi-steady way in order to get a little bit more engineering information about how the boost converter is operating over longer durations of time.
I've got a stylized irradiance curve. On the energy storage side, this is very low-fidelity. I have got a controllable power source and a basic management system. And I'm saying-- I'm going to run this while I talk-- I'm saying I want to produce at least 1.2 megawatts for the grid, at least 1.2 megawatts.
And so that's what this is doing. It's measuring what power is coming from my renewable sources my wind turbine and my solar array. And it will supplement the power, if necessary, with the battery. So let's take a look at some results here. I'll just stop this so I can then just bring up the results.
All right. So here's the power to the grid, 1.2 megawatts. I've actually not run it long enough for it to start increasing more as the wind and solar ramps up. But I think we've got enough here for me to show you what's going on.
Here's the power from my overall renewables. So this is power from solar and wind. If I just look at wind and solar-- very stylized, as you can see. But you can see we haven't got enough. The yellow, which is the combined power, there's not enough there to meet 1.2 megawatts.
So if I now click on the battery power, there you can see what the battery is producing in order to maintain that 1.2 megawatts. As the simulation progresses, which I won't do here, but the renewable powers exceed 1.2 megawatts, at which point the battery goes to 0. And this is expected operation for the functionality we've asked for this particular simulation.
OK, final model that I want to show you-- well, actually, before we do that, here's the figure for the full simulation that I just showed you. So you can see as time progresses, the renewable power goes above 1.2 megawatts. Very stylized profiles are put in here just to show, I think, clearly, what's going on.
And you can see the battery drops to 0. As soon as the renewables are able to meet our minimum grid power, we no longer need the battery. So we're seeing expected operation.
My final model is talking about the microsecond level. So let me bring it up. The reason I brought this one up is I wanted to introduce MOSFETs into my machine side converter. If my focus is only the machine side converter and the switching, I don't need the grid side.
So I've got an ideal DC source here. So I've been able to remove components from my system to focus on a particular task at hand, which, in this case, is the machine side. I could probably reasonably have removed the turbine side as well and just made sure I was feeding the right mechanical power in.
So there are options here. As an engineer, you can continue to trim detail off this depending on what you're looking at. But in this case, it was trimming off the grid side.
And under here, I've got MOSFETs. So I've also-- oh, yeah, I've also went up to 40 pole pairs as well.
OK, so let's just run this for a short period of time. And we'll take a look. And we'll start seeing the effects of this switching now. So I want to go to this three-phase current.
So we can see this was an initial transient for the system. 0.5 seconds, we're going to see power demand kick up. So let's just wait a few seconds for that to happen.
But with our much smaller time step now, because we're simulating the power electronics, you can see current ramping up here. And you can see the contamination, the harmonic contamination, on the waveforms. Let's just stop that.
A couple of things-- let's just take a look at what timescales we're at. We're at 1 microsecond now on the simulation of the system. And let's take a look at our PWM generator.
We're at 5-kilohertz switching on a 1-microsecond clock frequency. OK.
So what we've done in this section is we've moved from considerations of months all the way through to microseconds. We've looked at how we can integrate additional components into our system and also focus on specific modeling constructs and also specific components, depending on what engineering question we're looking to answer. And with that, I'll now pass over to Nils, who will talk in more detail about the full AC/DC converter. Nils, over to you.
Thanks, Graham. I will continue now with the full power conversion for the type 4 wind turbine model. After seeing you walking us from months to microseconds in your model, and also displaying various sources, like electrolyzer batteries or solar panels, we will focus here on the wind turbine and, more specifically, on the power electronics.
So both converters-- we have the machine side converter and we have the grid side converter. And we will see the same setup for three distinct fidelity levels, starting with the most simple one, the ideal.
And the name "ideal" comes from the fact that-- converter block we're using, which converts the AC power from the synchronous generator to DC, into the DC link, is an average source, which has an ideal behavior. So the output, or, in this case, the current it takes from the generator, is really ideal sinusoidal.
We are now on the machine side converter submodule. And we see beside this converter block, we have a current regulator and a voltage regulator. So the control goal here is to track the voltage of the DC link at 2,200 volts. We ensure this by generating the first simplistic controller and the ID reference. And then this is converted, compared to the actual current from the synchronous machine, to a voltage reference.
If you look now on the grid side converter, we see a similar setup. So we have the same converter block and also two governor and regulator blocks in a control hierarchy. So on the top level, we have active power tracking, which is taking both the reference power and the actual power fed into the grid into consideration, computing from there, again, the ID reference.
And then, with this current reference, we go into the current regulator and, again, compute a three-phase voltage signal as output. Note here that this three-phase voltage signal is directly fed into this block. So this is quite special because there is no PWM. You we will see this in later models.
I will show you now quickly how you would add such a model block into a project of yourself. So you open the Simulink Library Browser. Then, under Simscape, you have to find electrical.
Then there is a dedicated subsection for semiconductors and inverters. And on the converters, there are several of these blocks with various fidelity levels and features. And the one we are using-- this is this one. So whenever you need to apply it for your own model, you can always go back to the Simulink Library.
If you want to know more about the block and how it models, it's always a good idea just to hop over to the Help page, where the underlying concepts are described. And also, you will find the equation. But now we see this general setup. We have assumed constant wind speed of 12 meters per second.
We used lookup tables, which were generated in the process Graham described before, to have the reference for reactive power and also the reference for the RPM on the machine side. We can run this model relative efficiently as it has a quite low fidelity level, assuming these ideal converters.
If we simulate, we should be able to observe the results of the simulation, which is now timed for 200 milliseconds, relatively fast.
Now we have the active and reactive power fed into the grid. As desired, reactive power stays 0. Active power is slowly approaching the power reference. Again, this is just for 200 milliseconds. Then we see the DC voltage with a slight overshoot and then a slight undershoot of our reference of 2.2 kilovolts.
And most interesting, we see both currents. So we see there's quite a drastic difference in the frequency. Of course, the current fed into the grid has 60 hertz. But the machine side, as Graham said, due to the low number of pole pairs, has a lower frequency. But the full converter from AC to DC to AC, of course, allows us this degree of freedom.
So this model from the application, what would I use it for? Typically for tuning these control loops-- so either, really, the KP and KI in this case-- or investigating new maybe learning-based control approaches. This is really great because with this simplified model of the power electronics, there's no need to wait for high-detailed simulation of power electronics.
However, there are tasks where this might be necessary. So if we continue from this ideal to what we call a switched-linear system, we should see some differences. Let's start again.
In the grid side converter, we see there's additional blocks coming in, the PWM generator, and the gate driver. I will talk about the specific meaning in a second. But most importantly, you would see there's a different converter block. You could also, like the other block, just drag and drop it from the library.
This is now different modeling options. For example, switching device-- that's selected Ideal Semiconductor Switch. And this is where it's switched-linear, because "ideal" meaning it's a linear behavior when the switch is on and off.
You could simulate an even more detailed behavior, like Graham did in his part before, for example, representing a real MOSFET or IGBT switch. But we will stick here with the ideal, meaning linear-switched behavior.
So this makes it necessary to introduce a PWM generator. The output of the current regulator stays still a three-phase voltage reference signal. And the PWM generator now, with a certain carrier frequency, creates the PWM pulses, which the gate driver subsystem is then simply translating from a Simulink domain to a Simscape signal.
We find again the same structure also in the machine side converter with the same power electronic device. Now, for small timescales, like 200 milliseconds, we can still run this model efficiently fast.
And now we see the same scenario-- so same wind speed-- basically the same characteristics as with the ideal model. But, of course, we see that the signals now don't look that ideal. And this is desired because one would maybe like to investigate the distortion, the total harmonic distortion at certain points of this sine wave, which is introduced by the switching behavior of the plant, which was in the model before and idealized.
So you could directly see where the application for this model would be-- for example, simulation studies determining the total harmonic distortion power quality, or also fault studies, where you want to figure out the effect if a single of these IGBT switches degraded, failed over time. Then you would have to go to this fidelity level.
But there's one more fidelity level I'd like to talk about, and this is what we call subcycle averaging.
So this is mainly the same setup with one additional block compared to the linear switching model. And I will talk about the details of this block in a second. But just to be on the same page, doing the basics, what does "subcycle averaging" mean?
You have here what I think most of you are familiar with, our modulation wave, what our actual target is with the carrier wave. And by comparing this, we can derive a gate signal determining when the IGBT for a certain bridge has to be on and off, vice-versa.
Here you can see the signal where we integrate for a certain period this gate signal. In this case, we chose this period over which we integrate the subcycle sampling time equal to the carrier sampling time. And for this here, the subcycle sampling time is one-quarter of the carrier sampling time.
This results, then, in this green signal, which is the average. And this can now take values anywhere between 0 and 1. But it's not restricted to 0 and 1 as a gate signal, because it can also represent the average for any of these periods.
So if you have a look in the subcycle model now, again, grid and machine side converters-- similarly, both are adapted from the linear switching we saw before. And now we got this additional block in between the PWM generator and the gate driver. And this is responsible of what we just did, averaging and sampling the gate signal. This becomes obvious once we activate the sampling time overlay on Simulink.
This means this can save us a lot of time because even though the PWM is running at a very high clock rate, we can drive the gates at a much lower rate. This is allowed by the setting. Where in the previous model, we had it on an ideal semiconductor switch, we have now an average switch, so meaning which would have been several on and off periods, we instead have one averaged value for one subcycle period.
Application of such a model would typically be when it comes to hardware-in-the-loop modeling, simply when the hardware-in-the-loop is from computational loading, not capable to simulate each and every switching event, and the averaged behavior is sufficient.
To finish off, I would like you to compare with me these three curves for the ideal converter. And we see it here in pink it's really forming an ideal part of a sinusoidal wave with the subcycle averaging and with the switched-linear, which are the three fidelity levels we will look at. And we immediately see that for a study concerning harmonics, the full switching with the linear devices is the most appropriate because even the subcycle averaging might underestimate the harmonic distortion.
However, for hardware-in-the-loop tasks, this is still a suitable representation. I'd like now to hand over to Graham to show you how you would prepare such a model for hardware-in-the-loop simulation.
In this section, I'm going to give a high-level perspective on how we can prepare a model for real-time deployment in our hardware-in-the-loop system. Now, our objective with this is looking at how we can configure a model to run on multiple cores. So how do we separate components of the model so that they can be placed on multiple cores so we can take advantage of parallel execution?
So the model you're looking at here-- at the top, I've got my type 4 wind turbine that goes all the way through from the rotor through to the grid connection. And this is a model we saw in our previous section, where we have a DC link between the machine side and the grid side converters. And this DC link is modeled in Simscape Electrical and uses physical ports.
Now, DC, the DC link is usually a good place to decouple or couple-- you can use the words interchangeably, actually-- and decouple a model, two parts, couple it through the DC link. It tends to be a robust way of doing it.
So on the bottom, what you see here is I've actually separated the machine side and grid side converters from the physical connection. And instead, I'm transferring current and voltage information. So let's just take a look under the machine side.
So I have a controlled voltage source and a current sensor. And on the grid side, I have a controlled current source and a voltage sensor. And that's how I'm transferring the signals via Simulink signals.
Now, the reason I'm doing this is so I can take advantage of model reference because model reference communicating through Simulink signals is the way that we can prepare for real-time deployment. So let me just bring this model down. Oh, before I do that, there's one more thing. Let me just run this.
When we split using Simulink signals, we need to introduce algebraic loop breaks. So a unit delay, a one-sample-time delay, is the most natural way of doing this. I'm using ideal converters here. So there's no power electronic switching in this case. But we need to be sensitive to that when we introduce that delay because we do change the results slightly.
And let me just show you. Oh, what should we look at? Phase A current on the top model, and let's go to phase A current on the coupled-- or decoupled model. And just take a look.
You can see they're virtually overlaid. They're not perfect, of course, because we have that 1 over Z. But breaking a DC link is the way to go, usually, with this. All right. Let's bring this model down. I'm going to go straight to our model that's ready for real-time deployment.
So what you see here, it's a small wind farm for turbines. I've got stylized inputs, wind inputs. I've got four turbines, and I'm using model reference here. So let me explain what that means.
I'll just open up Turbine01. So this is my turbine model, which is configured to be referred to multiple times. And you can see its input and output ports are Simulink signals, which is a requirement for model reference.
This SLRT Overload, by the way, Simulink real-time block, I'm using Simulink Real-Time and Speedgoat hardware. And the overload, we can set a short period of time at the start when Simscape initializes and before it will then start going-- in this case, 50-microsecond time steps. So we can tell it to be a bit more lenient right at the start when Simscape initializes, and that's all key in this particular case.
So we have a single turbine model being referenced multiple times. And on the grid side, we have four grid side converters connected appropriately to the grid. All right. So this system is set up for real-time deployment.
And I'm not going to go too much into the details of real-time and hardware-in-the-loop in this particular webinar. That's a subject for another time. But I do want to show you this running real time.
So I've already got it configured. I've built the model, and I've deployed it to Speedgoat. And I can just click Start Now.
And what we're going to see here-- this is the task execution times of five tasks that are running, all at 50 microseconds. And you can see that we're below a 25% task-execution time relative to those time steps. So we are well within real time in this particular case.
Simulation ran for 15 seconds. Let's look at some results that come out through the simulation data inspector. So I can look at the four grid powers. I had contrived stylized wind profiles to show you the difference between the four turbines. So they're all acting the way they should.
And if I just now quickly show you phase A current on turbine 1, phase A on turbine 2, just to show you that we are indeed getting EMT, and with a time step of 50 microseconds in this case, well within real time-- very comfortable here for real-time execution.
And let me just show you what these task execution times look like on our four turbines and on our grid side. So this is task execution time. You expect some variability as it goes through. But you can see they're all around about a midpoint of 12 microseconds, so comfortably within our 50-microsecond time step.
Here are our key takeaways for today's session. "Different engineering questions are asked at different stages of technology development. Mapping MathWorks software to different stages of technology readiness helps you navigate and answer those questions."
"Adjustable model fidelity is the key value of energy system simulation for TRL mapping. This ranges from simple energy balance at early-stage, through to detailed power electronic switching at later-stage."
"Through worked examples of renewable energy systems, we demonstrated how to map model fidelity to timescales of interest, ranging from months to microseconds, and we presented some considerations for preparing models for real-time deployment on HIL systems."
Thank you for listening.