0
\$\begingroup\$

I would like to display a bode plot of a buck-boost converter using Matlab, so I got the figure shown below, If we look closer to the phase plot, we see that it starts from 360°. My wish is to make the graph starts from 0° rather than 360° in order to make the reading easier to me.

  • What should I do to make the phase plot starts from 0° ?
  • Another question is how can I display the gain at a desired crossover frequency in the graph ?

    enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ What was the dynamic system model you used? Do you use the Control System Toolbox, and if so, which command (bode, bodeplot) did you use to plot the bode diagram? \$\endgroup\$
    – Hufi
    Jun 5, 2020 at 19:55
  • \$\begingroup\$ Sometimes I use bode(sys,options) command, and sometimes I use margin(sys). In this display, I have used margin(sys) command. But in both cases I get the phase plot starts from 360° rather than 0° \$\endgroup\$ Jun 5, 2020 at 20:05

1 Answer 1

2
\$\begingroup\$

A possible solution would be to use bodeplot and then change the PhaseMatchingValue property. As an example, I use \$H(s)=\frac{s^4+1}{s+1}\$:

sys = tf([1 0 0 0 1],[1 1]);
h = bodeplot(sys);
p = getoptions(h);
p.PhaseMatching = 'on';
p.PhaseMatchingFreq = 1; 
p.PhaseMatchingValue = 0;
setoptions(h,p);

This results in the following bode diagram

Bode Diagram with PhaseMatchingValue = 0

Another (not very elegant) solution using the command bode

sys = tf([1 0 0 0 1],[1 1]);
wout = logspace(-2,2,201);
[mag,phase,wout] = bode(sys,wout);
wout = squeeze(wout);
mag = squeeze(mag);
phase = squeeze(phase);
%adjusting the phase
phase = phase - 360;
subplot(2,1,1);
% plot amplitude response
semilogx(wout,20*log10(mag));
hold on;
%mark a point at wout(101)
semilogx(wout(101),20*log10(mag(101)),'xr');
text(wout(101),20*log10(mag(101)),'\omega = 1')
%plot phase response
subplot(2,1,2);
semilogx(wout,phase);

Bode diagram using bode

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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