Operation of an ECU


  • Preface
  • System bus
  • Processor (CPU)
  • RAM memory
  • ROM memory

An ECU receives or measurement data from sensors, processes the information and performs calculations to control the actuators. The figure below shows a block diagram of a control system.

Sensors are sensors that respond to a physical quantity. The electronics in the sensor convert this into an electrical signal. The ECU receives this electrical signal as “input” and compares this signal with the pre-programmed value. Depending on what the signal is for, regulation takes place by adjusting the actuator control accordingly.

The following image shows an ECU with three connectors. From left to right: power and network, sensors, actuators.

In a petrol engine management system we find the following sensors:

  • crankshaft position sensor to measure crankshaft speed;
  • coolant temperature sensor to measure coolant heating;
  • throttle position sensors to measure throttle position and thus engine load;
  • MAP or mass air meter to measure the negative pressure or air flow;
  • lambda probe to measure the oxygen content in the exhaust gases;
  • the barometric sensor and intake air temperature sensors;
  • knock sensor to advance the ignition as far as possible.

The above sensors serve as input to control the injectors and ignition coil(s). For this, all sensor values ​​are searched for in a pre-programmed map.

Let's take the injector control as an example. At idling engine speed, the injectors inject an x ​​number of degrees after TDC.

  • At a low coolant temperature, the injection time is extended (enriched);
  • With gentle acceleration, the injection time is also extended. There is also a measurement that keeps track of how quickly the accelerator pedal is pressed: at abrubt full throttle, additional enrichment takes place;
  • The underpressure in the intake manifold influences the injection time and duration;
  • The lambda probe (for example the jump sensor) measures whether the mixture is too rich or too lean. If the mixture is too lean for a number of crankshaft rotations, the injection time is extended with the help of the fuel trims until the mixture is stoichiometric again;
  • The barometric sensor and intake air temperature sensor measure air pressure and temperature to determine the degree of oxygen in the intake air.

The injection time therefore depends on the values ​​of up to five sensors. With modern engines, even more sensors play a role in this.

During and after controlling an actuator, the sensors feed back information to the ECU. The measured value is compared in the software with the desired value. It can be used to determine whether an actuator control can remain constant, must be shortened or, conversely, extended. The ECU thus acts as a controller, so that a control loop is created.

The following figure shows a map in which the basic injection time is determined from the crankshaft speed relative to the underpressure in the inlet manifold, which is a measure of the engine load. The temperatures and lambda probe form a correction factor and each has its own characteristic.

System bus:
The system bus makes connections between the components in the ECU (see the figure below). At the top of the ECU we find the clock. This so-called oscillator produces a square-wave voltage with a frequency of usually 16 mHz. The clock frequency determines the speed of the control unit. The components in a control loop are tuned to each other by this timer.

The CPU, memory and I/O interface (I/O stands for: input / output) are interconnected with a system bus, consisting of multiple connections on the printed circuit board. We can subdivide these into:

  • address bus: this bus transfers data from the microprocessor to specific memory locations;
  • data bus: data between the memory, the cpu and the interfaces is transported via the data bus;
  • Controlbus: Serves as control by making read and write selections, requests, and resets according to the timing of the system clock.

Processor (CPU):
The processor (Central Processing Unit) is the heart of the computer. The combinatorial circuits, which consist of an enormous amount of AND, OR and NOT gates, are built in the ECU by means of software. When manufacturing the processor, a number of instructions (the software) are baked in. These instructions perform actions and put them in the correct order. Example:

  1. the letters of the alphabet are stored digitally in the processor. In reality, it will not be letters, but digital instructions representing simple actions;
  2. by putting the letters in the correct order, we can make words;
  3. by putting the words in the correct order, we can make sentences;
  4. the sentences make the story: in reality the computer program.

The program to put the instructions – known by the processor – in the correct order is baked into the software by the programmer. This program is loaded into the flash memory of the ECU.

When the ECU is started up, the instructions are taken from the flash memory one by one by the processor according to the clock and executed. After the program runs and ends, the cycle starts again.

The data required to load data such as ignition timings is loaded from ROM memory. The processor boots from ROM memory and copies data from ROM to RAM. After booting, the CPU pulls all data and commands from the fast RAM. A relatively small RAN memory is necessary for temporary storage of data and calculated intermediate values.

The CPU is connected to the memory by means of an address bus and data bus.

  • Set: bits are stored in RAM
  • Enable: Get bits from RAM

Bits and bytes of data in RAM can consist of:

  • numbers: data from sensors / data to actuators / calculations
  • addresses of sensors (input) and actuators (output)

The data in RAM can be:

  • letters: ASCII codes, numbers, letters, symbols
  • instructions: instruction set of the processor (processor commands)

The processor works according to a so-called ISA (Instruction Set Architecture) or an instruction set. The ISA is a list of instructions programmed by the manufacturer and used by the processor. The ISA differs per processor and is highly dependent on the application for which the processor is used. Below are a few examples:

  • LOAD the processor retrieves a value from the RAM memory
  • STORE the processor stores a value in the RAM memory
  • ADD the processor adds two numbers together
  • CLR the processor clears a value in the RAM memory
  • COMPARE the processor compares two numbers
  • JUMP IF the processor jumps to a particular memory address in RAM (condition from compare)
  • OUT the processor sends information to an output
  • IN the processor request information from an input

In order to be able to run a processor at full clock speed, internal RAM is used. These are called “registers”. Registers are particularly important function blocks in many digital systems. They consist of a collection of flip-flop circuits that can temporarily hold (remember) a binary number. The different types of registers are:

  • A register: register for A input to ALU
  • B register: register for B input to ALU
  • Work register: general purpose, for storing (interim) results
  • Instruction register: holds the current instruction to be executed for the processor
  • Address register (program counter): contains the address of the next instruction to be executed
  • Flag register: number (after a calculation) is: zero, negative, positive, too large, even or odd
  • Floating Point Register: number with decimal places
  • Shift register: memory in which the data shifts one bit during each clock pulse
  • Memory Data Register: buffer between CPU and RAM for memory data
  • Memory Address Register: buffer between CPU and RAM for memory address

The ALU (Arithmetic Logic Unit) performs all arithmetic and logical operations (AND, OR, NOT, etc.).

  • 2 inputs to ALU: A and B
  • 1 input: which operation should the ALU perform
  • 1 output: R (Result) goes to a register
  • 1 output: flag register

The figure below shows the simplified ALU (left) and the ALU with schematic representation of the logic gates (right).

1. The ALU wants to send 01010101

2. First the Control Unit must make set “1”

3. The register is completed

4. After this, Enable “1” is created.

5. The data from the ALU is put on a bus

The CPU wants to retrieve data from the RAM:

1. CPU sends an address to the RAM (01001001)

2. CPU wants to receive information; “enable” = 1

3. RAM sends data from address 01001001 to the CPU

4. CPU processes the information

The CPU wants to store data in the RAM:

1. CPU sends an address to the RAM (01001011)

2. CPU wants to store information; “set” = 1

3. CPU sends data (00111100) to address 01001011 in RAM.
The data in the RAM is now overwritten from: 11111001 to: 00111100

ROM Memory:
ROM is an abbreviation of: Read Only Memory. This memory is programmed by the manufacturer. The memory circuit is arranged with fixed connections. The ECU starts the software program (booting) from the ROM memory. The ROM memory is a slow memory. During boot, the data is copied from ROM to RAM.

Below are four examples of reading the ROM.

error: Alert: Content is protected !!