Loop shaping error

I have a plant transfer function (Gp) as shown,

The GCF is at 20 kHz, and my intended switching frequency is 20 kHz, so as a first step in shaping the loop gain I try to shift it to a new desired GCF at 3 kHz. Gp has an excess gain of 20.1 dB at 3 kHz, so compensator magnitude at 3 kHz should be -20.1 dB.

Next the phase of Gp at 3 kHz is 219 degrees, so if I want a Phase margin of 60 degrees, required phase boost from compensator is 39 + 60 ~= 100 degrees.

Now a double pole-zero pair type compensator can be used to provide boost > 90 deg. I choose my f_peak = 3 kHz.
$$f_{peak} = 3 kHz$$ $$\ k = \tan\left( \dfrac{boost}{4} + \dfrac{\pi}{4} \right) \\ \$$

$$\ f_p = k.f_{peak} = 8242.4 Hz\$$

$$\ f_z = f_{peak}/k = 1090.9 Hz \$$

Finally my compensator has a double pole-zero pair with an integrator at the origin.

However, no matter how I choose the integrator gain, I never seem to get positive gain margin, even if I get positive phase margin. How to choose the integrator's gain and where am I going wrong?

• Have you considered that you might need something other than a single integrator? (I haven't done any analysis so you might not, but it's worth considering.) Nov 27, 2022 at 19:09
• Greatest Common Factor = GCF??? Nov 27, 2022 at 20:15
• @Andyaka Gain crossover frequency I mean, sorry!
– SM32
Nov 27, 2022 at 21:10
• I suspect you got mislead by the 360° point at 0 Hz displayed by Matlab. Add -360° to the whole curve and it will start at 0° (which is the same) but then the phase at which you determine the wanted boost will be -141° which makes better sense. You can't have a positive phase for the plant here. From this -141°, determine the boost and compute the pole and zero of the type 2. Nov 27, 2022 at 21:40
• @VerbalKint Thank you - I did calculate by subtracting 360 from the plot. 141 lag is 219 lead, so my required boost would be 39 + 60 = 99 deg. I substituted 100 in the calculation of k. Am I wrong?
– SM32
Nov 27, 2022 at 21:51