I have a little problem which I cannot understand, control theory is not my specialty but I have been reading on it lately.

I have a buck-boost converter which I modeled on matlab and I am trying to control it with a PD compensator. However, I cannot achieve what is asked in the example namely a crossing frequency of less than 20 KHz and a phase margin of at least 52 degrees.

I suspect I might need to add an extra pole in the PD transfer function but I do not know how to choose the particular pole.

Here is my matlab code so far:

clear all

Tu0 = [10.417];
num = Tu0*[-6.51e-6 1];
denom = [1.72e-8  3.25e-5 1];
Tu = tf(num, denom);

%Compensator (PD)
Gc0 = [0.37];
num2 = Gc0*[5.06e-4 1];
denom2 = [1.54e-7 1];
Ts = tf(num2, denom2);

%Compensated loop gain
Tf = Tu* Ts;

%%Bode Plot
 grid on
 hold on

%Stability numbers
[Gm,Pm,Wgm,Wpm] = margin(Tf);
GainFreq = Wgm / (2*pi)
GainMargin = Gm
CrossoverFreq = Wpm /(2*pi) %Crossover frequency has to be less than 10% of the switching frequency: fc <20 KHz
PhaseMargin = Pm  %Phase Margin of at least 52

Thank you in advance for any hint!

  • \$\begingroup\$ Do you have the Control System Designer app for matlab? I was able to meet thosre requirements using the PID and the Optimization Based tuners. Will add my results as answer shortly... \$\endgroup\$ Commented Apr 20, 2018 at 1:43
  • \$\begingroup\$ I actually have never used simulink, I am solving it with 'a pen and paper'. I am simply using the theory from the Chapter 9 of "Fundamentals of Power electronics" and computing the bode diagrams just like in the code above. \$\endgroup\$
    – Fenrir
    Commented Apr 20, 2018 at 1:55

1 Answer 1


Assuming that you can use the Control System Designer app, load the system transfer functions for blocks C and G in "Edit Architecture". For C just use any untuned PD transfer function (like s+1).

Now, open a "Closed-Loop Bode Editor", right-click it and add the phase margin and crossover frequency requirements. There isn't an option named "crossover frequency", but you can use an upper gain limitation to the same effect.

After the requirements are set, open an "Optimization Based Tuning", follow the steps and check both parameters of C to be tuned (Gain and Zero placement). It finds a feasible solution after 14 iterations.

$$ C(s) = 2.27\times10^{-5} (s+1.49\times10^4) $$

enter image description here

Disclosure: I am getting my masters in control systems, but I'm a "numeric solver enthusiast". I would not know, from top of head, to obtain this in a pen-and-paper method, but search for "lead-lag compensators" and you will be on track.

  • \$\begingroup\$ Read about lead-lag RC filters \$\endgroup\$ Commented Apr 20, 2018 at 13:59
  • \$\begingroup\$ Thank you both, I have managed to get the poles and zero values from calculations! \$\endgroup\$
    – Fenrir
    Commented Apr 20, 2018 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.