Automated Model Generation for Hybrid Vehicles Optimization and Control

Résumé — Création automatique de modèles de composants pour l’optimisation et le contrôle de véhicules hybrides — L’optimisation de l’utilisation des groupes moto-propulseurs (GMP) modernes nécessite de modéliser le système de manière quasi-statique avec une logique inverse (“Backward Quasistatic Model’’ – BQM), en particulier dans le cas des GMP hybrides. Cependant, les modèles utilisés pour la simulation réaliste de ces GMP sont souvent dynamiques à logique directe (“Forward Dynamic Model’’ – FDM). Cet article présente une méthodologie pour obtenir les BQM des composants de GMP actuels directement issus de la limite quasi-statique des FDM correspondants de manière analytique. Grâce à l’aspect paramétrique de cette procédure, il n’est pas nécessaire de relancer une campagne de simulations après chaque changement du système modélisé : il su ﬃ t de modiﬁer les paramètres correspondants dans le BQM. Cette approche est illustrée par trois cas d’étude (moteur turbo, moteur électrique et batterie), et l’e ﬀ et d’un changement Abstract — Automated Model Generation for Hybrid Vehicles Optimization and Control — System-atic optimization of modern powertrains, and hybrids in particular, requires the representation of the system by means of Backward Quasistatic Models (BQM). In contrast, the models used in realistic powertrain simulators are often of the Forward Dynamic Model (FDM) type. The paper presents a methodology to derive BQM’s of modern powertrain components, as parametric, steady-state limits of their FDM counterparts. The parametric nature of this procedure implies that changing the system modeled does not imply relaunching a simulation campaign, but only adjusting the corresponding parameters in the BQM. The approach is illustrated with examples concerning turbocharged engines, electric motors, and electrochemical batteries, and the inﬂuence of a change in parameters on the supervisory control of an hybrid vehicle is then studied o ﬄ ine, in co-simulation and on an HiL test bench adapted to hybrid vehicles (HyHiL).


INTRODUCTION
Hybrid propulsion systems are nowadays increasingly recognized as one of the few possibilities of combining low CO 2 emissions, acceptable range, and good performance in road vehicles.In spite of their complexity with respect to conventional powertrains, hybrids offer additional degrees of freedom that can be optimized.
Optimization of hybrid energy management (supervisory control) ensures that the hybrid operation along, e.g., a drive cycle, is optimal with respect to some dynamic criterion.Such criterion is typically related to energy consumption and subjected to several constraints.On the other hand, optimal dimensioning consists of selecting the best choice in terms of components.If the same criteria are used, the simultaneous optimization of both task is possible (co-optimization, see Rousseau et al., 2008;Sundström et al., 2008).
The optimization and control of hybrid powertrains is increasingly based on system modeling in contrast to heuristic strategies dictated by experience only.Although modelbased techniques are inherently more flexible than heuristic strategies, however often they are still structured for a specific hybrid architecture.The literature offers several examples concerning parallel hybrids but also series and combined hybrids (see the comprehensive survey in Sciarretta and Guzzella, 2007).Many of these examples develop a control law (ECMS) based on the formulation of an optimal control problem.However, this formulation depends on the specific hybrid architecture.Such a constraint makes difficult studying the impact of the architecture on the energy consumption and performance.Moreover, a control structure developed for one architecture is hardly reusable for different ones.
Thus it would be beneficious to explore the possibility of deriving a generic model-based control structure for any type of hybrid powertrain.That structure would enable parametric studies and co-optimization of the powertrain configuration, not only of the component characteristics.Also reusability of data and results from one hybrid application to another would be enhanced.
Key factors for pursuing such a program are: (i) a generic system model, which is able to represent several configurations using the same set of equations belonging to the class of Backward Quasistatic Models (BQM) (1) used in optimization, (ii) a generic control structure emerging from the harmonization of different ECMS algorithms and capable of dealing with a generic BQM, (iii) a dedicated testing tool that is able to experimentally represent various hybrid architectures.
Concerning (i), a generic optimization-oriented model is used in the software tool HOT (Hybrid Optimization Tool), developed at IFP (Chasse et al., 2009b).With regard to (ii), the equivalence of the ECMS with Pontryagin's Minimum Principle (PMP, Serrao et al., 2009) ensures that the core of HOT can be used as an online controller (Chasse et al., 2009b), which thus profits of the same generality as HOT's system model.
As for (iii), a solution that is implemented at IFP implies the use of the Hardware-in-the-Loop (HiL) concept.In this HiL hybrid test bench (HyHiL), the power provided or absorbed by the hybrid components (motors, battery, etc.) is physically emulated.This emulation is made possible thanks to dynamic models of the hybrid components that run in real time in the system control hardware (Del Mastro et al., 2009).It should be noticed that these models are not BQM's, but rather they belong to the class of Forward Dynamic Models (FDM), which differ from the BQM with respect to causality and temporal resolution (Guzzella and Sciarretta, 2007).With the help of a library of such models, it will be possible to change the hybrid architecture under test.The controller should then automatically adapt according to the steps (i)-(ii) mentioned above thanks to its generic structure.
Ensuring that the FDM's used to emulate the hybrid powertrain and the corresponding BQM's used in the controller are always consistent with each other is an important and a little studied problem.To cope with that, the simplest solution consists of launching a simulation campaign for each system represented (Murgovski et al., 2008).The FDM of (1) A library of BQM's called QSS is publicly available for academic purpose at the URL http://www/imrt.ethz.ch/research/qss/.See also Guzzella and Amstutz (1999).
the system should be run for every combination of the operating conditions in order to Build Quasistatic Maps (BQM) point-by-point.The disadvantage of such a technique is that there are virtually as many maps as the combinations of system parameters.For such a reason, artificial neural networks have been adopted in similar problems, e.g., by Delagrammatikas et al. (2004).
An alternative methodology consists of deriving the BQM's as parametric, steady-state limits of their dynamic counterparts.Each FDM is defined by parameters (dimensioning, coefficients, maps, etc.) that affect the equations representing the behavior of the system modeled.The steady-state behavior can be sought by letting the dynamics vanish in the system of differential equations constituting the model.The solution of such steady-state system is the BQM sought.It will be parametric, i.e., it will depend on a subset of the parameters of the FDM.Thus changing the modeled system does not imply relaunching a simulation campaign, but only adjusting the corresponding parameters in the BQM.
The proposed method is applicable to any component of modern powertrains for which a consolidated dynamic modeling technique exists.After having introduced FDM's and BQM's in Section 1, and the associated tools in Section 2, the paper presents developments concerning naturallyaspirated and turbocharged engines (Sect.3) as well as electric motors and electrochemical batteries (Sect.4).In Section 5 simulation and experimental results are illustrated and discussed.

