I have a Sample and Hold block inside a Resettable Subsystem and it is not resetting.

조회 수: 3 (최근 30일)
I have a Sample and Hold block inside a Resettable Subsystem and it is not resetting.
Here is the Resettable Subsystem:
Here is the Sample and Hold block inside the Resettable Subsystem.
Here is the behavior. The signals controlled only happen once. The Sample and Hold behaves as if it's stuck permanently.
The sample and hold output does not reset. The initial condition of the Sample and Hold block is 0. I'm expecting the reset signal to reset the Sample and Hold block back to it's initial value of 0. It does not do this.
What do I have wrong?
Thanks,
-Abraxas3d
  댓글 수: 6
Michelle Thompson
Michelle Thompson 2024년 3월 3일
We should see another burst, as we see in the middle of the graph on the first rising edge. The figure is intended to help illustrate the behavior I am seeing. This behavior is contradictory to the documentation for all the blocks involved.
After nearly a month on MATLAB Answers, and after finding three or four other people reporting the same disappointment (Sample and Hold not working inside a Resettable Subsystem) with no answers for them either, I'm starting to think that 1) this feels like a bug and 2) MATLAB Answers is the wrong place to go for help.
Paul
Paul 2024년 3월 3일
편집: Paul 2024년 3월 3일
"We should see another burst, as we see in the middle of the graph on the first rising edge"
Where is the first rising edge? It looks like there is only one rising edge at just before t = 0.0008. The burst occurs just before t = 0.0005, but there doesn't appear to be a rising edge at that time.
Why do you think the behavior is contradictory to the documentation for all the blocks involved? Of course, it would help if you provided a link to the documentation to which you are referring (as was asked for at least one of the blocks involved).
Based on the green line and your statement in the question, the initial condition for the block is zero, which is the same value of the output of the block after the rising edge hits at just before t = 0.0008.
What should the output of the S/H block if the trigger signal and reset signal have simulatenously rising edges, like if they were both the same signal? Should it sample the input or rese to the initial condition?
If you feel like the observed behavior is a bug, feel free to report it as such. Click on Support -> Contact Us and go from there. You'll get a response from Tech Support within a day or two; they are very responsive. If you go down this path, please post back here with their response.

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

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 3월 4일
편집: Fangjun Jiang 2024년 3월 4일
The "Latch (buffer) input" has to be checked to see this effect. I think the reason is due to the execution order. The SH block always updates its output at its sample hit (rising edge). When this sample hit coincides with the Resettable Subsystem sample hit (rising edge), it got reset first and then got sampled.
The SH block has a state. Using a State Reader block seems to be able to find it. The model is in R2022b.
  댓글 수: 3
Paul
Paul 2024년 3월 4일
편집: Paul 2024년 3월 5일
Interesting. As I understand it from State Reader that setting needs to be 'on' if the block has state that can be accessed by State Reader (and Writer). At least that's how I read it. Now I'm wondering what you were seeing.
Would be nice if there was a block property to indicate if a block has resettable state (in the context of this thread), but I don't see anything along those lines in Common Block Properties

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

카테고리

Help CenterFile Exchange에서 Schedule Model Components에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by