modeling batteries using simulink and simscape video -凯发k8网页登录
from the series: hybrid electric vehicles
learn about equivalent circuits and why you’d want to use them. in this video, you will learn to:
- use equivalent circuits to represent the dynamic behavior of a battery cell.
- identify how to parameterize the equivalent circuit based on measurement data using parameter estimation.
- improve and refine an estimation, adding fidelity to the model with the use of more elaborate equivalent circuit topologies.
hello, everyone. my name javier gazzarri. and i am an application engineer at mathworks specialized in design and analysis of battery systems using modeling and simulation. i am a mechanical engineer with a bachelor's degree from the university of buenos aires, and master and phd degrees from the university of british columbia.
before joining mathworks seven years, ago i worked for four years for the government of canada studying the low temperature fuel cells at the institute for fuel cell innovation of the national research council in vancouver bc.
lithium ion is the battery cell type of preference in modern electric and hybrid vehicles because of their high specific energy, good cycle life, and very low cell discharge. however, with all these advantages comes the need for a careful battery management to ensure safe operation and acceptable durability. for example, temperature and voltage should remain within acceptable limits to avoid premature degradation, as should power delivery and acceptance.
today i will share with you some ideas about how to create a simulink model for a battery cell to be used in battery system design and control. first, we will show how to use equivalent circuits to represent the dynamic behavior of the battery cell. this is important since the bms, as any controller, needs to be tuned to the dynamics of the plant it is connected to. a good model of the battery cell will tell me how it behaves as a function of environmental conditions and state of charge.
secondly, we will see how to parameterize the equivalent circuits based on measurement data using parameter estimation, a technique based on optimization to fit models to experimental data. finally, we will see how to improve and refine an estimation, adding fidelity to the model with the use of more elaborate equivalent circuit typologies, compliment the study with curve fitting, and accelerate calculations using parallel computing.
developing a battery system using a model-based design requires a model of the battery cell that accurately represents its real life behavior and dependencies on environmental and operating conditions. for example, it needs to reproduce the voltage drop in time dependent recovery following a current discharge event, such as a pulse. although it would be desirable to capture all the details of the electrochemical phenomena present in a battery cell, controls-oriented applications demand a more efficient approach that can be scaled up to battery pack levels and eventually capable of real-time simulation.
a widely accepted compromise between fidelity and simulation time is the equivalent circuit. the equivalent circuit is an electrochemical analogy aiming at representing the behavior of an electrochemical cell using a relatively simple electrical circuit containing a voltage source and several resistors and capacitors that collectively reflect the open surrogate potential, the internal resistance, and the relaxation time of the real cell.
when modeling a battery cell, using any given circuit, it is important to choose circuit topology and parameterization such that it can respond as similarly as possible as a physical battery cell.
a typical equivalent circuit includes the voltage source associated with the open circuit potential, a series resistor related to the ionic conductivity of separator and electrolyte, and one or more resistor capacitor pairs that mimic that diffusion of processes involved in the interpolation and deinterpolation of lithium ions in and out of the porous electrodes.
as far as the parameterization is concerned, it is of crucial importance to capture the electrochemical and dissipated phenomena observed when testing a real battery as well as their dependencies on states and environmental conditions. these requirements demand the use of matrices instead of scalar parameters that function as lookup tables constituting the physical fingerprints of the lithium ion chemistry of interest.
one possible route to determine the characteristic parameters of an equivalent circuit is performing parameter estimation. parameter estimation is an optimization based procedure by which simulation result is compared against an experimental measurement and the parameters of the model are determined in such a way that simulation matches the experiment. it all begins by proposing an equivalent circuit architecture that, based on a previous knowledge of the system, we believe can represent the behavior of the real system.
the initial parameterization of equivalent circuits is done using tentative values based on our experience. the simulation is set to reproduce the conditions of the discharge experiment, typically done in a controlled temperature environment.
let's take a look at the experimental data first. keeping a constant temperature of 25 degrees celsius, a 31 in power nickel manganese core battery cell is discharged from a fully charged state all the way down to 0 soc. while current is flowing out of the battery, the measured voltage drops and then recovers after the pulse. the shape of the voltage drop in recovery is characteristic of these particular battery chemistries.
and the goal of this procedure is to be able to reproduce it using the equivalent circuit with the right parameters. more specifically, the series resistance needs to account for the instantaneous portion of the recovery. the combined rc pair needs to explain the exponential portion of the recovery. the voltage source must deliver the correct ocv as a function of soc.
additionally, we can observe that the response is different states of charge levels. because we do not have direct control over the state of charge, but it is state that changes as we drop current out of the cell, we need to allow all the parameters to be lookup tables as opposed to scalers to account for the soc dependence.
this is a simulink model designed for such purpose. a series of discharge current pulses is drawn from the equivalent circuit inside this block in the same way as it was done in the laboratory. at the same time the voltage across terminals is measured using this voltage sensor to be compared by the optimizer against the voltage measured experimentally.
looking inside the lithium ion cell block, we can see a simple equivalent circuit with a voltage source, an internal resistance, and a single rc pair. later, we will observe that only one time constant is not enough to capture all the dynamics of this particular cell. if we run the model using the initial guess as parameters, we observe this mismatch between simulation and experimental measurements.
simulink will work with matlab's optimization functions trying to minimize the difference between simulation and experimental data by adjusting the parameters of the equivalent circuit. this is done using a library called simulink design optimization. this tool acts as a bridge between simulink and matlab's optimization functions.
on the left hand side, we can see the four parameters to be estimated. we need to keep in mind that each of them is actually a vector of 10 elements corresponding to 10 levels of state of charge. secondly, we specify the experiment to be used for each estimation. we always recommend to have at least one independently measured set of data reserved for validation.
when we start the estimation, simulink runs the model over and over again. and every few runs, it evaluates how far it is from its objective, namely the experimental curve. while it is not close enough, it imposes perturbations to the values of the parameters to be estimated and evaluates if that change improves the situation or not. this is done in a very efficient way using advanced optimization algorithms.
the present calculation takes a few minutes to converge, so we will speed it up for demonstration purposes.
on the right hand side, we can see the evolution of the parameters. each color represents one of the four equivalent circuit elements. and each line within each color corresponds to a specific level of state of charge.
let's evaluate the final result. we can see that for most part the optimizer does a good job fitting the voltage drop events and the relaxation. however, in certain places the fit is clearly not good enough. this is a time to evaluate the validity of the equivalent circuit topology that we proposed at the beginning.
in some cases, it is clear that the exponential voltage relaxation is more complex than a single time constant exponential curve, leading us to believe that the equivalence circuit needs to be more elaborate. one easy thing to try is to add more time constants.
let's look at a single relaxation event and see what we find using simple curve fitting. going back to the experimental measurement, we select one relaxation interval. let's now export the data into a variable and look at it using the curve fitting tool box. since we are interested in quite specific function forms, we will need to use a custom equation, specifically one that has a sum of exponential terms.
it does not take more than three exponential terms to fit the relaxation much more accurately than before. this is an indication that three rc components are a better choice when it comes to selecting the equivalent circuit topology. let's try that.
this model is similar to the one that we saw before, but now the equivalent circuit contains three time constants instead of one. the number of parameters being calculated is now 80, 10 for each of the eight equivalence target elements. for a problem this large, it makes sense to use parallel computing to distribute the computational load.
simulink design optimization, allows us to do this effortlessly by selecting the use of parallel computing in the options. again, we will show the process at an accelerated rate for demonstration purposes. here are the results.
this procedure must be repeated at every temperature of interest and for which there is experimental data available. each vector of parameters identified with this technique will be stacked to constitute the lookup table that will later parameterize the general non-isothermal model. we will see this modeling detail on a separate lecture.
to summarize, we have seen how to use simulink model with simulink components in combination with isothermal discharge data to find the best equivalent circuit and parameters that describe the behavior of a given lithium ion battery cell. to perform this calculation, we made use of simulink design optimization.
in this video we saw a method to create and parameterize an equivalent surrogate for a lithium ion cell using a combination of experimental measurements, simulation, and optimization. we started proposing an equivalent circuit topology and initial parameter of guesses. and we saw how matlab and simulink work together to create an optimization problem to calculate the parameter values. the result is a battery cell block that contains the information to model the behavior of a real battery cell, and that is reusable in any system level model of an energy storage arrangement based on the type of device under study.
the next step from here is to create a model of the entire battery pack and design the battery management system around it. this will be the subject of a separate video.
download code and files
learn more
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 mathworks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- (español)
- (english)
- (english)
欧洲
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
亚太
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)