MATLAB Answers

Turn off a Signal for a few seconds and then turning it back on

8 views (last 30 days)
Daniel Senst
Daniel Senst on 11 Feb 2020
Commented: Daniel Senst on 12 Feb 2020
I'd like to turn off a signal for about 5 Seconds after it will be used again (It can differ from 0 to 5, depends on the Input the Signal gets). Hence I need a periodic function to turn it off and after 5 Seconds back on. Is that doable in Matlab/Simulink? Or rather, how can I do it?
Daniel Senst
Daniel Senst on 11 Feb 2020
Yes, I can use stateflow. I just tried it and came to the conclusion that I, most likely, will have to do a fourier transformation. Or is there another possibility to do that?
My clue was to use a sine wave as input for the stateflow chart and when it is positive (>0), there shall be an 1 passing through. If it is negative, there will be a 0. That now activates a switch which lets through the information of the Signal for just a second and then closes for 9 seconds

Sign in to comment.

Accepted Answer

stozaki on 11 Feb 2020
I attached example model. But it is created by R2019a and backport to R2013b.
Daniel Senst
Daniel Senst on 12 Feb 2020
Well, I spotted something which will now be going deeper into what I wanted to do with that ^^
I am building a Robotic Arm with Lego Mindstorms which sorts colors. The Systems you wrote do work perfectly fine, but only after a certain case. Basically the Arm is in a defaukt position from which he picks up a brick. That brick is the signal (the real signal is it's color that's been recognised by a sensor) and once it got grabbed by the arm the signal fades and would trigger the default position. Thats why I needed your system.
The procedure after recognising the color is: Arm goes down, grabs the block, goes back up, turns 180°, goes down, opens claw and goes back to default.
Now the problem: I can only take away the brick when the arm turns 180°. When I take it away before it will come back to default position and doesn't go through the rest of procedure which grinds my gears right now.
So there was nothing wrong with your code. I guess I have to do something different inside of my code

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!