LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to make this stepper motor control system

Solved!
Go to solution

The goal of my project is to have real-time data collected by a Dataq 158u utlimately controller a stepper motor.  I orignially planned on running this whole thing with basic stamp, but I'm realizing that this may not be possible.  I have a stepper motor and a L293DNE driver.  I will continuously be recording data with the dataq, in the form of volts, and want these values to determine how the motor works.  For example, if the voltage is 0-3 volts, I want it to rotate clockwise, 3-5 volts not rotate, and 5-8 volts rotate counter clockwise.

I've been trying to figure this out the past week, looking through threads with basic stamp, matlab, and now labview.

 

Is there an easy way to do this? or easier way that I am currently trying to figure out?

 

Any help would be greatly appreciated!!

 

Thanks in advance.

 

-Nick

0 Kudos
Message 1 of 5
(3,610 Views)

Hi,

 

What you are trying to do is called Locked antiphase PWM. The LD293 is a dual H-bridge motor controller primarily designed to drive one or two DC motors. I don't think it is going to work with a Stepper Motor. In any case the way you want to get this IC to do Locked Antiphase PWM is to send your PWM signal to the direction lines of the IC (PIn 2 and 7) You must invert the PWM on one of those pins! Use an inverter or do it in SW. Then enable the PWM line (Pin 1) Connect VCC2 (pin 😎 to the higher DC voltage that will drive the motor.  Now from 0 to close to 50% PWM the motor turns in one direction and at 50% PWM the motor stops from just over 50% to 100% PWM the motor turns in the opposite direction.

 

Alan

Message 2 of 5
(3,581 Views)

Thanks Alan,

I'm a little confused... Is all of this being done in Labview?  How do you control the PWM to be 0-50%?

How do you invert the PWM?  What is a SW?

 

Thanks!

-Nick

 

0 Kudos
Message 3 of 5
(3,552 Views)

 What is a SW?

 


software

Jim

LV 2020
Message 4 of 5
(3,547 Views)
Solution
Accepted by topic author uoprummel

Nick,

 

What I was describing is how you would need to configure the motor controller to accept PWM from LabVIEW and operate in a Locked Antiphase mode so you could control motor direction. A lot of the LabVIEW part depends on the DAQ you use. For instance does your DAQ have a Counter that can generate PWM? I did some checking just now and your DAQ is not manufactured by National Instruments and I could not locate any native LabVIEW drivers. I did however go to the Dataq 158u MFG website and found they do have LabVIEW drivers BUT their Software (SW) must be running in the back ground. The Dataq 158u web site also has a help forum, I suggest you start their to understand the capability of the Dataq 158u. Also it appears you are not familiar at all with LabVIEW , before you can take on a project like this you need to start with the basics of LabVIEW, learn how to handle arrays so you can store your ADC results and how to use loops and timing and shift registers.  NI has some FREE basic training like the 6 HR intrudction to LabVIEW I would start their. Oh and in your OP (original post) you doubted the Basic Stamp could do this, I do this type of control using Atmel micro controllers all the time, I am sure the Stamp could eaisily do this. Just get on one of their forums for more info. Oh and to answer your question an Inverter is an IC that inverts the input signal, what you would end up with at the direction pins of you motor controller is PWM on one pin and 180Deg out of phase PWM on the other.

 

Alan

Message 5 of 5
(3,535 Views)