Lookup Tables

Lookup tables provide a method to compute an approximate value of a function based on indexes into arrays of values with interpolation between values. The indexing is normally simpler and faster than the equivalent mathematical formula. Lookup tables can save processing time, while being faster to setup for complex non-linear equations, and easy to calibrate on the fly.

OpenECU lookup tables

OpenECU provides support for 1d and 2d lookup tables, with linear interpolation between data points, and no extrapolation. OpenECU also supports 1d and 2d non-volatile adaptive lookup tables.

OpenECU lookup blocks provide full support for ASAP2 MAP entries in the generated A2L file for all Simulink coders (i.e. RSIM, RTMODEL, and ERT based), including the active interpolation point (if available).

Simulink provides similar functionality, but allows for greater configurability for the lookup table dimensions, data types, index search, and interpolation method (with extrapolation available).

Considerations when using native Simulink lookup tables:

Naming considerations

In order to support a common axis in either OpenECU or Simulink lookup table blocks, either the naming convention must be disabled using Simulink Data Dictionaries in R2015a or later, or Simulink based ASAP2 generation must be enabled, see table below for details.

OpenECU blocks

Simulink blocks

Feature

put_Calmap1d

put_Calmap2d

pnv_AdaptiveMap1d

pnv_AdaptiveMap2d

Lookup Table

Lookup (2-D)

Lookup (n-D)

Interpolation Using Prelookup

Data types

float

float

float

float

float

float

Any numeric (incl. fixed pt)

Any numeric (incl. fixed pt)

Table dimensions

1

2

1

2

1

2

1-30

1-30

Configurable index search

No

No

No

No

No

No

Yes

Yes

Configurable interpolation method

No

No

No

No

Yes

Yes

Yes

Yes

Nonvolatile data

No

No

Yes

Yes

No

No

No

No

ASAP2 MAP entry

RSIM

Yes

Yes

Yes

Yes

Yes 1

Yes 1

Yes 1

Yes 1

RTMODEL

Yes

Yes

Yes

Yes

Yes 1 or 2

Yes 1 or 2

Yes 1 or 3

Yes 1 or 3

ERT

Yes

Yes

Yes

Yes

Yes 1 or 2

Yes 1 or 2

Yes 1 or 3

Yes 1 or 3

Active interpolation point

RSIM

Yes

Yes

Yes

Yes

No

No

No

No

RTMODEL

Yes

Yes

Yes

Yes

Yes 2

Yes 2

Yes 3

Yes 3

ERT

Yes

Yes

Yes

Yes

Yes 2

Yes 2

Yes 3

Yes 3

Common axis

RSIM

Yes 4

Yes 4

Yes 4

Yes 4

No

No

No

No

RTMODEL

Yes 2 or 4

Yes 2 or 4

Yes 2 or 4

Yes 2 or 4

Yes 2

Yes 2

Yes 3

Yes 3

ERT

Yes 2 or 4

Yes 2 or 4

Yes 2 or 4

Yes 2 or 4

Yes 2

Yes 2

Yes 3

Yes 3

  1. requires map (m) prefix naming convention (1 2 3 4 5 6 7 8 9 10 11 12)

  2. requires Simulink based ASAP2 generation (13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32)

  3. requires Simulink based ASAP2 generation and R2010a or later (33 34 35 36 37 38 39 40 41 42 43 44)

  4. requires disable naming convention, with Simulink Data Dictionary, R2015a or later (45 46 47 48 49 50 51 52 53 54 55 56)

For more description of Lookup tables, see Wikipedia's Lookup table Article.

For more description of Linear interpolation, see Wikipedia's Linear interpolation Article.

      Copyright © 2016 Pi Innovo, All rights reserved