how to change the rise time of step input in simulink

21 ビュー (過去 30 日間)
Swasthik Baje Shankarakrishna Bhat
Swasthik Baje Shankarakrishna Bhat 2022 年 9 月 19 日
回答済み: Paul 2022 年 9 月 22 日
Hello,
I want to change the rise time of the step input in simulink. I tried the transfer function 1/(s+1) but not satifying my requirement. Can someone suggest me some tricks. Thanks in advace.
Regards,
Swasthik
  2 件のコメント
Sam Chak
Sam Chak 2022 年 9 月 19 日
Can you specify all the performance requirements?
What did you mean by "tried the transfer function"? What is that transfer function for? For Plant, Actuator, or Compensator, or Prefilter? If possible, please the Plant transfer function.
Swasthik Baje Shankarakrishna Bhat
Swasthik Baje Shankarakrishna Bhat 2022 年 9 月 21 日
Hi sam,
i just need a step input with variable rise time. Something like this,
Thanks and regards,
Swasthik

サインインしてコメントする。

採用された回答

Sam Chak
Sam Chak 2022 年 9 月 21 日
編集済み: Sam Chak 2022 年 9 月 22 日
Edit: I created a general one so that you can enter the desired ramp up parameters:
% u = min(1, max(0, "Linear Line function"));
ramp_start = 5;
ramp_end = 8;
t = linspace(0, 25, 251);
u = min(1, max(0, 1/(ramp_end - ramp_start)*(t - ramp_start)));
plot(t, u, 'linewidth', 1.5), grid on, ylim([-1 2])
If you have Fuzzy Logic Toolbox license, then you can use this linsmf() function. Here is a demo for a Double Integrator:
% Plant
Gp = tf(1, [1 0 0])
Gp = 1 --- s^2 Continuous-time transfer function.
% PID
kp = 0;
ki = 0;
kd = 0.8165;
Tf = kd;
Gc = pid(kp, ki, kd, Tf)
Gc = s Kp + Kd * -------- Tf*s+1 with Kp = 0, Kd = 0.817, Tf = 0.817 Continuous-time PDF controller in parallel form.
% Closed-loop system
Gcl = feedback(Gc*Gp, 1)
Gcl = s ------------------- s^3 + 1.225 s^2 + s Continuous-time transfer function.
% Saturated Ramp Response
t = linspace(0, 25, 251);
u = linsmf(t, [5 8]); % rise time is from 5 to 8 sec
lsim(Gcl, u, t), ylim([-1 2]), grid on
  3 件のコメント
Sam Chak
Sam Chak 2022 年 9 月 21 日
I forgot to mention that although linsmf is user-friendly, it requires the Fuzzy Logic Toolbox.
If you don't have Toolbox, then you can try this alternative. It produces the same time-delayed saturated ramp signal.
% Syntax:
% u = min(1, max(0, "Linear Line function"));
t = linspace(0, 25, 251);
u = min(1, max(0, 1/3*(t - 5)));
plot(t, u, 'linewidth', 1.5), grid on, ylim([-1 2])
Swasthik Baje Shankarakrishna Bhat
Swasthik Baje Shankarakrishna Bhat 2022 年 9 月 21 日
Hi Sam,
Sorry to bother you again. Can we have a neative sloped step input with programmable fall time?
Thanks and regards,
Swasthik

サインインしてコメントする。

その他の回答 (3 件)

Timo Dietz
Timo Dietz 2022 年 9 月 20 日
編集済み: Timo Dietz 2022 年 9 月 20 日
Hello,
what about using a single-sided ramp function: b * (1 - exp(-a*s)) / s^2
The gradient of the rising slope is '1', so after the time 'a' the amplitude 'a' is reached. The factor 'b' should finally allow you to control the steepness of the 'step'.
Does this meet your requirement?
  3 件のコメント
Timo Dietz
Timo Dietz 2022 年 9 月 21 日
編集済み: Timo Dietz 2022 年 9 月 21 日
Hello,
I thought you are searching for a solution in the frequency/laplace domain since you mentioned the pT1.
So, with 'H_slope = b/a * (1 - exp(-a*s)) / s^2' you can control the slope (in time domain) via a and b:
syms s;
a = 1.5; % time after which amplitude is reached
b = 2; % amplitude
% frequency domain
H_slope = b/a * (1 - exp(-a*s)) / s^2;
% time domain
f_slope = ilaplace(H_slope);
fplot(f_slope, [0 2]);
grid on;
Swasthik Baje Shankarakrishna Bhat
Swasthik Baje Shankarakrishna Bhat 2022 年 9 月 21 日
thanks Timo

サインインしてコメントする。


Swasthik Baje Shankarakrishna Bhat
Swasthik Baje Shankarakrishna Bhat 2022 年 9 月 21 日
perfect, Thanks sam. Have a nice day
  1 件のコメント
Sam Chak
Sam Chak 2022 年 9 月 21 日
It's great to hear that it works. If you find the solution is helpful, please consider accepting ✔ and voting 👍 the Answer. Thanks!

サインインしてコメントする。


Paul
Paul 2022 年 9 月 22 日
A 1D Lookup Table seems like a good option.

カテゴリ

Help Center および File ExchangeClassical Control Design についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by