Documentation Home Page RT-XSG Toolbox Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

Quad Decoder

Block

Block

Mask

Mask

Description

The Quadrature Decoder block retrieves the angle of a rotating device according to a quadrature-encoded A, B, and Z channel triplet. Inputs A and B have a specific phase difference that enables the decoder to retrieve the modulated signal angle and speed at any time.

Parameters

Encoding configurationUsed to specify the encoding pattern (according to the encoder specification, the A pulse may come before or after the B pulse, for a positive speed). The user chooses between A leads B or B leads A, which applies to a positive speed (the leading channel is interchanged for a negative speed).
Provide resolution asDetermines how the decoder's resolution is specified. It can be specified either by a block parameter or by a block input port.
Number of pulses per turnThis entry is made available if the resolution is specified as block parameter. It allows to specify the number of A/B pulses per turn (i.e. between two consecutive Z pulses if the rotation direction does not change).
Provide Timestamp, DataReady and EventCount outputsIf this checkbox is selected, the Timestamp, DataReady and EventCount outputs are available.

Inputs

AThe A channel of the quadrature encoded A, B and Z triplets.
BThe B channel of the quadrature encoded A, B and Z triplets.
ZThe Z channel of the quadrature encoded A, B and Z triplets.. One Z pulse occurs per turn when the angle is close to zero. In practice, the output angle is reset upon the reception of the Z pulse. For optimal behavior, the width of the Z pulse should be inferior or equal to the width of an A/B pulse.

Outputs

AngleThe angle modulating the quadrature-encoded rotating device. The angle is provided as a turn ratio, in the range [0,1[ and in the UFix16_16 format.
TimestampThis output is available only if the Provide Timestamp, DataReady and EventCount outputs option is selected. It outputs the timestamp of the last update of the angle, detected as an event on A, B or Z. It is expressed as an integer number of clock ticks in the format UFix22_0. This output can be used along with the angle output to compute precisely the speed of the encoder.
DataReadyAvailable only if the Provide Timestamp, DataReady and EventCount outputs option is selected. It is active high and is activated only if the angle has been updated since the last synchronization pulse (ModelSync).
EventCountAvailable only if the Provide Timestamp, DataReady and EventCount outputs option is selected. It gives the number of increments or decrements of the angle since the last synchronization pulse (ModelSync), in the signed integer format Fix21_0.

Characteristics and Limitations

This block has no special characteristics. Figure 1 presents an example of a quadrature-encoded A/B/Z triplet behavior for positive speed.

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323