Return signal to zero - Simulink

I need to return a signal (whose value is randomly changing )to zero when a certain condition is satisfied in the model . Is there a block I can use to return the value to zero ?

回答 (1 件)

Paulo Silva
Paulo Silva 2011 年 4 月 11 日

0 投票

(Signal)-------------------->
[Product] -----> (Output)
(condition)->
(1)-> [Switch]------->
(0)->
When the condition is true the switch changes input from constant 1 to 0 so the Output is 0, if condition is false switch input is 1 and Output will be the signal.

4 件のコメント

Bharat
Bharat 2011 年 4 月 11 日
I tried using the switch . I am not sure what to use as the 2nd output in the switch to set the signal to zero . Currently the switch doesn't modify the signal ( return it to zero )
Paulo Silva
Paulo Silva 2011 年 4 月 11 日
I added one example how it can be done
Arnaud Miege
Arnaud Miege 2011 年 4 月 11 日
Also have a look at the demo mode "sldemo_zeroxing.mdl" that ships with Simulink.
Bharat
Bharat 2011 年 4 月 11 日
Paulo Silva
I think I understand your logic . But the problem still lies in the fact that an output of zero will not set the signal to zero .
For Example :
If the signal was currently steady at -30 , the only way i could set it to zero would be to add a signal of value +30 . Using the switch to generate an output of zero value does not modify the existing value of the signal .
My problem is , since the signal value changes randomly , I cannot use a constant to reset the signal to zero. The other problem is that , the step where I need to reset the signal value to zero happens at a different time step in the simulation . Hence I cannot tap into the signal to find out its value .

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

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

製品

質問済み:

2011 年 4 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by