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

Similar Messages

  • Generate Digital Pulses BNC 2120

    Hello,
    I am new to LabView and I am trying to use a DAQ Assistant to generate a discrete number of digital square pulses to be fed to a stepper motor driver via BNC 2120.  But I don't know how to go about doing this.
    I had an idea that I would use a Timed Sequence with 2 frames, the first frame would have a DAQ in it, and there would be a 1-D array of Boolean (TRUE) input in to the "'data" field of the DAQ. 
    Then the second frame would have a DAQ in it, and there would be a 1-D array of Boolean (FALSE) input in to the "'data" field of the DAQ. 
    But like I said I am very new to LabView and so I don't know if this approach makes sense. Please offer some suggestions!

    Hi all.
    I am currently doing a final year project to run six stepper motors using labview. 
    I was using an arduino mega to control the motors. When I had wrote the program to control the motors realized I only had enough outputs to control one motor.
    Now I intend on using the BNC 2120 to generate the pulses to run the motors but I have no idea where to start. 
    Any help would go along way. 
    I am using 6 Digital inputs for each motor. i have attached the VI i am using
    thanks in advance
    Attachments:
    StepperMotor1 project.vi ‏28 KB

  • How to generate biphasic pulses and change parameters?

    Hi I am a beginner. I need to know how to generate biphasic pulses. What are the functions i need to use(the logic involved in labview to generate)? I should be able to change the parameters like duration,interval during the course of the program.

    Greetings:
    You can go to the Analysis/waveform/signal generation toolbox and find Pulse Pattern. You can set the duty cycle, frequency and phase with the standard controls.
    Eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • How to generate pwm pulse using NI DAQ in MATLAB

    hi everyone. please tell me how to generate pwm pulses using Ni DAQ card in MATLAB Simulink. if through coding is possible then post the corresponding code.....reply me 

    Make sure you have installed the Measurement studio support for VB 6.0 then you will be able to find examples in the folder below on win7 and 8.
    C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples
    Narrow down to Analog Output and choose update voltage example for measurement studio.
    You also have the possibility to use DAQ assistant if you have measurement studio installed. This function is a configuration type programming. After going through the configuration Wizard code is automatically scripted for you so that you can output the voltage you need. Read more about DAQ assistant in the blow link.
    http://www.ni.com/white-paper/4652/en/
    Best Regards
    Jonas Mäki
    Applications Engineering
    National Instruments

  • How can I send commands to a stepper motor to move in steps?

    How can I controll a stepper motor by using labview.7?
    what do I need?

    This will depend on what hardware you are using to send the commands to the stepper motor. NI offers motion controllers and drives that come with all the functions you will need to operate the motors. Depending on the size and number of motors, you will have different hardware requirements. Take a look at the motion products available here: http://sine.ni.com/apps/we/nioc.vp?cid=1506〈=US
    If you have more questions, you can always contact NI at www.ni.com/contact to help spec out the system.
    If you are using third party products, you will have to call their dll from LabVIEW using a Call Library Node function. This gives you access to all the functions in a dll.
    Hope this helps.
    Regards-
    Julie S.
    Applications Engineer
    National Instruments

  • How to generate a pulse train with different pulse width and delay?

    How to generate a triggered pulse train with different pulse width. for example, after each trigger signal, let's say 2 ms, then the counter output a pulse with pulsewidth of 1 ms, and then after 3 ms delay after the first pulse, the second pulse was generated with a pulse width of 4 ms.  Next cycle when the trigger signal comes, the same two pulses will be generated and so on. Is it possible to achieve this by using 6601 counter card? and if yes, how to achieve this? Thanks!

    Unfortunately you can not create a hardware timed pulse train with different widths on each pulse from a counter. Whilst it can be changed on the fly using software, since you require a hardware triggered signal getting the software involved will not give a huge amount of accuracy when the pulse will actually change.
    So in short you can't use your 6601 card (or a counter timer) to achieve this
    There are three possible Alternative solutions
    1 You could use a high speed digital IO device such as the (6533/34) to generate your variable signal which would require setting up the pulse train as a series of states based around the burst transmission mode where the clock would give you your specific timing.
    2 A timed analogy output (for example on a MIO card with a clock (PCI-6220 / 62xx), i.e. Not the 6704 style static analogy output cards)
    3 A high speed digital waveform card such as the (, 656x , 655x, 654x, 6534, 6533 (http://www.ni.com/modularinstruments/find_right.ht​m) ) this could then be scripted to work with your triggering and also there is a digital waveform editor which will enable you to set up the pattern you wish to generate (http://sine.ni.com/nips/cds/view/p/lang/en/nid/135​55) 
    Hope that helps
    Tim Matthews
    NI (UK)

  • How to generate a pulse with 9472?

    I am trying to generate a single 8V pulse of 10ms duration on multiple channels of the 9472.  The 9472 is in slot 4 of the 9172 compact daq chassis.  To test my results, I have connected an oscilloscope to one channel of the 9472 (with no load attached).  I tried modifying the Create Digital Waveform VI from the Write Dig Chan-Ext Clk example VI.  In doing so, I generated a binary array with the first half of the array filled with all 0's and the second half of the array filled with all 1's.  When I triggered my O'scope on a rising edge, I saw the channel turn on (also the LED was lit on the 9472).  However, the channel stayed on even after the routine had completed (LEDs were lit solid).  So to try to turn the channel off, I appended one 0 to the end of my array.  Now the O'scope won't trigger and I see no sign of the LEDs on the 9472 blinking.  Any ideas how I can solve this problem? 
    I was able to get a single pulse of the proper duration by setting up a task in MAX with the 9472 in slot 5.  But in doing so, I was only able to generate the pulse on one channel.  I need to be able to parallel multiple channels for my application.

    I am trying to generate a single 8V pulse of 10ms duration on multiple channels of the 9472.  The 9472 is in slot 4 of the 9172 compact daq chassis.  To test my results, I have connected an oscilloscope to one channel of the 9472 (with no load attached).  I tried modifying the Create Digital Waveform VI from the Write Dig Chan-Ext Clk example VI.  In doing so, I generated a binary array with the first half of the array filled with all 0's and the second half of the array filled with all 1's.  When I triggered my O'scope on a rising edge, I saw the channel turn on (also the LED was lit on the 9472).  However, the channel stayed on even after the routine had completed (LEDs were lit solid).  So to try to turn the channel off, I appended one 0 to the end of my array.  Now the O'scope won't trigger and I see no sign of the LEDs on the 9472 blinking.  Any ideas how I can solve this problem? 
    I was able to get a single pulse of the proper duration by setting up a task in MAX with the 9472 in slot 5.  But in doing so, I was only able to generate the pulse on one channel.  I need to be able to parallel multiple channels for my application.

  • Generating digital pulses from the pci 6722

    I am trying to generate signals that will drive a piezoelectric motor. I need an analog signal that I will send to an amplifier and 6 digital pulses with varying offsets. I am using a pci 6722 and was hoping to get an offsets between the digital pulses to be around 2 microseconds. I am struggling  to find the best  way to get such exact time delays between multiple tasks. Any help  would  be greatly  appreciated.

    The actual offset times is not as important as the digital pulses firing sequentially and all within the envelope of the analog signal for multiple steps.  I guess my question is less about hardware limitations, and more about how execute my desired process in Labview. My experience in Labview is pretty rudimentary and I am struggling to see how to synchronize events in labview.  We are using a BNC 2110 to output our signals, and it is my understanding that the BNC 2110 has a 1 Mhz clock.  We are trying to import that clock from our device use that to clock timed loops and we are having some difficulties with the details.  I am honestly not sure if I am on the right track.  In hopes that it might add some clarity I attached a picture of the signals we are hoping to produce.  The orange signal is our analog output.  Between times t3 and t4 we need the 6 digital triggers to switch to "on" and we need them to all switch off simultaneously at t6.  Again we are definitely willing to compromise on speed if we can use the card we already have.
    Attachments:
    waveform.PNG ‏28 KB

  • How to generate a pulse waveform 90 deg phas shifted with respect to a pulse generated using a counter in PXI 6070E daq card ?

    Hi
    I ma using 6070E daq. I am generating a infinite pulse train using one of the counters. I want to generate another pulse train which should 90 degress phase shifted with respect to the previsously generated pulse. How to implement this using the counters in the DAQ card.

    Hi Gopal,
    1) yes the frequency generator is programmable. You have 2 timbebases (10MHz and 100kHz) and you can divide down by any integer between 1-16. Those are the only frequencies you can use.
    2) The way counters work is that you can apply a gate signal to the counter which will cutoff the output. Therefore, you can have a second counter generating a pulse train of an equivalent frequency to the frequency generator (fout) but you don't want it to start immediately. You want it to start only after a short delay (equivalent to a 90d phase). Therefore, you need to "gate" or prevent the output on this counter for that small delay period of time. The way you can do this is by using a second counter to create a delayed pulse. You would
    connect the output of that counter to the gate of your pulse train function. That way, during the delay period of the pulse, you won't be outputing your pulse train yet. When the pulse (high-time) of your pulse reaches the gate, then your pulse train will start generating its pulse train (which is consequently delayed by the amount of delay used in the single delayed pulse counter). Since you don't want your pulse to go back low, you will have to turn off or clear your pulse counter while it is high. That way the signal on the gate will remain high forever.
    Your better solution is to use a PCI-660x card to perform this action. You will have more counters which will give you a greater range of frequencies to choose from and you will have more accurate timing of the signals.
    Anyway, hope that clears things up. Have a good day.
    Ron

  • How to Generate Synchronized pulses across two separate cards on a PXI system

    Hey,
    I'm trying to generate three pulses from my PXI System for triggering purposes. I have two cards (PXI 6259 and PXI 6115) , each with two counter/timers on them. The 6259 has 32 bit timers, and the 6115 has 24 bit timers.
    Up until now, I only needed two pulses. One was 180us long at 20 Hz, and the other is 5us at 20 Hz, starting 150us after the beginning of the first pulse. I was able to achieve this by generating both pulses on my 6115 card by triggering the shorter pulse off of the rising digital edge of the longer pulse and giving the DAQmx Counter/Timer task an initial delay of 150us.
    The third pulse needs to be identical to the short pulse, only it needs to occur 20us early (130us after the start of the wide pulse). I tried to generate it using the same technique as I used when generating the short pulse, only generating the pulse and reading in the rising digital edge trigger on my 6259 card instead of the 6115. 
    The result was that my pulse trains were asynchronous and the pulse generated on the 6259 card was constantly shifting to the left.
    This puzzled me, so I wrote up a little dummy program to test generating triggered pulses. The results were that when I generated two pulses on the same card, they were always synchronized; however when I generated pulses on separate cards, one of the pulses always shifted.
    I was hoping somebody could suggest a reason that the pulses across cards are asynchronous even though I'm reading in a digital trigger and hopefully a way to rectify the situation and synchronize all of my pulses.  

    The problem, in a nutshell, is that the timebases on the two boards have manufacturing tolerances that will cause them to differ from one another.   The accuracy error is a small fraction of a percent, but the effect on the phasing of your pulses will be cumulative.  That's why you saw the one set of pulses "shifting to the left."
    The solution is to make sure each board derives its pulse timing from a single common timebase.  Fortunately, this is pretty easy to specify with DAQmx, just a little tricky to find.  In the chain of VI's you call to configure the counter pulses, insert a DAQmx Channel property node.   From memory, I *think* you should be looking under something similar to "Counter Output->General->Timebase->Timebase.Src"
    Right click and create a constant or control to define the timebase source.  You should get a dropdown list that includes a wide variety of choices.  Among them are each of the boards' 20 MHz clocks.  By default each task will use a timebase from its own board but this technique lets you route one board's timebase over the PXI backplane with that single property node setting.  DAQmx does most of the dirty work behind the scenes.
    -Kevin P

  • How to generate a pulse on x number of events PCI-6602

    I am running LabVIEW 5.1 full development with a PCI-6602 counter board.
    I would like to generate an output pulse after counting x number of input pulses. I would also like to reset the counter with an external signal.
    My application is I am trying to generate a second index pulse for an encoder.
    I would like to count the pulses from encoder phase A and generate an output pulse on x number of counts. Then I would like to reset the counter using the encoder’s index pulse. This way I can change the phase of the “generated” index pulse with respect to the “real” index pulse by x number of counts (degrees) and maintain that regardless of encoder rpm.
    Thanks
    Brian

    Brian,
    There actually is a way to do what  you want, but it gets a little complicated.  I don't have LV on this machine so I'll have to just describe the idea.  First a summary: the counter will repeatedly countdown to 0.  Each time it reaches 0, it will generate a brief pulse which will in turn hw-reset the counter value to N.  Then it will countdown to 0 again, etc.  The same brief pulse could also be wired to a different encoder-measuring counter to create a "delayed" reset to 0 (or some other #).
    1. Configure your counter for "position measurement" instead of "simple event counting".  Set the encoder type to, um, I forget the name -- something like "two pulse encoder."  It's the setting that will increment with every SOURCE edge and decrement with every AUX edge.  Wire your encoder channel A to the counter's default AUX input (in position encoder mode, you must use the default input pins).  Hard wire from the default SOURCE input to GND.  Now every encoder edge will decrement the count, and nothing wlil ever increment it.
    2. Configure the counter to use z-indexing.  Set the z-index reload value to be N-1, where N is the # of encoder counts by which to delay the encoder's real z-index pulse.  Set the z-index reload phase appropriately, probably to A low B low.  Wire the real z-index pulse to the counter's GATE input.
    3.  Configure the counter to "pulse on terminal count" -- you do this using 'Counter Set Attribute.vi'.  So N encoder edges after the real z-index pulse, you'll generate a pseudo-z-index with this counter.
    4. You can wire this pseudo-z-index to the GATE input of the encoder-measuring counter.  Now the encoder's z-index pulse is delayed by an amount you can program.
    5. Note: this method requires the motion to be uni-directional.
    Good luck!
    -Kevin P.

  • How to generate check from Payment Run

    How to generate check, if by mistake we forgot to check mark "Create payment medium" in payment run. Because the payment goes through but there is no check, Is there a transaction that can create a check from that payment run?

    (1) First find out the check numbers from check register (FCHN)
    (2) Go to your payment medium, highlight the variant and click on Maintain Variant.
    (3) At the bottom of Maintain Variant is a feature for you to reprint checks.  Key in the check numbers you get from (1)
    Hope you get thru it.

  • How to count digital pulses?

    I am using usb-6501 to read in 12 distinct digital pulses and want to know how to count the pulses. The 6501 has only one counter channel so I am looking for a software/labview program option to count pulses for each channel individually. 

    Do you need to know when they change or just how many times they changed? Also how fast are they changing?
    Mike ...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to eliminate the noise from the stepper motor

    I’m using stepper motors to move a traverse on which a hot-wire anemometer probe is mounted. When the stepper motors are turned on, they induce noise on the analog signal of the hotwire anemometer, or of any other transducer, at multiples of 120Hz.
    The stepper drives are P41 Series made by American Precision Inc. The P41 Series contains a power supply, a motor drive and a logic controller. The logic controller inputs are optically isolated and utilize the 5 VDC supplied internally by the drive.
    An NI 6251 or NI 6024E DAQ card is used with LabVIEW to send digital output signal to the logic controller in order to step the motors.  
    The AI input channels of either NI 6251 or NI 6024E DAQ cards and LabVIEW are used to acquire the signal of the hot-wire anemometer. Different DAQ cards are used for the data acquisition and the stepper motor control and the noise is transferred through the laptop to the data acquisition card (analog signal).
    All cables are shielded and the noise was confirmed to be conductive and not radiative.
    There was no difference when measuring the analog signal with Differential or RSE.
    As a test, the leads from to the drive’s logic controller were connected to the AI input channels in order to check the magnitude and frequency of the noise flowing to the DAQ card and were found to be 5 V peak-to-peak at 60 Hz.
    Please let me know if you have an idea on how to eliminate this noise.

    It sounds like you have a ground loop issue.  If possible, try totally isolating the stepper controller from the data acquistion AI more than you already have.  This could include any of the following:
    Ensure the optoisolation on the control lines fully separates the power and ground of the digital output and stepper input.
    Use different grounds for the stepper power supply and the DAQ power supply/computer.  Isolation transformers can help here.
    Use lower inductance lines for the stepper controller.  This will reduce the movement of the ground.
    I suspect you have probably been over the above, so you are left with filtering the noise out of the signal.  Since it has high harmonic content, a simple low-pass is unlikely to work well.  Your best bet is probably to characterize it and use some sort of Fourier filtering.  If the relative sizes of the harmonics are always the same, you can take the Fourier transform, find the height of the fundamental, use this to calculate the sizes of the harmonics, delete them from the Fourier transform, and do an inverse Fourier transform to recover your signal.  Alternately, you can use a series of narrowband filters to remove the noise, although this will also remove any signal at the same frequencies.  It is better if you can improve your circuitry to remove the noise.
    Good luck.  Let us know if we can help you more.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • MAX does not run stepper motor

    I am an abosolute novice at NI Motion and cannot get MAX to move a stepper motor. I'd be very grateful for any help.
    The system consists of a PXI-7340 Motion Controller card installed in a PXIe-1065 chassis. The PXI-7340 is connected by means of a SHC-68-C68-S cable via the Motion I/O port to the Motion I/O port of an UMI-7774 board. The UMI-7774 board is supplied with a 24Vdc power supply as well as an isolated 15Vdc power supply to its power terminals. Two stepper motors are to be controlled using this UMI, which has 4-axes capability. The Axis 1 and Axis 2 sections on the UMI are connected to a Danaher Motion P70530 Stepper Drive each by means of a D-Sub to D-Sub cable via the Control port on the UMI and the J4 Command port on the P70530 Drives. The P70530 drives are supplied with 65Vdc power from a bench top DC power supply capable of 70V, 15A. Each P70530 drive is connected to a Pacific Scientific Powerpac stepper motor (N33HRHJ, 65V, 5A).  (Thus, two P70530 drives and two stepper motors are connected tothe UMI.)
    I am trying to get MAX to turn the motor. In the listing in MAX, under NI Motion Devices/PXI-7340/Default 7340 Settings/Axes 1/Axes Configuration, all limits were disabled, settings saved and initialized.
    However, in the 1-D Interactive window, when the Target Position is set to a value, e.g. 2000 steps, and the Start button is pressed, the motor does not move.
    But, the LED on the P70530 blinks until the Kill button on MAX is pressed.
    Can anyone tell me why the motor does not move?
    Where does one go to learn more on MAX? Why are all the manuals at NI made for experts who already know what they are doing and not for beginners? The Help is no help at all really.
    Regards,
    PKP

    Thank you, Jonas, for your reply.
    I called in to NI and talked with "Vivek" and he helped me set the MAX settings and the DIP switches on the P70530 motor drive (amplifier) to get the motor to run. He pointed me to the "Getting Started P7000 Series Stepper Drives" 28 page manual, which for some reason was not included in the CDROM that came with the P70530 drive or with the pre-installed manuals in the PXI chassis. (You would think to include all the relevant manuals on the CDROM, but nope.) The manual showed how to "Change Settings" for the PXI-7340 inside MAX and set it to the 7340 Settings for P7000 Drives.
    Under Axis 1/Axis Configuration/ Stepper Settings tab, set the Stepper steps per revolution to 5000.
    Under Axis 1/Motion I/O Settings, all the filters, switches and the "Inhibit Output Settings" has to be disabled.
    Now the motor runs. Yay!
    But there is one teeny-weeny thing.
    Under  Interactive/1-D Interactive, when the velocity is set to 100 rpm or more, or the Acceleration is set to over 20 rps/s, the motor whines and does not rotate.
    When V=0 to 95 rpm, Acc=10 rps/s, the motor runs for a given Target position value (such as 200, 2000, 20000, etc.)
    Here is another weird observation. When the Velocity is set to say 60 rpm, the actual motor speed measured with a tachometer and a stroboscope is found to be  about 1440 rpm, i.e., 60 x 24 rpm. (I measured the rpm using the two different devices and both tend to agree.)
    Is the "rpm" unit a typo? Should it be something else?
    What am I missing? Why is the stated rpm different from the actual measured rpm?
    Thanks for any help.
    Regards,
    PKP

Maybe you are looking for

  • XMLSocket connection fails

    Hello everyone , My actionscript2 is used for xmlsocket connection . The xmlsocket connection failed when the crossdomain.xml file size more than 20k. Does anyone has idea or solution ? Thanks .

  • [SOLVED] Value too large for defined data type in Geany over Samba

    Some months ago Geany started to output an error whith every attempt to open a file mounted in smbfs/cifs. The error was: Value too large for defined data type Now the error is solved thanks to a french user, Pierre, on Ubuntu's Launchpad: https://bu

  • MP4 video file-too big to email

    I have a MP4 file that is 72.4 MB. It is too big to send it via email. How do I do it? Thxs

  • Mac Book Pro Charger won't charge

    Just yesterday my Mac Book Pro "L" 85W Magsafe Charger would not charge my laptop. Eventually I tried using my sisters Charger, a 60W "T" Magsafe charger. It seemed to charge for a day, but today that charger has died as well. I can't understand why

  • Plan Table error

    Hi all, I created few tables in test schema. And i am trying to see the execution plan. I connected to test schema, then i am getting error as "Specified plan table not found " error i am getting. So, what to do to check the execution plan of tables