FDM AND BQM FOR HYBRID POWERTRAINS
Different classes of models are usually used in real-time simulation and control of modern powertrains.Among several other characteristics, they mainly differ with regard to (i) causality and (ii) temporal resolution.
With respect to the causality, a distinction is often made between forward and backward models.Recall that in modular modeling, each component of the system is simulated as a stand-alone subsystem, which exchanges variables with the other subsystems through connectors.Typical connectors are pairs of power factors (e.g., torque and speed, current and voltage, etc.).Connectors are non-causal when all physical effects are described only with equations or other relationships, without any input/output prescription.However, in many applications connectors are causal, which means that input and output variables have to be assigned at each connector (2) .With respect to the philosophy that inspires the choice of the inputs and outputs, backward modeling assigns both the power factors at a single connector as  Forward and backward causality patterns for an engine system.
inputs or outputs.In contrast, in forward modeling at each connector one power factor is selected as an input, the other as an output.Examples of forward and backward causality for an internal combustion engine are illustrated in Figure 1.
As for the model temporal resolution, the key distinction lies between quasistatic and dynamic models.The former class does not contain state variables, and all the dependencies between variables are intended to be the same as in the case of steady state.
The performance of a powertrain and its controllers along a prescribed drive cycle is conveniently assessed using the Backward Quasistatic Modeling (BQM) approach in which the flow of input variables is directed from the end of the propulsion chain (the wheels) toward the prime movers (the engine).Although internal powertrain dynamics are neglected, the overall prediction can be very accurate (Guzzella and Amstutz, 1999).The BQM approach is also naturally suitable in powertrain control.Indeed, the "torque control'' structure of modern powertrains, including hybrid powertrains, is such that at each time the driveline speed can be measured while the torque demand is estimated from the accelerator pedal using several mappings.Then, following the propulsion chain backwards, the torque and speed demand can be predicted, e.g., at the output stage of the engine.
On the other hand, Forward Dynamic Modeling (FDM) finds its natural place in system simulators.Not only the forward causality can represent the internal dynamics of the system, but it also well represents the cause-and-effect relationships, enlightening the effect of the control variables on the instantaneous powertrain performance.A consequence of this approach is that the vehicle speed must be calculated as a function of the other power factor, namely, the traction force.Therefore, in order to follow a prescribed drive cycle, a model of a 'driver' is needed to demand more or less power to the prime movers.
A hierarchical structure illustrating the role of FDM's and BQM's in powertrain simulation and control as well as their interactions is shown in Figure 2. The figure clearly distinguishes quasistatic models, while dynamic models can have very different temporal resolutions.Two main classes are recognizable according to their relationships with controllers.Component controllers (e.g., engine controllers, motor controllers, etc.) are usually based on dynamic models with a medium-frequency temporal resolution.The validation of such controllers is thus necessarily entrusted to higher frequency models.
As an example, in internal combustion engines the medium-frequency class is represented by the well-known Mean-Value Engine Models (MVEM), which have a temporal resolution of one engine cycle.Engine controllers are more and more based on MVEM's (air loop control, fuel loop control, etc.).In contrast, high-frequency models of engines typically have a temporal resolution of one or few crank angles, thus representing the dynamics inside the cylinders, etc.Similar considerations apply for motors, batteries, and other components of modern powertrains.
In contrast to component-level controllers, powertrainlevel controllers are based on quasistatic models, see Figure 2, and thus their validation necessitates FDM's of the MVEM type.Ensuring that the FDM used to emulate the hybrid powertrain and the corresponding BQM used in the controller are always consistent with each other is an important and a little studied problem.
The methodology illustrated in the following sections consists of deriving the BQM using two steps.In a first step, the steady-state behavior of the FDM is sought by letting its dynamics vanish in the system of differential equations constituting the model.The resulting model is quasistatic but still with the forward causality (FQM).Its role here is to determine the admissible inputs for the BQM, which is derived in a second step by changing the causality.
Notice that both the FQM and the BQM will be parametric, i.e., they will depend on a subset of the parameters of the original FDM.Thus changing the modeled system does not imply relaunching a simulation campaign, but only adjusting the corresponding parameters in the FQM and BQM generation.

