update/memorise the constant block value

1 view (last 30 days)
Niaz
Niaz on 11 Jul 2012
Hi to all:
I am running the stepper motor with the MATLAB Simulink and this stepper motor rotation will help in uplifting the certain pipe according to the input values.
For this I have build the Simulink block in such a way that two input constant blocks (Ref Point and Set Point) values will enter into the two sub systems, 1)Pulse generator 2)Direction. These Input constant block values are assumed to be in the Percentage i.e from 0 to 100%, which will move the pipe accordingly.
1)Pulse Generator: When the Ref and set point values enter into the system it will make some calculations and then allow the pulses to pass trough the pulse generator block for the certain time such that the pipe will reach the desired position. The ref and set point are just the variables.
2)Direction: In this the system will make the comparison. If the Ref Point in greater then the Set Point the Stepper motor will rotate in the clock wise direction to move the pipe in the upward direction (towards 100%) and if the Ref Point is smaller then the Set point then the Motor will rotate anti-clock wise to move the pipe down(towards 0%).
Till here my system is working accordingly and perfectly. What I need or the problem that I am facing is that:
I need to update my Ref Point with the Previous Set Point.
For Example: Ref Point=0 (initial point, assuming the Pipe is at rest) and Set Point=10. So the stepper motor will rotate from 0 to 10% or (for the 10% from the total time). At this Stage when the system (pipe) has reached to the 10%, the Set point value will be updated/moved into the Ref Point and when the user will enter the new set Point value the system will make the comparison with the New Ref Value (Last Set Point Value) and move the system accordingly. The user can only vary the Set Point value, and the Ref Point Will always be the last/previous Set Point Value. Or we can say that the system should memorise about its present position.
Basically I need to update the Ref Point with the Previous Set Point Value.
Please also let me know that how can I upload my Work or the Screen Shot of that so that it would be convenient for the understanding.

Answers (1)

Albert Yam
Albert Yam on 12 Jul 2012
Perhaps I may need more clarification, but this is my understanding. You currently have 2 [Constant] blocks, for 'Ref Point' and 'Set Point'. 'Ref point' wants to reach 'Set Point'.
Seems to me, 'Ref point' should just be a [memory block] with a line taken from the output % position (with initial condition = 0). 'Set Point' should be a [look-up table], or [signal builder] of your testcase.
What confuses me is, "The user can only vary the Set Point value, and the Ref Point Will always be the last/previous Set Point Value."
  1 Comment
Niaz
Niaz on 12 Jul 2012
Thanks Albert for your respond.
Yes Albert you have reached the right understanding, that Ref Point will be acting as the memory block that stores the data of the set point or a line taken from the output %position so that the system will be acknowledged about its present position and can perform and can take the decision accordingly. And the set point should be a signal builder.
As per your confusion: I mean the same that the ref point should serve as the memory block that will hold the data of the last/previous cycle, Might it would be an interpretation problem, Sorry for that.

Sign in to comment.

Categories

Find more on General Applications in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!