“Simscape enables us to create a comprehensive model of the engine appropriate for our design tasks that is easily understood by all teams. Closed-loop simulations of the ECU and engine performed in Simulink, completed as early as possible, are essential to our front-loaded development process.”
Dr. Hisahiro Ito, Toyota Motor Corporation
Engine control unit (ECU) software is becoming increasingly sophisticated as automotive manufacturers strive to deliver improved fuel efficiency, reduced emissions, and a better driving experience. In particular, tighter regulations on emissions require precise control over air-fuel mixtures and combustion timing.
With such complex systems and strict requirements, defects or design flaws found late in development can lead to significant rework and cost overruns. To avoid these problems, it is vital to have an accurate simulation model of the engine as early in the ECU development process as possible. Toyota Motor Corporation engineers developed an engine model that was used to front-load their development process, enabling model-in-the-loop (MIL) and software-in-the-loop (SIL) testing on a production vehicle program.
“Front-loaded development with Model-Based Design enables us to shorten development cycles and minimize rework, which allows us to deliver products earlier than our competitors,” says Dr. Hisahiro Ito, assistant manager at Toyota. “With MATLAB, Simulink, and Simscape, we create the control software, plant model, and closed-loop simulator in a single environment, which greatly simplifies control system development.”
Previously, Toyota engineers tested only small subsets of ECU functionality with relatively simple plant models, which prevented them from testing and optimizing the control software. To ensure optimal operation of a new engine, they needed an engine model that covered the entire engine, including the fuel, combustion, and exhaust gas recirculation (EGR) systems. The engineers needed to model system behavior by directly implementing equations describing these systems.
Toyota engineers needed to improve the flexibility and scalability of their SIL and MIL technologies to more efficiently develop the ECU. Engineers needed the SIL environment to support simulated CAN bus communication between ECUs, source-level debugging of control code, and the correct execution order of interrupt service routine (ISR) and timer tasks.
Toyota engineers used Simscape™ to develop an engine model comprising thousands of equations. The model enabled a front-loaded development process based on Model-Based Design for ECU software.
The engineers used the Simscape language to create a custom physical domain consisting of multiple gas types, including air, fuel vapor, and burned gas. They created custom component models to represent the combustion cylinder and air-path (including the EGR). By combining these models with component models provided in Simscape, they were able to model the torque converter, automatic transmission, and other drivetrain components.
They assembled these components in Simscape using a physical network approach to create acausal models. These acausal models were combined with a data-driven causal model of the combustion dynamics developed using Simulink® and Model-Based Calibration Toolbox™.
To develop an executable specification of the ECU algorithms in Simulink and Stateflow®, they employed MIL simulation with Simulink to analyze the design of new control logic while taking into account the dynamics of the connected plant.
After code was generated from the control model using Simulink Coder™, Toyota engineers used SIL testing to verify low-level drivers, the precise execution order of ISRs and timers, and other details that cannot be tested via MIL simulation. With SIL, engineers used Microsoft® Visual Studio® for source-level debugging of control code. Breakpoints set in the code paused the simulation in Simulink, enabling the engineers to examine the state of control variables before resuming execution.
Using model-and-software-in-the-loop simulation (SIL+M), engineers develop a new control module as a model, which is then integrated with the control software. SIL+M is expected to further front-load ECU development by enabling engineers to incorporate new control logic into the complete control system.
Working in MATLAB®, the engineers automated simulations during parameter optimization and performed data analysis on simulation and test results.
Toyota currently uses front-loaded development with Model-Based Design in the development of engine control, transmission control, and hybrid electric control systems.
Accelerate the development of complex engine control system software
Develop a comprehensive engine model and combine it with SIL+M testing to frontload the development process