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: 

Error in motion of step motor

my 4 axis(X,Y,W,Z) and 6 wired step motor goes clockwise and anti clockwise if I go through X-Y-W-Z and Z-W-Y-X respectively. However, If I try to go in order X and W, motor is not rotating(clockwise) as expected. It's doing the opposite. Why is this happening?Isn't it supposed to go clockwise because I am moving it in clockwise direction.

 

Can I do something like whatever position motor is , if I am trying to work with the motor I want to assume the present position as the first position(X)?

 

Thank you.

 

 

0 Kudos
Message 1 of 6
(2,775 Views)

If you have XYWZ phases, these are circular (e.g. repeated all around the axis ...XYWZXYWZXYWZ...). Might as well say it's WZXY. If you go from X to W, the distance between them is exactly the same clockwise as counter clockwise. CW it's skipping Y, CCW it's skipping Z. So I'd say the direction is just arbitrary. I'd think that usually you start moving slow XYWZ, and when there is momentum in a direction, you start skipping positions.

 

I'm no expert either, but I do know these stepper motor are not as easy as the appear. Have you read trivial literature like this?

Message 2 of 6
(2,734 Views)

Thanks for the reply. Yes, I have read that. After going through examples what I understood is that It does not have any feedback signals from  motion system and thus never know about the exact position of the drive. That means I have to calibrate it.

 

Is their any particular procedure for calibration or is it has to be done using hit and trial method.

 

 

 

0 Kudos
Message 3 of 6
(2,720 Views)

Not sure what you mean by calibrating.

 

Usually, the term homing is used for 'calibrating' the absolute position. So you move one direction until a switch is triggered. Then you know the motor is 'home', usually position 0. As for the relative distance, what I'm used to is that the step size is fixed and static. The motor, when driven correctly, should not skip positions, so the relative distance from home should always be steps from home X distance per step. The distance per step can of course  be calibrated as well. If there is slip (e.g. a slipping conveyor belt) you need an encoder (and might as well use a normal motor then).

Message 4 of 6
(2,712 Views)

So Stepper motor systems usually need a sensor/feedback at one position, often called the Home position, to define a starting point after the power has been off.  Any other position is located by counting steps.

So  electromechanical system can operate in a mode where the motor cannot always be assured of completing each step, then you need feedback or something other than a stepper motor. 

 can you please give me some headers on how to make the stepper vi work so that it can remember the position. 

0 Kudos
Message 5 of 6
(2,691 Views)

I hope you didn't just copy the case in the picture four times? That would be what's called duplicate code. It should be avoided. Think about what would happen if you need to change the code. You don't want to make that change four times. Instead make a 2D array of Booleans, and simply use the step to index. This would give you a 1D array. No code is there more then once.

 

Keeping track of the position can be done in many ways. I'd make a motor class, and keep that value (and others) in the class' private data. That's call encapsulation (and\or abstraction). So you don't need to worry about it anymore.

 

Other tactics are: uninitialized shift registers or feedback nodes (Action Engines, functional Globals). Or (please avoid) local variables, global variable.

 

You can put a quotient & remainder (x=pos, y=4) in the driver VI. So if you go from 0 to 10, you'll get step 0,1,2,3,0,1,2,3,0,1,2 and back 2,1,0,3,2,1,0,3,2,1,0. Exactly what you want. You do need to make sure the position always makes 1 step at the time. You should do that at a higher level VI. This VI could keep track of the previous position, and can direct the low level VI to take the individual steps.

0 Kudos
Message 6 of 6
(2,674 Views)