LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to hook up stepper motor, driver, and labview

I'm using the ni-usb-6009, and L293, and a stepper motor, using labview 8.2.  The data sheet for the L293 is: http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/603-00019-L293D-Datasheet.pdf

 

I have my stepper motor connected to the L293, but I'm a little confused about how I'm supposed to wire the L293 to the 6009.  I'm mainly confused with pins 1, 8, 9, and 16.  Pin 1 is for enabling 3 and 6, pin 9 is for enabling 11 and 14, pin 8 and 16 are Vcc.  So does this mean I just connect pins 8 and 16 to +5v supply?  I'm assuming pins 6, 9, 11, and 14 go into the digital output of the 6009.  So where does pin 1 and 9 go?  I don't quite understand the "enabling" term.  

 

Also, I'm a little unsure about how the vi will be constructed for this.  I've been looking through threads but I'm still confused... I've seen some mention PWM.  Is that the way I should go?

 

Thanks,

Nick

0 Kudos
Message 1 of 23
(9,029 Views)
  1. Pin no 16 Should be connected to 5V since it will operate the internal ckt of IC which is controlled by 6009(whose outputs are at 5V).
  2. Pin no 8 should ve connected to voltage at which your motor operates. If it operates at 5V then you can short 8&16 and tie them upto +5V.But I assume that it will no be the case.
  3. You are completely wrong that pins 6,9,11&14 will be controlled by 6009 outputs.It will blow up your 6009.All these are output pins.Pins 2,7,10 & 15 should be controlled by 6009 outputs.Pins 3,6,11,14 will be connected to Motor to drive it.You need to read the datasheet more in depth.Smiley Tongue
  4. Pin 1 & 9 should also be controlled by 6009 ouputs.If pin-1 is low then any input at pin 2&7 will have no effect on output 3&6 respectively. If pin-1 is high then inputs at 2&7 will control the outputs 3&6 respectively.So basically pin1 & 9 will decide whether L293 output should drive motor or NOT.

 Kudos are welcomed.:-)

 

Message 2 of 23
(9,020 Views)

Haha, thanks!  I actually didn't have those wired like I said (thankfully), I just wrote in the wrong the number... so no 6009 explosion this time.

 

So I can wire pin 16 to the +5V on the 6009?  Then, the data sheet for my motor says it's a 4-phase 12-volt motor: http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/Stepper_Motor_27964.pdf

so do I need another power supply for those 12 volts?

 

I have pins 2, 7, 10 and 15 going into p1.0, p1.1, p1.2, and p1.3.  Since I also need to wire pins 1 and 9 into the 6009 outputs, should I move it so pins 2, 7, 10, and 15 are in p0.0, p0.1, p0.2, and 0.3, and pins 1 and 9 are in p0.4 and p0.5?

 

Once I have them all plugged in I'm still a little confused about how the signal will make it move.  I understand the concept of the stepper motor, just not how I can do it with labview.

 

0 Kudos
Message 3 of 23
(9,013 Views)
  1. Yes you can use +5V supply pin of 6009, but the source driving 6009 will provide current for VCC1.
  2. Yes you do need a 12V supply for VCC2.
  3. I would recommend to use separate port for pin 1&9, since they will not require any PWM signal.Connect pins 2,7,10,15 to P0.1 to P0.4 and use P1.1 &P1.2 for pins 1 &9.
  4. As shown on page-2 of your data sheet under "stepper basics" section, your 1,2,3&4 phases will be controlled by P0.1 to P0.4. so a dark circle means that particular poer pin should be high........quite simple.
  5. You need to learn Labview for that................or else you can use Measurement & Automation Explorer for diagnosis.

    Kudos are welcomed.:-)

     

Message 4 of 23
(9,007 Views)

Hi,

So I decided to make a program with LEDs first to make sure that all of my VI was working properly.  I have four LEDs, and made a VI that lights them up in the same sequence as my 4-phase 12 volt stepper motor would work, doing half steps (according to this link for my motor: http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/Stepper_Motor_27964.pdf)

The VI runs fine, lighting up the LEDs on the front panel, as well as the LEDs I connected to p0.0 - p0.3.

However, when I replace the LEDs with the wires for the stepper motor, nothing happens with my motor.  Shouldn't this VI work for my motor?

 

I am using an L293 (http://www.parallax.com/Portals/0/Downloads/docs/prod/compshop/603-00019-L293D-Datasheet.pdf) driver with pins 1, 9, and 16 going to +5v, pin 8 going to a +12V supply, pins 4, 5, 12, and 13 going to ground, pins 2, 7, 15, and 10 going to p0.0 - p0.3 (in that order), and the four wires from the motor going to pins 3 (black wire), 5 (orange), 11 (yellow), and 14 (brown), and the fifth wire going to ground. 

 

I've attached my VI

 

Thanks for the help.

 

-Nick

 

0 Kudos
Message 5 of 23
(8,968 Views)

uoprummel,

 

It sounds like your 6009 is working correctly.  Have you had any other trouble with the 6009 specifically or do you believe the problem is with the L293?  If so you may want to bring this to the Parallax of Texas Instrument forums for help specifically with the L293.

 

However, please let us know if you feel the issue may be with the 6009 and we can come up with some trouble shooting steps for you to try (though the LED testing was a great first step).

 

Regards,

 

Sam K

Applications Engineer

National Instruments

Message 6 of 23
(8,924 Views)

Hey everybody,

 

I got a bit more information in a private message from the original poster.  It sounds like the motor connections are good at this point--I also put together a VI showing the user one way he could control his stepper motor (he wants it to turn whenever input voltage drops below 5V).  Here's the VI that I put together:

 

Motor_Control.png

 

 

EDIT:  The U32 instance of DAQmx Write should actually be U8 for his 6009.  I am using a 6353 which has a 32-bit port 0.

 

 

Best Regards,

John Passiak
Message 7 of 23
(8,918 Views)

Thanks John,

I changed it to U8, and ran the vi.  When the voltage is under 5 volts the motor starts vibrating, but not rotating.  It does the same thing if I change it to 00110011.  Do you have any idea why this is happening?

 

Thank you so much for your help!

 

-Nick

0 Kudos
Message 8 of 23
(8,908 Views)

I don't think this is your main problem, but it appears you missed a step in your logic progression, according to the half step "states" from the link you posted,, the last step should be "1001" you stop at "0001" then return to "1000" (the first state)

 

Alan

0 Kudos
Message 9 of 23
(8,905 Views)

I would also speculate , that after you add the " last state" to the code you posted, then go into the Daq Assist and check the " INVERT all signals in the port"  box , your motor will turn. The 6008 and 6009 are intended to "sink current"  So when you " turn a line ON " in the LabVIEW code, the coresponding line goes LOW on the 6008/6009 (On in LabVIEW code, means LOW on the 6008/6009 port)

 

Alan

0 Kudos
Message 10 of 23
(8,902 Views)