TOOLS
The generic hierarchical modeling structure of Figure 2 reveals the importance of the model generation process, which is described by the arrows pointing from FDM's to FQM's and then to BQM's.While the rest of the paper will present some examples of such a model generation, this section shows how the various modeling levels are integrated into a chain of tools for control design and prototyping, see Figure 3.
The QM's are used for real-time model-based supervisory control as well as for offline optimisation.The offline optimization stage consists of calculating the evolution of powertrain power factors along a prescribed drive cycle, that are optimal with respect to some mathematical criterion (typically, the minimization of the fuel consumption over the cycle).The software tool named HOT, developed and validated at IFP (Chasse et al., 2009b) uses BQMs (static maps) to represent the powertrain components and a generic model structure to represent various hybrid configurations.Unlike other offline optimisation tools, which mostly apply Dynamic Programming techniques (Rousseau et al., 2008;Sundström et al., 2008;Scordia et al., 2005), HOT is based on the Pontryagin minimum principle, i.e., on the direct application of the optimal control equations (Rousseau et al., 2007;Serrao et al., 2009).In the next future, HOT will integrate an automated QM generation preprocessor in order to build the necessary static maps from mean value models (FDM's).
Online supervisory control are also more and more based on modeling and optimisation.The ECMS controller developed at IFP (Chasse et al., 2009a) use BQM's as in offline optimisation to calculate the optimal control outputs.In order to validate an ECMS controller, a first approach is to continuously send the control outputs to a real-time running powertrain simulator.As shown in Figure 3, this simulator must be based on mean-value FDM's to ensure a fair validation of the supervisory controller.Such a procedure is known as co-simulation and it is often preliminary to the validation of the controller on a real system.
As a final step of the control prototyping chain, the ECMS-based controllers are integrated in a testing concept for hybrid powertrains called HyHiL.This concept couples a real engine test bench with FDM's running in real time that emulate the transmission chain as well as the hybrid components (e.g., battery, electric motor, power electronics, etc.).Unlike similar engine-in-the-loop concepts (Filipi et al., 2006;Jeanneret et al., 2004), high-frequency models are used for the drivetrain and hybrid components.The goal of the HyHiL concept is to test a component at a time in an environment that realistically represents a hybrid powertrain including drivability issues.As depicted in Figure 4, the engine test bench is controlled in such a way that the speed and the torque at the engine output shaft represent the outcome of a driver request (e.g., to follow a drive cycle) and the output of the supervisory controller that splits such a request between the engine and the electric motor(s).Similarly to the co-simulation scenario, the ECMS controller needs BQM's for the physical engine as well as BQM counterparts of the FDM's emulating the hybrid drivetrain.

