Search code examples
matlabsignal-processingsimulink

Pass through switch depending on time extension of a certain event


I am currently working on a control method which is coupled with a time-frequency analysis of an acceleration frequency: roughly speaking, the control loop is activated only if the frequency content of the acceleration is within a certain bandwidth near the natural frequency of the system I mean to control.

The Simulink loop is represented in the following figure:

enter image description here

At the moment, after checking that I'm actually within the frequency interval of interest, the signal is going through a switcher. After the switcher the acceleration is moduled via a certain control loop. The problem is that, at the moment, the control loop is activated and de-activated instantaneously: so, if at t0 the frequency is within the interval, the control loop is active; however, if at t1 the frequency is outside the devised range, no control is applied.

What I'd like to do now is the following:

  1. Define a minimal time length inside which the frequency content falls into the interval, e.g. the frequency content is within the range [0.25 - 0.3]Hz for 3s (or 6s, 9s, etc.).
  2. Put this block within the frequency interval detector and the switch.

In this way, the acceleration will undergo the control action only if the frequency contant stays inside the interval for, at least, a certain period of time (as said before, only if the frequency content is inside the range for at least 3s).

Look forward to suggestions.


Solution

  • The Histeresis idea works that way: You define two intervals. One of them with a small frequency range and with a large frequency range. I would try this logic.

    Simulink-Screenshot