6.8.26. Engine speed (pan_EngineSpeed)

Calculate the rotational speed of the engine.

6.8.26.1. Supported targets

M220-000, M221-000, M250-000 and M670-000

6.8.26.2. Required license

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

6.8.26.3. Description

The pan_EngineSpeed block provides the rotational speed of the engine, derived from the primary crankshaft wheel. The ECU continually records the time of arrival for each primary crankshaft wheel tooth. The block uses these timestamps to calculate engine speed. The Type mask parameter selects the speed calculation output by the block.

6.8.26.4. Inports

  • sim_speed

    Only used under simulation. Under simulation, the value of this inport is passed through to outport speed.

    Range: [0, 10000] rpm

    Value type:Real
  • cylinder

    The cylinder to return the processed tooth rangespeed calculation. Only used when Type is set to Tooth range (relative).

    Range: [1, n] where n is the number of cylinders specified by the pan_EngineConfig block.

    Value type:Integer
  • tooth

    The engine tooth identifier used in combination with the num_teeth inport to calculate engine speed, based on the mask parameter Type.

    Tooth range (absolute)

    The first engine tooth to be used in the engine speed calculation. See Section 6.2.5, “Engine tooth identification” for a description of engine tooth identifiers. If the given tooth is out of range, the tooth value will be clipped to the range before engine speed is calculated.

    Range: [1, n] tooth identifier, two stroke Range: [1, n*2] tooth identifier, four stroke where n is the number of physical crank teeth as specified in the pan_CrankWheelConfig block.

    Tooth range (relative)

    A crank tooth relative to the cylinder's TDC-firing angle (tooth), where 0 is the closest TDC-firing tooth, -1 the proceeding tooth, and so on. Extra teeth in sync points are ignored. If the given tooth is out of range, the tooth value will be clipped to the range before engine speed is calculated.

    Range: (-n, 0] tooth identifier, two stroke Range: (-n*2, 0] tooth identifier, four stroke where n is the number of physical crank teeth as specified in the pan_CrankWheelConfig block.

    Value type:Integer
  • num_teeth

    Used in combination with the tooth inport to calculate engine speed. The number of crank teeth after inport tooth to be included as part of the engine speed calculation. The engine speed calculation is based on the time difference between the detection of these teeth. If the given tooth is out of range, the tooth value will be clipped to the range before engine speed is calculated.

    Range: [1, n) tooth identifier, two stroke Range: [1, n*2) tooth identifier, four stroke where n is the number of physical crank teeth as specified in the pan_CrankWheelConfig block.

    Value type:Integer

6.8.26.5. Outports

  • speed

    The measured speed of the engine.

    Range: [0, 10000] rpm

    Value type:Real

6.8.26.6. Mask parameters

  • Type

    A drop down to specify the speed calculation to perform. The selection of type is dependent on the target ECU hardware selected in the put_Identification block.

    Per cylinder

    The speed as measured between two adjacent cylinder TDC-calculation events.

    Per engine revolution

    The average speed of the last two 360° revolutions of the primary crankshaft wheel (i.e. every 720° crank, regardless of whether the engine type is four-stroke or two-stroke).

    If the ECU has recorded one crank revolution but not yet two, then the speed is averaged over one revolution. This allows the application to retrieve a per-engine-revolution value as quickly as possible but without having to know how many crankshaft revolutions have so far occurred.

    Per tooth

    The speed as measured from the time between the last two primary crankshaft wheel teeth. When calculating a speed across a crankshaft sync point, the block adjusts the speed as if there were physical teeth present in the case of missing teeth, or as if there was no physical teeth present in the case of an extra tooth.

    Tooth range (absolute)

    The average speed measured between two of the primary crankshaft wheel teeth (specified through inports tooth and num_teeth). The teeth are interpreted as relative to crank zero degrees, see Section 6.2.5, “Engine tooth identification” for further details.

    For crankshaft wheels with missing teeth sync points, the time that the missing teeth would have occurred is not estimated and is treated the same as the last physical tooth prior to the missing region sync point. If requesting the engine speed based on missing teeth only, the block outputs zero.

    For crankshaft wheels with extra teeth sync points, the time of any extra teeth is not recorded and is treated the same as the last physical tooth prior to the extra tooth sync point. If requesting the engine speed based on extra teeth only, the block outputs zero.

    Tooth range (relative)

    The average speed measured between two primary crankshaft wheel teeth (specified through inports tooth and num_teeth). The teeth are interpreted relative to each cylinder's TDC-firing angle.

    For crankshaft wheels with missing teeth sync points, the time that the missing teeth would have occurred is not estimated and is treated the same as the last physical tooth prior to the missing region sync point. If requesting the engine speed based on missing teeth only, the block outputs zero.

    For crankshaft wheels with extra teeth sync points, the time of any extra teeth is not recorded and is treated the same as the last physical tooth prior to the extra tooth sync point. If requesting the engine speed based on extra teeth only, the block outputs zero.

    Value type:List
    Calibratable:No
  • Sample time

    The periodicity of the block execution.

    Range: [0.001, 3600] seconds

    Value type:Real
    Calibratable:No
  • Provide simulation inports?

    Tick to enable inport sim_speed.

    Value type:Boolean
    Calibratable:No

6.8.26.7. Notes

None.