Again, still LabVIEW beginner.
I am currently reading an ebook titled “LabVIEW based Advanced Instrumentation System” by S. Sumanthi and P. Surekha, and IMHO this is a good book for beginner. I wish I could finish reading this book as soon as possible, because time is what I do not have
Two days ago, I tried to control a stepper motor with ULN2803 and LabVIEW. FYI -again- I am new to LabVIEW, so don’t expect too much from this article. I have NI-PCI 6221 and NI-PXI 7358 with me, the later is specifically manufactured for motion controller but still it has the digital I/O. And in this article I am using the motion controller digital I/O to control the stepper, if you only have DAQmx you also still can use it to drive your stepper motor, because to control stepper motor only need digital output which you can generate from your DAQmx.
Here’s the LV source code:
This is the front panel where user can specify the speed, direction, number full step. In this case, I am using 1.8 degree stepper motor, which means for one full rotation I need 360/1.8 = 200 steps, then 200 steps/4 = 50 times iteration.
This is the source code when all condition is true:
This is the source code when all condition is false:
Here’s the video for the trial:
and I tried to test the accurateness of this stepper motor for one full cycle (50 iterations) you can watch here:
This stepper motor is not that accurate, for 2-3 trials it was okay but the next trial it lost its position, I tried several times and it still can not maintained its previous position, even though I used slower speed.
And here is the electronic connection I used for the ULN2803 you can find here.





