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 - Crank Encoder v1

Cam and Crank - Crank Encoder v1 — The crank encoder generates a crank signal depending on the number of teeth, the number of missing teeth/tooth, duty cycle and speed. The speed can also be a negative number, which represents reverse rotation. However the current implementation of the cam decoder is not able to detect reverse rotation.

Library

Simulink® Real-Time™ - Speedgoat

Description

The crank encoder generates a crank signal depending on the number of teeth, the number of missing teeth/tooth, duty cycle and speed. The speed can also be a negative number, which represents reverse rotation. However the current implementation of the cam decoder is not able to detect reverse rotation.

Ports

This driver block has two output and two input ports:

Inputs
Speed

Speed in rpm.

Duty Cycle

Crank signal duty cycle in %. Default value is 50%. Duty cycles of 0% and 100% are not allowed.

Outputs
Speed

Displays the round information indicating the revolution number within the two revolution cycle.

  • Round 1: 0° - 360°

  • Round 2: 360° - 720°

Position

Current crank position in segments. The ratio between number of teeth and number of segments is 1:2. So the signal-high part and the signal-low part of a tooth correspond to one segment each. If the duty cycle is not 50%, these two segments are not of the same size. Example: A crank with 18 teeths (including 2 missing teeth) has internally 36 segments.

Parameters

Module Setup Tabulator
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.

Crank Encoder Tabulator
Number of teeth vector

This parameter defines the number of teeth of the crankshaft. Note that the number of teeth also includes the missing tooth/teeth.

Number of missing tooth/teeth vector

This parameter defines the number of missing tooth/teeth of the crank shaft.

Missing tooth/teeth signal high

This checkbox defines the level during a segment. When the checkbox is not checked the even segments are high (and the missing tooth low) whereas when the box is checked the odd segments are high (and the missing tooth is also high).

TDC position vector vector (deg)

This parameter defines the starting offset (starting point) of the crank encoder in degree.

Input and output Port configuration Tabulator
Show round

This parameter defines if the round counter is visible. The signal indicates the revolution number within the two revolution cycle.

Show position

This parameter defines if the position counter is visible. This signal is the crank encoder signal in segments.

Show Duty Cycle

This parameter defines if the Duty Cycle input port is visible. The default duty cycle is 50%.