技术文章和新闻通讯

开发使用基于型号的设计的混合动力车电池管理系统的Autosar-和ISO 26262兼容软件

By Duck Young Kim, Won Tae Joe, and Hojin Lee, LG Chem


当我们的团队为Volvo XC90插件混合动力车开发电池管理系统(BMS)时,使用AutoSar是沃尔沃的要求,但我们可以自由选择自己的开发方法和工具。我们将这个项目视为建立基于基于模型设计的工作流程的机会。使用此工作流程,我们可以将基本软件层中的硬件特定模块的开发留给具有专业知识的供应商,并专注于建模,模拟和验证应用程序层中的控制逻辑。

MATLAB基于模型的设计®和Sim万博1manbetxulink®has enabled us to increase component reuse, reduce manual coding, improve communication with our customers, and deliver a higher-quality BMS. Following the introduction of Model-Based Design, the number of software issues identified in each software release dropped from about 22 to fewer than nine—well below our target for the project.

为什么要基于模型的设计?

We chose Model-Based Design in part because it enables us to model and simulate the complex algorithms and behaviors that make up the core of the BMS. We wanted to automate quality checks and thoroughly verify our design with software-in-the-loop (SIL) and hardware-in-the-loop (HIL) tests prior to customer acceptance testing.

我们需要的算法来开发来自不同学科和背景的工程师所需的贡献,包括电化学,数学,控制设计和软件工程。我们知道,基于模型的设计将为他们提供一个共同的平台和一种共同的语言,可以在设计上进行协作。

Reusability was another key factor driving our decision. We had already assembled a library of components that we wanted to use on the Volvo BMS project, and we wanted to continue to develop this library to speed development of future projects with OEMs. So far on the Volvo project, we have used the core library across five variant models. With this core library it takes us much less time to initiate a new variant model, and even a new project.

Developing the AUTOSAR Software Components

We began our top-down development approach by modeling the system architecture and defining software component descriptions in an AUTOSAR authoring tool. We then imported the component descriptions (exported as ARXML files) into Simulink.

Working in Simulink and Stateflow®,我们使用在导入过程中自动创建的骨架模型对BMS的控制逻辑和算法行为进行了建模。我们还将Simulink模型中的信号映射到AutoSar组件万博1manbetx描述中的信号。在此阶段,我们重新使用了SOC(负责)估计,SOH(健康状万博1manbetx况)估计,控制逻辑,诊断逻辑等的SIMULINK组件,从我们从早期项目组装的核心库中。我们添加了自定义逻辑,以满足沃尔沃对这个特定项目的要求,包括PHEV的电动机仲裁逻辑。

在Simulink开发控制器模型的同时,我们经常使用模型顾问检查符合样式指南和建模万博1manbetx标准。我们还使用Simulink Design Verifier™检查了模型中的Dead Logic,by Zero错误和其他设计错误。万博1manbetx

LG Chem的电化学模拟团队创建了电池组电化学细胞的数学模型。我们将该团队的MATLAB代码纳入了Simulink工厂模型,我们用来模拟控制器模型。万博1manbetx

Generating Code and Automating Tests

Once we had completed the initial design, our goal was to automate as much of the remaining workflow as possible, including code implementation and test execution. We generated AUTOSAR-compliant C code from our controller models using Embedded Coder®以及用于Autosar标准的嵌入式编码器支持包万博1manbetx。

为了验证生成的代码,我们使用了针对三个区域的测试用例进行SIL测试:核心库组件,映射信号和自定义逻辑。

在自动化SIL测试期间,我们使用Simulink Coverage™测量了执行覆盖,修改条件/决策覆盖范围(MC/DC),查找表覆盖范围和环量复杂度。万博1manbetx这些指标使我们能够确保我们的测试正在行使整个设计。几乎不可能诊断出在集成测试中与依赖手动编码的开发过程中确定的难以删除的问题,尤其是对于由软件组件(SWC)输出(SWC)进行处理的系统,然后由第二个SWC处理然后送回。进入原始SWC。借助基于模型的设计,我们可以在模拟过程中显示每个级别的信号,并查看错误如何通过反馈回路中的SWC传播,这使得基础问题更易于识别和纠正。

我们将生成的代码部署到目标嵌入式处理器中进行HIL测试,其中模拟了车辆的完整电动动力总成。这些最终测试导致我们客户进行的车辆验证测试。如果客户测试发现错误,我们可以使用测试日志文件在Simulink中重现问题,通过仿真确定根本原因,并调整模型以解决问题。万博1manbetx我们作为工作流程的一部分进行的广泛测试导致软件问题显着减少(图1)。

Figure 1. Issue counts for software releases before and after the adoption of Model-Based Design.

Figure 1. Issue counts for software releases before and after the adoption of Model-Based Design.

下一步

The BMS we developed for Volvo using AUTOSAR and Model-Based Design has achieved ISO 26262 functional safety–based certification for Automotive Safety Integrity Level C (ASIL C). For this initial project, we completed most certification tasks manually. We have since automated many of the tasks and reduced the resources needed to generate reports for certification.

Our team is now using the workflow that we established for the Volvo BMS to develop AUTOSAR software components for a growing number of automotive OEM customers.

Published 2018