If you need help in any of your LabVIEW projects, head on over to LAVA. They are a great resource.
See here: http://forums.lavag.org
Thanks for your info valiot, it is nice to have a forum abouth LV. Anyway I found that there are not that many topics about motion controller
, or I’d better started a new thread
Simple and nice control post.
It would have been fine if you added some text to explain regarding the programm…
nice post
keep on posting…!
I felt happy to see your Quation….
.:Doing my little part, changing the world:.
I want to change the world! I have my part!
Really its true.
Thankx.
Lux.
Could you mind to give me the example of Labview of this stepper motor control ?
My email : alexlichingyeung@yahoo.com.hk
I have newer worked with LabView, and I have to control stepper motor with pc through it. I don’t know what do i have to create, how to start… Does anybody have some instructions, some short guideline how to create code.
No, I have to use labview, because it is my homework, but I don’t have too much time, and I have to work. It is difficult to me, I cannot afford so much time to learn how to work with labview and to read tree book on english.
I’m just learning basis of labView, and I have problem with everything. Stepper motor is not in my hands, do I have to know motors characteristics, to be able to control it with LabView. And can someone give me just first step to start with controlling stepper motor with LabView. Thanks in advance. My email is idol11@net.hr if it is easier for you to help me.
Hi it is Marin again. My stepper motor is simple one with 4 inputs, clock, enable, direction and step(half/full). I know that it is easy to create labview program to control it but everything is new for me. I have to control it through parallel port on computer. I’m using flat sequence to create clock square signal, but I need some advice. Thanks for advice before. I will contact you here when I find myself in nowhere situation.
I’m almost finished wit my work, but I don’t know how to create clock impulse, 101010101, to be precise, I have created it with flat sequence, but I don’t know how to use it. Indicator is showing that it is changing from one to zero, and so on, but I have to use that and connect it to array. How to do it?
No, I need to generate clock, and I have made it one way but it is complicated, there must be simpler way.
Thanks.
Hi, i am working on trying to get a stepper motor to run with a ULN2803 chip. I can get the motor spinning running by connecting it directly to I/O ports and using a C++ program. For some reason though, I cannot get the ULN2803 chip to work the way I want it too. I want the low-level logic from my I/O ports to be transformed to 12V. I connect 12V and ground to the chip. Then I try to test the chip by simply connecting 5V to an input of the chip. I then check the output and there is 0V there. If you could give me some advice on how to get the chip working it would be greatly appreciated.
Hey, i’m working on moving a stepper motor myself right now but i’ve stumbled over this problem : how do you accelerate the motor? you can’t really make it function at full speed in one step, you’ll most likely end up not positioning it correctly. I’ve thought about simply generating bigger and bigger frequencies for the motor, starting from 0 up to the desired one, but how do i actually do that taking into consideration the mechanical side of the problem (the rotor’s inertia, etc). Maybe you have some documentation?. Sorry about my english, my tech vocabulary isn’t that complex, hope you get the idea.
Hi,
Thanks for the response.
Well, i’m trying to make the motor move in such a manner that you have constant torque. I’m trying to do that by changing to the next phase while the current phase still provides enough fw momentum (i’m talking about the rotor’s momentum) in order to help the next phase switch faster. I’m not talking about high freq here, i’m talking about building a “behaviour” for the command of the motor, so that i can build stable and precise apps with it.
You’re right, you can’t push the motor over a certain freq, the mechanical part lags behind (you can see this best by comparing full step to half-step frequency)
Meanwhile, i’ve managed to put the freq generating part together. The torque part is still a problem. Any ideas?
It is Marin again. I have finished my work for stepper motor, but I still have one little problem. I have to control it through other computer, and I am using web publishing tools. And on some computer I have response “remote panel connection exceeds maximum number of licenses”, but if I use any of others computer and try to connect through this computer it is working. Is it problem with labview or something else
What link please?
Thanks I didn’t notice, because of the similar colors.
Thank you very much for everything. I have made it finally, but now I need to measure steps (bank angle). Using logic blocks and mathematics I have made subVI for calculation of step angle (minus for left, plus for right, and 0.9 for half, double for full) now I need to * it with time, not time but every time flat sequence make one circle indicator have to add or subtract step angle if enable is on. How can I do that? Can I do it with for loop? Motor is working in open loop. It is hard to understand my writings, because of my bad English.
[...] public links >> stepper Comment on Stepper Motor With LabVIEW by Marin Saved by paulocpauloc on Tue 09-12-2008 YUI-based numeric stepper widget Saved by magicmeg on Mon [...]
Hi there,,,,,nice wat u’ve done and it’s really great job…but i have one que…am trying to send a pulse to hardware stepper motor controller,but am facing a problem how to generate the pulse-train and how to send it to the DAQ Assis??
thanx alot for wat u done …
Hi there,
I use NI Labview Motion, with PCI 7330, UMI 7764, stepper motor and an encoder that moved conveyor belt automatically to trigger the camera.
With the same encoder, I plan to trigger also the stepper motor movement (not only the camera) to move the camera, for example given the input trigger of an encoder (by movement of the conveyor belt), the camera position (related to the stepper motor) will also move accordingly.
My idea is to try two different axis, one for encoder, other for motor stepper using Master-Slave VI on NI Motion (gearing and camming), but it is not supported by PCI 7330.
Do you have any other idea ?
Ok I think its bit complicated to explain, I am still working on it I will let you know the progress.
One question, do you know how to reset encoder position in NI Motion using Labview ? it seems that the PCI 7330 always save the last position of the encoder, unless we reset the board completely.
Yes actually there are to Vi’s can be used, reset position and reset encoder position. None of them work. Strange…
hi iam new to labview i need some information on to control stepper motor using labview 8.5
I have searched about the word “stepper motor” and you blog appeared to me.
where can I read about stepper motor in details in your blog?!
i want make program using LabVIEW to control stepper motor moving to right 180 degree and left 180 degree. there are someone suggest me to build it?cause i had been try to build it, but it still fail . Thank you so much
additional questions from me before, in the stepper motor control I use 4 wire so i also use 4 the digital output in LabVIEW 8.2. steper motor that I use in each step produce 0.9 degree. how to make the program to create a stepper motor rotates 180 degrees to the right and left 180 degree. there are ideas to help me?Thank you so much
Hi,
I have never worked with LabView , and I have to simulate stepper motor and control it with LabView. I don’t know what do I have to do… Does anybody have some instructions how to start?
Hi, are you going to make a simulation or directly control a stepper motor using driver, so on…?
i am going to make a simulation… actually i am going to simulate an insulin pump that work with stepper motor …do you know how can i start?
Hi ,
I’m using LabVIEW 8.6. Could you please tell me the subvi that is connected to the Board ID & Port(1) is (wondering if it’s a DAQmx create channel)? and also what is the subvi with in the flat sequence structure? I’m new to LabVIEW and have trouble findingin these icons on the palette. Sorry if this question sounds really dumb.
Thank you so much!
Hi,
Could you please tell me the name of the icon that is connected to the boardID and Port. I’m sorry if this question sounds really dumb. I am new to LabVIEW, and I’m using 8.6. I’ve just not been able to find this icon on the express VIs.
Thank you so much
Hi, you can use a constant (int). The number of the boardID can be seen in MAX.
My project involves controlling a stepper motor using a labview code. I have connected the unipolar stepper motor to the parallel port via the ULN2003A and would like your help guys. My prof insists on this and im new in this field. Please help me with the code and other necessary information expexcted during implementation.
My project involves controlling a stepper motor using a labview code. I have connected the unipolar stepper motor to the parallel port via the ULN2003A. The ULN2003A acts as the motor driver. I dont yet have the circuitry.
This is my idea, i want to implement a house lift using a stepper motor in the folwing manner. During the motor’s clockwise rotation the lift will be moving upwards and during the anticlockwise rotation, the lift will be moving down to groung floor. This will act as a lift which can be taking luggage upstairs in a building.
Now my prof wants me to control the stepper motors rotation using a labview code. Is my idea going to work? Help me with your ideas and complements on this urgent project!! I will appreciate every single detail. Thanks
Hi, I guess it will work. First you need to tell me which NI hardware do you use.
You can start by first describing your project.