# Phase margin for a system (design of PD controller)

I have a system with the following transfer function:

$$\G(s)=\cfrac{20}{s^2+s+20K_f}\$$

where $$\K_f=1.75\$$

I want to use a PD controller and I want obtain a phase margin of 35 degrees. I need to determine the parameters ($$\K_p \text{ and } K_D\$$) for the PD controller.

I made a Bode plot in Scilab for G(s):

As I want a phase margin of -10º, I would have to see the $$\f_0\$$ for which I have a phase of $$\\phi=-10-180=-190º\$$, but with -190º the system is unstable.

I can not determine $$\f_0\$$ from the Bode Plot, because the graph only reaches -180º. How can I design the PD controller for this system?

• You want it to be an oscillator then? – Andy aka Jan 28 '20 at 12:26
• @Andyaka No, I want to know if I can design a PD controller in order to have the entire system (with controller) with 35º phase margin. – Carmen González Jan 28 '20 at 12:29
• I would resort to classical pole-zero placement then convert them into $k_p$ and $k_d$ parameters. However, before you do this, you have to select a crossover frequency $f_c$ and extract the magnitude and phase at this point from your Bode plot. Then you'll know how much gain (or attenuation) and phase boost are needed at $f_c$ to satisfy your phase margin design. You can have a look at a seminar I taught at APEC some time ago, I showed how to match PID parameters with poles and zeroes: cbasso.pagesperso-orange.fr/Downloads/PPTs/… – Verbal Kint Jan 28 '20 at 12:35
• @CarmenGonzález why are you saying you want a phase margin of -10 if in fact you want a phase margin of +35? You currently have a PM of about 20 deg so what are you really trying to achieve? – Andy aka Jan 28 '20 at 12:49
• @Andyaka I want a phase margin of 35º with the controller. Since the controller increases 45 degrees in the phase for high frequencies, so I want to obtain a "phase margin" for the system without controller of -10º (35º-45º). In summary, I want a phase margin of 35º for the system with the controller. I need to find Kp and Kd for the controller. – Carmen González Jan 28 '20 at 13:16

If I understood well, you want to compensate the plant whose transfer function is given so that once compensated you have a phase margin of 35°. The plant transfer function is $$\H(s)=H_0\frac{1}{\tau_2s^2+\tau_1s+1}\$$ with $$\H_0=\frac{1}{k_f}\$$, $$\\tau_1=\frac{1}{20k_f}s\$$ and $$\\tau_2=\frac{1}{20k_f}s^2\$$. The plot I got from Mathcad is this one and matches yours:
Then, you need to pick a crossover frequency $$\f_c\$$ at which you will measure the open-loop phase margin of 35°. Let's take $$\f_c=10\;Hz\$$. What is the attenuation of the plant at $$\f_c\$$ and what is its phase?
Determine what the $$\k_p\$$ coefficient should be based on the zero position and plot the open-loop gain $$\T(s)\$$:
The crossover frequency is 10 Hz as arbitrarily selected and the phase margin is 35°. The compensator transfer function is $$\G_1(s)\$$ in the picture. Is this what you wanted to see?