Jump to content

HOW TO CONTROL A a stepper motor


xzhengze

Recommended Posts

  • 2 weeks later...

Hey,

I also had to do that to control a stepper motor to change wavelengths on a fluorometer, but I was using a DAQ card (USB-6009), not a PCI card. I don't know how to do it with a PCI card, but here's how to do it with a DAQ card. I'm not sure what your stepper motor inputs are, so you should first get the manual that tells you what each of the inputs do and what voltage they require. For instance, the machine I was using was very old, so we had to cut open the cable and trace each individual wire back to the input on the stepper motor. The manual told us what each pin did (e.g. change direction, step, etc.). The change direction and step should probably be digital inputs. For instance, on my stepper motor, each time you input 0V and then +5V, the motor would step.

Alright, so plug wires connecting the input pins to your stepper motor to the DAQ card. The DAQ card contains pins for digital i/o, analog output, and analog input. So for those inputs requiring digital signals (0/+5V), I plug it into those, and for those that require analog inputs, I wire it to the analog output of the DAQ card. From there, I controlled what I wrote to the inputs of the DAQ card using functions in the NI Measurements>>NI-DAQ MX subpalette. There's lots of examples installed in Labview relating to writing to a DAQ card.

Hopefully that helped a little bit,

S

Link to comment

QUOTE (xzhengze @ Aug 20 2008, 03:41 AM)

Hi! I am new to Labview (v.8.2). I have to create a program to control a stepper motor. I want to control the direction and speed of the motor.Currently I am using a stepper motor and a NI 7344. I do not know how to create the program.Are there any examples I can look at? Thank you.

I've also had to do this as part of our project. Most Stepper motor drivers (controller) have 3 inputs /motor (step, direction, and enable). Step is usually a frequency (which correlates to number of steps of the motor) - if your motor has a step size of 200steps/revolution and you input 400Hz into the Step input on the driver - your motor will turn 2 turns per second (400Hz)/(200 step/revolution)=2 rotations. Direction is the direction of turn of the motor (obviously only 2) - like the previous poster mentioned (you will have to check out what your driver input level are and adjust (sometimes with hardware (relays and such)). If your lucky, the inputs will be TTL 0V-5V. Enable simply turns the power to the motor on or off - Beware - running a stepper motor at full amps in a full stop positions can be very hard on it. Most drivers have a idle current reduction setting for cutting the driver amperage in half (usually) when the motor is not turning but enable is left on. Now for step ... this controls the speed at which your motor turns. If you try to start your motor at too high a step rate, it will stall and not turn at all (but it will sure make alot of noise). You have to start turning your motor at a lower step rate, then you can ramp the frequency to give you higher speeds. This is achievable in a normal DAQ card (as I have done it) but you run into problems running under windows ... it is supposed to be a multitasking operating system, but it is more like a multi threading operating system ... you can generate a frequency using the digital outs, but you find very small pauses in the frequency as windows takes the cpu from labivew for other tasks (even just windows ones). I'm pretty sure, since the card you are using is designed to run stepper and recieve encoder inputs, that it will have the capabilities to procude a frequency and effectively ramp the frequency to run a stepper. I had to use a frequency generator, and just have a set frequency (not ideal but works).

As far as actually talking to the PCI card from labview - this should be fairly easy ... first thing to do is look at the examples that ship with labview ... then if you are still having trouble write back to this thread with come more specifics .

Greycat

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.