Naturally-Aspirated Engines
This section illustrates the method of generating a BQM for a naturally-aspirated engine with the purpose of presenting simple developments that will be later extended to more complex engine systems.Since mean-value modeling of engines is an established technique (Guzzella and Onder, 2004), the relevant equations will be listed below without further comments on their derivation.Connections between submodels of a naturally-aspirated engine.

Equations
The main submodels of a naturally-aspirated engine are connected as in Figure 5.For each of the submodels, the static equations describing its steady-state, mean behavior are extracted from the corresponding FDM.For the meaning of the variables, refer to the nomenclature.

Throttle Valve
The air mass flow rate through the throttle valve is given by the nozzle equation (3) The quasistatic hypothesis implies that the mass flow rate D is constant along the air path.

Intake Manifold
The temperature in the intake manifold is calculated from an energy balance,

Cylinders
The intake mass flow rate is usually expressed in terms of volumetric efficiency that is often parameterized as a function of intake pressure and engine speed, Likewise, the torque generation is represented by an indicated efficiency map as a function of air mass and engine speed.Pumping losses are also considered to obtain the effective (shaft) torque, (3) Also known as the Barré de Saint-Venant equation.
The air mass inducted in one cylinder is related to mass flow rate through the equation Moreover, fuel consumption D in j is proportional to D or m air , considering a fixed air to fuel ratio.

Resolution
Besides the constant parameters (eleven) and the tabulated data (two maps), Equations (1-5) contain seven unknowns (D, S tv , N e , C e , m air , P in , T in ).If two of the unknowns are imposed, the other five variables can be solved for.In the FQM, S tv and N e are imposed.In the BQM, the torque setpoint C e and N e are imposed.
The solution procedure is detailed in Appendix both for the FQM and the BQM.
An example output of the FQM generation is the graph in Figure 6, where the torque curves for several throttle commands are shown.These curves explicitly yield the maximum and minimum engine torque, which will be used later in the BQM generation to saturate the torque input.
An example output of the BQM generation is the graph of Figure 7, showing a D in j map obtained by solving the procedure above for several admissible torque and speed values (saturated with respect to the output curves of the FQM).

Turbocharged Engines
Mean-value modeling of turbocharged engines is a wellknown technique that is also frequently adopted as a basis for model-based control.See   Fuel consumption map of a naturally aspirated engine.

Equations
The main submodels of a turbocharged engine are connected as in Figure 8.For each of the submodels, the static equations describing its steady-state, mean behavior are extracted from the corresponding FDM.
In the following, nozzle equations will be denoted by the function BSV defined as BS V(S , C q , P up , P down , T up ) = S C q P up T up C m P down P up (6)

Compressor
The compressor behavior is described by static maps and first-principle equations.The characteristic curve map yields while an isentropic efficiency map is used to calculate downstream temperature as Moreover, the compressor torque is calculated using energy balance,

Heat Exchanger
Heat exchangers are variously simulated in FQM's.A possible choice is with the assumption of several pressure losses in series representing connecting pipes and the exchanger itself.Here a lumped equivalent pressure loss is considered in such a way that D = BS V(S he,eq , C q,he,eq , P c , P e , T c ) (10) Also, it is assumed that at steady state the temperature of air downstream of the exchanger equals the temperature of the coolant that is given by the map Throttle Valve, Intake Manifold, Cylinders The models of the throttle valve, the intake manifold, and the cylinders are the same as in the naturally-aspirated engine model, except for the fact that P e , T e replace P 0 and T 0 at the inlet of the throttle, while P exm replaces P 0 at the outlet of the cylinders.Thus D = BS V(S tv , C q,tv , P e , P in , T e ) ( 12) ) and Equation ( 5) holds for m air .
Connections between submodels of a turbocharged engine.
An additional equation is now necessary to find the temperature at the exhaust, T exm , which is done with a third engine map (besides η v and η ind ) representing the heat flux to the exhaust,

Exhaust Manifold
The exhaust temperature is found from an energy balance applied to the exhaust manifold involving a variable wall temperature and neglecting the radiating contribution, The mass flow rate through the exhaust manifold is

