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?
You can start by first describing your project.
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.
can anyone of you guys who tried the code above post it in the form of document or show me a link where I can get it.i am very new to LabView and I cant understand half the above symbols which have been used.At least if i have the code I can use help to understand the diagram.
My project is to oprerate a stepper motor using Labview.I have to construct a xy table using 2 stepper motor and control the movement of a plate using the table.
Hi Ramu, this stepper motor is only for fun. Btw, what is your hardware configuration for this project.
In my opinion, this is lookup table, just get the x and y value (in cm) and translate this to steps or
if you use feedback sensor you can read the value of the feedback.
I think I have understand your code a little.Can you please expain to me why you have used the flat sequence.Is it to create the pulses.Then it means your code doesnt account for half step right? What are the VIs that you feed the boolean sequence for?
Am sorry for asking really basic questions but I am starting to learn LabView and am using LabView 8.6.Please do reply as soon as possible.
It is Half step gives more torque. Any sequence diagram as long it is sequence is okay. The sequence is to make sure that the control signal is in sequence as this is the way to control a stepper. No problem. I created this program when I was new to LabVIEW also…just a trial…no optimization..
Also can you explain to me the meaning for the Boolean Cluster you have used.What is the significance of the 1s and 0-s you have used.I understand that apart from the all true condition the rest forms the seqeunce for full step.Then why the other all true condition.
Doh..seems there’s a misunderstanding here…the FULL Step form is the number of how many times the motor will rotate, if it is 0, it will rotate all the time.
It is not the matter of the signal input to the motor (half/full step). Boolean cluster since the port is 8 bits. Just like I say, I create this program at the beginning when I was introduced to LabVIEW.
Hi,
I have a a PCI 7730 which does not have analog outputs.. I have connected to it a UMI 7764 and I need to make operate a actuator that works with a 5Vdc.. I do not need to have a feedback from it.. I just need to have an output with this value (OV and 5V)
Best regards
Hi Ricardo,
If you have the hardware and already installed the software (library for your device), instead of reading the fine manual, you can intuitively “draw” your code using the library, trial and error. If it does not work yet, you can alter your code and try again. Then if you feel you’re going nowhere, then you can start reading the manual. If yet still unsolved, the forum is a good way to start. This method works for me 🙂
hi
i want to learn labview. how do i start ???
doing my graduation in instrumentation.
hav VI nxt sem , but i cant wait to learn
the thing is … i dont hav any project
Yeah. You’d better start with small but challenging project ^^
I am not getting how to generate clock for stepper motor using DAQ PCI-6014 card. Please help me.
You mean pulse clock? You just need to generate on-off-on-off signal on the digital output.
please,can you help me i would like to control a stepper motor with labview i use keithley kusb3100 for acquisition ,i can’t generate a square signal
baraka allaho fikom
Hi, don’t have experience on that device. But if you found digital output, then just generate on-off-on-off signal.
Assalamualaikum,
I’m a mechanical degree student need your help about about my project for controlling the 2 phase stepper motor. I’m using an angle encoder to send the signal to the stepper motor therefore the stepper motor will move according to the signal received. Can you give me the idea to create the vi and front panel for this project.
Wa’alaikumsalam warahmatullah
My 2 cent.
Open loop:
First you need to decide how many step per rotation your motor will move. Supposed if your motor moves 360 steps per rotation, means that one step is 1 degree. If the angle encoder asks for 180 degree then you need to send 180 steps signal to the motor. Do the math.
Close loop:
With the angle encoder works as feedback, you might want to apply the close loop control with some error tolerance. You might refer to some close loop control references for this.
oikss…
hai…I’m trying to control the stepper motor using LabVIEW, with the SD02B 2A stepper motor driver..because i’m new with labview i cannot find a way to do it. can u show to the example how to control the stepper motor with SD02B 2A stepper motor driver in labview.
What is SD02B 2A? If you want to learn LabVIEW try to learn the simplest one, turn on and off LEDs.
Then you can go to the next level.
thanks 4 ur reply….
by the way i already know how to turn n off led’s
and a litter bit about the math scrip.
what i want to do right now…is to control 6 stepper motor by apply the inverse kinematic..
to answer the question of yours… the SD02B is a driver for motor stepper that i use in this project
for your note..i all ready sent my project paper via email…
Hi, I did not receive any email from you..
i already send the email..i hope u can help me…thanks again..
Thanks you for your reply Mr Bondhan Novandy.
My project is about to develop a steer by wire HIL system. I choose to design a close loop system with the angle encoder at the rotor to give the feedback. And one angle encoder at the steering wheel to give the input to the stepper motor. Do you have any step by step tutorial to develop a control system model for 2 phase stepper motor using LabView or Matlab? Or can you provide the tutorial on the source code you develop in this article. Thanks you.
Nice. Steer by wire. Please let me know after you finish your works, looks interesting!! 😀
Sorry, I don’t have experience on controlling the stepper motor using closed-loop. For my thesis I used open loop control where linear potentiometer works as feedback for the steps but not for control input.
Hi, Bondhan
What kind of motor did you use? Can you let me know its
part number? And did you use speed sensor to control
the motor?
Hi Jacob,
Just an ordinary practical stepper motor, It was Sanyo stepper motor.
It is controlled open loop, therefore no need for any sensor as feedback.
asllm;
please,can you help me to generate a square signal with labview in order to control a stepper motor
baraka allaho fikom.
i already send the email..i hope u can help me…thanks again..
Hi bondhan,
i’ve sent you a message on your YouTube profile. I used a uln2803 in order to control a step motor interfaced with labview. I Connect pin 9 to ground and pin 10 to 12 Volt,
pin 1 to 4 at the NI Board and pin from 15 to 18 to motor’s wires, but it doesn’t move. Where could be the problems?
(If i connect the motor directly on board it functions but it has low power because the exit of board is less of 3 mA)..I hoope you could help me: (
The problem usually around these areas:
a. The connection, make sure the connection as it is mentioned in the datasheet
b. Check the signal input from controller (LabVIEW) to the driver. Try to give slow motion first by creating delay in between two signals. Cheap stepper motor usually has a limited response (frequency) on the signal input.
Btw, I already replied to your personal message @ youtube.
Hey I am researching to control 2 step motors via Labview 8.0 with the NI USB 6008 to make the car go ahead, backwards, turn right, turn left.
I do not know very much about labview, could some one help me?
Thanks
Hi
I am using LabView 8.5 and I want to control a stepper motor through LabView. NI PXI 7340 controller card and NI-PXI-6221 Mseries DAQ is having with me. The stepper motor is from Astrosym(Name NEMA23) and the key features are Step Angle 1.8°, High Torque, High Accuracy, High Acceleration, Low Noise, Low Inertia and Smooth Movement. I want to know that wheather I can control this motor through LabView or not? I have a very basic knowledge on LabView.
Does anybody have some instructions, some short of guideline how to complete my project.
Hi, it was two year ago my chance to use DAQ 6221 though in my time it was PCI. In my short guess, yes you can. However, it seems that you’ll need a driver for your motor.
Can you please tell me what sub VI you were used. I just want to know the name of the sub VI only. Is it coded by you or it is a standard one.Actually from the image it is not clear.
For the driver IC ULN2803 is sufficient or I need any micro controller board separately. The specified motor I have already controlled with microcontroller.
Controlling through LabView I think Micro controller board is not required. May be I am wrong.
It was only DIO (Digital Input Output), and that depends on the card you are using. In this article if I am not mistaken it was DIO sub VI from the motion controller PXI 7528. If you have 6221 you can find the sub VI for DIO. Yes, you not need the uC (microcontroller) anymore, since its function will be replaced by LabVIEW.
Dear tell me which type of stepper motor you have used
Please read the comments..
Hello Bondhan,
Nice post and so many comments!
I nee to replace a defected stepper motor (7,5 degree).
I have 2 replacement motors:
1. one is 7,5 degree but when connected it reples. you know it doesnt do the steps, it just goes back and forth 1 step.
2. another motor which takes steps but it is 1.8 degrees so my collected values are wrong.
Can you guid me whereabout in the labview code I should look for no of iterations?
Do you know what causes the reples?
Hi,
I am trying to control stepper motor using Lab View & NI USB 6009. I am using labview for the first time. I saw the source code but Actually I dont know how to get that source code. Can u please Help me?
Try to understand the articles, what I mean is that try to get the idea of how to control a stepper motor. Then with any programming languages you can do that, especially using LabVIEW which should be faster and easier (since it is graphical).
Hello, I am trying to build a rotating radiation detector which is mounted on a stepper motor. My board is PCI 6503 I am using LabVIEW 10.
I am a physicist and i am new to labview, i have been trying to control the stepper motor with the Write Dig Chan.vi example. My problem is that when i run the program nothing happens and i have to manually turn on/off the knob that corresponds to the line that the clock of the motor is connected to get 1 step. I cannot figure out how to replace the boolean knobs of the array that is connected to the DAQmx Write function in order to make a loop etc.. SORRY for the lengthy post, any help would be grateful,
cheers
Hello,
Send me the diagram that you have written. As a physicist you must already know the digital electronics I guess, it is the matter of ON-OFF with a certain pattern and adjusting the delay between those pulses.
I want to control a servo motor thru labview. I have the following hardware: servo motor, electro-craft bdc-12 ampilifer, s8vm-15024 cd power supply, NI PCI-7831R, and scb-68 circuit board. I am new to the field, I connected the motor to the amplifier and I have no idea how to connect the amplifier to the circuit board and create a program in labview to control the motor.
Thank you for your help.
Hello, you need to read the basic way of controlling a servo motor. However, if that electro-craft bdc-12 amplifier is actually the driver you can read the manual, that is how the input configuration to the amplifier and what is the corresponding output. If it is using ADC, then from NI labview, you can generate VDC with respect to the max and min value of the amplifier could take. Therefore you need to read the amplifier manual before you can go on..
hi
i have to control dc motor movement in labview 2009,plz help me in finding solution
Ok, I was able to connect the ampilifer to the SCB-68 shielded connector board. My next step is to control the motor in labview but I dont know where to start. Is there a tutorial or is your program suitable?
I need source code and complete circuit please e-mail to me.
Can you please tell me how to use DAQmx to drive the stepper motor? Will I need to buy a motor driver and a controller too or will DAQmx work to drive the motor?
Hello, If I am not mistaken yes you have to, since the current from DAQmx is not sufficient to drive the motor.
Just buy darlington transistor or ULN2803 is enough.
hi.. I want to controll 2 stepper motor using with labview through usb but what are codes to stepper motors will turn left or right. previously my project, they have controlled with code such as 1,3,4,6,8,9,12 etc… would anybody help me about issuse..
e mail: samedcetinkaya@gmail.com
hii
tjhis is deepak….i have to drive 2 stepper motors.can any one please tell me the driver circuit diagram of uln2803apg ic???????????????????????
hi everyone i want to make something also like that, but i dont have any experience in Labview i like more the Mechanic part but i also i have to put a controller for my stepper motor i have a ULN2803AN, labview, an DAQ NI 9174 with the NI9474 i have it borrowed so i would like to know if its posible t control a stepper motor with this
if someone have something my E-mail is the_little_cuite_death_girl[at]hotmail.com pleasee !!
Hi,
Stuck into a problem, hope to get help from this blog.
I have a GUI built in LabView platform to control camera and accessories which I have done successfully. But I am stuck into controlling a stepper motor.
I have to control the stepper motor through PSoC. I just need to send pulse either to rotate the motor or stop the motor. Thats all. I use the motor driver, PSoC, USB-232 converter and LabView software. With the code I develop I am not able to send any pulse to PSoC to start the motor.
Hope I can get help from here.
Thanks
Sagar