How to find PI controller gains and conduct stability analysis

67 views (last 30 days)
I have a second order digital PLL diagram which is used to estimate motor rotor position from emf signals. What would be the mathematical way to obtain the transfer function for this system and find gains from it? Also how would one conduct a stability analysis for this system using matlab transfer function and bode plots when the gains to the PI controller are unknown.
  1 Comment
Aquatris
Aquatris on 25 Nov 2024 at 9:30
So PI control can be written as:
From there using basic closed loop algebra, you can obtain the closed loop transfer function from reference signal to position as:
From there you can do whatever you want e.g., use routh stability criterion to come up with ranges for Kp and Ki which ensures stability

Sign in to comment.

Answers (2)

Sumukh
Sumukh on 25 Nov 2024 at 5:59
Hi @Afsal,
To perform PI controller tuning and stability analysis of the given system, the individual components of the system: the PI controller, the plant transfer function “1/s” and the feedback-path transfer function (gain of 1 in the system provided) must first be modelled and then multiplied to form the open-loop transfer function. The “tf” command in MATLAB can be used to achieve this. You can refer to the following documentation to know more about this command:
The PI controller can be specifically modelled using the “pid” command with certain initial values for the gains of the controller that can be tuned later. Please refer to the following documentation to know more about this:
To perform stability analysis, the gains of the PI controller are required to be properly tuned along with the plant transfer function. The “pidTuner” app in MATLAB can be used to tune the controller gains. Kindly refer to the following documentation to learn more about the “pidTuner” app:
The app provides the option to automatically tune the controller gains based on required response time and transient behavior. The various bode plots of the system like plant and open-loop transfer function can be assessed from within the app. Kindly refer to the following example of tuning PID controllers using the app:
The gain and phase margins of the open-loop transfer function can be assessed for the stability of the system. The “bode” command creates a bode plot of the transfer function and provides tooltips regarding the margins and closed-loop stability of the given open-loop transfer function. Please refer to the following documentation to understand more about assessing stability of feedback-based systems:
I hope this answers your query.

Pavl M.
Pavl M. on 25 Nov 2024 at 5:54
Edited: Pavl M. on 25 Nov 2024 at 5:55
The answer to the 2 questions:
1.
What would be the mathematical way to obtain the transfer function for this system and find gains from it?
let reference signal = r;
position(rad) = y;
then the transfer function from r to y (I calculated it algebraically):
Let parallel PI form: PIp = Kpp + Kip/s, series PI form PIs = Kps(1+Kis/s)
in discrete: ideal(series) PI = P*(1+(z))
parallel PI:
(y/r)(s) = ((Kpp*s^2) + Kip )/ (Kip + (1-Kpp)*s^2)
series (aka ideal) PI:
(y/r)(s) = ((Kps*Kis*s^2) + Kis)/ (Kis + (1-Kps*Kis)*s^2)
I can do it in discrete time / frequency case ( in z-domain) as well if you accept the my answer and hire contact me for.
by Tustin/Bilinear continuous to discrete: s -> (2/Ts)*(z-1)/(z+1)
Then the gains are Kpp, Kip, Kps, Kis you can find in most simpler and clear way from the transfer function desired behaviour by zeroes poles placement or via settling time, rise time, margins, overshoot, undershoot formulas for the resultant second order closed loop system. (let me know if you need to construct the exact expressions/formulas further).
2.
How would one conduct a stability analysis for this system using matlab transfer function and bode plots when the gains to the PI controller are unknown?
figure
w = logspace(2,6,1000);
bode(closed_loop_tr_f_in_2_vectors_form,w),grid
In TCE NCE MPPL Matlab/Octave you can check whether the resultant closed loop system is stable (and also is stabilizable in Octave already, not yet in Matlab) by just invoking built-in function:
In TCE NCE MPPL transfer function is presented as 2 vectors b for numerator and a for denumerator coefficients.
%for instance for parallel PI form: (for seria(ideal) the way is the same, just the transfer function denominator and numerator coefficient to substitute accordingly):
isstable(tf2ss([Kpp 0 Kip] [1-Kpp 0 Kip]))
With Bode:
closed_loop_tr_f_in_2_vectors_form = tf([Kpp 0 Kip] [1-Kpp 0 Kip])
figure
w = logspace(2,6,1000);
bode(closed_loop_tr_f_in_2_vectors_form,w),grid
%In Octave also isstabilizable(y/r(s))
isstabilizable(tf2ss([Kpp 0 Kip] [1-Kpp 0 Kip]))
Another way is to find and check the zeros and poles locations and so stability from the transfer function mathematically or via root locus analysis (can do it if you hire me).

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!