how to change the rise time of step input in simulink
19 views (last 30 days)
Show older comments
Swasthik Baje Shankarakrishna Bhat
on 19 Sep 2022
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 Comments
Accepted Answer
Sam Chak
on 21 Sep 2022
Edited: Sam Chak
on 22 Sep 2022
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])
% PID
kp = 0;
ki = 0;
kd = 0.8165;
Tf = kd;
Gc = pid(kp, ki, kd, Tf)
% Closed-loop system
Gcl = feedback(Gc*Gp, 1)
% 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 Comments
More Answers (3)
Timo Dietz
on 20 Sep 2022
Edited: Timo Dietz
on 20 Sep 2022
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 Comments
Swasthik Baje Shankarakrishna Bhat
on 21 Sep 2022
1 Comment
Sam Chak
on 21 Sep 2022
It's great to hear that it works. If you find the solution is helpful, please consider accepting ✔ and voting 👍 the Answer. Thanks!
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!