Controlling Stepper Motor

Hi All.
I am pretty new to Labview, and am looking for some advice in controlling a set of two stepper motors.  I have some experience with controlling stepper motors, but previously I used Matlab to create a binary script that was read into Labview to create a motion that I desired for the two motors.  Now I am hoping to control the motors using coordinates read in from another system (not an encoder, but a completely different system).  I basically just want the motors to follow the X and Y coordinates as they are read into Labview from the other system.  Any ideas are appreciated.
Thanks!
Jacob

By LabVIEW driver I'm ssuming you mean the DAQ drivers and I'm also assuming since you're using a DAQ to control the motors you don't have an actual motor controller which means you will have to write the code to perform the function of a physical motor controller.
Since it sounds like you're starting with a pretty low-level interface, I would say the next step is to write a wrapper that lets you input a) Step Direction and b) No of Steps to make in the direction
Then you could use that function within what will ultimately be your "motor controller" which will keep track of where the motor currently is based on previous steps, and use that to enable the use of an absolute position your high level input.

Similar Messages

  • I am using field point to replacement plc, i need to control stepper motor by using field point, what module should i buy and how to control it?

    Can i use FP-PG-522 or FP-PWM-520 to control the stepper motor.

    Cheeking,
    I think Aaron has answered this query at: http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=506500000008000000E16E0000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
    Pravin

  • Using BNC2110 DAQ In Order to Control Stepper Motor

    So basically my goal here is to use LabView to control the direction and the steps of the stepper motor.
    I have BNC 2110 (connected to PC), Lin Engineering's 4218M-54P-04 Stepper Motor, and Lin Engineering's R701 Stepper Motor Driver.
    The specification documentations are attached.
    I know that the driver and the stepper motor are compatible.
    Is it possible to control the motor through Labview(PC) < - -> BNC2110 < - -> R701 Driver < - -> Stepper Motor, without the motor's own controller?
    An example of a controller for this particular motor would be on this website.
    I would much appreciate your support.
    Thank you.
    Attachments:
    4LeadBipolarSteppingDriver-linengineering--4218m-54p-04.pdf ‏652 KB
    DriverR701.pdf ‏379 KB

    Hi jhprks,
    It would appear that the stepper motor controller that you list communicates via RS-232 or RS-485.  You can make serial calls in LabVIEW using the Serial or VISA commands.  It could be something to look into.
    Further, we do have a multitude of ways to accomplish this with our hardware; here are a few resources to take a look at, with the first being an example of how to do this with a multifunction DAQ device:
    Using Software Timed Digital IO to control a stepper motor with DAQmx:
    http://decibel.ni.com/content/docs/DOC-6385
    Stepper motor control via Parallel port:
    http://zone.ni.com/devzone/cda/epd/p/id/3611
    High Performance Stepper/Servo control:
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/10026
    Stepper Motor Theory of Operation:
    http://zone.ni.com/devzone/cda/ph/p/id/248
    Stepper motor Drives:
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/3308
    Adam
    Academic Product Manager
    National Intruments

  • 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.

  • What kind of cFP can I use to control a stepper motor

    Hi everybody !
    I want to control stepper motors (like to control the opening of a My question is :

    Duplicate post !

  • 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

  • What NI Stepper Drive is compatible with both NEMA 11 and NEMA 42 stepper motors?

    I have a NI PXI-7350(Motion Controller), a NI UMI7774 (Universal Interface), and a NI P70530(Stepper Drive) and I tried linking up a new NEMA 11 stepper motor linear actuator from Hayden Kirk and kept getting a constant red blinking light on the driver. I then connected my new NEMA 23 stepper motor linear actuator from Hayden Kirk and the driver had the go ahead green light and it worked fine. I consulted the manuals and saw that the driver was only compatible for NEMA 17-34 Steppers. I tried the third party setting as well for the NEMA 11 to no avail. Does anyone know of a NI Stepper Drive that is compatible with my UMI and Motion Controller and also is compatible with a NEMA 11 and NEMA 42 (another motor I need controlled) stepper motors?????
    Solved!
    Go to Solution.

    Thank you for the quick response
    So I have connected as the Third Party Motor option with the P70530 Stepper Driver. I have read the manual and selected the appropriate DIP switches for the third party motor setting. As instructed I downloaded the P7000 Tools 2.11 to set up the motor with the driver. When I open it and try to search for the driver nothing is located. I have appropriately changed the COM settings in the device manager to the appropriate values and also I am seeing the steady green light on the driver. I am at another stand still. What else can I do to get the driver recognized so I can set up these motors?
    Thank you for your time,
    Tom

  • 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

  • Stepper motor closed loop control using 7344

    I have some question about the closed loop control of stepper motor using 7344. From the NI website I got that closed loop steppers work differently from closed loop servos. Instead of adjusting the output on each PID iteration like a servo system, closed loop steppers will do a pull-in move at the end of a move to adjust for any difference between the target position and the encoder feedback. By default, it will attempt the pull-in move three times.
    Now for example I got five points: (0,0) (10,20) (30 40) ( 31 60) (50 65). The request time interval I set as 10ms. This mean that in the first 10ms, the machine should move from (0 0) to (10 20). But for some reasons the machine can not move to (10, 20), it moves to (8,16) and the first 10ms passed. In the second 10ms, how it move? Move from (8 16) to (30 40), If like this, the following error will accumulated. In practise, it is not accumulated. Is there anyone can explain something about the closed loop control of stepp motor? Thanks a lot!

    Requested Interval is additional data for the Position buffer type. The Position buffer type requires a Requested Interval parameter, and indicates the time between contouring data points in milliseconds. For all other buffer types, the Requested Interval parameter is ignored.
    The controller will use the closest value it can that is greater than or equal to the interval value you requested. Your time interval must be an even multiple of the PID rate.
    For example, given a PID rate of 250 ms, a time interval of 11.2 ms between points is physically impossible, so a call to configure buffer with an interval of 11.2 causes the  buffer to actually be configured for 11.25 ms, since 11.25 is the nearest possible interval greater than 11.2. The following table shows valid intervals for each PID rate.
    My question is like this. For example I got five points: (0,0) (10,20) (30 40) ( 31 60) (50 65). The request time interval I set as 10ms. This mean that in the first 10ms, the machine should move from (0 0) to (10 20).  If it is impossible for the machine to move from (0 0) to (10 20), there are two ways to solve this problem. First is the time interval is 10ms and assume it move to (8 16) within 10ms and take (8 16) as the start point and (30 40) as the end point of the second move. Second is extend the time interval, assume it takes 14ms to move from (0 0) to (10 20). After 14ms, the (10 20) is the new start point for the second move. I think it works as the second ways.If not, the following error will accumulated.  Is there anyone can explain something about the closed loop control of stepp motor in detail? Thanks a lot!

  • Stepper Motor with Linear Stage (Position Control and Data Acquisition)

    Hey All,
    So.. I've attached a stepper motor to a linear stage and so far it's working pretty well.  Using a stepper motor driver from Pololu, I've simplified the control of the motor by just using output pulses from the counter output of a PXI-6143.  I've tested the motor using the Pulse Train examples in LabVIEW and all is working well.  
    My goal now is to allow the user to collect data from a pressure sensor, attached to the linear stage, every X number of steps.  From what I can tell so far, and please correct me if I'm wrong, the motor step movement is synchronised with the pulse train input.  That is to say, if I give the motor a 200 step pulse train, the pulse train ouput is completed at the exact time the motor has moved 200 steps.  From this, I've created a VI that moves the motor X steps, aquires the data point, and then repeats this process for the required amount of data points.  The problem with this is that the motor movement is not continuous; it stops for a split second to take the data point.
    How can I have labview ouput a pulse train of say 1000 steps and record a data point every 50 steps?
    Two ideas that came to mind were:
    1. Use the counter input port on the card to count the pulses being sent to the motor.  
    2. Use an encoder connected to the motor shaft.
    I wanted to stay away from theses ideas though since they require resources from the DAQ card.  
    Thanks,
    Ryan

    Hi Ryan,
    Just to cover all the bases, what version of LabVIEW are you using and can you attach your VI? Initially your ideas sound like they should work, do you expect to be nearly maxing out the DAQ?
    Thank you,
    Deborah Y.
    LabVIEW Real-Time Product Marketing Manager
    Certified LabVIEW Architect
    National Instruments

  • What's the type of control for stepper motor?

    Hi,
    I'm using PXI-7358 controller, UMI-7774, Industrial Device NextStep third part microstepping drive, stepper motor SANYO-DENKI (type 103-8932-6421, NEMA42) and incremental encoder 3600 ppr (14400 count/round). I want to say what's the NI onboard type of control used to control motor step position? In the case of servomotor the type of onboard control is a PID, in the case of stepper motor what's the type of control? What's the MAX parameters to set for the project specific (overshoot, settling time, rise time etc..)? What does it means "Pull-in Window" e "Pull-in Tries" in MAX? So, it's possible control the stepper motor with user's algorithm control, excluding the onboard control?
    Thanks for your patience,
    Best regards
    Lorenzo

    >
    Matt wrote:
    > Go to SE24.  Type in cl_dd_document and press enter.  Select the methods tab.  Look for the method "CONSTRUCTOR".  Double click on it.   Click on SIGNATURE button.  The types of the parameters are clearly seen.
    >
    > matt
    TYPE and VALUES OF TYPE -- different things. For example, TYPE C -- CHAR. VALUES of this: A, B, C, ..., 1, 2, 3.
    Thus, return to question.
    TYPES: sdydo_attribute(50) TYPE c
    TYPE: sdydo_attribute
    VALUES: ???
    May be, value ABRAKADABRA correct?

  • How can i control the motor movement of stepper motor using a NI PXI 7330

    Good day to all,
    i'm a newbie in programming in motion control of NI. I just want to ask if how can i control the clockwise and counter-clockwise rotation of a stepper motor using NI PXI 7330 module. all i can do is the counter-clockwise rotation using the example vi (Simple one-axis move.vi) found in the examples of LabView 2009.
    Thanks

    what type of limit switch sensor are you using and how did you wire itß What are your MAX settings regarding the limit switches?
    Good day SIr Jochen,
    I am using two reed switch for the reverse and forward limit. I wired the signal wire of the reed switch to the limit ports(forward and reverse Limit) and its ground to the digital ground of the UMI-7764.
    the attachment below is the my max configuration about limit switches
    Attachments:
    max configuration.JPG ‏155 KB

  • How do you control LED lights on the front panel to identify the number of steps a stepper motor has taken?

    I am controlling a stepper motor that is coupled with a valve with four outlets (using an Arduino).  I've got a general understanding of how to control the motor, but I want LED lights on the front panel to light up that indicate which outlet the valve is currently at after the steps are taken.  The method I'm thinking about involves a lot of repetitive code.  I'm not that experienced with LabVIEW, I'm assuming I need some sort of loop structure but I don't know how to set it up in order to control the sequence of the LEDs.  I've attached my current block diagram for a visual aid if needed.
    Attachments:
    Capture.JPG ‏33 KB

    I was thinking about using the Stepper To Go and Stepper Write functions four separate times, using the same constants for the steps each time since the distance between each outlet is equivalent.  The only difference would be what's connected to the "steps remaining" node, which would be the function that activates one of the four LEDs (if that makes sense).  I was thinking that doing it this way would be a little counterintuitive since the only thing that needs to be changed is the LED indicator.

  • Can I control a stepper motor by a time varying velocity input?

    I want to control the motion of the stepper motor by a velocity input that looks something like a Sine wave.The velocity is changing as a function of time. Can I change the velocity of the motor at a prescribed time interval?
    Thanks in advance
    Kevin

    Thanks for getting back to me on this. The controller card that I have is the PCI-7342 controller card. The time of a cycle is about seven minutes. I want to ramp the RPM of the motor from zero up to a max value then return it to zero and then go in the opposite direction . A graph of the RPM vs Time is attached.
    I thought that I could input an array of velocities into a Load RPM VI and specify the time for each input.I have not been able to do this as of yet, because the load RPM VI will not take an array input.
    All these inputs would be made in labview so they are inputs for the controller card. I was under the impression that the controller card generates the steps and direction from the data entered in labview and sends the step and direction impulses to the driver. Do I have the method of operation right?
    Do you think this is possible?
    Thanks again

  • Position drift during the stepper motor controlled back and forth motion

    Hi everyone there,
    I get a headache position drift problem during the stepper motor controlled back and forth motion. I have been wroking on the problem for the last two weeks, and still can not figure it out. So I write down here my problem in hope of getting some clues from those have some experiences in stepper motor motion control.
    My goal is to use a stepper motor to drive a beam flage fixed onto the shaft to go back and forth for a certain angle, and this back and forth motion needs to be stable and reproducible within hours. With the SMD1 stepper motor driver, I only need to send in a pulse train to control the number of steps(the pulse frequency defines the stepping rate), and another pulse to controle the direction (i.e., cw or ccw). To do this, in LabView, I used the counter of the DAQ board to produce a finite pulse train to step the motor, and used one digital line to produce a pulse to switch the direction every 500ms, the timing is contolled by the software.(I used the oscilloscope to monitor these two pulses, the pulse train produced by the counter looks very stable, and delay between the pulse edges of the direction pulse and the pulse train is also very stable within 500ms. There seems no software timing problems at such a long delay.)  And this labview controlled motor appears to work perfectly as I required, the motor steps a defined number of steps at one direction, and then steps back at the origin position. But after running for a few minutes, the back position shifts gradually(I can not observe a obvious shift at the first few minutes) with repect to the origin position(the position I start running). I looked it up at the manual and also the website, I got a clue that this might because the motor steps at the resonace frequency of the motor and hence misses or takes extral steps sometimes. So I changed the steping rate from 1Hz to 1000Hz to see if the shift disappears or gets smaller at certain frequency range, but the shift always exists.
    I did observe the shift got smaller within the same running time when change the step model from full step (1.8degree/step)to half and quarter step model. According to this, the motor did miss steps (or pulses) during running, the quarter step model has smaller shift due to the smaller steps.  But I also noticed that the motor always shift at one direction, no matter I started with clockwise or counter-clockwise, this seems really strange to me. Because the motor should shift at each direction with the same probability if we assume the motor missis steps randomly.
    There is something must be wrong, either the labveiw program or the motor, but I don't even know a clue of this weird shift problem. And because of this, I haven't made any progress in my lab for the last three weeks. So any suggestions could be very helpful for solving this headache and will be really appreciated.
    Thanks a million in advance and Merry Christmas!
    Li

    Hey, Brian Beal,
    Thanks for your quick response. "accel" and "decel" mean acceleration and deceleration, am I understanding right?
    If yes, then I don't have these in my LabView program, I just generate one TTL pulse train and one TTL pulse with LabView and send them into the SMD1 stepper motor driver.
    The pulse train steps the shaft, and the other switchs the direction.
    Yesterday, I confirmed that if the motor steer always at one direction either CW or CCW, then the stepping were very stable, no missing or extra steps happen for hours.
    And I also observed that the motor took one extra step  from time to time when the direction changes. And this only happens when the direction switch from CW to CCW. (bizarre!)
    I guess this indicates that some pulse noise happens when the motor switch the direction too often.  But I just don't have any clue for irregular extra steps.

Maybe you are looking for