Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DAQ NI USB-6009 to operate a stepper motor

I need help programming a DAQ card to operate a stepper motor controller.  The controller reads 200 5V steps as one revolution.  I need the width of the 5V output to be adjustable so it can be calibrated to a speed that the controller can read. I have no idea to the steps of this kind of output.

Cheers,
Matt

0 Kudos
Message 1 of 9
(9,158 Views)
 
 
 

If your DAQ card has an on-board counter, then this vi should suit your needs as a starting point. It allows to to change frequency and duty cycle of the output pulse train on-the-fly.

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=DE27921DB53A4D8DE034080020E74861 

FYI- stepper motor velocity is usually changed by altering the frequency, not the duty cycle, of the pulse train. But without knowledge of the driver hardware you are using, you could be correct about altering the width (duty cycle). Also if you try to accelerate a stepper motor too fast, it may stall out and whine at you.

Now I just saw from the header you are using a 6009, I do not think that has a counter on board. So you will have to do a software timed loop to cycle a digital output repetively on and off. You will only get a couple 100 of Hz out of this and actual frequency may drift due to Windoze timing uncertanties. The loop timing is used to set frequency, not duty cycle. So if you need fixed frequency and variable duty cycle, let us know the ranges to come up with a solution.

Good luck

Message Edited by AnalogKid2DigitalMan on 10-05-2005 02:48 PM

Message Edited by AnalogKid2DigitalMan on 10-05-2005 02:55 PM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 2 of 9
(9,158 Views)
Hi AnalogKid,

I'm trying to do something similar to Matt___W, create a variable duty cycle pulse train with the USB-6009 DAQ (no counter unfortunately). The frequency I need is 60 Hz. I would like to vary the duty cycle between 100% and 50%. Unfortunately, I'm not even able to create a fixed duty cycle pulse train right now, given my limited LabVIEW skills.

It would be awesome if you could help me figure out how to do this, as I've been bashing my head against LabVIEW's wall.

thanks,

Vikas Gupta
0 Kudos
Message 3 of 9
(9,033 Views)

vikg,
To be able to output a semi-fixed duty cycle signal at 60Hz you could create a while loop that has a Wait(ms) vi with a wait time of around 8ms (120Hz) and then alternate the output to the digital channel every iteration of the loop.  However, the loop will be software timed, meaning if the computer is doing something there may be a glitch of a longer period.  Additional programming may allow functionality roughly similar to what you are looking for but the performance will be poor at best. You will not be able to achieve a duty cycle that is close to 100%.  Since the time of the low portion of the duty cycle will be going toward 0 as the duty cycle goes to 100% the update rate will need to increase.  If you are lucky, you may be able to push the duty cycle to 80% or so but not much closer than that.  You can achieve 100% by writing a high and not changing it but you will not be able to get anything between 80% and 100%.  And as I mentioned before this is all software timed meaning the timing of the duty cycle will all be influenced by what is going on on the computer.  If you move a window your update rate may drop to a few hertz. 

In conclusion, I would highly recommend getting a DAQ board with a counter.  If you are looking for a USB solution I would recommend taking a look at the NI USB-6251.  In addition to having a couple counters it has many other impressive features as well.  You can take a look at:
https://www.ni.com/en-us/support/model.usb-6251.html
I hope this is helpful.

Regards,

Neil S.
Applications Engineer
National Instruments

0 Kudos
Message 4 of 9
(9,012 Views)
Hi Neil,

Thanks a lot for your reply. We are considering ordering the NI PCI-6221. Apparently this model has 2 digital counters on board. Would this be sufficient to maintain two separate 60-Hz PWM digital signals, in addition to an analog input? Also, since our application involves a closed-loop algorithm (we are trying to control directional antenna motors and using the power detected from a satellite as input), we would want a fast response time as far as our duty cycle (which is proportional to the motor speed) is concerned. In other words, we'd like to be able to change the speed of the motor very quickly and accurately without much lag.  If you have any concerns about our DAQ choice, we'd appreciate any advice you can offer.

Many thanks,

Vikas Gupta

0 Kudos
Message 5 of 9
(8,984 Views)

Hello Vikas,

The PCI-6221 will be able to support two separate 60-Hz PWM digital signals in addition to an analog input.  The Pulse Width Modulation in NI LabVIEW Using NI-DAQmx describes how to program a PWM in LabVIEW or if you are using another programing language you can reference the DAQmx API helps to translate between the VI names and the API convention.  The 6221 will most likely work for your application, but for the fastest response time you might consider a Real-Time system. 


Regards,

 
Micaela N
National Instruments
Message 6 of 9
(8,967 Views)

Hello,

 

I am using a Geckodrive G203V stepper drive (http://www.geckodrive.com/upload/G203V-REV-6-MANUAL.pdf) to operate a tension stage.  I also want to use the USB-6009 to operate this stepper motor as well as the load cell and LVDT.  

 

My labview experience is limited so I am looking for advice/help

 

What would be the best approach to build this up in labview?

 

In the other posts there was mention of a counter (however, not on the 6009).  What would be the best approach to control the stepper and be able to set the count? I know there were ideas in previous posts but this is a different application so may be there is a better way or another approach that would would?  

 

 

 Thanks much,

Jerry

0 Kudos
Message 7 of 9
(7,985 Views)

Hi All

I'm Triyng to make an interface between my Laptop and another one Using their Own USB port.I could not do it yet.would somebody help me?

Where can i find related VIs.

Regards

Azizi

0 Kudos
Message 8 of 9
(7,240 Views)
Do NOT hijack a completely unrelated thread for your question. Start a new one and provide some actual details like what type of USB device you have created for the link. I hope you are doing more than just a cable between the two.
Message 9 of 9
(7,212 Views)