How to compute control system's performance parameters?

7 views (last 30 days)
John Doe on 31 Jul 2020
Edited: Paul on 1 Aug 2020
Hello everyone.
J = 0.2;
b = 0.1;
K = 0.2;
R = 10;
L = 5;
s = tf('s');
p = K/((J*s+b)*(L*s+R)+K^2);
step(p,200)
[y,t]=step(p,200);
stepinfo(y)
With the following code, I want to measure the rise time. Using the stepinfo command, this is what pops in my command window :
ans =
struct with fields:
RiseTime: 94.5571 %%Rise time
SettlingTime: 172.5924
SettlingMin: 0.1735
SettlingMax: 0.1923
Overshoot: 0
Undershoot: 0
Peak: 0.1923
PeakTime: 1378
But when I check the parameters using the step response graph, the answer is different.
So, why am I getting two different rise times? Any solution?

Star Strider on 31 Jul 2020
You are not calling stepinfo correctlly.
stepinfo(p)
produces:
ans =
struct with fields:
RiseTime: 4.4144
SettlingTime: 8.0108
SettlingMin: 0.1735
SettlingMax: 0.1923
Overshoot: 0
Undershoot: 0
Peak: 0.1923
PeakTime: 23.2961
.

Paul on 31 Jul 2020
Edited: Paul on 1 Aug 2020
stepinfo(y,t)
If you want to use the output from step. Note that stepinfo using the transfer function gives a peculiar result for PeakTime:
>> sy=stepinfo(y,t)
sy =
struct with fields:
RiseTime: 4.414431198715340e+00
SettlingTime: 8.010849818943374e+00
SettlingMin: 1.734586244553206e-01
SettlingMax: 1.923076923076916e-01
Overshoot: 0
Undershoot: 0
Peak: 1.923076923076916e-01
PeakTime: 6.428571428571429e+01
>> sp=stepinfo(p)
sp =
struct with fields:
RiseTime: 4.414430957167118e+00
SettlingTime: 8.010849940068825e+00
SettlingMin: 1.734589587177580e-01
SettlingMax: 1.923064745779809e-01
Overshoot: 0
Undershoot: 0
Peak: 1.923064745779809e-01
PeakTime: 2.329614202821439e+01
PeakTime from stepinfo(y,t) is just taking the time at the first value that is the maximum of y. Maybe it should take the time at the last value that is the max?
>> [ymax,imax]=max(y);
>> t(imax)
ans =
6.428571428571429e+01
>> all(y(imax:end)==ymax)
ans =
logical
1
It appears that stepinfo(p) works by first generating a step response yy for some time vector tt and then essentially calling stepinfo(yy,tt). In this case, the time vector used by stepinfo(yy,tt) ended at the PeakTime, which also corresponds to max(yy).
I'm suprised by this result for this p. I would've thought that stepinfo would catch the case of all real, negative poles and then just compute the peak value as the final value (which can be determined without generating yy) and assigning the PeakTime = inf.