LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting a stepper motor to control linear movement

Hello, I am trying to get a gantry set up and controlled by labview. I am new to using labview and barely have the basics down. basically I am using two stepper motors that are connected to linear drive shafts and am wanting to program the set up to be able to type in either distances or coodinates and have the motors move to that set. I have limit switches that I will be using as well. My thought is that I will have to program the limit switches first in order to establish a 0,0 for the systme then set up the motors to move accourdingly in the defined region. I need advice on if this is the right course of action and how to program the motors to move linearly as well. any advice is appreciated. Thank you 

0 Kudos
Message 1 of 7
(1,551 Views)

What type of hardware are you using?  Do you have an actual motor controller of some kind or do you just have something that sends raw electricity to the motors?

0 Kudos
Message 2 of 7
(1,537 Views)

so we are using two PCM4826E stepper motor drivers connected to two stpper motors, that have about a 31in rail connected to both stpper motors. we have the limit switches connect to national instruments usb-6000. the motors are connected to SP-240-48 dc outputs. each have their own. 

0 Kudos
Message 3 of 7
(1,531 Views)

Well, I'm not going to spend too much time looking into your motor's documentation but the fact that it uses USB, and you're using a USB DAQ as secondary control, means that there are a few things you will want to consider.

 

The big one is that you need to remember that anything running under standard LabVIEW over USB is not going to be "real time".  You won't be able to guarantee that you do anything with potentially close timing.  So, as an example, if you have a limit switch that you read with your DAQ, and you want the motor to stop when it hits that switch, if you do that "stop" command using LabVIEW you have no guarantee that it will stop as soon as you had hoped.  Maybe it will look like it works, but all it takes is your OS pausing LabVIEW briefly at a critical time and your motor has now gone past your limit switch and broke your whole setup.  

 

So what you probably ought to do is set up the limit switches so that they are hardware-based.  They either need to signal the motion controller to stop immediately (it looks like the controllers each have 4 digital inputs that might be usable for this?) or they need to cut power to the motor entirely when hit.  Then add in a system that if the positive limit switch is pressed, the motor can only move in the negative direction.

 

I would recommend you get either a 3rd limit switch or an optical sensor and use that to establish a zero position.  This would be somewhere in the middle of your setup instead of at the ends, so you could measure a zero position without running into the limit switches.

 

Have you got LabVIEW able to "talk" to your controllers at all yet?

0 Kudos
Message 4 of 7
(1,516 Views)

I believe we have a three or four limit switches we are going to use. The other thing is out gantry system is set up vertically so we it would be harder to get a sensor in the middle as that is where the material we are going to be moving will be located and we are using it for testing laser damage so the middle needs to be clear. we have not had luck getting labview to talk to the controllers yet. I am new to labview so I don't know where to start to or what tab to use in order to get for the controller I am using. 

Also thank you for the help thus far. 

0 Kudos
Message 5 of 7
(1,463 Views)

This page looks like the page for your motor controller:

 

https://www.haydonkerkpittman.com/support/legacy-products/legacy-stepper-motor-programmable-drives/p...

 

It looks like it has USB and RS485 serial.

 

It doesn't say what sort of USB driver you need.  Hopefully that means that the USB driver is just a serial port emulator.

 

At the bottom of the linked page there is a downloads section with a communications manual.  Have you looked at that?  If you want to use it with LabVIEW that's almost certainly where you need to start.

0 Kudos
Message 6 of 7
(1,454 Views)

That looks like what I need. Thank you for the help. 

0 Kudos
Message 7 of 7
(1,448 Views)