bode phase plot reversed

Thread Starter

suzuki

Joined Aug 10, 2011
119
Hi,

sort of an amateur-ish question, but here goes.

i am trying to plot the bode plot of the following transfer function


i am using the margin(tf) call in matlab, but for some reason the phase plot seems to be reversed. i.e. the plot ranges from +180 degrees to -90 degrees.

What I want is the "typical" phase plot which ranges from 0 degrees to -180 degrees. I can't quite seem to figure out what is causing the plot to do this, as my gain factor is not negative and i have 3 left hand poles.

On a somewhat related note, this transfer function also seems strange to me since, even though i have normalised the denominator to a "standard" form, the numerator still has a s^2 term. So, if i was to find the dc gain, would it be zero?

On its own, this would seem ok, but this doesn't quite make sense to me in terms of control loops. When you want to find the uncompensated open loop gain of the loop at s = 0, because of the s^2 term, you would get 0 for the total gain, which seems odd to me. Ideally, as with most examples found in textbooks, i would want the numerator to be equal to 1, but im not sure how i can go about this.


TIA
 
Last edited:

Georacer

Joined Nov 25, 2009
5,182
Remember that the margin is in degrees, a quantity that has a period of 360.
The range -90 to 180 that Matlab gives is exactly the same as -450 to -180.

If you posted the Bode plot too, it would be nice.

As you said the DC gain is 0. That's ok.
Imagine a system which you want to respond only when it is disturbed. That would mean a certain gain in all of the frequencies and zero output in DC operation.
 

Thread Starter

suzuki

Joined Aug 10, 2011
119
as requested here is the bode plot:
http://i.imgur.com/95Ktk.png

that is a good point that the ranges are the same. however, i am still unsure of why theoretically this would happen. i also quickly tried multiplying my transfer function by i and 1/i to try to move the phase by 90 degrees, but for some reason, i could not get the starting point to be at zero degrees.

regarding your second comment, under closer inspection, i see that my transfer function operates similarly to a bandpass filter. my intial problem was that one of my equations required a 1/dc gain, which would mean infinite in this case, so i guess i will need to find another way around this.
 

Georacer

Joined Nov 25, 2009
5,182
It is very possible that Matlab wraps the phase response to bring it close to 0, or within -180,180 space.

wraptopi is an existent function in Matlab. You might want to search if bode uses it to plot the response.
 

t06afre

Joined May 11, 2009
5,934
As you said the DC gain is 0. That's ok.
Then we talk about gain. We refer to the dB scale unless otherwise noted. Particular then mention bode plaot in the same sentence. And 0 dB is equal to a gain of 1. And that transfer function do not have a DC gain equal to 1. Just a reminder. No big deal :)
 

Georacer

Joined Nov 25, 2009
5,182
I wasn't referring to dB gain, rather to pure V/V gain. I, as much as the OP I guess, come fresh from an academic environment, where dB isn't the norm yet.

The pure math approach of control systems isn't a big fan of a filthy oversimplifying measures such as the dB gain :p
 

t06afre

Joined May 11, 2009
5,934
I wasn't referring to dB gain, rather to pure V/V gain. I, as much as the OP I guess, come fresh from an academic environment, where dB isn't the norm yet. The pure math approach of control systems isn't a big fan of a filthy oversimplifying measures such as the dB gain :p
Nonsense show me a bode plot that do not use use the db scale for magnitude. Have you drawn any bode plot that did not use slope of −/+ 20 dB per decade. Or -/+6 db pr octave rule. If you have done it is actually not a bode plot.
 

Georacer

Joined Nov 25, 2009
5,182
Sure, every bode plot I have drawn is in dB scale.

But for every bode plot they have made me draw, they have previously made me analyze the controller/system in pure gain terms. That's why I said 0 DC gain when I saw the standalone transfer function.
 

Ron H

Joined Apr 14, 2005
7,063
You have 2 zeroes at the origin. Each zero contributes +90° at DC. It sounds to me like your Bode plot is OK.
 

Georacer

Joined Nov 25, 2009
5,182
You have 2 zeroes at the origin. Each zero contributes +90° at DC. It sounds to me like your Bode plot is OK.
And just like that, because no one before cared to take a closer look at the TF, we wasted the OP's time.

Nevertheless, he noted that multiplication by i didn't change anything, when it should have a phase shift by 90deg. That means that he will have to review his method.

And the conversation with t06afre is fun too...

As we say over here: No bad (exists) without good (in it).
 

Thread Starter

suzuki

Joined Aug 10, 2011
119
Hi again,

thought i would just reply here instead of starting a new thread, since i have a related question to my last post. Since my last post, i have developed a compensator to form a closed loop system of the above plant transfer function. Here is the new bode plot of the closed loop system.

http://i.imgur.com/3m5c1.png

so it appears that im getting sufficient gain and phase margin. i had also plotted the nyquist stability of the closed loop and it looked like the point (-1,0) was not enveloped by the plot. both of these things imply that the system should be stable.

However, under inspection of each block in my feedback network, i found that the transfer function of the compensator had a denominator which had a higher order than the numerator. From what i know, this means that the transfer function is unstable. On further review, when i plot the step response of the closed loop system, i get an unstable response.

How can this happen? two of the three plots show stability in the closed loop, but one of the processes (the compensator) is unstable. I guess the other thing was that, am i even plotting the correct bode plots? to get the phase margin and gain margins, should i be observing the open loop or the closed loop?

edit: to tie things up, the reason i want to see a compensator in standard form (order of deno > order of num) is so that i can plug that transfer function into another software, which does not allow the vice versa case.
 
Top