Simulation-Based Development of Automotive Control Software with Modelica
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011 Simulation-based development of automotive control software with Modelica Emmanuel Chrisofakis1, Andreas Junghanns2, Christian Kehrer3, Anton Rink1 1Daimler AG, 70546 Stuttgart 2QTronic GmbH, Alt-Moabit 91a, 10559 Berlin 3ITI GmbH, Webergasse 1, 01067 Dresden {emmanuel.chrisofakis, anton.rink}@daimler.com, [email protected], [email protected] Abstract development of control algorithms. This paper presents technology targeted toward the late stages in We present and discuss the Modelica-based develop- the development process, like tuning, validating and ment environment currently used by Daimler to de- debugging the entire controller software in closed velop powertrain control software for passenger cars. loop with simulated plant models. Virtualizing these Besides well calibrated vehicle models, the environ- later engineering tasks requires plant models with in- ment supports automotive standards such as A2L, creasingly higher quality (physical effects modeled MDF, CAN, and XCP to integrate control software and quality of calibration) and near-production con- and simulated vehicles on Windows PCs. troller software (percentage of the controller soft- Keywords: automotive software development, soft- ware included, parameterization using production ware in the loop parameter sets and adaptation of the software to the plant) to be coupled. A tool-chain supporting such coupling should 1 Introduction • be easy to set up and use by automotive de- velopers who are usually not computer sci- More and more automotive functions are implemen- entists ted using software. Hence, there is an increasing de- • support many of the engineering tasks usu- mand to support the corresponding development pro- ally performed with physical prototypes to cess using virtual, i. e. simulation-based develop- allow for front-loading ment environments. • support short turn-around times, i. e. minim- ize the time between editing of control soft- ware and validation of the resulting behavior on system level to help find problems early • provide built-in support for standards and de-facto standards used in automotive soft- ware development to allow cost-effective use of existing information sources • support distributed development and ex- change of work products between OEMs, suppliers, and engineering service providers. This requires e. g. measures to protect intel- lectual property. • support reconfiguration of the development tool chain, since automotive development tools are frequently updated or replaced, e. g. due to emerging standards, new bus proto- Figure 1: Vehicle model as used for SiL cols or tool policy considerations. In this paper, we present the simulation-based devel- Virtually coupling control strategies with plant mod- opment environment used by Daimler to develop the els is standard technology today, mostly using com- powertrain control software for Mercedes passenger mon-place tools such as Matlab/Simulink for pre- cars. The tool chain presented here addresses the 1 Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011 above demands. It is based on vehicle models imple- tions are necessary if the measured signal is a flow or mented using Modelica and processed using Simula- potential quantity (e. g. torque as opposed to speed). tionX as a tool for the design and analysis of com- plex systems, the FMU standard for model exchange, MATLAB/Simulink and TargetLink as a tool for model based development of automotive controllers and Silver as a tool for virtual integration of control software, application data and the simulated vehicle. The paper is structured as follows: In the next sec- tion, we describe why and how Modelica is used here to create vehicle models. Section 3 describes how such a vehicle model is then coupled with con- trol software and what else is needed to get automot- ive control software running in closed loop on a PC. Section 4 describes how such a SiL setup is used to support automotive software development, and sec- tion 5 describes costs and benefits of setting up a SiL. Figure 2: Gearset of a 7G-Tronic Transmission 2 Vehicle models Different capabilities for implementing measured data in SimulationX and validating the Modelica Daimler started around 2004 to use Modelica for models against these data without the necessity of building vehicle models used for test and develop- using another tool in combination with further op- ment of powertrain control software via software in tions like the VariantsWizard help to increase the ef- the loop (SiL). For example, the members of the 7G- fiency of model calibration. With special regard to Tronic transmission family have been developed this the needs of powertrain modeling ITI provides dif- way [1]. Ongoing projects developed within this ferent analyzing methods, e. g. the linear system ana- Modelica-based framework include dual-clutch lysis or the steady state simulation. transmissions by Mercedes [2] and AMG [3], and hybrid drivetrains. Basic requirement of a plant mod- el in a SiL-environment for automatic gearboxes is the accurate calculation of the gear shifting. In order to achieve this goal, detailed model representation of gearbox kinematics, clutch mechanics and hydraulic control is essential. Therefore special Modelica lib- raries have been developed over the years to support transmission development. For the development of customer specific libraries SimulationX offers a wealth of options such as the dedicated TypeDesigner that simplifies graphical and textual modeling compared to traditional forms. Based on these libraries, a well calibrated vehicle model for a new transmission project can be setup within just a few weeks. This short development is partly credited to good properties of the Modelica Figure 3: Transmission hydraulics language, which provides outstanding support for the reuse of component models, mainly by providing Figures 1, 2 and 3 show typical Modelica models powerful means to parametrize models and built-in used in series development projects. support for acausal modeling. Latter feature offers the model developer great possibilities to calibrate Daimler uses Dymola and also SimulationX [4] to and validate his model by using measurements either edit and process Modelica models. Since Modelica from car or from test rig since no model modifica- version 3.1 there is full compatibility of the plant models both in Dymola 7.4 as well as in Simula- 2 Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011 Figure 4: Modelica library Car in SimulationX and Dymola tionX 3.4. Models and libraries are stored on hard • Modelica libraries often use different version disk as .mo files. Both tools are able to read these of annotations for graphical objects or attrib- files with no specific modification, i. e. they use ex- utes which are invalid in the particular con- actly the same files for displaying exactly the same text (e.g. fillColor for lines). While several structure. Figure 4 shows a screenshot of the direct- tools ignore such annotations other programs ory structure and the integration in every tool. generate error messages, which can be a This proves that one design goal of Modelica and the little bit confusing for users and developers. Modelica Standard Library (MSL) has been reached For that reason a stronger validation of an- now, namely to provide a tool-vendor independent notations would be preferable. representation format for simulation models. There are however still a few issues to be solved to fully To create a Software in the Loop setup, the Modelica reach vendor independence of the MSL: model is then exported. In previous years, the C code • The definition of tables in Modelica Stand- generated by either Dymola or SimulationX from a ard Library is based on external functions. given Modelica model has been wrapped and com- The implementation of these functions is not piled for execution by one of the SiL tools described part of the library itself and has to be done in Section 3. For export, special wrapper code had to by tool vendors. In consequence of missing be developed for each simulation tool, and even for specification the different implementations each version of such a tool, which was time consum- are not completely compatible. ing and error prone. Daimler started recently to use • With the exclusive usage of external func- the FMI [8] developed within the Modelisar project tions it is difficult to adapt the implementa- as an export format for Modelica models. This stand- tion on the requirements of the underlying ard is supported by the latest versions of Simula- tool. The substitution of external functions tionX, Dymola, and Silver. This removes the need to by external objects would improve the im- maintain version and vendor specific wrapper code, plementation capabilities. which further improves and speeds up the SiL-based • For users of a Modelica tool it is difficult to development process. decide whether a used construct is compat- ible to Modelica language specification or not (e. g. classDirectory function). All tool 3 Getting automotive control soft- dependent extensions of Modelica language ware into the loop should be marked as vendor specific similar to existing vendor specific annotations. Daimler uses Silver [5] and its in-house predecessor Backbone to virtually integrate vehicle models and control software on Windows PCs. Tools such as Sil- ver or Backbone are mainly needed to support vari 3 Proceedings 8th Modelica Conference, Dresden, Germany, March 20-22, 2011 Figure 5: SiL environment an its interfaces to automotive standards ous standards and quasi-standards used for automot- ECU, its physical unit, comment and scaling inform- ive software development. Developers are familiar ation that tells how to convert the raw integer value with these standards and know how to use them. to a physical value. The SiL-environment reads A2L Data is available in these formats already as part of files and uses the information to automate many the existing tool chain and reuse is virtually free of tasks, such as scaling of the integer variables of the cost.