Cam and Crank - Crank Encoder Analog v3
Cam and Crank - Crank Encoder Analog v3 — This Crank
Encoder Analog code module is an extension to the Crank Encoder v3 code module.
It generates an analog output signal from the crankshaft.
Library
Simulink® Real-Time™ - Speedgoat

Description
This Crank Encoder Analog code module receives the crankshaft angle from the
corresponding Crank Encoder v3 code module channel. The settings, such as tooth and
missing tooth number, are also adopted from the corresponding Crank Encoder v3 code
module. The analog output signal is either a sine wave or square wave representing
the crank teeth.
This driver block must be used in combination with a Crank Encoder v3 block as
well as an Analog Output block to enable and parameterize the corresponding Crank
encoder and Analog output channels.
Ports
This driver block has two input ports:
Inputs
-
Amplitude
This input signal defines the amplitude [V] of the analog crankshaft
output signal. It is limited by the range of the analog output interface
on the configurable I/O module.
-
Bias
This input signal defines the bias [V] of the analog crankshaft
output signal. It is limited to -5 to 5 volts.
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 Crank encoder analog channels which this driver block
entity will access. Channels can be specified in the range 1 to N (N is
the number of crank encoder channels in the configuration file). The
order of the channels can be freely mixed, but the same channel should
not be used more than once. The width of this vector also defines the
resulting size of some of the following parameters if scalar expansion
applies. The length of the channel vector defines the dimension of the
input signals.
-
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: Input and Output Port Configuration
-
Enable Output Sine Wave
The analog output signal will be a sine wave representing the teeth of
the crankshaft if this checkbox is enabled. The output signal will be a
square wave if this checkbox is cleared.