Class TPU_FQD

  • All Implemented Interfaces:
    Impc555, IntbMpc555HB, Ippc32

    public class TPU_FQD
    extends Object
    implements IntbMpc555HB
    Decoding of quadrature coded signals (FQD - Fast Quadrature Decoding) with TPU-A or TPU-B. Quadrature coded signals are generally used to measure the angular position of a motor axis. For this purpose a signal pair is used (signal A,B). The following operations can be used on all 16 channels of the TPU-A or TPU-B. However, make sure to use two adjacent channels for the signal pair.
    • Field Detail

      • channel

        int channel
      • diff

        int diff
    • Constructor Detail

      • TPU_FQD

        public TPU_FQD​(boolean tpuA,
                       int channel)
        Creates a FQD function on two adjacent TPU pins.
        channel and channel+1) will be used for FQD function.
        The signal A of the encoder has to be connected to the TPU pin channel, while signal B has to connected to the pin channel+1.
        Parameters:
        tpuA - true: use TPU-A, false: use TPU-B.
        channel - First TPU channel to initialize. Allowed values are 0..14. The second channel channel+1 will be initialized as well.
    • Method Detail

      • getPosition

        public short getPosition()
        Reads the actual encoder position.
        Returns:
        Actual encoder position.
      • setPosition

        public void setPosition​(int pos)
        Sets the encoder position to a given value.
        Parameters:
        pos - New position to be set.