11.1.2 MOTF QuadratureDecoder Configuration |
The incoming raw encoder data is scaled by QuadratureDecoderModuleDistancePerCount, thus mapping the encoder counts to linear distances, and allowing us to measure the belt position.
When tracking is active, the difference between the current belt position and a given reference position can be transformed so as to define the Current MOTF Offset in the user's frame of reference.
This transformation can be written as:
Current MOTF Offset = (θx ; θy ; θz) * (Current Belt Position – Reference Belt Position) + (bx ; by ; bz)
where θ and b are defined by MotfConfigMainDirection and MotfConfigOffset, respectively.
As will be explained later in this section, if we want tracking to be triggered when the current belt position reaches a certain distance from a given reference position, it is important that the measured belt position increases when the part is moving towards the scanner.
However, the encoder wiring might be connected to the SP-ICE-3 Card so that it reports apparently decreasing positions, even though the belt is actually moving in the positive direction towards the scanner.
In this case, the decoder’s counting direction can be reversed by setting QuadratureDecoderModuleInvertDirection to true.
If the encoder provides an Index signal (also known as home
or reference
signal), the card can be instructed to make use of it
by setting QuadratureDecoderModuleEnableIndex to true.
When enabled, the card will reset the decoder position each time its Index input is asserted.
Instead of (or even despite) connecting external encoder hardware to the SP-ICE-3 Card, the card's built-in encoder simulator can be activated.
The simulated encoder is of particular interest either for debugging purposes, or for applications where the part velocity is sufficiently constant to render a hardware encoder unnecessary.
The flag QuadratureDecoderModuleSimulateEncoder defines whether the module’s encoder signals are fed from an external encoder (flag is false) or from a built-in generator (flag is true).
The methods QuadratureDecoderModuleSimulationSpeed and QuadratureDecoderModuleSimulationAcceleration allow us to specify a new velocity for the simulated encoder, and that it should take effect either instantaneously, or gradually. The latter may be used, for instance, to simulate the conveyor belt’s gradual ramping to the new target velocity.