Internal Combustion Engine Control 1. Engine Control Unit Software
Internal Combustion Engine Control 1. Engine Control Unit Software
Figure 1
The ECU takes information from various engine sensors and uses that information to calculate and
tune engine spark and fuel for maximum power and efficiency. In many vehicles this controller also
regulates the electric power distribution, provides the on-board diagnostics, and communicates with
a number of other automotive systems to share information it obtains from various sensors.
Figure 2 shows some of the main sensors and actuators used by the ECU.
Often, the powertrain control unit is made up of the engine control unit and transmission control unit
subsystem. The engine control module controls a set of actuators and ensures proper engine operation.
The transmission control module ensures the fuel efficiency of the engine by taking input from the
engine sensors.
Figure 2
It is an electronic card housed in a small box (aluminum or plastic). The material of the shell depends
on the location of the block. It is usually in a plastic case if it is located in the cabin and in a metal
case if it is under the hood of the car. A pair of connectors come out of the controller for CAN Bus
and Sometimes there is an extra connector for easy diagnostic and flashing.
The ECU generally uses 32-bit microcontrollers with a few megabytes of memory registered at speeds
between 32MHz and 100MHz. They generally communicate with other electronic units using one or
more CAN bus interfaces (FlexRay and/or LIN bus communications may also be employed). It is a
sort of a mini computer which has storage devices, namely:
EPROM - read-only memory, stores the motor function parameters and other required
software;
EEPROM - designed to store temporary information: lock and access codes, mileage,
temperature in engine, fuel consumption, etc.
[Source: https://gtshina.ru/en/uhod-za-avto/osnovnye-funkcii-elektronnogo-bloka-upravleniya-dvigatelem-v/]
For the record, here are some ECU manufacturers: Bosch, Continental, Delphi, Haltech, Hitachi,
Fujitsu Ten, Hyundai Kefico, Keihin, LifeRacing, Magneti Marelli, Mitsubishi Electric, Motec,
Performance Electronics, Pi Innovo, Visteon, Woodward, Westport.
1. Software development
The ECU is essentially an on-board computer in a car that has a microprocessor that receives,
interprets and reacts to sensor inputs as quickly as they occur. It is made up of hardware (a fairly
standard printed circuit board) encoded with software (a program that tells the car how to operate).
ECU programming is the process of taking a ROM file and placing it into permanent storage inside
a vehicle's engine management ECU. The ROM file is made by using a development interface like
ASCET-DEVELOPER and/or Matlab Simulink which are interfaces that help us to create embedded
software for almost all industries.
ASCET-DEVELOPER:
ASCET-DEVELOPER allows us then to program all the interactions and calculations that an ECU
has to perform in order to get a model that will be integrated in the ECU.
ASCET-DEVELOPER allows you to easily combine texts and graphics suiting your programming
needs. There are different possibilities for modeling your logic, enabling you to work as efficiently
as you like. Therefore you have four choices of specification (Figure 3):
Graphic specification using Block Diagram
Graphic specification using State Machine Editor
Textual specification using C Code Editor
Textual specification using ESDL Editor, Embedded Software Development Language.
[Source: https://www.etas.com/en/products/ascet-developer.php]
After having finished programming the operation of the ECU, we can easily generate the C-code
which will serve as a ROM file to be inserted later in the hardware. This program provided by ETAS
Company is configured to create embedded software for AUTOSAR 1 and non-AUTOSAR
applications.
Figure 3
1
AUTOSAR (AUTomotive Open System Architecture) is a development partnership of major automotive industry OEMs
and suppliers, as well as tool and software vendors worldwide. The goal of the partnership is to establish a global standard
for common software architecture, application interfaces, and methodology of embedded software for vehicle electronics.
Matlab SIMULINK:
Matlab Simulink also is used to develop embedded software using either hand coding or by
simplifying the task a little using blocks and gives access to the C-code (Figure 4).
Figure 4
The V-model starts with Control targets phase in which the team or management tries to understand
the product requirements from customer perspective. This phase aims to establish a mutual
understanding that an ideal system has to perform. However, it does not deal with the low level details
of how this software will be designed. Requirement document will be then the output of this phase.
So, once we get clear and detailed product requirements it is time to analyze those requirements,
conduct feasibility study and design the complete system (functional design). The output of this phase
is the high-level system design document that will have the complete picture of various components
of the system such as user, software, hardware and interfaces and database. Now appears the role of
software architect who will analyze the functional design document and generate high level software
design. He will take all technical decisions in this phase like which controller will be suitable,
deciding on which programing language should be used, memory, communication protocols and
much more. Once the software blueprint is ready, software developer can start designing the
individual modules (control software) and generate low-level software design documents. Then
comes coding, where the actual construction of the software takes place (code implement) (Figure 5).
In V-model, the testing phases are also planned in parallel with its corresponding development phase.
So, before closing the control targets phase, review and validation tests should also be planned. Once
the software is ready, it will be tested by customer or system user for validation. Similarly, the system
testing and functional integration testing should be planned in parallel with functional design and
physical design. The System testing will be conducted just before the product delivery to test the
entire system functionality including all internal and external components. Also functional integration
test will be conducted to test the software internal modules and internal communications. The
software verification is the bench testing that can be described as a white-box testing which will be
conducted by individual developer to test the module functions.
Figure 5
We notice that in the V-model at each level there are checks whose principle is to detect failures at
an early stage in order to avoid the accumulation of errors. In fact, this would save a lot of time during
development process of an electronic control unit as that time spent early in the software development
cycle can reduce cost at later stages.
Automotive controller design (ECU): Modeling and Design
This step concerns the Implementation of a program which will have the possibility of executing all
the functions that an ECU is supposed to do as shown in the Figure 6, from the reception of the inputs
with their processing, calculations and errors estimation to the results that are sent as information,
reminder or order.
Figure 6
ECU operations
* EMI: filters that are an effective way to protect against the harmful impacts of electromagnetic
interference.
** ESD: Electrostatic Discharge control practices have substantially minimized the dangers from
unwanted electrical overstresses that are known to haunt semiconductors and other micro-electrical
devices at all stages of their manufacturing, handling and applications.
The program can be made through interfaces such as Matlab SIMULINK and/or ASCET developer
that allows us to make Physical software components modeling using Library with standard blocks,
Document generator, Simple integration from C-Code, library Functions.
Using prototyping it is possible to identify and correct errors at an early stage of the development
process. This significantly reduces the number of time-intensive and costly iterations during software
development.
Furthermore, AUTOSAR software components can be generated by Simulink using Embedded Coder
or by other code generation tools like ASCET. Finally, ETAS INCA tool makes it easy to perform
desktop calibration of Simulink models and code.
Figure 7
ETAS prototyping system example: ES910 module running the control function modeled in Simulink is connected to an
ECU through the ETK bypass interface and to sensor and actuator signals via the ES930 module in real time
[Source: https://www.etas.com/en/company/news_archive_2012-
prototyping_intecrio_rlink_measurement_calibration.php]
In fact, the ECU under development is not the same as the one produced because during this process
it is equipped with an additional calibration device which will be removed after the development
process is completed.
Figure 9
ECU emulators (also known as ETK) can be parallel (i.e. directly connected to the data bus) or serial (i.e. directly
connected to the microcontroller)
[Source: http://autoelexblog.blogspot.com/2013/11/]
There are two types of technology to exchange with the ECU, one is a simple CAN based interface -
with a calibration interface driver software installed (known as CCP - CAN Calibration Protocol) -
in this case, the ECU needs extra memory (compared to standard), to facilitate the online handling of
the measurement labels. The other type is to connect an emulator with the ECU. This device is
installed inside the ECU and has direct read-write access to the data bus inside the micro controller.
It also has additional memory and processing capability in order to directly handle communication
with the PC running the calibration tool software. Generally speaking, the emulator has superior
performance to the CAN solution, but is more complex and costly to implement.
Usually, the ECU flashed data is only readable and not writeable. That means the original data cannot
be directly changed. However, with additional hardware (ES59x, ES69x, ES910 or ES1000)
connected with INCA can be the ECU’s ROM with an extern RAM bridged. The flash data is from
the RAM run, so the original data can be changed, without changing the original content itself.
With this variety of hardware provided by ETAS, we can access the ECU during run-time, and make
changes, for example, changing ignition timing to give the best performance at any given engine
operating condition (speed, load). The ignition timing is held in a ‘map’ – the map covers all engine
operating conditions and provides an ignition timing demand value as a set point (Figure 10). Using
the calibration tool, the map can be adjusted during testing, optimizing to give the best performance.
Note that a map is considered as a single value (or label) to be calibrated.
During the development cycle, the calibration engineer will adjust and modify many values inside
the ECU in order to optimize and characterize the engine. In a modern powertrain, it can take teams
of people months or even years. Take an ECU, with 30,000 labels, which will equip 10 vehicle
variants. Each vehicle has a different calibration in order to differentiate it in the market. Every
vehicle needs to be calibrated for emissions, performance, fuel consumption, handling and on-board
diagnostics - each of these tasks is significant and all impact on each other. It is very common for the
calibration of a single ECU variant to be handled by large teams of engineers, often with specialist
knowledge of how a function works and how to calibrate it. For example, there may be a team of
engineers calibrating the emissions, which will include a specialized person or team who can look
after the start / stop system or the after treatment system. This complex environment creates masses
of data (calibration and measurement) that must be processed, analyzed, controlled and merged, to
create the final "master" calibration which will be approved by the chief calibration engineer. This is
the final version which will then be deployed on the production vehicle. This final calibration is
normally "flashed" into the ECU during the vehicle's production run. Before the final vehicle test, at
the factory before the vehicle is shipped.
Figure 10
Figure 11
3. Conclusion
With current technological advancements, this has gone a step further - a lot of development work
can now be done on a computer, with a simulated environment - and this applies greatly to ECU
development work. Electronic control unit software and functions can be easily developed and tested
in virtual environments. The entire electronic control unit can be simulated, with the vehicle, the
driver and the environment on a computer, and the simulation can run faster than in real time, this
means that a 20-minute trial run can be reduced to a few seconds (depending on the complexity and
the processing power of the PC) - providing results Simulation for analysis and development. A
typical next step is to make the ECU itself into a test environment - thus being able to test the actual
ECU code, which runs on the ECU hardware, with the physical connections to electrical stimulation,
but a complete virtual test environment (driver, vehicle, and environment).
There is no doubt that developing and calibrating the ECU is a complex task! Several tools and
techniques are available to help, and much will need to be developed to keep pace with the demand
for further development.