LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stepper Motor does steps unequally depending on direction

Hello,

 

actually my Labview programm works mostly fine so far, but I've got one issue, and I don't get it. I set the speed of my stepper motor to 900 and Steps to move to 2080. The stepper motor changes the direction every turn. So always with the values 2080 and -2080. But somehow I end up beeing approx. two stepps to far on the negative side. What could be the reason?I am communication with the stepper motors via Arduino. Someone out there who's a specialist with stepper motors?

 

Thanks in advance!

 

PS: I'm using LV16, and the secon sequence is for correcting this mistake, but it is more or less cheating. I don't like this way.

0 Kudos
Message 1 of 5
(2,401 Views)

Please, learn LabVIEW.  Spend serious time with the Tutorials to learn the ideas that motivate LabVIEW, including the Principle of Data Flow (it's a lot more than dropping Controls, Indicators, and Functions and connecting them with non-straight colored wires).  Some specific comments that will significantly improve the readability of your LabVIEW code:

  • Make the Labels for Controls and indicators legible, especially during development.  Having White Lettering on a light-grey background does not help figuring out what which control sets the Step Speed.
  • Neatness counts.  Place your Controls and Indicators in a logical arrangement, as though you were building an actual (as opposed to a Virtual) Instrument.
  • Neatness especially counts in wiring.  Try to run your wires straight and horizontal as much as possible.
  • You are (correctly) using the Error Line.  Yet you are also using Sequence Frames, which are almost never needed in LabVIEW code.
  • You appear to have missed the Lesson on creating sub-VIs.  A good Design Principle for LabVIEW code is "The entire Block Diagram should fit on a small Laptop screen".  The idea is that the sub-VI "does one thing" (like "Stepper Configure" or "Analog Read Port"), with the "messy details" hidden inside the sub-VI.
  • Because your code is so sprawling and the wire paths are not clear, it is very difficult to see and understand its logic.  Look at some of the Example Code that ships with LabVIEW for some examples of better LabVIEW Style.

Bob Schor

0 Kudos
Message 2 of 5
(2,360 Views)

So maybe this helps to understand the procedure. Now, the problem as mentioned aboive is that every time I change the direction I end up beeing two steps too far on the negative side. I had the idea that it could have something to do with the falling and rising edges of my pulse. So that the stepper motor realizes one pulse too late that it has to change the direction. But I couldn't find this information in any of those sub-VIs.

The problem just occurs when the motor turns anti-clockwise.

0 Kudos
Message 3 of 5
(2,332 Views)

I don't have any of the Arduino toolkit vi's so I can offer only very limited thoughts based on the overall structure I see.

 

1. Nothing in your LabVIEW application code appears to make sure that a prior motion command has been completed before issuing a new one.  This isn't causing your current symptom, but may be something to watch out for in the future.

 

2. What do you know about the lower-level Arduino code?   As for myself, knowing nothing about it, I'm leaving it on my list of suspects.   Probably #2.

 

3. What's the nature of the system you're driving?   Any static loads (springs?  gravity?  pneumatic pressure?).   Any gears or other transmission with backlash or lost motion?   

    How are you *measuring* this ~2 step error?   Could the measurement device be subject to similar biasing loads or backlash?

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 5
(2,296 Views)

What is the motor and motor controller? I'm agreeing with Kevin and suspect a hardware setting is the culprit.   

 

Have you tried a move to position rather than a jump?  Are acceleration and deceleration rates balanced?  Is the load equal in both directions?

Link to the whole drive chain components.

 

And, yes, I have swum in the deep end of that pool.  It's easy to get over your head unless you understand the system.

 

What is being controlled and how fast?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 5
(2,293 Views)