.

MPIFilterConfig / MEIFilterConfig

Definition: MPIFilterConfig

typedef struct MPIFilterConfig {
    long           gainIndex;
    MPIFilterGain  gain[MPIFilterGainCOUNT_MAX];

    MPIObjectMap   axisMap;
    MPIObjectMap   motorMap;
} MPIFilterConfig;

Description

MPIFilterConfig contains the configuration information for the Filter object.

 
gainIndex Gain table index. The gain table index range is from 0 to MPIFilterGainCOUNT_MAX -1. Although the user application can get or set the gainIndex directly when the gainSwitchType is MEIXmpSwitchTypeNONE, it is recommended to use mpiFilterGainIndexGet(...) and mpiFilterGainIndexSet(...) methods for best performance.
gain An array of filter coefficient gain tables. The array size is MPIFilterGainCOUNT_MAX. See MPIFilterGain.
axisMap For legacy applications. Do not use. See MPIObjectMap.
motorMap For legacy applications. Do not use. See MPIObjectMap.

 

Definition: MEIFilterConfig

typedef struct MEIFilterConfig {
    char                  userLabel[MEIObjectLabelCharMAX+1]; 
                               /* +1 for NULL terminator */
MEIXmpAlgorithm Algorithm; MEIXmpAxisInput Axis[MEIXmpFilterAxisInputs]; long *VelPtr; MEIXmpSwitchType GainSwitchType; float GainDelay; long GainWindow; MEIXmpSwitchType PPISwitchType; MEIXmpPPIMode PPIMode; float PPIDelay; long PPIWindow; MEIXmpIntResetConfig ResetIntegratorConfig; float ResetIntegratorDelay; MEIXmpFilterForm PostFilterForm; MEIXmpPostFilter PostFilter; } MEIFilterConfig;
  Change History: Modified in the 03.04.00. Modified in the 03.03.00.

Description

MEIFilterConfig contains controller (or firmware) specific configuration information for the Filter object. For features that require custom firmware, see Controller Firmware.

 
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 MEIXmpAlgorithm.

Axis
[MEIXmpFilterAxisInputs]
This array defines the axis (pointer to the axis) and coefficient for the position input into the filter. The array size is MEIXmpFilterAxisInputs. The input to the filter is the position error of the axis, which is multiplied by the coefficient defined by the Axis array. See MEIXmpAxisInput.
*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 MEIXmpSwitchType. The switch type MEIXmpSwitchTypeMOTION_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 MEIXmpSwitchTypeWINDOW 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 MEIXmpPPIMode.
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.
PostFilterForm

This value specifies the post-filter type applied to the closed-loop control algorithm output. The post-filter parameters are specified by the PostFilter. See MEIXmpPostFilterForm.

Although the postfilter may be configured through this structure, it is strongly recommended that users use the meiFilterPostfilterGet(...) and meiFilterPostfilterSet(...) methods.

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 meiFilterPostfilterGet(...) and meiFilterPostfilterSet(...) methods.

Sample Code

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

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

long isAlgorithmPid(MPIFilter filter, long* isPid)
{
     MEIFilterConfig xmpConfig;    
     long returnValue = (isPid==NULL) ? MPIMessageARG_INVALID : MPIMessageOK;

     if (returnValue == MPIMessageOK)    
     {        
         returnValue =            
             mpiFilterConfigGet(filter, NULL, &xmpConfig);
         if (returnValue == MPIMessageOK)
         {            
             *isPid = (xmpConfig.Algorithm == MEIXmpAlgorithmPID) ? TRUE : FALSE; 
         }    
      }    

      return returnValue;
}

See Also

mpiFilterConfigGet | mpiFilterConfigSet | meiFilterPostfilterGet |
meiFilterPostfilterSet | meiFilterPostfilterSectionGet | meiFilterPostfilterSectionSet

 

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