I would like to implement in simscape a kind of ramp block having reset option, thus that ramp would start rising from zero every time the reset is triggered. I've tried with resetable subsystem block but is of no helpfull.
Have u got any idea how to solve this?

답변 (2개)

Aquatris
Aquatris 2024년 4월 15일

0 개 추천

Here is one way with enabled subsystem, where the subsystem comes up with an offset (so if the ramp number gets too large it might be a problem):

댓글 수: 5

Aquatris
Aquatris 2024년 4월 15일
Alternatively, you can use a constant block with an integrate within a resettable subsystem, where constant block will determine the ramp rate:
Andraz
Andraz 2024년 4월 16일
이동: Sam Chak 2024년 4월 16일
Hi Aquatris,
I'm having very fine duty-cycle. Could you reveal what is inside resettable subsystem block at variant 2? I haven't found any ramp having also input port.
Aquatris
Aquatris 2024년 4월 16일
There is no ramp inside the resettable subsystem. it is a simple integration as below:
Andraz
Andraz 2024년 4월 24일
Now I'm a bit confused. In the first scheme you drew down an enabled subsystem block while in the second one a resetable subsystem block. Which option should be the right one? If I use the latter one with the integrator in then the source signal cannot be a time ramp but a step. The integral of a time ramp is not a saw.
Aquatris
Aquatris 2024년 5월 8일
There is no right or wrong as long as the output signal is what you expect, or unless it is a homework question asking to use a specific method.
In discrete time, there is no real ramp, it is always a step.
The ramp block does not have a reset option, so I introduced another method to generate 'resetable ramp' with an integrator.
I showed the output of the resettable subsystem as saw so why do you thinkg integral approach cannot genereate saw? The output of an integral gives a ramp, and with the reset functionality it becomes a saw

댓글을 달려면 로그인하십시오.

Sam Chak
Sam Chak 2024년 4월 16일

0 개 추천

If you have a good understanding of the fundamental mathematics behind a line graph, then theoretically, you should be able to implement the mathematical formula for a Resettable Ramp in the MATLAB Function block. This way, you can avoid using any specialized blocks that require a more abstract programmatic If–Else logic to comprehend.
t = linspace(0, 10, 1001);
p = 2*(heaviside(t - 2) + heaviside(t - 4) + heaviside(t - 6) + heaviside(t - 8));
y = (t - p)/2;
plot(t, y), grid on, ylim([-0.5, 1.5])
xlabel t, ylabel y(t), title('Resettable Ramp')

카테고리

도움말 센터File Exchange에서 Configure Simulation Conditions에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

2024년 4월 15일

댓글:

2024년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by