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

6 次查看(过去 30 天)
Hi,
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?
Thanks
  2 个评论
Daniel Senst
Daniel Senst 2020-2-11
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

请先登录,再进行评论。

采纳的回答

stozaki
stozaki 2020-2-11
I attached example model. But it is created by R2019a and backport to R2013b.
  5 个评论
Daniel Senst
Daniel Senst 2020-2-12
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 LEGO MINDSTORMS EV3 Hardware 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by