Evaluating EV Charging Infrastructure with Simscape Electrical
Overview
In this webinar, MathWorks will demonstrate modeling and simulation of larger-scale electrical grids which are driven by time-series data profiles. The choice of suitable model fidelity and solver options to achieve time-efficient simulation will be highlighted. Also, Parallel Computing Toolbox will be used to simulate multiple scenarios. Furthermore, attendees will be given insight on relevant aspects for EV charging hubs (grid impact, grid autonomy, energy storage, renewable energy…).
Highlights
- Select suitable model fidelity and solver options for time-efficient simulation.
- Give insight on EV charging stations electrical design & operation
- Build automatically electrical power networks from network description data.
- Integrate time-series data of EV charging profiles into the simulation environment.
- Evaluate multiple operational scenarios using multiple cores.
- Analyze data from multiple simulations using statistical methods.
About the Presenters
Graham Dudgeon
Principal Product Manager – Electrical Technology
Graham Dudgeon is principal 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 and utilities, 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.
Juan Sagarduy
Principal Application Engineer
Juan Sagarduy is a principal application engineer with focus on physical multidomain modeling and simulation. In his role, Juan provides technical expertise for successful adoption of plant modeling tools (Simscape™ platform) for model-based development. Furthermore, he leads several Electrification initiatives for the Nordic region. Before joining MathWorks in 2011, Juan worked at the ABB Corporate Research Centre (Västerås, Sweden) in electrical machines and motion control projects. Juan holds an M.S. degree in industrial engineering (Bilbao, Spain) and a Ph.D. in electrical engineering from Cardiff University (UK).
Recorded: 17 Nov 2022
Creating EV charging infrastructure with Simscape Electrical. My name is Juan Sagarduy. I'm an application engineer working with focus on electrification and mechatronics. I am based in Sweden and cover northern Europe. My colleague Graham Dudgeon will introduce himself a bit later on.
So let's get a quick overview on the agenda for today. I will take in the first session on assuming perspective on EV charging with first-part component design integration and including embedded development and multi-domain behavior analysis. Then charging hubs from grid network all the way down to the battery. And then finally evaluation of a concept where renewable energy is providing energy for EV charging.
My colleague Graham will tackle the following in his session. So configuring a grid-scale model for infrastructure evaluation based on the IEEE European test feeder and programmatic methods in MATLAB. And then a second part on optimization of charging profiles and finding the best charging locations from different perspectives. Then we will end up with a summary and some brief call to action.
So EV charging is a very exciting, broad area-- multidisciplinary by all means. So for EV charging concept to be successful you need expertise in communications. You need expertise also on test measurement. So understand the sensor technology that is needed in order to perform all tasks and then commission. On the other hand, development of suitable control algorithms and software is key and paramount to succeed.
And then last but not least, the understanding of power s and power electronics is very important in order to have a competitive concept. And these are the two areas where we are going to focus on today.
So let's get a quick overview on AC versus DC charging modes. When power is low below 40 kilowatts so EVs will be charged through an onboard charger that will convert the AC to DC power that will end up in the battery. For fast charging is enabled by having direct DC power transfer from the charger to the battery.
Today we are going to focus mostly on fast charging and DC-based technology. Below you see some of the plug standards for different nations. CCS has been established in Europe whereas CHAdeMO, for example, consolidated in Japan. It is worth mentioning that EV charging applies to a wide range of industrial applications-- micromobility passenger cars, but even off-road marine and light and heavy duty transportation.
The differences lie on power and energy levels, but they all share common physical principles. So since we are going to have model simulation as our red thread so the concept of fidelity is once again paramount. So if our ambition is to develop a solution in the millisecond or microsecond range, so then we need to have logically a model that matches those requirements in terms of fidelity.
On the other hand, if we are interested in performance over seconds, minutes of hours, then it makes sense to sacrifice a bit of that fidelity in order to get an agile simulation that can give us a key performance assessment. In the end if you are looking into long-term techno-economic predictions over months and years, so then you will need to lower the fidelity even a bit more just to make those batch simulations purely effective and rewarding.
OK. So let's get started with the first part in session number one-- component integration embedded development. Let's kick off with a description of a typical longboard charging . On the left-hand side, we'll have AC power-- possibly one phase-- electromagnetic interference filter, measuring unit, a front end converter converting AC to DC power, a power factor correction sometimes needed to mitigate the impact on the net.
A DC/DC converter to adjust the level of voltage and then provide isolation. And then on the left-hand side, the battery taking in the power and charging itself.
In the following video, I'm going to showcase how Simulink and Simscape Electrical offer you the possibility to perform a component designed integration and development and testing of algorithms. We will simulate two cases-- one with an average front end converter, and then a second one with a switching front end converter.
So the first element a filtering unit with a phase-locked loop capturing the frequency of the grid used for converter control. Front end converter. And then DC/DC converter consisting of a four quadrant chopper with its scale drive. And then a high frequency isolation transformer that can be modeled as a purely electrical component or a multi-domain one.
Simscape language gives you the freedom to author and customize components to add the properties that you desire. In this particular case, the thermal behavior. By using the language and its constructs you will be able to really meet your requirements in terms of modeling. The thermal losses generated in the transformer are transferred to the cooling oil. And then the oil is cooled by air that is provided externally by a fan.
Final step, a diode bridge rectifier before we arrive into the battery unit. In this case, the batteries model as a Panasonic pack based on a pre-pandemic lookup table based cell that is a scale in serious and parallel to configure a simple pack.
So time now for the first simulation with an average front end converter. The reason for this is that we want to skip the high frequency harmonics but make sure that the behavior is precisely the one that we were expecting.
As a second step we can add more fidelity with a switching front end converter. This is done by selecting the adequate variant in the block. And then when we simulate, we will see that the current has got all the high frequency harmonics that we're looking for. Those are intuitively analyzed in the FFT analysis tool in Simscape Electrical giving us the total harmonic distortion and the spectrum for different stages in the charging process.
By moving from a switching front end converter to an average front end converter, we are losing fidelity and information on the high frequency harmonics. But then the simulation becomes 35% faster. And that is worth considering sometimes.
A brief recap on what we saw-- Simscape language does give you the possibility to customize and offer components. Simscape is multi-domain platform allowing you to capture energy flows across domains. If you want to know more about Simscape and its capabilities you're very welcome to enroll to one-day course provided by MathWorks.
Last but not least, once you have a model based representation of the , including the physical part and the algorithms, you want to convert the graphical algorithms, for example, into a better code that you can execute in real controllers. And that is very easily done with an automatic code generation in The MathWorks toolchain that allows you to generate a structured text that runs in PLCs, C/C++ code that is normally executed in the classical digital signal processors, or HDL code that is run by a field programmable gateways.
I'd like to mention Composer, one of the latest additions to our portfolio where you and your fellow colleagues can design software and hardware architectures in an intuitive and collaborative way allowing you to link to different requirement platforms as well. It's very good. Now it's time to get into part number two of our first session as a main perspective. We're going to look into EV charging hubs from grid network to battery.
In order to do that in more detail, so we are going to explore power conversion and then even a degree transformer. So in order to make simulations agile and to provide us with valuable info on current voltage and energy and power, we are going to use average converters because they are good enough, make the simulation fast, but then we can capture also losses of energy. That applies to DC/DC converters, AC/DC rectifier. And as I mentioned before so we are going to dig a bit deeper into the modeling of grid transport by a very important element when connecting EV charging hubs to the network.
In the following video, we're going to describe the model in Simscape Electrical that we use for the rest of the analysis. That will include circuit breaker for bridge protection, the grid transformer, AC to DC rectifier, and then respective DC/DC converters for EV charging and then the energy storage unit. The energy storage unit will act as a backup thus providing grid autonomy in some circumstances.
So we'll start with a grid in this case modeled as a three-phase voltage source. The transformer, AC to DC rectifier, where we can capture the energy losses and even the thermal behavior if we wanted to. The same applies for DC/DC converters-- in this case, a control with a current reference, the battery for recharging, and then the energy storage unit as mentioned before.
So the first simulation ideal transformer no protection. So we get a very high spike at the very beginning, but everything else seems known. What if you now take into account no linearity or saturation in the transformer? So we do that by selecting the adequate variant in the model. And then there we can define the non-linear saturation properties and non-linear properties link between the current and the flux.
So we get that simulation of very high peak and high currents during the transient. Then as a result of that, so we need to think about the way of protecting the . So the easiest way is just to magnetize the transformer during a few instance and then during that time disconnect it from the grid. We did that with a circuit breaker. And then when the is energized by the energy storage unit then we can connect the traffic to the grid.
So now we are going to look into the function of the operation of the energy storage unit. So basically this can be providing most of the power for the EV charging. Or it can be just harvesting power from the net to recharge itself. Or stay more as a neutral element not absorbing or contributing to charging of the EV. So the mode is selected in that block. So a grid supply. Then we are absorbing a lot of power from the grid just for the EV charging but also for the energy storage unit to charge itself as you can see.
In the second case, so the energy storage unit is providing most of the power for the EV charging. That would mean that the power absorbed from the grid goes down significantly. So this is accomplished by regulating the DC/DC converter in a special manner as you see on the screen. So depending on the mode of the energy storage unit of course, power and currents drawn from the grid will be significantly different.
So a brief recap on what we saw. The importance of modeling nonlinearities in the transformer captures magnetic saturation can be important to capture phenomena like inrush currents or transients that we want to avoid, prevent, or mitigate. If you're interested to know more about how to design energy storage s based on batteries, you are very welcome to explore our latest product Simscape Battery enabling you to do important tasks such as thermal management.
So what are the challenges when it comes to fast versus slow charging in EV stations? The first question is, what is the total capacity for fast versus slow charging and that depends on many factors has to be traded off. Energy storage to tackle peak power demands-- it can make sense, but that is not given either so that deserves some analysis. Development of software and IP creation can be the differentiating factor that allows you to optimize the outcome from your EV charging hub.
And then last but not least, how can I embed intelligence data into a simulation model so the use of grid electricity prices forecasted a demand by EVs and the use of machine and deep learning techniques in MATLAB and Simulink will make a lot of sense. So now a little video to describe how simulation captures the dynamics in fast versus slow charging. The base model is similar to the one that we had before. We have added an industrial load to constrain the .
So the industrial load that EV charging have a different grid transformer, then the first charging unit is just basically a set of batteries with a specific timing for charging. So then depending on how we operate the energy storage , we might get a different pattern when it comes to energy consumption of course from the grid. We apply peak shaving so we can even optimize the impact on the grid-- how fast charging.
So as you see with an inactive we assess so in comparison with peak shaving BSS. So we could save in this particular simulation 5.1% energy absorbed from the grid network. So that was good to see. So now let's tackle the final part in the first session-- concept evaluation for renewable based charging hubs.
So when it comes to concept evaluation of course charging hubs are an interesting concept because of the high demand and it is worldwide-- not only passenger cars but even heavy duty transports and in the maritime sector. But then the scalability is going to be paramount.
On the other hand, renewable energy sources like solar and wind are attractive. They can capture investments. They have become more competitive in terms of price. But then of course you have the limitation in the fluctuation of the energy coming from those sources. And then energy storage technology with batteries in particular have become very consolidated. There is additionally a new impulse with hydrogen that can act as an energy buffer. So those are the opportunities and the challenges.
So that in order to overcome those challenges and capitalize on opportunities, we will need engineering methods. And this is where a simulation can become really a strong enabler for design exploration for sizing and integrate those components. And then later on to plan and operate this charging hub over a lifetime basically setting the growth for technical and economic feasibility.
So to get started with-- it goes through a model including photovoltaic energy for recharging. So we recognize the topology from before with the EV charging, the battery, the energy storage unit as well. But then now we have a photovoltaic solar plant included. So how do we model that in Simscape Electrical? So then we have a model of solar cells, diodes and a back converter that is controlled with a maximum power point tracking. So you see the pre-pandemic tries options for the solar cell with a lot of suppliers that we now supporting our Simscape Electrical library.
Then the maximum power point tracking algorithm-- it's implemented in a simple but effective way with a MATLAB function. So we simulate to get an idea of the energy balance in that particular . So then depending on the state of the EV charging battery, so then we can make decisions on how much power we can take from the energy storage from the grid and so on. Of course development of algorithms will be easily enabled by this plant model. So you see the three sources of energy-- energy storage, photovoltaic, and grid. And then the load being the EV charger.
So now a brief summary of the result of the energy balance simulation. So we could see that the photovoltaic, the energy storage, and the grid contributed almost equally to the recharging. We could see also that 12% of the energy was lost across different components in the system. So simulation will definitely give you valuable insights on how efficient and then profitable your EV charging hub can become taking into account the investment in technology but also the possibilities when it comes to dimension and algorithm development and optimization.
So let's have a look at the wind-based EV charging hub. I started with the topology. So wind power as renewable energy source converting mechanical energy to electrical. Then two EV feeders with each one with their own transformer and AC/DC rectifier. There is an optional grid connection in case wind power is not enough. And then in this particular , we will allow bi-directional energy flow-- so grid to wake or vehicle to grid. And that is done by controlling the AC/DC rectifiers in the right way.
So what happens when we have wind power only? So then we see that one of the batteries can transfer power temporarily to the other one when we have a green and wind power altogether. So it will be quite common to charge both units at the same time. One of the important considerations for the wind-based charging hub owner would be to secure that no reactive power disturbances introduced to the grid. And that can be accomplished by converter control and EV charger control. But even by adding a compensating unit as a STATCOM. By not benefiting from the power of modeling and simulation, which seems hype electrical to tackle this task.
And then final item. So in a scenario where we have an energy surplus either from renewable energy sources or from the grid, then an electrolyzer unit will allow to convert electricity and water into hydrogen. And if you want to know more about how a the Simscape and Simulink can be applied to solve that particular problem, you are very welcome to access our previous work in the year on that topic.
With this, I'd like to thank you all for your attention and hand over to my colleague Graham. Good luck, Graham.
In this section, we're going to look at how we configure a grid-scale model for infrastructure evaluation. The we're going to be using is the IEEE European test feeder. This is a benchmark model published by the IEEE AMPS Distribution Analysis Subcommittee. The benchmark as published has 906 three phase nodes, so 2,718 nodes in total. 55 loads with unbalanced distribution of phase loading. The network data is available at the link shown below.
The image you're seeing here is a render from a MATLAB graph object which shows us the network, but also highlights the voltages across each of the nodes. This is actually for an unloaded condition across the network. We'll see more of this visualization later as we go through. Files that build the IEEE European test feeder and Simscape Electrical are available for download on MathWorks file exchange. See the link below. Alternatively go to file exchange and search for IEEE European test feeder and you'll find the link.
For this application we're going to construct the network automatically from the network description and we're going to add a PQ load for each of the 2,780 nodes. And each of these PQ loads can be driven by time series data. By doing this we're able to consider the entire network for evaluation studies. On the right here you can actually see the as modeled within specialized power s after it has been automatically generated.
When working with larger scale models, it's typically good practice to put the model under a model reference. This is a convenient way to architect the model interface and also compile the model only once. So for subsequent simulation runs we do not need to recompile. Here's a comparison of the specialized power s simulation results with the published benchmark. You can see that the Simscape Electrical simulation accurately captures the published benchmark results.
We're going to take our modeling one step further. Because we want to evaluate multiple locations and give ourselves the opportunity to run multiple simulations for multiple scenarios, we're going to take advantage of another implementation of the network where we're going to use a phase or matrix. This represents the linear relationship between the inputs and outputs at the frequency. And so you can see here what the matrix looks like when we have voltages and currents for inputs, and voltages and currents for outputs.
We can use specialized power s-- the function power underscore analyze-- in order to generate this phase or matrix. Once we have this matrix we can implement the model in the form that you see here. Now this doesn't look like the model we saw before, but it is an equivalent implementation. And this implementation allows us to take advantage of vector and its components. So the PQ loads are vectorized.
So let me just bring this model over so we can take a closer look at it. Just go to full screen here. Press spacebar to fill it. So here's the model. So these are matrix and representing the relationship between the voltage and current input and output. We have our source voltage at the feeder. And these PQ blocks-- this is vectorized so it's one block-- I'll just double-click to take a look under the mask. And here's the implementation. So basically the current is the input. And we calculate that by dividing active and reactive power by voltage.
Now it's one block but it has multiple inputs. And so this is vectorized and it allows us to simulate the faster than if we use the native implementation and specialized power . And so we've rolled our sleeves up a little bit to rearchitect this and reimplement it so we can get faster speed of execution. And here's an indication of the scale of the model that we're working with that are 2,721 inputs and 5.439 outputs.
And after we simulate this model and compare, you can see that the simulation with the phase out matrix is equivalent to the original specialized power s model. And so we now have an efficient implementation of the IEEE European test feeder which we can now use for subsequent grid-scale evaluation studies.
In this section, we're going to look at how we optimize charging profiles and then evaluate charging locations with those profiles on the larger scale model. So we are considering techno-economic optimization. So we're now thinking about how we use the Optimization Toolbox in order to look at how we can optimize charging profiles for some -level benefit.
And so here's the objectives that we're looking at today. So each storage unit needs to achieve full charge at the end of its charging cycle. And we're going to constrain each storage unit to remain within 25% to 100% of state of charge during the charging cycle. Charge and discharge rates in this example are constrained to 0.5C. And we're also going to constrain grid supply. So as we are charging and discharging we do not want the grid supply to provide more than some predefined value.
And on the economic side the aggregate electricity cost based on time of use electricity price is to be minimized. This example reflects a reasonable scenario for how plug-in electric vehicles could be utilized for overall benefit. I might add this is not the only way you could do this. We're using this as an example to show you how the Optimization Toolbox can be used for -level optimization of individual units.
Here's a basic example of how the optimization problem is formulated. We're looking only at one storage unit here. We assume it's connected all day and we're updating at six-hour intervals-- so four time periods for the day. So I wouldn't dwell on this too much. I've got some high level observations about this formulation. So first of all this first rule this is the constraint for the final state of charge for the unit. So we sum the storage energy, the six multiplier converts power to energy for six-hour intervals in this case and kilowatt hours.
So we constrain that. The next four rules is concerned with load power. So we create four new states which are equal to any load profile that we have on our system. And then our final four rules is where we do the power equation. So we add storage power and load power to negative of grid power. And this makes sure that we've got our powers with 100% efficiency taken care of. With this formulation we're not thinking about the electric grid and its characteristics, we're simply doing a basic power equation. But once we've done the optimization, we then evaluate on the full grid.
So this top matrix is to do with the equality constraints of the optimization. The inequality constraints relate to energy or state of charge. And so the first four rules are to do with our lower state of charge band and our final four rules are to do with the upper stage of charge band. As you can see, it's a lower triangular matrix in each case where we're adding energy at each timestep.
And so we take this basic architecture and scale it up to the systems that we're looking at. We're ultimately looking at 10 minute timesteps with 906 units being optimized. So the first thing we do is we define some plug-in duration. So we just randomize this. What you're seeing here is just a plot of 20 vehicles with random plug-in durations over a 24-hour period.
And for each of the units they all start with a certain state of charge when they plug in. And they must be fully charged to 70 kilowatt hours in this case and when they're disconnected. Before the optimization we see when that unit is plugged in you can charge and discharge as long as you end up in full charge. And this is how we look at system-level benefit.
I might add that this optimization requires perfect knowledge of the 24-hour period. If we were doing this in practice we would be taking advantage of energy forecasts and also forecasts for plug-in duration. But what we're looking at here is the basic optimization formulation assuming perfect knowledge of the 24-hour period.
After we've conducted the optimization, we can compare so-called flat charging where we just do a constant charge profile for each vehicle and compare it to the optimized charging profiles. In this case here, you can see on the left that we have a peak nearly 100 kilowatts. But with the optimized charging profile we've been able to make sure that that grid power does not violate some predetermined level.
When we're looking at the economic aspect of this we're assuming that the grid cost for consumption and also grid payment when you're supplying are the same. So from this figure what you can see here, note that the optimization has taken advantage of the high power cost between hours 17 to 19 approximately. And it's pushed energy back onto the grid in order to take advantage of that. And these dollar values I put on the right here are just the numbers that came out of this particular optimization.
And here's a view of the units. And looking at constant charge profile and the smart charge just so you can see from a small number of units that were not violating those boundaries. We're fully charging to 70 kilowatt hours which is a requirement. And we're not violating that lower bound. And so you can see with the smart charge that it's adjusting during its plug-in period in order to help obtain that system-level objective.
So the next step is to consider the IEEE European test feeder. And we're just going to put a unit on each node. So there's 2,718 storage units and 906 nodes on each phase. And so what we're going to do is just optimize 10-minute intervals across a 24-hour period for those 2,718 units on a phase-by-phase basis. So 906 units per phase.
And when we do this-- the optimization for 24 hours-- it takes less than 90 seconds when we use the link type function with the Optimization Toolbox. And after we've calculated the charging profiles we use them as inputs to the full simulation and simulate with a timestamp of five minutes. And this is because we need unit delays in our active and reactive power blocks. And so we have a timestep, which is half the charging update rate.
Let me bring back the simulation model and show this. So here's the simulation model set up to simulate at 5 minutes, 300 seconds. And I'm just going to simulate this now just to show you how quickly this simulates. So it's now running. You can see just a few seconds for it to simulate that 24-hour period. The view we're looking at here-- this is phase C. 906 units on phase C as with the other phases.
We're just showing that we don't violate the state of charge limits during the plug-in periods. So everything limits to 70 kilowatt hours. They all end there. And they don't violate that lower limit either.
The view we're looking at here is the active power at the substation. When we simulate all those profiles-- and looking at the smart charging profiles and then the constant charging profiles. So on the left is the smart profiles. We can see there that we're limiting that grid power to below 2000 kilowatts. But with the constant charging or the flat profiles where we're not considering the grid power limits or the grid cost, you can see that we peak to beyond 2,500 kilowatts.
Here are phase A voltages for 10 of the nodes. So looking at the smart profile on the left and the flat profile on the right. So now we're starting to get information on the impact of those charging profiles on the voltage levels. And just to reemphasize each 24-hour simulation takes around 4 seconds for the 24-hour scenario.
We can also take advantage of parallel computing and we can run multiple scenarios on multiple cores. Here's a MATLAB script I wrote where I can define the scenarios I want to evaluate and then use the parse on command on line 29 here to run multiple simulations. And then gather that simulation data into one data structure called out underscore multi in this case that I can then use for subsequent analysis.
When we are working with a large amount of data and a large number of scenarios then statistical analysis can provide a more effective way to gain insights on grid characteristics. In this particular case, I've just done a histogram on the right of the voltage profiles which gives us more clarity on what's happening with the voltages than necessarily what you can see on the floor on the left. Both are valuable, but statistical analysis certainly gives added insights.
We can also visualize voltages using MATLAB graph objects. So here I'm actually running the smart profile over the 24-hour period and we've color-coded the voltage levels across the network. And so we can sit back and watch this scenario. And we can see the changing voltages. Now roundabout 17 hours is going to supply back to the grid. We're going to see voltages jump up at that point. There we go. And then we start consuming again, and we're back to consumption. So it's another view that we can take. And certainly the visualization does add that extra richness to an evaluation.
So in summary, we first looked at configuring a grid-scale model for infrastructure evaluation. We looked specifically at the IEEE European test feeder. And we showed how we can construct that model automatically using Simscape Electrical specifically specialized power systems. Then we took it a step further. We rolled our sleeves up a bit. We asked specialized power systems to calculate a complex phase or matrix photos.
And then we've done an implementation that took advantage of vectorized components which we're then able to use to run that simulation more efficiently. And that was necessary because of the volume of study that we were looking at. We then looked at optimize charging profiles and evaluating those charging locations. We used Optimization Toolbox. And we formulated the optimization problem to reduce peak loading and minimize electricity cost for a large number of storage units or electric vehicles.
We showed how we can run multiple scenarios and multiple cores and also use statistical analysis to analyze the results. I hope you found this information useful. Thank you for listening.