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

Quadrature - Encoder v2

Quadrature - Encoder v2 — The QAE driver block provides simulation of a quadrature encoder.

Library

Simulink Real-Time - Speedgoat

Description

The QAE driver block provides simulation of a quadrature encoder.

In QAE version 2 the number of segments per revolution can be any arbitrary even number from 2 to 2^32.

In addition, the angle between the A and B signal can be configured in the range of +/- 180°.

Ports

The width of all the inputs and all the outputs are equal to the channel count as defined in the channel vector parameter.

Inputs
position cmd

This port allows the QAE position to be set. The position is defined within a revolution in the range of 0 to (number of segments per revolution) -1. This port is enabled/disabled using the 'Show position input port' parameter.

speed cmd

This port allows the QAE speed to be set. This port is enabled/disabled using the 'Show speed input port' parameter. The unit of the speed input is rpm.

Outputs
position

This port allows the position of the encoder to be read back. This port is enabled/disabled using the 'Show position output port' parameter.

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: Quadrature Encoder
Number of segments vector

The number of segments the encoder emulates per revolution

Phase angle from A to B (deg)

The phase angle between the two output signal A and B. Valid range is +/- 180°.

Initial speed vector (rpm)

Encoder speed at model start.

Initial position vector

The initial segment position of the QAE at model start.

Free wheel

When this parameter is checked, position control is disabled.

Tab: Input and output configuration
Show speed input port

When this parameter is checked, an additional input is shown and allows to set the QAE speed (rpm).

Show position input port

When this parameter is checked, an additional input is shown and allows to set the QAE position.

Show position output port

When this parameter is checked, an additional output is shown and the current QAE position is available as a readback information.