Turbine
The turbine behavior is described by static maps and firstprinciple equations.The characteristic curve map yields where Π t = P exm /P t and N tc,corr = N tc T re f,t /T exm .Downstream temperature is calculated using an isentropic efficiency map Moreover, the turbine torque is given by The mass flow rate through the waste gate is calculated with the nozzle equation, The sum of the mass flow rate through the waste gate and through the turbine gives the total mass flow rate at exhaust, Downstream of the turbine, the mass flow coming from the turbine and the waste gate mix together into a single flow, whose temperature is given by

Exhaust Pipe
The mass flow rate through the pipe is calculated with the nozzle equation, D exh = BS V(S exh,eq , C q,exh,eq , P t , P 0 , T t ) The exhaust temperature is found from an energy balance applied to the exhaust pipe involving a variable wall temperature and neglecting the radiating contribution, The resolution procedure is described in Appendix.Example outputs of the FQM and BQM generation are the torque curves of Figure 9 and the fuel consumption map of Figure 10.Notice that the maximum torque curve visible in Figure 10 can be easily extracted from the data in Figure 9 by enveloping the maxima of the torque curves at various throttle or waste gate commands.
Figure 9 Torque curves of a turbocharged engine as a function of the throttle valve command (0-100) and the waste-gate command (100-200), as well as the engine speed.

Figure 10
Fuel consumption map of a turbocharged engine.

Electric Machines
In this section, the approach illustrated for engines is applied to a different component of EVs and HEVs, i.e., electric motors.This development considers only one type of motors, namely, the Permanent Magnet Synchronous Motor (PMSM).

Equations
Similarly to other types of motors, FDM's of PMSM are based on the electric circuit approach representing the machine characteristics as lumped electric parmaters such as resistances, inductances, etc.The equivalent circuit of a PMSM with iron losses is depicted in Figure 11 (Sun et al., 2008;Urasaki et al., 2000).
The steady-state equivalent circuit equations yield Equivalent electrical circuits of a PMS Motor (ω e pω).
C m = pϕ m I qt (29) In absence of iron loss, I d = I dt and I q = I qt

Resolution
The five Equations (27-29) contain eight unknowns (U d , U q , I d , I q , I dt , I qt , C m , ω), besides the constant parameters.Both in the FQM and in the BQM, only two variables have to be imposed, thus one equation is still necessary to solve the system.This missing equation describes the motor control strategy.
In Maximum Torque per Ampere (MTA) control (Mohamed and Lee, 2006), the torque is maximized with respect to I d and I q with the constraint that I 2 q + I 2 d = I 2 m .For the system under study, this strategy leads to regardless of the value of I m .Therefore it is possible to calculate the quasistatic dq current and voltage as a function of motor torque and speed, which are imposed in the BQM, The electric power P m = U d I d +U q I q , i.e., the output variable of the BQM, is calculated as from whence the efficiency η m = ωC m /P m follows.The quasistatic modeling is completed by the physical limits imposed on the electric power P m < P m,max and on the current I m < I m,max , which impose a limit to torque that is variable with speed.

Batteries
Batteries are often represented in system-level simulators in a quasi-static way as simple equivalent circuits, like in Figure 12.The equivalent electric circuit comprises a voltage source and a resistance, both varying with the state of charge and temperature.In contrast, battery dynamics is variously represented.FDM of automotive batteries range from blackbox or 'gray-box' equivalent circuit models (Kuhn et al., 2006;Takano et al., 2000) that try to reproduce battery dynamics with networks of resistances and capacitances, to electrochemical models (Newton and Paxton, 1997;Wu et al., 2001;Botte et al., 2000;Zhang and White, 2007).

Equations
In Bernard et al. (2008), a lumped-parameter electrochemical model has been presented for Ni-MH batteries, which comprises among the state variables the concentrations of the reactant species and the electrode reference potentials, while the State Of Charge (SOC) is calculated from the nickel concentration.Neglecting the influence of the side reactions (involving the production or absorption of gaseous oxygen) that are relevant only for high values of SOC, and other dynamic effects, a simplified cell FDM consisting of four equations is derived as where A static counterpart of the first two equations of the set (35) can be extracted as Conversely, the SOC dynamics is that of a pure integrator and in such a way it cannot generate static equations.Instead, the SOC is related to C Ni through Equation (36), while the concentration C MH is related to C Ni via the balance of total number of moles, The latter equation compares with the well-known Coulomb-counting equation that is the baseline to estimate the SOC online.The term C Ni,max /k Ni is equivalent to the nominal battery capacity.

