LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper motor - steps counting

Solved!
Go to solution

Hi,
I am a beginner in the LabVIEW.

I need an advice. How to count the number of steps of the stepper motor The stepper motor rotates the potentiometer and its rotation is needed to complete 170 steps. In the LabVIEW I made the manual control of a stepper motor. I used two case structures. First for starting and stopping the rotation and the second for changing the direction of rotation.



When the motor rotates to the left, the "Number of steps" is incremented, and when it rotates clockwise, the number in the indicator decrements from zero, but I need to decrement from the numbers, that are recorded when turning left (for example) 59, 58, 57, 56 instead of 0, -1, -2 ...)

Can this be somehow implemented in my program or is there another solution for counting steps?



Thanks

Download All
0 Kudos
Message 1 of 5
(6,613 Views)
Solution
Accepted by topic author gooner

Instead of 2 feedback nodes (one in each case), you need 1.  But to make life even simpler, use the shift register you already have.  Most of the logic inside of the case structures is not needed.  Just increment or decrement based on the direction.  Place this value back into the shift register.  This will keep track of your step number.  Now for the index of the boolean array to use, just use the Quotient & Remainder function on your step number with 4.  The Remainder output will tell you exactly which row of your boolean array to use.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
(6,594 Views)

This is it. Thank you

0 Kudos
Message 3 of 5
(6,578 Views)

I have one more question. How to reach not to run an motor again in the same direction, while achieving 170 steps? I tried "not equal". The motor turns off, while achieving the step 170, but after that it is possible to run it again.

0 Kudos
Message 4 of 5
(6,550 Views)

I would take the Absolute Value of the count and check if Less Than 170.  OR that result with your Motor Running button.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(6,538 Views)