Documentation search search close
CONTENTS
https://www.speedgoat.com/help/slrt/page/icon_documentation.jpg
v10.0.1.x for R2026a
View other versions

Cam and Crank - Cam Encoder v2

Cam and Crank - Cam Encoder v2 — The cam encoder generates a camshaft signal depending on the specified start and stop position of the cam teeth. Up to 10 teeth are supported by the cam encoder.

Library

Simulink® Real-Time™ - Speedgoat

Description

The cam encoder generates a camshaft signal depending on the specified start and stop position of the cam teeth. Up to 10 teeth are supported by the cam encoder. To disable o tooth, the start and stop angle of the tooth have to be '-1'. The current implementation of the corresponding crank decoder supports cam profiles which meet the following conditions:

  • Only one cam tooth

  • Start and stop angles of the cam tooth coincide with the start angle of a crank tooth. e.g., for a crank profile with 18 teeth and 2 missing teeth, possible cam start and stop angles are multiples of 20 degrees.

Ports

The Simulink block has one input port, two additional input ports per channel and no output ports:

Inputs
Speed

Speed in rpm. The value has to match with the Speed value of the corresponding crank encoder.

Cam start CH<x>

Start angles vector of the up to 10 cam teeth of channel <x> in degrees [0, 720). The size of this vector must always be 10. If an element of the vector is '-1', the corresponding tooth is disabled. An example of a Cam start vector is [20, 60, 125, 550, -1, -1, -1, -1, -1, -1]. In this case, the 4 configured teeth start at 20°, 60°, 125° and 550° respectively. The other teeth are disabled. The corresponding stop angles of the teeth are specified in the cam stop port.

Cam stop CH<x>

Stop angles vector of the up to 10 cam teeth of channel <x> in degrees [0, 720). The size of this vector must always be 10. If an element of the vector is '-1', the corresponding tooth is disabled. An example of a Cam start vector is [40, 90, 180, 665, -1, -1, -1, -1, -1, -1]. In this case, the 4 configured teeth stop at 40°, 90°, 180° and 665° respectively. The other teeth are disabled. The corresponding start angles of the teeth are specified in the cam start port.

Parameters

Tab: Module setup
Configurable I/O Module ID

This parameter associates a code module block with a configurable I/O module setup block. Set this value to match the Module ID defined in the setup block of the required configurable I/O module.

Channel Vector

A vector of channels this driver block entity will access. You can specify channels in the range 1-N (N = the number of channels implemented in your specific configuration file defined in the Setup block). The width of this vector also defines the subsequent size of some of the following parameters if scalar expansion applies. With a single block, all the channels of the block are synchronized.

Sample Time

Defines the base sample time at which this driver block gets its sample hit. This parameter can also be set to -1 for inherited sample time. The units are in seconds.

Tab: Cam Encoder
Crank master vector (read only)

The corresponding crank encoder master. This parameter is read-only, and therefor only for information purpose. The crank encoder master is predefined during the pin layout.

Number of teeth vector (read only)

This parameter defines the number of teeth defined in the crank encoder master. This parameter is read-only, and therefor only for information purpose. The number of teeth vector is defined in the crank encoder mask.