LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to hook up stepper motor, driver, and labview

Ah sorry I guess he did say "half step" in his post didn't he.  I was going off of the Full Step, Low Torque image.  00110011 would implement the Full Step, High Torque scenario.  The Half Step case isn't quite as straightforward using the code I set up (but obviously it is possible to implement this as well if desired).  It seems like the motor should be able to operate in any of the 3 modes, you don't have a load connected right?

 

As far as the logic states go, the 6009 defaults to open collector (aka open drain).  There is an internal 4.7 kOhm pull-up resistor, so when you output a logic high your output port should be connected to 5V through the pull-up.  Driving the line low will connect the output line to GND.  Alternatively, the 6009 could be configured for Active drive, allowing ±8.5 mA of source/sink current at 0-3.3V operation.  Having cleared that up, I don't think inverting the logic is what you need to do here.

 

 

What do you have your delay set to?  I think I left it at 0 for the default.  Is it possible the loop is iterating too quickly?

 

 

 

Best Regards,

John Passiak
Message 11 of 23
(2,877 Views)

Thanks for the input Alan,

 

0 Kudos
Message 12 of 23
(2,876 Views)

Paul,

 

I know the 6008 works the way I described, I am sure you know better than I about the 6009, but I thought they were the same. Any way I guess I shouldn't even have to ask but can you confirm that the 6008 and 6009 are different in this regard.

 

Thanks!

 

Alan

Message 13 of 23
(2,866 Views)

Ah... perfect, the delay needs to be at least 8 for the motor to rotate.

 

Works perfect!

 

I'd like to thank you John and Alan, for all of your help!  I'm going to build off of this VI to make it meet the needs of my project.  

0 Kudos
Message 14 of 23
(2,866 Views)

Cool!  FYI I just benchmarked the program on a 6009--with no delay configured it takes ~2 ms to run on average (system dependant of course).  The example in the motor's manual you linked uses a 15 ms step time.

 

 

The 6008 doesn't have active drive mode like the 6009, but it works the same as the 6009 in open collector (default) configuration.  An image from the user guide shows the internal pull-up:

 

        2010-12-13_180045.png

 

So, when you write a logic high, the port pad is essentially floating, but the line is then driven through the internal (or external) pull-up.  Writing a logic low will drive the line to GND (and 5V is dropped across the 4.7kOhm resistor). 

 

 

Of course, there are many different ways to connect things to the DIO lines, some of which would require inverted logic.  For example:

 

        2010-12-13_180302.png

 

Case 1 (output) and Case 4 (input) would require inverting logic, assuming you want a "True" to turn on the LED (case 1) or indicate the switch is closed (case 4).

 

 

Best Regards,

John Passiak
Message 15 of 23
(2,854 Views)

I hooked up a waveform chart to the analog dbl on top because I'm going to want there to be a real-time graph, and also record the values of the voltage.  However, it only records values below 5V.  I'm assuming this has something to do with the fact that we set it up to run the motor when the voltage is under 5V.  How can I graph the voltage over 5 volts?

0 Kudos
Message 16 of 23
(2,846 Views)

Yep, That's exactly what I was thinking! In my experience turning an LED "ON" with a logic true in the 6008 required the line to be inverted (so it could sink the current).  i guess I implied to much into this fact. Thanks for the explaination.

 

Alan

0 Kudos
Message 17 of 23
(2,840 Views)

I'm not sure how you're connecting the chart, but the following should give continuous updates for all voltage values:

 

 

2010-12-13_182359.png

 

 

If you put your Waveform Chart inside the case structure it would only update if the value was less than 5V (or greater than 5V if you put it in the "false" case).

 

 

Best Regards,

John Passiak
Message 18 of 23
(2,834 Views)

Hi,

The VI right now reads in the voltage from my 6009 analog input, and plots it on a chart.  I would like to have the motor rotate depending on the value of the voltage.  I have created two values, Initial Voltage, and Lowest Voltage.  I would like the motor to rotate clockwise from initial voltage until the Lowest Voltage is read, then have the motor rotate counter-clockwise until the Initial Voltage is reached once again... and continue this process.  I've having trouble figuring out how to do this.

 

I've attached my VI

 

Thanks

-Nick

0 Kudos
Message 19 of 23
(2,788 Views)

If anybody else if following this thread, I figured out how to adjust my VI so that it works for my specs on the previous post.  The VI is attached.  As of right now, the 6009 reads in voltages from ~5.22V to ~-3V.  The initial voltage is 5.22V.  The goal of my VI is to rotate the stepper motor, which will lower an LVDT (Linear Variable Differential Transformer), decreasing the voltage read by the 6009.  How it is set up now, once the voltage reaches 0V, the stepper motor will change directions (counter-clockwise), and rise the LVDT, until the voltage read is 5V, then it will switch again.  I am still modifying the VI so as to fit my device, and will keep updating this thread with the latest VI.

 

-Nick

0 Kudos
Message 20 of 23
(2,775 Views)