Repository navigation
If Entering A Transfer Function Via "roots' Instead of As Polynomials, The Step Response Is A Bit Degrated #1246
Replies: 1 comment
|
One thing first: in python-control, entering a transfer function by roots and by polynomial coefficients gives you the same object. ct.zpk(zeros, poles, k) just expands to num/den internally, so Gc_roots = ct.zpk(zeros, poles, k)
Gc_poly = ct.tf(num, den)end up with the same num/den, and step_response gives the same curve for both (I checked, the difference is 0). So if the two plots differ, the two compensators are not actually the same system, even though they are meant to be. The useful clue is that both responses settle to the same final value. Your loop has an integrator (the pole at the origin in the Type III), which gives zero steady-state error no matter the gain. So a difference that keeps the final value the same but makes one transient ring and the other smooth is almost always a difference in loop gain / phase margin, not in the poles and zeros. The usual reason is the gain. In zero-pole-gain form the k multiplies (s-z1)(s-z2).../(s-p1)(s-p2)..., so it is the high-frequency (leading coefficient) gain. For a Type III with widely spaced roots that is a very different number from what you get if you type polynomial coefficients scaled for a certain crossover. If the two gains do not match, the crossover and phase margin differ, so one closed loop is well damped (smooth) and the other is lightly damped (the rippled look), while both still end at the same value because of the integrator. To check it, compare the two directly instead of assuming they are equal: print(Gc_roots, Gc_poly)
print(Gc_roots.poles(), Gc_roots.zeros())
print(Gc_poly.poles(), Gc_poly.zeros())
print(ct.margin(Gc_roots * plant)) # gain margin, phase margin, wg, wp
print(ct.margin(Gc_poly * plant))If the gain or phase margins come out different, that is your answer: fix the gain so the zpk k matches the polynomial version at the crossover. If the margins match and the curves still differ, paste both compensator functions and I can look. (Building the compensator by multiplying first/second order factors or in state space is fine numerically here, just make sure the overall gain is the one you want.) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello community,
I am simulating the response of a buck converter along with a Type III compensator. As I am developing two Type III compensator functions, for flexibility in how I might enter the compensator values, either as roots or as polynomials, I noticed that if I enter the compensator values in polynomial format, the response is ideal. However, if I enter the values as roots, the step response is less than ideal. The following screenshot is the step response using the same Type III compensator transfer function but entering the values both as 'roots' vs. polynomial format.
Has anyone had similar experiences? If so, is there a workaround?
All reactions