05-08-2014 07:13 PM
Hi there,
I'm fairly new to LabVIEW, and I'm trying to run a small stepper motor with ULN2003 based driver board (one of these) with a myRIO. I have gone through a few examples in the project guide to get a feel for things, but I can't figure out how to run this stepper.
What I'm wondering is how do I create the signals to run to the IN1,2,3,4 on the driver board? What functions would I use?
I don't have a deep understanding of LabVIEW yet, so any specific explanations are welcome. Or, if anyone has an example VI for doing this or something similar, I can just look through that.
05-09-2014 06:38 PM
Hi GregRomero,
You could use the Edge Detection and Debouncing example shipped with the myRIO. You can open this example by navigation to Help >> Find examples and then look under Modules and Toolkits >> myRIO. For controlling these signals (1s/0s), you should use a digital output task; in the example, you can just reconfigure the Express VI. For the stepper, you need to control both the direction and pulses. You can start by programming the sequence given in the 8-step sequence. I also found an example that might help you (example.) .
05-14-2014 10:24 AM
Hey GregRomero,
I'd start simple. You can control the stepper motor controller inputs using the Digital Output Express VI, but before you to that, play around with the LED Express VI so you can see how digital outputs work. Create a VI that looks like this:
Run the VI and click the buttons to turn on and off the LEDS. Then switch the LED Express VI to the Digital Out express VI and choose the DO channels you've connected to the stepper drive. Now you can use the buttons to set the digital outputs and use the logic table on the page you linked to set the motor step.
Once you get that working you can replace the manual button presses with generated values to drive the motor.
Let us know if you have questions about any of this.
-Sam K
Join / Follow the LabVIEW Hacker Group on google+
05-14-2014 05:46 PM - edited 05-14-2014 05:47 PM
Thanks for the replies,
I'll attach a screenshot of the VI I came up with to run the stepper. It works, but I have a feeling it might not be an ideal way to do it. The array starts at 1100 and just shifts, driven by the iteration (there's probably something wrong with this). To turn right, the iteration is just multiplied by -1.