Resolution
The set of Equations (35) has six unknowns.Thus if two of the unknowns are imposed, the other four variables are solved for.In both FQM and BQM, the temperature T b can be treated as an input (exogeneous variable).Moreover, in the FQM the current I b is imposed, while in the BQM the electric power P b = I b U b is imposed.In order to solve Equation (38) in terms of P b in closed form, the equivalent circuit approximation of Figure 12 is introduced.The cell parameters U oc and R cell are derived by linearizing the function h(•) around a current I 0 , Since U ∞ re f depends on the sign of the current, h(•) is linearized twice, for ±I 0 .This expression yields two values of U oc and R cell for the equivalent circuit, according to s that is also the sign of the power P b , Therefore the linearization parameters that do not depend on I b , thus the battery BQM can be solved from the equivalent circuit equations including the number of cells in series n cell , Moreover, a battery local 'efficiency' can be calculated as Notice that Equation (42) implies that the power is limited by the condition of having a positive quantity under the square root, so that the maximum power delivered by the battery equals n cell U 2 oc /(4R cell ).

Automated Generation Procedure
The method presented in Section 3 was implemented as a Matlab (4) routine that automatically generates a FQM and (4) MATLAB r is a software developed by The MathWorks, Inc.
a BQM from a FDM of a turbocharged engine coded in the AMESim (5) environment.The FDM is a Mean-Value Engine Model for what concerns the engine combustion and breathing processes with a detailed dynamic representation of the air and exhaust flows in the engine pipes.All the maps and parameters used in the model generation were downloaded from the original FDM.It is possible to download the parameters from an AMESim model to the Matlab workspace by using the AMESim toolbox in Matlab.While it is relatively straightforward to extract the parameters from submodels with a single instance, like the engine MVEM or the turbocharger model, it is more difficult to get parameters from elements that have several instances, e.g., the section of a pipe.The number of instances should be known in advance but, as this number may change from one model to another, making this extraction automatic problematic.
The solution proposed consists of using the XML file related to the AMESim model, which contains all the model elements and the connections between these elements.By reading this XML file, it is possible to distinguish the different instances of the pipe submodel (or any other element that is needed), and then download the correct values from AMESim.This extraction has been performed with a Matlab script and a Java package, by using the DOM (6) to cope with the XML language.
The results of the engine model generation have been validated by launching a simulation campaign on the FDM of the HyHiL 2 turbocharged engine.The FDM was run for several combinations of the commands and the engine speed.Each run was pursuited until stabilisation.The resulting steady-state values of torque and other variables were then recorded.
Figure 13 shows the comparison of these torque values with those predicted by the FQM.Similarly, Figure 14 shows the comparison between the stabilized fuel consumption of the FDM and the corresponding values predicted by the BQM.
The figures clearly show that the accuracy of the proposed model generation method is quite satisfactory.The small differences (always below 5%) can be explained with some simplifications adopted in the equations of Section 3 with respect to the original FDM, particularly for what concerns the spatial discretization of pipes and heat exchangers as well as some details on the shape of the BSV function that describes mass flow rates.

Models Comparison
The BQM models automatically generated are used both in HOT and in the ECMS as representing the system to (5) AMESim r is a software developed by LMS Imagine S.A. (6) Document Object Model.

Figure 13
Comparison between the output torque from the FQM and the FDM of the HyHiL turbocharged engine.Figure 14 Comparison between the fuel mass flow rate calculated by the BQM and the FDM of the HyHiL turbocharged engine.be controlled.In both cases, the generic control structure is automatically adapted when a new set of parameters is defined in the FDM's.To illustrate such an adaption, the parallel hybrid vehicle emulated in the HyHiL test bench (Del Mastro et al., 2009) has been taken as a baseline.The main parameters of its components have served to build the the BQM's as in the previous sections.
The HyHiL engine is a 2 turbocharged engine.The engine fuel consumption map (experimental data) is shown in Figure 15 together with the BQM generated in Section 3.2, to which a new torque limit has been added to represent the real engine operating range.The figure shows a good agreement between measured data and model outputs.
Similarly, the measured efficiency data of the permanentmagnet, synchronous electric machine are shown in Figure 16, alongside with the map generated by the BQM of  Section 4.1 using the data listed in the figure legend.The quantitative differences observed can be explained by the difficulty to take into account the iron losses (R i ) in a realistic way.Here, the air gap equivalent resistance is considered as increasing linearly with speed, but higher order models have been proposed, e.g. by Zhu et al. (2001), which could lead to a better agreement.The static losses in the power electronics have not been modeled, thus they are included in the motor parameters.It is important to remark at this point that the availability of tabulated experimental data is a BQM in its own and it can be used as such both in HOT and in the ECMS.However, the adaption of the map to variations of parameters can only be done effectively by using a parametrable BQM.
In order to validate the battery BQM of Section 4.2, FDM data are used here instead of experimental results, since battery 'efficiency' maps like the one defined in Equation ( 43) are not commonly available (7) .However, an experimental validation of the electrochemical FDM has been already presented, e.g., in Bernard et al. (2008) for typical chargedischarge profiles and thus it can be considered here as representative of the real behavior of the battery.Efficiency maps for the NiMH battery used in HyHiL are shown in Figure 17.Clearly, the agreement is good except for highcurrent values, where the nonlinear effects that have been neglected in the BQM become relevant.

