Stepper motor and NI6025E card

I want to control a stepper motor with a 6025E National instrument card. My stepper motor is controlled with a microstep controller.
Does anybody have already done that ? I am interested by some examples...
Please HELP me...
Frederic
[email protected]

I don't have any examples but I have done this before and it's not that difficult in principle. Getting precise timing can be tricky, and you'll have to use counters rather than the regular DIO ports for that kind of precision.
I had an MC3479 stepper motor driver to control each motor (there were 2). The way I did it was to use a counter for the clock signal and the DIO ports for control. I generated a gated pulse train on one of the counters, with a DIO pin (DIO 0)as the gate. The Direction, Full/Half step, and other control lines were also connected to the DIO port. I just wrote out whatever data word I needed to setup the motion I wanted, with the pin 0 high to let the clock move the motor. The motor had to be stopped by clearing bit 0, which I had after a tim
ing delay that was changed in the program. It required a little calculation to get the time delay matched with the frequency of the pulse train to get the number of steps I needed, and it was only approximate; I wasn't worried about exact position as much as being able to adjust the position dynamically.
For precise position you might try using just a digital line to increment the clock. This is simplest, but the timing will depend on your program. You can also use the other counter for a very precise gate signal, which gives accuracy as well as time-specific rotation, but uses the other counter and is programmatically more complex.

