Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

How to reset a signal to zero after certain intervals in simulink?

Asked by rnayek on 6 Jun 2014
Latest activity Commented on by rnayek on 9 Jun 2014

Let me first describe my problem. I am having a signal which comprises acceleration signal(for 20s) followed by zero signal (for 10s) and again followed by acceleration signal(for 20s) and again followed by zero signal (for 10s) and this goes on. Now I am also simultaneously integrating the acceleration signal to get the velocity. Now the problem I am facing is that during the period of zero acceleration I get a non-zero constant value of velocity(as obtained from the last integration of non-zero acceleration) which I want to reset to zero for each periods of the zero acceleration signals. Is there any way of doing that? Please help me!!

0 Comments

rnayek

Products

2 Answers

Answer by Rashmil Dahanayake on 8 Jun 2014
Edited by Rashmil Dahanayake on 8 Jun 2014
Accepted answer

You need to create an external reset signal checking the acceleration zero instances. Then double click on integrator parameters an tick the check box external reset for initial condition. In your case initial condition should be zero.

Updated file attached

1 Comment

rnayek on 9 Jun 2014

Thank you a ton. I was exactly looking for this!

Rashmil Dahanayake
Answer by Rick Rosson on 7 Jun 2014

The integrator block provides an option to allow you to reset the state variable using an external trigger signal. Please review the doc:

Integrator Block

1 Comment

rnayek on 8 Jun 2014

I tried doing what you said but still I am unable to resolve the issue. Would you please show me how to do reset a signal after certain time interval based on some external signal?? I am attaching my SIMULINK model; I implore you to make the necessary change in my model. Thanks in advance.

Rick Rosson

Contact us