Table of Contents
The angle decoder (DEC) block decodes quadrature-encoded signals produced by incremental encoders for motor drive applications.
The imperix controllers provide decoder inputs for quadrature-encoder speed/position sensor signals (usually called A and B), with or without a reset line (usually called Z). These inputs are either configurable as four independent inputs or two differential inputs. Each decoder module counts all 4 edges of the A and B inputs, leading to an angular resolution 4 times superior to the PPR value usually specified for a given encoder. The position counter can be reset either at a specified value or using the Z signal provided by the sensor. Finally, the position is latched similarly and simultaneously to the sample-&-hold feature of the ADC inputs.
Performance specifications are available in the following datasheets:
Alternatively, the Motor Interface for B-Box RCP also supports incremental encoders. In this case, please refer to the incremental encoder module (INC).
Information on how to use this block is available in Using the angle decoder modules (PN104).
Simulink block
Signal specification
- The output signal is the decoded angle in radians.
- The
siminput signal is used in simulation and represents the actual angle value in radian, computed by the simulation plant model. - The
>input signal needs to be connected to the CONFIG block to account for the exact sampling instant in simulation.
Parameters
Device IDselects which B-Box/B-Board to address when used in a multi-device configurationInput modeselects if the decoder considers one GPI input per encoder signal (Single-ended) or two GPI with complementary signals (Differential).DEC moduleselects which GPI inputs are used. See the B-Box datasheet or B-Board datasheet to check where to connect the encoder signals.Pulses per rotationdefines the number of pulses of the A or B signal during one complete rotation of the encoder, as given by the manufacturer.Reset modeselects the counter reset mode. If Z input is selected, the pulse counter value is reset on the rising edge of the Z signal. If maximum value is selected, it is reset as soon as it has reached the number of pulses per rotation.Directiondefines, when A is leading B, if the angle increase (Clockwise) or decreases (Counterclockwise).Invert input signalsconfigures the decoder to consider the inverted logical value of the considered GPI inputs.
PLECS block
Signal specification
- The output signal is the decoded angle in radians.
- The target inport (only visible at the atomic subsystem level) is used in simulation and represents the actual angle value in radian, computed by the simulation plant model.
- The
>input signal needs to be connected to the ADC output of the CONFIG block to account for the exact sampling instant in simulation.
Parameters
Device IDselects which B-Box/B-Board to address when used in a multi-device configurationInput modeselects if the decoder considers one GPI input per encoder signal (Single-ended) or two GPI with complementary signals (Differential).DEC moduleselects which GPI inputs are used. See the B-Box datasheet or B-Board datasheet to check where to connect the encoder signals.Pulses per rotationdefines the number of pulses of the A or B signal during one complete rotation of the encoder, as given by the manufacturer.Reset modeselects the counter reset mode. If Z input is selected, the pulse counter value is reset on the rising edge of the Z signal. If maximum value is selected, it is reset as soon as it has reached the number of pulses per rotation.Directiondefines, when A is leading B, if the angle increase (Clockwise) or decreases (Counterclockwise).Invert input signalsconfigures the decoder to consider the inverted logical value of the considered GPI inputs.








