May 25, 2020

MMT servos - KSS - Output "35 Hz" notch

This is labeled num(x)/den(x) in the model. This is the third of 4 filters that process servo output The routine that sets up these filters looks like this:
void
flexmode_init ( void )
{
        flex_n567 = n567_init ();
        flex_n20 = n20_init ();
        flex_n35 = n35_init ();
        flex_ho = ho_init ();
}
The 35 Hz notch filter is set up as follows:
/* 35 Hz notch -- Order 8 */
/* Tested OK 8-12-2010 */
/* Tested OK 1-23-2014 */
/* matches orignal to 1.0e-8 (could be better ?!) */
/* same old and new el model */
/* broad notch from 20-50 Hz centered at 35 Hz */
struct sos_info *
sos_n35_init ( void )
{
        static double a_data[8] = { 6.8217957422029460E+00, -2.0466274673086829E+01, 3.5301941866539323E+01,
            -3.8327087090874912E+01, 2.6845564024052106E+01, -1.1857576023044318E+01,
            3.0221646885382398E+00, -3.4052876963220202E-01 };
        static double c_data[8] = { -1.5530532862939417E-01, 9.4508953161017928E-01, -2.4748323531014549E+00,
            3.6210887553930462E+00, -3.2029853171924465E+00, 1.7158060191765028E+00,
            -5.1624912269383438E-01, 6.7387836190452743E-02 };
        static double d_data = 9.1180382278537264E-01;

        return sos_init ( a_data, c_data, d_data, 8 );
}
Note that, as for the "6 Hz" notch filter, newer versions of Matlab produce a DTF filter rather than an SOS filter for this.