Dongfeng Electric Vehicle Develops Battery Management System for Hybrid Electric Vehicles Using Model-Based Design

“With Model-Based Design we have an integrated process for development, from idea through production code generation. MathWorks tools enabled us to develop key battery management technology using our own expertise, in an environment that facilitated early and continuous verification of our design.”

Challenge

Develop a battery management control system for a hybrid electric bus

Solution

Use MathWorks tools for Model-Based Design to model, verify, and generate code for the controller design

Results

  • Project completed ahead of schedule
  • Design reuse enabled
  • 100% of application code generated
The Dongfeng EQ6110 hybrid electric city bus.

Dongfeng Electric Vehicle (DFEV) is responsible for the research and development efforts for electric vehicles and hybrid electric vehicles (HEVs) within Dongfeng Motor Company in China. The company sources most components, such as traction motors and batteries, from suppliers. However, because the control strategies for battery management and vehicle energy management are vital to performance and fuel economy in HEVs, and these controllers must be optimized and integrated on the vehicle level, DFEV decided to develop the electronic control systems for its HEVs in-house as part of its original intellectual property.

Engineers at Dongfeng used MathWorks tools and Model-Based Design to develop a sophisticated battery management control system for the Dongfeng EQ6110, a hybrid electric city bus that delivers 30% better fuel efficiency than standard city buses while lowering emissions.

“A team of just six engineers developed the controller model and generated production code on schedule and on budget,” says Dr. Xiaokang Liu, principal engineer at DFEV. “Continuous verification and the use of plant models for closed-loop simulation enabled us to identify and resolve problems early to ensure that our high quality standards were met or surpassed.”

Challenge

Dongfeng engineers had experience developing controllers in C, but the battery management system project was considerably more complex. Integrating the vehicle’s control systems was also a challenge.

“On projects that involve multiple engineering disciplines, development styles vary greatly, which makes C-based implementations difficult to debug and maintain,” explains Liu. “With our limited human and material resources, hand-coding was not feasible given our tight 18-month schedule.”

Dongfeng engineers must comply with ISO/TS 16949 quality management guidelines, and the code they produce must meet the set of MISRA ® C standards that Dongfeng follows. “We need a development environment that enables continuous verification and generates consistent, compliant, and efficient production code.”

Solution

Dongfeng engineers used MathWorks tools and Model-Based Design to first design, simulate, and verify the battery management control system and then generate production code for it.

After requirements for the project had been established, they developed a baseline version of the controller model in floating point using MATLAB®, Simulink®, and Stateflow®. In parallel, the team used test data to develop a Simulink model of the battery, which when used with the controller model, provided information about battery dynamics necessary to verify the controller design.

After unit testing, the team linked the controller model with the battery model in Simulink and ran desktop simulations to verify the basic functionality of the algorithms.

To further refine the controller algorithms, the engineers quickly generated code from the model using Simulink Coder™ and ran this code on a rapid prototyping controller against the real battery.

With Fixed-Point Designer™, the group converted the model from floating point to fixed point and ran a second round of desktop simulations to verify the quality of the conversion. The engineers collected modified condition/decision coverage (MC/DC) metrics to assess the completeness of the testing.

The engineers generated production code from the model using Embedded Coder®. They verified that the generated code behaved as expected by performing software-in-the-loop tests in which they ran the code against the Simulink battery model in closed-loop simulation.

As a final verification step, the team deployed the code to the target ECU, which is based on the Freescale™ S12 microcontroller. Using code generated from the plant model, they ran the ECU in hardware-in-the-loop (HIL) simulation to verify the integration between the controller software and the ECU hardware.

The controller was then calibrated using CANape and installed in prototype vehicles for on-road reliability and durability testing, taking advantage of the ASAP2 calibration file generated alongside the production code.

The embedded battery control system is in place on Dongfeng EQ6110 buses, which are undergoing trial operation.

Results

  • Project completed ahead of schedule. “We had just 18 months to take the initial idea to proof-of-concept and then deliver a complete product,” says Liu. “By using Model-Based Design, automatically generating code, and streamlining the conversion from floating point to fixed point, a small team of six engineers completed the effort ahead of schedule.”
  • Design reuse enabled. Dongfeng engineers are reusing parts of the controller design for the company’s HEV sedan, which is currently in development. “Using Model-Based Design and Simulink, engineers can easily visualize the changes that need to be made for the new application, minimizing the scope of the changes and the time needed to implement them,” says Liu.
  • 100% of application code generated. The team generated over 100,000 lines of application code for the controller using Embedded Coder. “Because it was automatically generated, the code was consistent and easier to maintain. Equally important, the code was of high quality, meeting the MISRA C guidelines we need to follow,” says Liu. “Achieving this level of consistency and quality with hand-coding would be very difficult.”