Parameter-Sensitive Optimization Results
A further analysis is aimed at showing how changes in system parameters affect the powertrain optimal operation calculated by HOT and that controlled by the ECMS.In particular, two system parameters, namely, motor power and battery capacity, are varied with respect to the baseline case as listed in Table 1.The results below refer to the same drive cycle (NEDC) performed in charge-sustaining mode, that is, the battery SOC at the end of the cycle is kept close to the initial value.Both in HOT and in the ECMS, that is a consequence of the optimal control algorithms adopted.
Comparison of the efficiency map of the HyHiL battery (NiMH) as given by the FDM (top) and the BQM (bottom).Parameters: capacity = 5 Ah, n cell = 96, voltage = 115 V.

Optimization with HOT
Since HOT is purely based on BQM's to represent the system, changes in the latter directly affect the trajectories calculated, as shown in Figures 18, 19.
The results are plotted in terms of engine and motor operating points in the respective efficiency maps, along the NEDC speed profile.With HOT, these points result from the dynamic minimization of the overall fuel consumption with the major constraint of battery charge sustaining along the cycle.In this case, reducing the size of the electric motor reduces the room for recharging the battery, both using regenerative braking and using the engine.The latter influence is also visible in the engine operating points, which exhibit a trend in moving toward lower load regions when case 2 is applied.The use of the engine is then restricted by the generating limits of the electric machine.

ECMS in Co-simulation
The online controller ECMS uses the same models as HOT to calculate the optimal control outputs.On the other hand, Figure 18 Operating points of the engine on the NEDC with HOT for the data cases 1 and 2, see Table 1.

Figure 19
Operating points of the motor on the NEDC with HOT for the data cases 1 and 2, see Table 1.
the controller effects on the powertrain operation are investigated by sending the control outputs to corresponding FDM's that are run simultaneously (as described in Sect.2).Contrarily to the previous scenario, now the driving schedule is not known in advance but it is estimated continuously from the action of a virtual driver that tries to follow the NEDC by adapting the current vehicle speed to the prescribed one acting on the pedals.
Another difference with respect to the HOT case is that co-simulated FDM's appropriately include the dynamics of the components.This is clearly shown in Figures 20, 21, where several transient operating points appear in addition to a quasistatic behavior that is similar to that of Figures 18,19.The figures also show that, in such a scenario as well, shifting from case 1 to case 2 makes the operating points of the engine move towards lower load (and lower efficiency) zones.

ECMS in the HyHiL Test Bench
In the HyHiL test bench control outputs of the ECMS controller are sent to a real engine on the one hand, and to real-Figure 20 Operating points of the engine on the NEDC in co-simulation for the data cases 1 and 2, see Table 1.time FDM's of the other components (e.g., battery, electric motor) on the other hand.These FDM's are then used to control the bench dynamometer controller, as shown above in Figure 4. Data are collected from real sensors on the engine and the dynamometer, and from virtual sensors in the models.Figures 22,23 show the operating points measured during a NEDC test (followed by a virtual driver as in the co-simulation scenario).
The results of the baseline case and of the case 2 (not shown) are very similar to the other scenarios (HOT and cosimulation).The figures also show the results for the case 3, where the motor power is sufficient to enable relatively highload, high-efficiency operation of the engine (contrarily to case 2).However, the battery size reduction leads to a much more aggressive SOC control, which implies several operating points where the engine is strongly loaded to recharge the battery.The result of this operation is clearly seen in Figure 21 Operating points of the motor on the NEDC in co-simulation for the data cases 1 and 2, see Table 1.
Figure 22 in terms of a larger dispersion of the engine operating points from the best efficiency zone.