Similar Messages

  • Servo Motor and NI Card

    Hello,
    I'm pretty familiar with LabVIEW specially with the vision part of it, but I'm not familiar at all with servo motors.
    Problem statement:
    I'd like to make a VI that controls a servo motor that will rotate a screw every x amount of time (in both directions, obviously).
    Limitations:
    The screw turning should be a smooth as possible as it is a very delicate instrument and experiment. 
    As stated above, I don't know the first thing about servo motors and NI cards, and I would like to get some advice from you. Where should I begin? What are your recommendations for NI cards/ Motors?
    I don't think that the software aspect will be very challenging, it's just two nested loops-- the first is a while loop that controls the whole experiment time and the other controls the turning function.
    Unless, I underestimate to complexity of setting up a servo motor VI.
    I'd be happy to hear any thoughts/ideas you might have.
    Thank you,
    A

    Hey A,
    I would start by checking this website.
    I would recommend using a PCI card 7332, with UMI 7772, and AKD servo drive P00606. Then you can select the motor from here. Depending on the size of your application, choose a motor, and then make sure that the drive has enough current to power it. 
    Regards,
    A. Zaatari
    National Instruments
    Applications Engineer

  • Relationship between angle (Stepper motor) and distance (Kinect)?

    Hi I am doing a project consisting of a stepper motor and Kinect. I want the stepper motor to rotate according to the distance of a
    body joint recognised by Kinect. I wan to cast a laser pointer on the left hand of a person all the time. If the person goes further away from the camera, the stepper motor moves in a way that the laser dot is at the hand.

    Kinect will have no knowledge of your external system, you have to develop how that would work. The Kinect Skeleton tracking api's will provide you the joint distances from the sensor in "world space" in meters. Each skeleton object has a position
    property that will give you the center of the person(up to 6). If you want to know specific joint detail, you can get full joint information on up to 2. See the skeleton tracking samples in the SDK Toolkit browser(Skeleton Basics, Kinect Explorer, etc)
    https://msdn.microsoft.com/en-us/library/hh973074.aspx
    Carmine Sirignano - MSFT

  • Stepper motor and loacell PID control - waveform motion.

    Hi, 
    Hardware :  cRio9073, C series module 9403 for stepper motor control and 9215 for load cell data acquisition. 
    I am trying to control a stepper motor in a closed feedback loop system with a load cell. The user would have to input two things : the maximum load applied and the frequency of the motion. At the moment I have it working in open loop controlling how many steps forwards or backwards it does and at what rate, with a display showing the load being applied.
    I am now looking to include the "PID.vi" built into labview into my existing code. I am using the load cell output as the 'process variable' and the 'output' of the PID will control the wait time between an ON and OFF signal to the motor (since I have to do the PWM in software as the 9403 module doesn't do it in hardware. Is this the right way to do it? ) 
    I wish to make the motor do a sinewave motion, thus the 'setpoint' of the PID would be dynamic. I have therefore linked the "Sinewave form.vi" (also built into labview) to the setpoint and the frequency of the "Sinewave form.vi" will be the user input for the frequency of the motor. However my problem lies with the 'Sampling info' of the "Sinewave form.vi" : Previously that is what controlled my number of steps, defining the maximum displacement of the motor. Now I need the peak of the generated sinewave to coincide with the maximum load applied defined by the user. How can I make it do that? 
    I have attached my existing code with how I have attached the PID.vi at the moment. 
    Many thanks for your help
    Lawrence 
    Attachments:
    PIDControl.vi ‏23 KB
    BIOGROWTH.lvproj ‏46 KB

    Hi Lawrence,
    Here is an example PID VI.
    Regards
    Rico P
    Attachments:
    General PID Simulator.vi ‏22 KB

  • I want to run a stepper motor using FPGA card 7851r with 9474 driver C rio 9151 is it possible or can i do in LABVIEW CVI

    Hello i want to run Stepper with 7851 R FPGA card with 9474 driver of crio chasis but i am not able to understand how to proceed .Or can opt this option by using lab view CVI
    Solved!
    Go to Solution.

    Hi SHV,
    actually I don't know in which context you want to use your existing hardware for your stepper motor.
    1. The hardware, which you describe, is/was used for which application? ( data acquisition, controlling a system, etc)?
    2. Did you buy the hardware especially for the motor application?
    3. You don't know how which signals are required for your stepper motor.
    Here are some basics from NI about motor control
    Fundamentals of Motion Control
    http://www.ni.com/white-paper/3367/en
    NI Motion Control Technical Library
    http://www.ni.com/white-paper/3054/en
    4. Why do you get the idea the digital output module 9474 is suitable for the stepper motor?
    I would recommend to talk directly to the customer support, so we can figure out in detail your aims about
    the application. Contact your local NI office or request
    a service request on following website:
    Service Request Manager
    https://sine.ni.com/srm/app/login/p/tab/getassistance
    Kind regards,
    RupiDo

  • Stepper motor and sequence

    There are stepper motor vi and sequence vi at the attach file. I want to control stepper motor via sequence vi. When I run the stepper motor vi, it can not be reached part of enter position. How can I integrate sequence vi into the stepper motor vi.
    Attachments:
    Stepper motor.vi ‏24 KB
    Return Code Insertion.vi ‏14 KB

    Sequence vi.
    Attachments:
    Sequence.vi ‏10 KB

  • How to generate digital pulses to run stepper motor in a sinusoidal motion profile using NI DAQ 6229 card

    Hi,
             I need to make a stepper motor undergo rotary oscillation with a sinusoidal motion profile. As it nears the extreme points it should decelerate and finally slow down to zero velocity and then it should reverse direction and accelerate until it reaches the other extremity where it should slow down and stop and reverse direction and repeat this motion.
            The hardware is NI DAQ 6229 and the stepper motor can be controlled using digital Hi-Low (1,0) pulses. For each high pulse(1's) the motor turns 1 step. I am able to generate a analog sine wave and convert it to digital data using Analog-to-Digital.vi  But i am not able to convert the digital data to a stream of 1's and 0's in the correct sequence to get the sinusoidal profile with the amplitude and frequency i require.
            The direction of rotation can be changed by giving a pulse to another input of the stepper motor. So only half cycle of sine wave needs to be generated and it can be replayed after changing the direction to get the full sinusoidal profile.
    Any ways of making this approach work or any new approaches to this problem would be helpful. Thank You.
    Regards,
    Prabu.
    Solved!
    Go to Solution.

    Hi,
             I finally figured out a way to do it. The analog sine wave is converted to digital and sampled. Consecutive values are compared and if the least significant bit(LSB) changes then a pulse is sent to the stepper motor to turn one step.
    I have included the sub-VI's that accomplish it for the particular stepper motor and connector block i have. The front panel of both sub-VI's are quite messy but the block diagrams should be much clearer. The sub-VI's get their inputs from a third VI which i have not included. So take a look at the VI connector panel to figure it out. Hope this helps. Kinda messy but worked out fine in the end for my application. 
    Thanks again for all the help. I appreciate it very much.
    Regards,
    Prabu Sellappan
    Graduate Student
    Aerospace and Mechanical Enggineering
    University of Southern California
    Attachments:
    start motor test waveform dtest.vi ‏73 KB
    sine profile generation subVI.vi ‏41 KB

  • Anaheim Automation stepper motor with PCI-7330 and UMI-7764

    Hi, I'm fairly new to LabView 2010 and stepper motors in general. I've been trying to get an Anaheim Automation stepper motor and encoder to work with LabView with some success but it isn't quite right. My main problem is when the home switch is activated the whole thing is killed and I cannot get it to respond unless I manually turn the motor so that it is not on the home switch anymore. After that it will run ok, unless it hits the home switch again (btw if it hits the forward limit switch it will stop but it will accept a command to move away from it).
    Could someone please take a look at my wiring diagram in the link below and let me know if there is anything obviously wrong with how I wired it up or if you have any suggestions on where my settings might be going wrong I'd really like to hear from you. 
    Thanks,
    Rob
    Wiring diagram: https://docs.google.com/present/edit?id=0AW08JmeQD7nyZHBzejljOF82OWc4NHg4Z2M4&hl=en_GB&authkey=CPbsv...
    Tech sheets:-
    Stepper motor: http://www.anaheimautomation.com/manuals/stepper/L010130%20-%2023MD%20Series%20Users%20Guide.pdf
    Encoder: http://www.anaheimautomation.com/manuals/encoder/L010723%20-%20ENC-A2N%20Single-Ended%20Encoder%20wi...

    Thanks for the reply, I am trying to run any of the find reference example VIs from NI. I've not edited the code in any way.
    The motors will run with the wiring I've posted, it'll move to the forward limit switch then come back again but it will then hit the home switch, the motor stops and cannot be started again until it is manually moved off the home switch. It has never made it all the way to the reverse limit switch meaning I cannot use home (it stops) or the centre (can't find the reverse limit) as a reference point.
    It was suggested to me I might have the grounds miswired, the manuels were not all that clear so I'm unsure.

  • Using LabView, Arduino, and Easy-Driver to control a Stepper Motor

    Hello fair folks of the LabView forums!
    I am a humble engineering student in need of some advice and input on a project I am working on.
    I’ve also done a fair amount of reading on the LabView forums with people trying to use LabView and Arduino to control stepper motors, and I’ve used as much information from each as I could. However the problem I'm encountering now is one which is unique to my VI Configuration.
    So, here is what has been done thus far:
    -Installed LabView Interface for Arduino [LIFA]
    -Installed necessary VISA drivers for LabView to communicate with arduino
    -Uploaded firmware to Arduino to allow it to communicate with LabView
    -Properly wired Stepper Motor with Easy Driver and Power Supply; I have verified this by first using the Arduino independently of LabView, using example code found here.
    -I have created a VI, and have just recently got it to run without reporting back any errors. While I suspect the behavior I’m encountering has to do with something inside the VI, it is difficult to determine as there are no errors being reported!
    But here is general problem I am encountering:
    -Connect Joystick to USB Port, connect Arduino to USB Port.
    -Plug in outlet for Power Supply
    -Open LabView VI
    -Run LabView VI
    -LabView successfully detects Joystick, and Arduino.
    -Tilt Joystick; Stepper Motor moves in proper direction, but it only takes a single step. If held, it does not move further. If returned to zero, and then tilted, it again only takes a single step.
    I know that in the example code, the Arduino issued the step command by writing the signal from LOW to HIGH, and varied the speed by how often it did this.
    I assumed that the Write-PWM feature would do this same thing, but perhaps my assumption is wrong. I will continue to tinker with this myself, but I would be extremely grateful for any insight you might be able to lend.
    I’m thinking, if not the Arduino Write-PMW feature perhaps a simple timing-sequence that could be used to alternate between writing 0 and 1, with the timescale of the sequence being scaled to the X-Axis from the Joystick. But, I am open to suggestions, and certainly appreciate any thoughts you may have to offer!
    Attached to this is the VI used in this setup, a picture of said VI, as well as a rough sketch of the hardware configuration.
    Thank you!
    Attachments:
    Arduino Stepper Control.vi ‏1224 KB
    VI Picture.png ‏82 KB
    Configuration Sketch.png ‏522 KB

    Hi danjifraga,
    I am not so familiar with the Arduino toolkit functions, but you may have better luck looking at the Arduino page at:
    www.ni.com/arduino
    I'll ask around on Monday to see if anyone is more familiar with the toolkit.
    Good luck,
    Brian
    Brian G.

  • Stepper motor positioning control system

    hello
    Iam building positioning control system using a stepper motor, and I need to know what are some position sensors available to feedback the position of the stepper motor.. Also I need to know how can use a C code in the labview...For example, if I have an algorithm developed in C; How can I use that code in the labview..
    Thanks
    Shaham

    Shaham,
    Below is a link to several encoders that NI provides specifically for stepper motors.
    Quadrature Encoder:
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/205321
    As far as the C code is concerned, this can be accomplished in two different ways, provided that the code is first placed in a dll file.  
    First, you can import the dll into a project library, by selecting Tools»Import»Shared Library.  This option is good for code that will be used often, as it creates wrapper VIs for each function that can be reused.
    Secondly, a "Call Library Function" node can be used to call a C function from a dll.  This procedure is shown in the following tutorial, and is useful when code only needs to be called a few times.
    http://decibel.ni.com/content/docs/DOC-9069
    I hope this helps!
    Drew
    Drew T.
    NIC AE Specialist

  • Stepper motor

    I have a labview program for controlling a stepper motor and allthe necessarry hardware. When I run the labview program there are no errors. However the motor does not move. A friend suggest to run MAX AUTOMATION but I have not. I am concerned if I run MAX I might damage the computer and corrupt the present configuration. I have connected STEP< DIRECTION< PRESET AND CLOCK from the drive board to four DIO. I have not specified that in MAX. What shall I do?

    MAX gives you a very useful but limited ability to manipulate your DAQ board's i/o signals. It's often used in place of a full-fledged user program during initial setup and later during troubleshooting because it provides an NI-controlled interface to the DAQ hardware that isn't corrupted by possible user programming bugs. I think you probably ought to use MAX first to work out all the appropriate signals and connections before trying to use your friend's program.
    You'll also need to understand the basic principle of operation for your friend's program and the stepper driver board. If you're using a different motor or driver, you may have incompatibilities.
    What DAQ board do you have? Who makes the drive board? The signals you mentioned (STEP, DIRECTION, PRESET, and CLOCK) are not a familiar set to me. DIRECTION is very likely a digital bit to determine whether to step CW or CCW. Either STEP or CLOCK (or both?) should probably be a counter pulse train. I've usually seen either one or the other word used in a stepper interface, but not both at once so I'm not sure what's up with that. I really couldn't guess what function PRESET means. And you'll also need your digital GROUND or RETURN connection(s).
    As for "assigning pins" to the functions: I would approach it a little differently. The issue is that you can't arbitrarily assign any old signal to any old pin. For example, some pins are for analog input and you can't generate digital bits on them.
    So..... First determine what kind of signals you need for each functions (digital bit?, counter pulse train?), then find out which pins from you DAQ board can produce the right signal, and finally wire them up. At that point, you can choose either MAX or LabVIEW programming to put signals onto those pins. MAX will be best for initial testing, but the final app almost always needs to be based on programming.
    -Kevin P.

  • I need an example vi about stepper motor control

    Hi.
    My system is consist of pc-tio-10 controller, SLOSYN SS2000D6 driver, NEMA 17 stepper motor,and labview5.1.
    I'm trying to give a pulse to the motor, take a pulse from the motor and control the nmotor. But I don't know what to do. So I want to see the example vi.
    Please let me know where I can get appropriate example for this case. Thanks.
    Jee

    Here is an older example from LV 3.X, but the concept is still valid.
    Attachments:
    STEPPER.TXT ‏2 KB
    STEPPER.LLB ‏197 KB

  • Best way to make this stepper motor control system

    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
    Solved!
    Go to Solution.

    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

  • Stepper motor input pulse problem

    Hello
    I've purchased 4 autonics a41k-m599 model 5-phase stepper motors and 4 MD5-MF14 model drivers. I want to pulse the drivers via parallel port with c++. Now I have some serious problem, first I can't get a higher speed than 666 pps (1500 microseconds interval), second and more important when I send pulse to driver I see motors rotate smoothly but in some moments (and not regularly) they produce some small pauses which result in some small shakes or vibrations. Here I send you a scrap of my c++ code:
    // ten cycle
        for(int iLoop = 0; iLoop < 10; iLoop++) {
            // 500 step to complete a cycle (each step is 0.72 degree)
            for(int j = 0; j < 500; j++) {
                outp(LPT1, HIGH);    // send HIGH to CW through LPT1
                outp(LPT1, LOW);    // send LOW to CW through LPT1
                DelayMicroSleep(1500);    // delay 1500 microseconds as pulse interval
    Here's a picture of my driver's time chart and input pulse specifications:
    http://lh4.ggpht.com/_sFND_wFW_Qo/SttpJRzLpKI/AAAAAAAACGA/uRNWYH519dU/s800/StepperMotorTimeChartPuls...
    So now what could be the problem?

    Should you not have a delay between sending the high and low pulse? Otherwise the pulse will happen very quickly.
    // ten cycle
        for(int iLoop = 0; iLoop < 10; iLoop++) {
            // 500 step to complete a cycle (each step is 0.72 degree)
            for(int j = 0; j < 500; j++) {
                outp(LPT1, HIGH);    // send HIGH to CW through LPT1
                DelayMicroSleep(hightime);
                outp(LPT1, LOW);    // send LOW to CW through LPT1
                DelayMicroSleep(1500);    // delay 1500 microseconds as pulse interval
    nrp
    CLA

  • Stepper motor case structure

    Hey everyone
    I am currently a physics student and for my final year project I am building a mini CT scanner which involves the use of two stepper motors. I currently have a program working which controlls the motors but i am having difficulty in reversing the rotation. Unlike conventional CT scanners, I must rotate the sample. Would anyone be able to help me figure out how to automatically change the case structure form true to false in order to reverse the stepper motor and without stopping the program.
    Many thanks
    John
    Attachments:
    motor.vi ‏48 KB

    From this point, it is just a matter of figuring out what logic you want to be in place of that control.
    You can go by the number of iterations and switch if you go beyond a certain count.  You could go by your rotations completed.  It is just a simple comparison.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • How can I combine an old Apple ID database with my current new apple ID

    My boss used an old forgotten Apple ID and we found an old IPOD and used touch copy to move the data(music) from the ipod back into I-Tunes. When trying to play we found two problems. One is we no longer use the Apple ID tied to the music files and t

  • Can things in the icloud be shared between apple id accounts?

    I would like to add my iphone and my wifes iphone to icloud.  If we each have our own apple id, will we be able to share our photos between accounts, or would it be better to have one apple id and place both of our devices under the one account?  If

  • Reg.Calculate Raw material cost(Fabric)+Process cost(semifinished -cutting)

    Dear Friends Please consider our below scenario In AFS, PO is created and stock is maintained in unrestricted (Raw material) and then Production order is created for Cut pcs and Raw material is issued to production order through 261 mvt type next Cut

  • Session value

    hi experts, am using jdev 11.1.1.5.0 - adfbc- oracle db10g. here i what i want. following season class >> scope is session scope..   <af:inputText label="anni" id="pann"                               value="#{season.p_ann}"                           

  • UDF at balance sheet report

    Hi All, When we run the finance report (Trial balance,profit and loss statement,Balance sheet) then there are two parameter to bifurcate the reports on Expended button.These parameters are working well on Trial balance and P&L but not on Balance shee