steveneads Posted April 28, 2017 Share Posted April 28, 2017 Hi I'm trying to use the filter generator to generate the coefficient for a 1st order low pass filter. My servo frequency is 4kHz and the initial proportional gain is 1, and I've chosen a corner frequency of 200Hz. The filter generator calculates kd1 = -0.728489 and proposes a new gain of 0.13575 (see attached screen grab). I don't understand how the calculator arrives at this proposed gain value! The reference manual states: "Note that the “DC gain” of this filter is equal to 1 divided by the sum of 1 plus all of the coefficients used, and this gain is part of the overall servo-loop gain" - and this comment seems correct to me. This implies that the gain of the filter is 1/(1-0.728489) = 3.6831. I would therefore assume that the proposed gain should be 1/3.6831 = 0.2715, to compensate for the filter. This is a factor of 2 different from the value proposed by the generator. Can you explain this please? Thanks. Link to comment Share on other sites More sharing options...
Alex Anikstein Posted May 1, 2017 Share Posted May 1, 2017 That note describes the relationship between the kdi terms and the dc gain, but it is not the only parameter that goes into the proposed Kp; reading it with the equivalent note from Motor[x].Servo.Kci paints the fuller picture. The DC gain is equal to 1 plus all of the kci coefficients divided by the sum of 1 plus all of the kdi coefficients. Despite all of the terms appearing on the same page, the manual seems to distinguish between the Kci and Kdi terms as being two distinct filters. In this case: (1 + Motor[x].Servo.Kc1) / (1 + Motor[x].Servo.Kd1) = 2/0.27151... = 7.366, and 1 / 7.366 = 1.35755. Link to comment Share on other sites More sharing options...
steveneads Posted May 3, 2017 Author Share Posted May 3, 2017 Thanks for your explanation. I know it's a typo, but 1 /7.366 = 0.135755 ! Link to comment Share on other sites More sharing options...
Recommended Posts