From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper Control

Hi all .

 

I am looking for some help and here is a simplified version of my project. I have a motor and 2 steppers  that I am trying to control. The motor rests on a table whose position is defined stepper 1 and stepper 2. My main problem is with the positioning sequence. States A through E represent different positions i would like to 'fire' at.   Position A is the resting position and the motor is always in the 'on' state.  At regular intervals ( 5 minutes )  or on demand ( 'press fire') a 'firing' event is triggered.  Whenever this happens I would like for the motor to stop and then the table to move from A to B and then back to A. When prompted the second time the motor stops and  the table moves from A to C and back to A and so forth. The cluster provided in the 'fire' event case are coordinates to the new position.  The order of movement is something like this:

 

 

First Time    ( 5mins)    =      A to B

Second Time(10 mins)  =      A to C

Third Time    (15 mins)  =      A to D

Fourth Time  (20 mins)  =      A to E

Fifth Time    (25mins)  =      A to B

 

The motor is also turned on after reaching the new position. I would like to know how to implement this sequence.  As it stands the table moves continuously in an almost random manner which is not what I want. Thank you in advance.

0 Kudos
Message 1 of 3
(1,980 Views)

Charles.m,

 

I am not sure I completely understand what you are trying to do. Your simplified example is almost too simple.

 

I suspect that your problem is in the shift register and event structure in the upper loop. You have the output tunnel set to "Use Default if Unwired." Everytime any event case with that terminal unwired executees the value on the shift register is set to the default value for the enum, which appears to be "A."  When I wired through all the other cases and alternately hit the Fire and Start Motor buttons, it seems to go through the sequence you want.

 

Use Default if Unwired is useful for situations like the booleans connected to the termination terminal for the loop.  Only in the Stop case do you wire anything.  In most other circumstances, like tracking the position (A B C D), it is definitely NOT what you want.

 

Lynn

0 Kudos
Message 2 of 3
(1,971 Views)

Thanks for the info about the shift registers.You are right, I ommitted a good portion of the code thats giving me the problem. Here is the updated file.

0 Kudos
Message 3 of 3
(1,946 Views)