mpiFilterPostFilterSectionSet

Declaration

int32_t mpiFilterPostFilterSectionSet(MPIFilter                   filter,
                                   int32_t                        sectionNumber,
                                   MPIFilterPostFilterSection  *section);

Required Header: stdmpi.h

Description

mpiFilterPostFilterSectionSet sets the configuration of a single section of an MPIFilter object's postfilter. It sets filter's postfilter sectionNumberth section to the configuration specified in *section. If the postfilter type is IIR, then this method is essentially equivalent to mpiFilterPostFilterSet().

The MPI calculates the post filter coefficients taking into consideration the sample rate of the controller at that time. If you change the change the sample rate of the controller, you will need to recalculate your post filters. This can be done for all filters specified in Hertz by setting the filters again using the MPI. The MPI will calculate the filters using the current servo sample rate.

Postfilters are used to digitally filter the output of a control loop. One common use for postfilters is the compensation of system resonances.

filter the handle of the MPIFilter object whose postfilter section configuration is to be set.
sectionNumber the index of the postfilter section whose configuration is to be set.
*section the data location of the section configuration to copy to the controller.
Return Values
MPIMessageOK

Sample Code

/*   Set a section of a MPIFilter object's postfilter 
     to a unity gain filter type.   
     Sample usage:   

     returnValue =        
         setSectionTypeUnityGain(filter, 3);
*/int32_t setSectionTypeUnityGain(MPIFilter filter, int32_t sectionIndex)
{
    MPIFilterConfig config;    
    MPIFilterPostFilterSection section;    
    int32_t returnValue;    

    section.type = MPIFilterPostFilterSectionTypeUNITY_GAIN;    
    section.form = MPIFilterPostFilterformBIQUAD;    

    returnValue =       
        mpiFilterPostFilterSectionSet(filter, sectionIndex, §ion);    

    return returnValue;
}

See Also

MPIFilterPostFilterSection | mpiFilterPostFilterSet | meFilterPostfilterSectionGet | MPIFilterPostFilterSectionCOUNT_MAX | Post Filter Theory