.

MPIMotorLimitConfig and Motor Limit Configuration

Two fields, directionFlag and duration, are built into the MPIMotorLimitConfig{} structure. From motor.h:


typedef enum {
    MPIMotorEncoderFaultMaskNONE     = 0x0,

    MPIMotorEncoderFaultMaskBW_DET   = mpiMotorEncoderFaultMaskBIT(MPIMotorEncoderFaultBW_DET),
    MPIMotorEncoderFaultMaskILL_DET  = mpiMotorEncoderFaultMaskBIT(MPIMotorEncoderFaultILL_DET),
    MPIMotorEncoderFaultMaskABS_ERR  = mpiMotorEncoderFaultMaskBIT(MPIMotorEncoderFaultABS_ERR),

    MPIMotorEncoderFaultMaskALL      = (mpiMotorEncoderFaultMaskBIT(MPIMotorEncoderFaultLAST) - 1)
} MPIMotorEncoderFaultMask;

typedef union {
    int32_t	polarity;	/* 0 => active low, else active high */
    int32_t	position;	/* MPIEventTypeLIMIT_SW_[POS|NEG] */
    float	error;		/* MPIEventTypeLIMIT_ERROR */
    int32_t	mask;		/* MPIEventTypeENCODER_FAULT */
} MPIMotorLimitTrigger;

 typedef struct MPIMotorLimitConfig {
          MPI_BOOL              enable;
          MPIAction             action;
          double                duration; /* seconds */
          MPIMotorLimitTrigger  trigger;
      } MPIMotorLimitConfig;

The duration field may used in the configuration of all MPI Motor Events. A positive value for this field will require the limit condition to exist for duration seconds before an event will occur. This field is useful in overriding noisy limit inputs. For example, an overtravel limit with infrequent short (< 1msec) noise spikes on the limit input will ignore the noise of the limit is configured with a duration of 0.05. A spike whose duration was at least 0.05 seconds (50 milliseconds) would be required before an overtravel event would occur. The default value for duration is 0.0.

Return to MPIMotorLimitConfig

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering