LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ZICK ZACK problem

Solved!
Go to solution

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

 

Unbenannt.PNG

0 Kudos
Message 1 of 9
(237 Views)

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). 

aputman_0-1741621635877.png

 

aputman
0 Kudos
Message 2 of 9
(224 Views)

We cannot debug truncated images, but all you probably need to do is make minor adjustments.

0 Kudos
Message 3 of 9
(213 Views)
Solution
Accepted by malik240

See if this can give you some ideas...

 

altenbach_0-1741626019734.png

 

0 Kudos
Message 4 of 9
(191 Views)

yes this is what i wanted but my problem ending in every direction there is a movement in y-axis due to type change.

0 Kudos
Message 5 of 9
(139 Views)

@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?

0 Kudos
Message 6 of 9
(136 Views)

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.

0 Kudos
Message 7 of 9
(124 Views)

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!

 

altenbach_0-1741714319387.png

 

0 Kudos
Message 8 of 9
(88 Views)

@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

0 Kudos
Message 9 of 9
(69 Views)