MPIFilterConfig

Definition

typedef struct MPIFilterConfig {
   MPIFilterGain                    gain[MPIFilterGainCOUNT_MAX];
   char                             userLabel[MPIObjectLabelCharMAX+1]; /* +1 for NULL terminator */
   
   MPIFilterAlgorithm               algorithm;
   MPIFilterAxisInput               axis[MPIFilterAxisInputCOUNT_MAX];
   int32_t                             *velPtr;
   
   MPIFilterSwitchType              gainSwitchType;
   double                           gainDelay;
   int32_t                             gainWindow;
   MPIFilterSwitchType              PPISwitchType;
   MPIFilterPPIMode                 PPIMode;
   double                           PPIDelay;
   int32_t                             PPIWindow;
   MPIFilterIntegratorResetConfig   resetIntegratorConfig;
   double                           resetIntegratorDelay;
   
   MPIFilterPostFilterConfig        postFilter;
} MPIFilterConfig;

 

Required Header: stdmpi.h

Change History: Modified in 04.00.

Description

MPIFilterConfig contains the configuration information for the Filter object.

gain An array of filter coefficient gain tables. The array size is MPIFilterGainCOUNT_MAX. See MPIFilterGain.
userLabel This value consists of 16 characters and is used to label the filter object for user identification purposes. The userLabel field is NOT used by the controller.
algorithm This value defines the closed-loop control algorithm that the controller's filter object will execute every servo cycle. See MPIFilterAlgorithm
axis This array defines the axis and coefficient for the position input into the filter. The array size is MPIFilterAxisInputCOUNT_MAX. The input to the filter is the position error of the axis, which is multiplied by the coefficient defined by the Axis array. See MPIFilterAxisInput.
*VelPtr Pointer to a velocity value for algorithms that require a velocity input (such as the PIV algorithm).
gainSwitchType This value specifies the switch type for the gain table index. See MPIFilterSwitchType. The switch type MPIFilterSwitchTypeMOTION_ONLY is supported by standard firmware. All other gain switch types require custom firmware.
gainDelay This value specifies a delay between when the gain switch conditions are met and when the gain table index value is updated. This allows the gain table switching to be delayed. Units are in seconds. This feature requires custom firmware; it is NOT available in standard firmware.
gainWindow This value specifies the position window between when the gain switch conditions are met and when the gain table index value is updated. This allows the gain table switching to be delayed. It is only valid with the MPIFilterSwitchTypeWINDOW gain switch type. Units are in raw position counts. This feature requires custom firmware; it is NOT available in standard firmware.
PPISwitchType This value specifies the switch type for the P/PI velocity mode bit. This value is for legacy analog controllers and is not available for SynqNet controllers. This feature requires custom firmware; it is NOT available in standard firmware.
PPIMode This value specifies the mode for the P/PI velocity loop calculation and P/PI switch type. See MPIFilterPPIMode.
PPIDelay This value specifies a delay between when the P/PI switch conditions are met and when the P/PI bit is updated. This allows the P/PI switching to be delayed. Units are in seconds. This value is for legacy analog controllers and is not available for SynqNet controllers. This feature requires custom firmware; it is NOT available in standard firmware.
PPIWindow This value specifies the position window between when the P/PI switch conditions are met and when the P/PI bit is updated. It allows the P/PI switching to be delayed. Units are in raw position counts. This feature requires custom firmware; it is NOT available in standard firmware.
resetIntegratorConfig This value specifies the mode (enabled or disabled) for the reset integrator feature. This value is for legacy analog controllers and is not available for SynqNet controllers. This feature requires custom firmware; it is NOT available in standard firmware.
resetIntegratorDelay This value specifies a time duration to force the integrator sum to zero, after the command trajectory is complete and the motor is settling. Units are in seconds. This feature requires custom firmware; it is NOT available in standard firmware.
postFilter This structure specifies the configuration for the filter's postfilter (type, length, and values for the postfilter coefficients). Postfilters are used to digitally filter the output of a control loop. One common use for postfilters is the compensation of system resonances. Although the postfilter may be configured through this structure, it is strongly recommended that users use the mpiFilterPostFilterGet and mpiFilterPostFilterSet methods.

 

Sample Code

/*   Test whether an MPIFilter object's control loop algorithm is PID.
     Sample usage:   

     returnValue =        
         isAlgorithmPid(filter, &isPid);
*/

int32_t isAlgorithmPid(MPIFilter filter, int32_t* isPid)
{
     MPIFilterConfig filterConfig;    
     int32_t returnValue = (isPid==NULL) ? MPIMessageARG_INVALID : MPIMessageOK;

     if (returnValue == MPIMessageOK)    
     {        
         returnValue =            
             mpiFilterConfigGet(filter, &filterConfig);
         if (returnValue == MPIMessageOK)
         {            
             *isPid = (filterConfig.algorithm == MPIFilterAlgorithmPID) ? TRUE : FALSE; 
         }    
      }    

      return returnValue;
}

See Also

mpiFilterConfigGet | mpiFilterConfigSet | mpiFilterPostFilterGet | mpiFilterPostFilterSet | mpiFilterPostFilterSectionGet | mpiFilterPostFilterSectionSet