Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using DAQ NI USB-6009 to operate a stepper drive (geckodrive g203V) and motor for tension stage

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

 

1. 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).  Drive step rate, number of steps based on pitch of threaded rod and so forth. 

 

2. 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?          

 

Any advice or suggestions and examples would be much appreciated.

 

Thanks much,  Jerry

0 Kudos
Message 1 of 9
(5,532 Views)

Hi Jerry,

 

The 6009 does not support hardware timing, i.e., a 6009 does not contain any hardware timing circuitry and therefore is not a suitable device to output or control a PWM. While you can attempt this, you will be limited and may not achieve the quality you require. To control this G203V, do you need to output a PWM signal from the 6009?  As far as the LVDT and the load cell, as long as the the measurements are within the specifications, you should be able to just read the voltage on the analog input channels.  You can find examples in the Example Finder at Help >> Find Examples.  Depending on the type of measurement you are doing, you can find examples by clicking on the Browse tab then double clicking Hardware Input and Output >> DAQmx >> Analog Measurements.

Regards,
Jim Schwartz
0 Kudos
Message 2 of 9
(5,511 Views)

Thanks for replying. 

 

I am just learning about all of these devices.  I was thrown into a project headfirst and I am attempting to complete this with good output.

 

Here is my problem.  I have a small budget and some of the DAQ's with the counters are expensive.  Can you recommend a NI DAQ that has a counter, at least 4 Digital Input, 4 Analog Input

 

I understand that I do not have a counter but is there another way that I could possibly get this to work with satisfactory performance?

 

Can I have the program do the counting for me?  Is there any way to control the PWM with labview?  

 

Right now I have step and direction from the G203V driver.  

I guess I am not sure I need to control the PWM.  I dont see another way of doing it (with my experience) besides controlling the pulse  from the driver.   

 

Let me know if this helps.  I am sorry if any of this is unclear. 

 

0 Kudos
Message 3 of 9
(5,504 Views)

This is a continuation of my last post.  I wanted to make this clear.

 

My tension stage program will have user inputs for step rate, direction, and stop condition (timed, percent extension or distance traveled).  The user will then enter sample dimensions and hit start.  While started the motor will move in the direction and speed as user defined.  (It will not change throughout the cycle and will be constant).  Is there any way to do this using the USB6009???  

 

Can I program a software timed loop somehow? 

 

If I make a while loop with some kind of wait time (????).  Not sure if something like this would work.  

 

Any ideas? 

 

 

0 Kudos
Message 4 of 9
(5,503 Views)

Hi Jerry,

 

Depending on the accuracy you need from your PWM, you can do software timed PWM.  This KnowledgeBase will explain how to do this . As for a card that can do the hardware timing, if you are looking for a lower cost solution, the PCI-6220 would work.  For a USB solution, the USB-6221 can do hardware timed DIO.  Can you confirm that the G203V is PWM controlled?

Regards,
Jim Schwartz
0 Kudos
Message 5 of 9
(5,480 Views)

Thanks for responding,

 

The G203V is pulse width modulated and one microstep is the equivalent of a pulse. If you send it 2kHz it will go one revolution per second at 10uSteps on a 200 step motor.

 

Hope this answers the question.

 

I looked into it a little bit.  So here is my next questions

 

1. What would be better to  set up my driver, load cell, and LVDT?  The Dmax Express or DAQ Assistant?

 

2. If I set up my stepper drive using Dmax then how would I operate the pulse width modulation?  How would I want to set up my DI/O on the Dmax for the driver?  It will be by sending a frequency? 

 

Thanks,

Jerry 

0 Kudos
Message 6 of 9
(5,470 Views)

Hi Jerry,

 

I would try to do all of this in LabVIEW.  LabVIEW will allow you a lot more versatility.  With the DAQ Assistant, you will be able to set up signals just as easily as in SignalExpress but you will have the added benefit of the LabVIEW programming environment. The only way you are going to be able to do the PWM is with the software timed solution linked in the previous post.

Regards,
Jim Schwartz
0 Kudos
Message 7 of 9
(5,454 Views)

Okay, I understand doing the entire program in labview.  Bare with me because this program is still in rough format (at least I think so).  I am still confused about the difference between the DAQ assistant VI and the DAQmx VI's.  What would be better to use in this situation?

 

I am attaching my program (VI) and hopefully I could get some help you all.

 

I am using software timed motor speed generation.

 

So far, 

 

I want to be able to initiallize the program set the motor speed, the direction, the mode, and start and stop the motor to set my sample.    

 

At this point I do not want to record any data just set my sample and (a little confused on how to accomplish this)

 

Enter all of the data (speed, sample data,frequency, duty cycle, rate, steps, etc) and then be able to run the program and record the data.  

 

 

Things I am confused about that may be you all can help me with. 

 

1. Am I using the right structure (Event/Case) to set this up or is there a better way?

 

2. I am confused on how to be able to initialize the motor as soon as I initialize the program.  This way I could use run the motor to set the stage. 

 

3. Am I setting up the waveform generator correctly?  I want to be able to set the frequency and duty cycle of the motor through the waveform.  Is it the proper stucture and how would I output this to the driver (which is plugged into the USB device)?

 

4.  I am not sure whether to use DAQ Assistant or DAQmx when setting up my signals and my frequency/duty cycle output?

 

 

If you all could help me get on the correct path with these I would appreciate it. 

 

Also, let me know if there is anything better I could do to improve this program. 

 

I know there is still a lot to be done, and it is in a little unformatted but I am trying to learn as fast as I can. 

 

Thanks,
Jerry

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

Hi Jerry,

 

The DAQ assistant simply takes care of a lot of the initiallization that you would have to do yourself with the DAQmx VIs.  The advantage of the DAQmx VIs is greater flexibility while programming.  You may need to use the DAQmx VIs to create your software timed PWM signal.  You can find examples of digital tasks in the example finder located at Help >> Find Examples.  Be sure to click the Browse tab in the top left then double click Hardware Input and Output >> DAQmx >> Digital Generation.  These examples may not do exactly what you want but will give you a good idea of the DAQmx flow.

 

1.  I'm not sure what you mean here.  Which structure are you talking about?

2.  The sequence structure may work for an initiallization step

3.  To set up your PWM signal I would look the the linked KnowledgeBase

4.  See the above discussion of DAQ Assistant v. DAQmx VIs

 

 We do offer online training located here. I woudl make sure that you test your program as you go.  Make sure that each part works first.  I would first get the PWM signal controlling your motor.  The other two parts of this program (the load cell and LVDT) will be simple acquisition tasks.  I would also take a look at creating subVIs for improving the readability of your code.  You can find the help for that here. Below is a tutorial that might be useful:

 

Tutorial: SubVIs

Regards,
Jim Schwartz
0 Kudos
Message 9 of 9
(5,411 Views)