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

Similar Messages

  • 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

  • How can I control 3 stepper motors w/ amplifier by sending TTL pulses from DIO96

    We have NI PCI-DIO-96 board and we have 3 stepper motors with amplifier and encoders. We want to control the motors by sending TTL pulses directly from the DIO-96 board to the amplifiers. Is this possible? What would you recommend if this is not a good approach? Thanks in advance.
    Roman Zeylikovich

    Roman,
    Thank you for contacting National Instruments. While using a motion controller would be the recommended approach for any type of motion application, you may be able to use your DIO board to generate a TTL pulse train to control the step and direction inputs of your drive and motor. You will need to make sure that the current sinking and sourcing specification for the DIO-96 fits your stepper motor. That board is not designed to source very much current at all so this is one issue you will need to verify. Also, this board does not have any counter/timer logic that can handle quadrature encoder inputs.
    Again, this digital device is probably not the best solution to control a stepper motor, but, depending on your hardware, could be configured to work proper
    ly. The PCI-7334 is a low-cost stepper motion controller that can control up to 4 axes and is designed to easily accommodate these types of applications. You can browse through more information on our Motion controller boards at the following website:
    http://sine.ni.com/apps/we/nioc.vp?cid=3809〈=US
    Let us know if you have any more questions or comments.
    Regards,
    Michael
    Applications Engineer
    National Instruments

  • 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

  • Problems when trying to move 3 stepper motors

    Hello,
    I am having problems when I try to build a program to control 3 stepper motors.
    I have 3 steeper motors and the controller (3 SMCP33 + SMCP33-EVA) from nanotec.com they provide also a Vi example to control one motor that works successfully but the problems come up when I try to adapt the program to try to run the 3 motors. The final application for that is going to be a Cartesian robot XYZ so eventually I will need to program coordinates to move the 3 motors.
    I am new in LabVIEW so what I am doing is trying to adapt the nanotec example to control the 3 motors doing the following.
    - I assign each motor a different address, doing that I can run each motor separately. But when I try to run 3 programs at the same time, they work but all of them move the same motor (the first that was run).
    - If I try to do a kind of subVi the same thing happens, only one motor is driven.
    - Furthermore,  I get back a warning when I try this, I enclose a screenshot of that.
    I enclose the Vi and screeshots to enhance my description.
    I woul be grateful if someona can aport some help.
    Regards.
    Solved!
    Go to Solution.
    Attachments:
    Untitled.jpg ‏59 KB
    error details.jpg ‏136 KB
    Nanotec Motor1.zip ‏68 KB

    Hello johnsold,
    Thank you for replying. Enclosed is a picture where can be seen the motor address. This case is for motor 1, for motor 2 would be number 2 and 3 for motor 3. It works if I run the programs one by one. Anyway I enclose the generic example without any manipulation by myself.
    Thanks again.
    Attachments:
    error details1.jpg ‏259 KB
    Nanotec-Example for LabView 2011.zip ‏68 KB

  • Stepper motor pulses per step measurement (Step Angle)

    Hi everybody,
    Recently I have one project to do step angle measurement for a stepper motor. The motor will couple with A,B phase encoder, and PXI-6602 card is used to count the pulse from encoder.
    Well, the test will make the motor to rotate 1 revolutuion (360 degree) i.e. 200 steps are required. The software must able to measure and record the pulses per stepper's step i.e. 1.8 degree until 1 revolution is reached. But now the PXI-6602 will only present the accumulative counts per revolution, Any idea can split the accumulative count into small per step count with high speed and accurate method.
    Thanks & Best regard. 

    What is it you need to characterize?  For what purpose?  Using an external sampling clock can help make the test run much more quickly, but is not absolutely necessary.
    One of my first counter-based apps was to characterize a stepper motor with a microstepping drive.  1 counter measured the step and direction signals going from the motor controller to the microstepping drive.  1 counter measured a quadrature encoder.  Only the encoder measurement used a sampling clock, and it was internal.
    My technique included considerations such as:
    1. I did not move in single steps.  It may be a little less crucial to you with a 200 step/rev motor & drive.  I had something like 3200 step/rev as I recall.  Friction alone could have prevented any motion from occurring on single steps. 
    2. Each motion moved some small-ish prime number of steps so I could move around many many revs and be sure to land on each stopping position an equal # of times.  A simpler method would be to move 1 rev + 1 step.  In your case, that's 201 steps.  The downside is that you extend testing time.  With a 200 step/rev motor, this shouldn't be such a burden though.
    3. After all step pulses were issued, I started monitoring the encoder data.  I looped around evaluating chunks of position data to determine when I had a dataset that looked "settled."  The main criteria I used were slope and standard deviation.  When the criteria were met, I would store the median value.  You could consider using a mean or an RMS as well.
    4. Repeat enough times that you land on each stopping position a statistically significant # of times.  Rule of thumb seems to be about 30.  That would give you 6000 actuations of 201 steps each.  Seems feasible that test time might be in the 1-2 hour realm.
    -Kevin P.

  • Smc emy2 stepper motor problems

    Hi,
    I am trying to set up a stepper motor to run with labview 8.2. I am pretty sure that the code I have written should work so I am trying to figure out if I have wired everything correctly, I hope this is the right place for this. I have added the description and manual for the SMC EMY2 stepper motor (page 22 is where I am looking mainly for the wiring, I am using the 5-point Stoppable Type) and manuals for the two NI DAQs I am using, NI9474 for the control singals to the motor and NI9423 for receiving signals from the motor. I am using an external power supply with these that is set to 24V. I have the NI 9474 in slot 5 of the cDAQ-9172 and the NI 9423 in slot 6. I have attached to the power supply cable wires wires as described in the EMY2 manual to the power supply and the motor runs fine when using the attached controller, then I have attached the I/O wires as follows:
    Brown - Vsup of the NI 9474
    Blue - Com of the NI 9474
    Pink - line 0 of the NI 9423
    Orange - line 1 of the NI 9423
    Yellow - line 2 of the NI 9423
    Red - line 3 of the NI 9423
    Green - line 4 of the NI 9423
    Purple - line 3 of the NI 9474
    Gray - line 7 of the NI 9474
    Black - not attached
    White - line 2 of the NI 9474
    I can get the NI 9474 to output a signal but the stepper motor does not seem to react at all. I had a colleague recommend that I connect the - terminal of the power supply to the ground terminal, is that a good idea. If anyone can think of something to help that would be great and if you need more information just ask and I'll try to get it.
    Thanks.
    Attachments:
    Stepper Motor Manual.pdf ‏2396 KB
    NI 9474 Operating Instructions.pdf ‏237 KB
    NI 9423 Operating Instructions.pdf ‏401 KB

    Hi rlacroix156,
    Looking at page 22 of the stepper manual, it looks like there are two seperate power supplies that are referenced.  Are you using 2 power supplies? Also, have you considered using just one module since you are only using 7 lines?  Then you eliminate the split grounds between the modules.  Which brings me to another point.  The 9474 DIO lines are tied to the power supply ground.  The Blue and Brown lines you mention, are those DC2 or DC1?
    Kristen H.

  • Stepper motor problem

    Hi!
    I edited a code with labview to control the motion of my stepper motors
    by simply sending a command to the serial port 1, this command depends
    on the controller card.
    It works absolutely fine but when the code is running for long, the
    stepper motor goes funny and doesn't stop , I have to switch off the
    controller card power supply resulting in the lost of the reference
    point I have previously set up.
    It might be the buffer memory getting full, I tried to initialise the
    port without any success, it still does it.
    It is crucial for me to solve this, the stepper motors are used to
    transverse optics such as lens and mirror. If this happens again the
    optics could be crunched.
    Thanks
    Fabrice
    Sent via Deja.com http://www.deja.com/
    Be
    fore you buy.

    Stepper motors can get stuck and resonate if they are driven at too high as
    frequency or if they are overloaded. If that is what is happening when "the
    stepper motor goes funny and doesn't stop" you should try changing your driving
    frequency or if you are using a six-wire two-phase stepper you may be able
    to change the wiring configuration to allow more torque or a faster frequency
    response.
    -Jim
    [email protected] wrote:
    >Hi!>I edited a code with labview to control the motion of my stepper motors>by
    simply sending a command to the serial port 1, this command depends>on the
    controller card.>It works absolutely fine but when the code is running for
    long, the>stepper motor goes funny and doesn't stop , I have to switch off
    the>controller card power supply resulting
    in the lost of the reference>point
    I have previously set up.>It might be the buffer memory getting full, I tried
    to initialise the>port without any success, it still does it.>It is crucial
    for me to solve this, the stepper motors are used to>transverse optics such
    as lens and mirror. If this happens again the>optics could be crunched.>Thanks>>Fabrice>>>Sent
    via Deja.com http://www.deja.com/>Before you buy.

  • 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

  • Stepper motor noise in 1 direction

    Hi guys, i'm currently using my 6221 DAQ to provide the pulse train to drive my stepper motor (through a stepper driver). But i'm currently having a problem. The motor always produce clicking noises when i run it in 1 direction. I've tried swapping the driver and checking the cables but to no avail. Based on your experiences, what may be the problem here?

    Thanks Jochen for your reply.
    >As I have posted many times in this forum, I'm not a fan of using DAQ boards for controlling motors (e. g. here, here and here).
    Typically the costs that you can save by using a >cheaper DAQ board
    (compared to a motion control board) will be wasted rapidly by the
    additional time that you need to spend for implementing a solution that
    is anything but ideal.
    Well, sometimes tasks are given to us just like this...
    >But anyway.
    >Which part of the 6221 are
    you using to control the motor? (DIO, AO, Counter)? Are you using
    software timing or hardware timing?
    I'm using AO to generate the TLL pulses. I'm using software timing
    >Have you checked the electrical
    signals with a scope? There is a chance that the control signals are
    pulled down by low-impedance inputs of the drive. E. g. if this happens
    to the Dir+ signal, you may see the problem that you are talking about
    (ok, when Dir+ signal is low, not reliable if Dir+ signal is high).
    I've checked the pulse train for both forward and reverse action and it both looks the same. My Dir signal is driven with a DIO line. How would i know if my Dir signal is causing the problem? I haven't thought of probing it with the scope yet but what kind of 'unreliability' should i be looking for? Isn't it just 5V and 0V?
    And if Dir signal is the problem how can i rectify it?
    >By the way: NI motion control boards provide open collector outputs that allow to drive up to 64 mA.
    Mine requires 1.5A
    Attachments:
    Pulse train.JPG ‏65 KB

  • How can I control 3 stepper motor in same time?

    I want to control 3 stepper motor and 30 electro-valves.
    I only had a few lessons on how to control one in C in college.
    Now I need to do this in labview and using an board from NI
    How can do the control of the three motors in same time?
    What the best board to do this. Maybe the NI PCI 6034.
    But I will need more than one?

    At least some of the NI motor controller boards have up to 32 digital lines which can be set to input or output. I did not write the software for our systems but we are using quite a few of the digital lines for our systems and have no problems reading the digital inputs or setting the digital outputs. Also, the digital outputs offer a high current sink capability and usually can be used to drive external drives without any interface circuits.
    The digital lines are available on a separate connector of the NI boards and there are also break-out boxes (with screw terminals) available. I do not see any serious problems to do your control tasks just with one NI motion controller board, as long as you do not have any special requirements (high sampling speed, high frequency pulse output etc) for the digital lines.

  • Modulating the width of the P70530 stepper drive output pulses

    I'm using a NI-PCI-7332 controller with a UMI-7772 and a P70530 drive to qualify a stepper motor (using LabVIEW 8.5). One of the test to perform is to lower the drive amplitude level until the motor stall.
    I'm controlling the drive input supply by GPIB (using an HP6032A system supply) but the problem is that the amplitude at wich the motor stall might be below the 20V specified lower limit of the P70530 (the motor lower drive value is specified at 23V).
    Using my actual hardware would there be a way to modulate the width of the drive pulses to the motor to get a lower RMS output (and will it work)? If not, do somebody has any suggestion of the hardware to use to perform this task?
    Thanks,
    Ben

    Hello ben64,
    You should use the software (via GPIB) to lower the drive’s current output to the motor. You can do this in real-time while the motor is running.
    However, if you decrease the power supply to the drive you may not get the point where the motor stalls but rather the point at which the drive fails/browns out/chokes.
    I hope this helps you out
    David G
    Sales Engineer - SE Michigan & N Ohio
    National Instruments

  • 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

  • How can I output a square wave to control a stepper motor using 7332 controller?

    I have the following system configuration for testing a linear actuator (LA):
    LabView 7.1
    NI FlexMotion 7332 Motion Controller
    NI Flex DMM 4070
    The LA is a stepper motor with Step and Direction of Rotation inputs, as well as some discrete I/O for Power Enable and other functions.
    The LA specification only requires that I send a 50% Duty Cycle square wave signal with frequency less than 300 Hz to it in order to make it step.  The LA has it's own power source.  I only need the 7332 to generate the drive signal and the DOR signal to the LA.  Using some of the example VI's, I can get the LA to work, but I will need to incorporate the functions in to a custom application. 
    How can I weed through the numerous advanced functions the 7332 offers and only generate a DOR signal and a step command at a user-defined frequency.  How do I set up the controller for this?
    Thanks

    Hello,
    All the VIs that you can use to create a pulse train and digital I/O from your motion controller are found in the "Analog & Digital I/O VIs" sub-palette in the "Flex Motion" palette. Use "Load PWM Duty Cycle" and "Configure PWM Output" VIs to create the square wave. Use the "Set I/O Port Direction", "Set I/O Port MOMO", and "Set I/O Port Polarity" VIs to create digital output. I hope you find this information useful. You can learn about the specifics of these VIs and their inputs/outputs in the NI-Motion VI Help.
    Regards,
    Aaron B.
    National Instruments

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

Maybe you are looking for