フィルターのクリア

How to limit the Pulse generator Pulses ?

8 ビュー (過去 30 日間)
shayan
shayan 2012 年 7 月 2 日
回答済み: Manikandan 2015 年 9 月 15 日
I need to run the stepper motor, the problem is that the Logic (MATLAB code (Simulink)) will be interfaced by the "dSpace (Control Desk NGV version 4)", which does not support the Stepper motor block, available in the Simulink Library.
In this case I can only use the "Pulse generator block".
What I need to do: Pulse generator will continuously generate the pulses and two (Constant Blocks) will take the input and generate the pulses unless the pulse reaches the second input block value, and then it should remain at zero.
Eg: I/P(1) = 0, I/P(2) = 20, so a Pulse generator will generate the pulses from Zero till 20 and then it should be stopped.
The basic problem is that all of the comparison block with whom I am familiar will make the decision by looking at the "Amplitude (values on Y axis)" and I need to compare or want to make a decision by Looking the values on the (x-axis).
  2 件のコメント
TAB
TAB 2012 年 7 月 2 日
Some confusion !!
generate the pulses unless the pulse reaches the second input block value
Are you comparing time, so that pulse will be generated from 0 - 20 Seconds where 0 and 20 values are provided from 2 constant block ?
shayan
shayan 2012 年 7 月 2 日
Thanks for Reply:
Yes I need it exactely that " Pulse generator will generate the pulses until it reaches the 2nd I/P block value"
Yes I will have to compare it with respect to time.
Actually I need to move a pipe in some particular Percentage which will be done by the movement of the stepper motor, In such condition I have formulated the Different parameters that how long (time in Sec), Total distance (cm). So I have an open option to run it, Preferable time.

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

採用された回答

TAB
TAB 2012 年 7 月 3 日
編集済み: TAB 2012 年 7 月 3 日
You can implement with algorithm as shown below
Sources/Clock block gives the current simulation time at every time step. You can compare this time with desired value and pass/stop the output.
  1 件のコメント
shayan
shayan 2012 年 7 月 3 日
Thanks TAB for your valuable work and for giving me the time. The code is running perfectly

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

その他の回答 (2 件)

shayan
shayan 2012 年 7 月 13 日
Hello:
In addition to the above system can any body help me out that how to remember the previous value or how to update the start point with the stop time.
For Example: If the Start Time is 0 and Stop Time is 20, after the stepper motor has run for the 20sec the system should remember where pipe is or how many sec's the system has already moved.

Manikandan
Manikandan 2015 年 9 月 15 日
It's required pulse decoder system as like QEP sensor. For more information on how to implement, contact me on electricmani@yahoo.co.in

カテゴリ

Help Center および File ExchangeSources についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by