DEC – Angle decoder input
Table of Contents
The angle decoder (DEC) block decodes quadrature-encoded signals produced by incremental encoders for motor drive applications.
The B-Box RCP and B-Board PRO 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.
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
sim
input 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 ID
selects which B-Box/B-Board to address when used in a multi-device configurationInput mode
selects if the decoder considers one GPI input per encoder signal (Single-ended) or two GPI with complementary signals (Differential).DEC module
selects which GPI inputs are used. See the B-Box datasheet or B-Board datasheet to check where to connect the encoder signals.Pulses per rotation
defines the number of pulses of the A or B signal during one complete rotation of the encoder, as given by the manufacturer.Reset mode
selects 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.Direction
defines, when A is leading B, if the angle increase (Clockwise) or decreases (Counterclockwise).Invert input signals
configures 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 ID
selects which B-Box/B-Board to address when used in a multi-device configurationInput mode
selects if the decoder considers one GPI input per encoder signal (Single-ended) or two GPI with complementary signals (Differential).DEC module
selects which GPI inputs are used. See the B-Box datasheet or B-Board datasheet to check where to connect the encoder signals.Pulses per rotation
defines the number of pulses of the A or B signal during one complete rotation of the encoder, as given by the manufacturer.Reset mode
selects 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.Direction
defines, when A is leading B, if the angle increase (Clockwise) or decreases (Counterclockwise).Invert input signals
configures the decoder to consider the inverted logical value of the considered GPI inputs.