5.1.1. 1-d calibration map look-up and interpolation (put_Calmap1d)

1-d map look-up and interpolation.

5.1.1.1. Supported targets

All targets

5.1.1.2. Required license

None (Main library). (See Section 2.3, “Licensed Features”.)

5.1.1.3. Description

Looks up the inport x in the X-axis Data parameter, interpolates the corresponding elements in the Z Data parameter, giving a corresponding z(x) as the output.

Some calibration tools provide a feature which shows the map in graphical or tabular form together with the active interpolation point. OpenECU supports this feature by populating the ASAP2 file with the signal name which corresponds to the x inport. To make this feature work, the x signal must be a named DD entity with its storage class property set to ExportedGlobal.

5.1.1.4. Inports

  • x

    The x-value at which a z-value is to be interpolated. May be a scalar or a vector.

    Value type:Real
    Calibratable:No

5.1.1.5. Outports

  • z(x)

    The value or values interpolated from parameter Z Data at x.

    Value type:Real
    Calibratable:No

5.1.1.6. Mask parameters

  • X-axis Data

    The name of the map's x axis (e.g. vftm_mymap_x, see Section "Naming rules"). There must be two or more elements in this parameter and that must be the same as the number of elements in parameter Z data. The values of X-axis Data must increase monotonically but adjacent values may be the same.

    Value type:Real
    Calibratable:Yes, offline and online
  • Z Data

    The name of the map's z axis (e.g. vftm_mymap_z, see Section "Naming rules"). There must be two or more elements in this parameter and that must be the same as the number of elements in X-axis Data.

    Value type:Real
    Calibratable:Yes, offline and online
  • Sample time

    The periodicity of the block execution.

    Range: [0.001, 3600] seconds

    Value type:Real
    Calibratable:No

5.1.1.7. Notes

  • The Simulink look-up and pre-index blocks can be used instead of the put_Calmap1d block. If a model uses the OpenECU data dictionary, then the axes and look-up data dictionary items must adhere to the naming convention and cannot be shared between look-up blocks. If a model uses the Simulink data dictionary, then the naming convention is not required, and axes and look-up DDEs can be reused between look-up blocks.

    – Note that other combinations are possible, see Section 4.2.2.2, “Data dictionary files” for details.

    – Note that in some cases, the Simulink look-up block can be slower to run than the put_Calmap1d block.

    – Note that when using Simulink look-up blocks with the Diab compiler, the following warning message is emitted during model builds. The warning can be ignored.

    '[model].c', line [line]: warning (dcc:1792):
                              trying to assign 'ptr to volatile' to 'ptr'
  • The look-up and interpolation work as follows:

    If the inport x value is less than the first element or larger than the last element of parameter X-axis Data, the block outputs the first element or last element of parameter Z Data respectively as outport z(x).

    Warning

    This effectively clips the output value as if it were looked up at the nearest defined break-point, which differs from the behaviour of the standard Simulink look-up block in older versions (e.g., Simulink R12).

    Otherwise, if the inport x is equal to the value of one of the elements of parameter X-axis Data, the block outputs the corresponding element of parameter Z Data as outport z(x).

    Otherwise, if the inport x is equal to the value of more than one element of parameter X-axis Data and the corresponding elements in parameter Z Data differ (causing a discontinuity in the function), the earliest element in the parameter Z Data is output.

    Otherwise, if the inport x is intermediate in value between two consecutive elements of parameter Z data, the block interpolates linearly between the two corresponding elements in parameter Z data using the scale defined by parameter X-axis Data to obtain outport z(x) value.