CONCLUSION
The paper has presented the concept of automated model generation for hybrid powertrains.In particular, a parametric building of backward and forward QM's from their respective FDM counterparts has been proposed with the goal of serving as a prerequisite to perform complex optimisation and prototyping tasks with dedicated tools (HOT, HyHiL).Some examples have illustrated the concept for engines (both naturally-aspirated and turbocharged) and electric components of HEVs.The equations derived show the feasability of the proposed procedures, while the simulation results show that such a procedure is equivalent in terms of accuracy to longer simulation campaigns.Moreover, the effect of changes in the components' parameters Operating points of the engine on the NEDC with HyHiL for the data cases 1 and 3, see Table 1. and of the consequent map adaption is clearly visible in the optimisation and online control results.

APPENDIX Naturally-Aspirated Engines Forward Resolution
Given S tv and N e , D can be deduced from Equation (1) if the flow through the throttle is sonic, since C m depends only on the gas properties for sonic flows.In this case, Equation (2) yields T in and P in is found with Equation (3).Once P in has been found, the sonic hypothesis can be checked.If it is true, then m air and C e are calculated with Equations (5, 4), respectively.Else, the proposed solution consists in assuming a value for P in , deducing D from Equation (1), then T in from Equation (2), and finally calculating a new value for P in with Equation (3).If the two P in 's are equal, a fixed Figure 23 Operating points of the motor on the NEDC with HyHiL for the data cases 1 and 2, see Table 1.

Figure 24
Flowchart of FQM generation for a naturally-aspirated engine.point has been found, and m air and C e are calculated with Equations (5,4), respectively.This procedure is illustrated in Figure 24.

Backward Resolution
Given C e and N e , no equations can be solved directly.The proposed solution is to assume a value for P in , then calculate D and T in from ( 2) and (3), and finally calculate a new P in with (4) and (5).If this value matches the first guess, a fixed point has been found, and S tv is calculated with (1).This procedure is illustrated in Figure 25.

Turbocharged Engines
The resolution procedure is inspired by the same considerations illustrated in the previous section for naturallyaspirated engines, thus it is not further detailed.For the FQM, four algebraic loops have been identified.For the BQM, a distinction has been made between the cases in which the throttle valve command is active (S tv S tv,max ) and the waste gate command is active (S wg S wg,max ).The proposed methods of resolution are illustrated in

( 2 )
Modelica/Dymola is an example of a simulation environment based on non-causal connectors, while Simulink or AMESim are examples of simulation environments of the causal type.

Figure 2 Hierarchical
Figure 2 Hierarchical structure of FDM and BQM interactions.

Figure 3 Tool
Figure 3Tool chain for hybrid control development based on the hierarchical modeling structure of Figure2.

Figure 4 Schematic
Figure 4Schematic representation of the HyHiL setup for a hybrid powertrain.

Figure 6 Torque
Figure 6Torque curves as a function of the throttle valve command and engine speed for a naturally-aspirated engine.

Figure 12 Simple
Figure 12Simple equivalent circuit of an automotive traction battery.
b is the cell output current (positive if discharging), s = sign(I b ), U b is the output voltage of the battery cell, U re f is the reference potential of the nickel electrode, C Ni and C MH are the nickel and the metal hydide concentrations, T b is the temperature, and f (•), g(•) are nonlinear functions that depend on many electrochemical and geometrical parameters, as the constants k Ni and k MH do.The cell SOC is

Figure 15 Comparison
Figure 15Comparison between the engine consumption map of the HyHiL turbocharged engine as given by the BQM (top) and measured (bottom).

Figure 16 Comparison
Figure 16Comparison of the efficiency map of the HyHiL electric machine as given by the BQM (top) and as provided by the manufacturer (bottom).Parameters: R s = 0.2 Ω, ϕ m = 0.88867 V•s/rad, L s = 0.002835 H, R i = 0.3 • ω + 0.5 Ω, p = 1.

Figure 25 Flowchart
Figure 25Flowchart of BQM generation for a naturally-aspirated engine. 

Figure 27 Flowchart
Figure 27 Flowchart of BQM generation for a turbocharged engine: waste gate totally open.

TABLE 1
Baseline and modified data for the electric motor and the battery of the HyHiL system