03-10-2025
10:22 AM
- last edited on
03-10-2025
12:03 PM
by
altenbach
HI Everybody,
I am working on a project that involves two motors:
One motor moves along the X-axis.
The other motor moves along the Y-axis.
The intended movement pattern is as follows:
The X-axis motor moves from a starting point to an endpoint in steps at specific intervals.
Once it reaches the endpoint, it returns to the starting position with same intervals.
Then, the Y-axis motor moves one step forward.
The X-axis movement repeats after each Y-axis step.
Issue:
Instead of following the expected sequence, my system is executing the movement incorrectly:
The X-axis motor moves from the start to the endpoint in interval.
The Y-axis motor moves forward.
then X-axis move back with interval
Thanks
Solved! Go to Solution.
03-10-2025 10:54 AM
You mean zig-zag? If I understand your intention, you want the traversal on the left but your code is doing the traversal on the right. If so, you need to adjust when to do the zag motion (Y-axis). Unfortunately, I'm not going to try to decipher that spaghetti mess of an image. You need to look up how to use a state machine. Labview ships with some examples or you can download templates from VIPM (JKI state machine, etc).
03-10-2025 10:59 AM - edited 03-10-2025 11:47 AM
We cannot debug truncated images, but all you probably need to do is make minor adjustments.
03-10-2025 12:01 PM
03-11-2025 02:46 AM
yes this is what i wanted but my problem ending in every direction there is a movement in y-axis due to type change.
03-11-2025 02:54 AM
@malik240 wrote:
yes this is what i wanted but my problem ending in every direction there is a movement in y-axis due to type change.
I have absolutely no idea what you mean by that. What is a "type change" here?
03-11-2025 03:54 AM
OP, you should lose half the wiring and conditional code.
In fact I would copy altenbach's design, either for your solution, or to generate all the coordinates in an array first to then simply walk through them in order.
Keep it simple. Generating an array first would help to see what is going on.
03-11-2025 12:35 PM
Again, I hope you understand that it is really impossible to "follow the wire" and figure out any logic from a picture showing wires flowing in all direction and deep stacks of case structures where only 10% of the possible cases are even visible.
Just look at what you gave us: It is impossible to tell what you are doing wrong!
03-11-2025 04:46 PM
@malik240 wrote:
yes this is what i wanted but my problem ending in every direction there is a movement in y-axis due to type change.
Maybe this example will help...
https://forums.ni.com/t5/Example-Code/Generate-2D-Raster-Pattern-in-LabVIEW/ta-p/3503399