NI Home > Community > NI Discussion Forums
Reply
Member
Choong
Posts: 9
0 Kudos

Using USB-6008 for closed loop motor control

Hi all,

I'm having problem designing a PID closed loop dc motor control. I was told that the NI USB-6008 is not good for this application, but this is the only DAQ card i can work with.

 

I wanted to use analog input for rpm measuring and analog output for PWM signal, there's an encoder sensor for rpm measuring.

 

I'm having hard time to understand the timing for this project,  the dt(s), dt out(s), and the DAQ timing, i wanted to know how to set these values.

 

When i split the VI i'm able to measure the motor's rpm, the problem is on the pwm output part. Below is the VI i'm working on, please help me figure what problem is in my VI.

 

Choong

 

 

Trusted Enthusiast
Jochen
Posts: 2,475
0 Kudos

Re: Using USB-6008 for closed loop motor control

Choong,

 

I guess, you are using a USB-6009, as a USB-6008 doesn't provide analog outputs. As you have stated correctly, this device is anything but ideal for control tasks. Here are some reasons:

 

  • The maximum AO rate is 150 S/s, which is pretty slow for control tasks
  • You only can use this device under Windows, which results in non-deterministic timing and in many cases to unstable control behavior


Still, if you want to give it a try, better use a counter on the device for the PWM generation, as this allows a much better timing resolution.

For help with the tuning process, please refer to this document. Please note, that this document is written for NI motion control products, but you still can learn a lot about the impact of the PID terms.

Again, please note, that there is a great chance, that you end up with a lot of work and a poor solution with your current setup. Please have a loot at these related links (1, 2) and at ni.com/motion.

 

Kind regards,

Jochen Klier

National Instruments

 

 

Member
KrisnaWisnu
Posts: 115
0 Kudos

Re: Using USB-6008 for closed loop motor control

[ Edited ]
Uups, someone replied already!
Message Edited by Krisna Wisnu on 12-15-2008 02:29 AM
Sincerely,


Krisna Wisnu
Member
Choong
Posts: 9
0 Kudos

Re: Using USB-6008 for closed loop motor control

Jochen,

 

Thanks for the reply. I'm sure that this is the USB-6008 because there is no counter I/O in this DAQ. Then i found 2 AO port here at the analog side of the DAQ. My question is how i'm going to design the program so that it will be able to use AO port to output PWM signal, please give me some direction on what VI i can use or a sample VI. Basically the program flow like this, duty cycle is the output from PID.vi, then it will be converted to PWM and send to DAQ. If possible please take a look at the VI i attached earlier(test4.vi).

 

Maybe the solution is poor but please provide me more info on doing this. Thanks for those who read this.

 

Choong

Trusted Enthusiast
Jochen
Posts: 2,475
0 Kudos

Re: Using USB-6008 for closed loop motor control

Hi Choong,

 

sorry, I mixed up some things. You are right. The 6008 provides 2 AOs, but the counter can't output a pulse train. Still these outputs provide a maximum update rate of 150 S/s. This is not enough for any reasonable kind of PWM signal that I could think of. E. g. if you generate a 50 Hz PWM signal, the timing resolution allows you to vary the PWM in exactl 4 discrete steps (0%, 33%, 66% and 100%). This doesn't sound like a reasonable approach to me.

 

Sorry, but this is really the wrong hardware for your application.

 

Jochen

 

Member
Choong
Posts: 9
0 Kudos

Re: Using USB-6008 for closed loop motor control

Hey,

 

Can i know how to set an initial PV because when the motor not running my RPM is infinity.

Thx

Member
coup
Posts: 2
0 Kudos

Re: Using USB-6008 for closed loop motor control

Hi Jochen,

 

I'm interested in the same problem. If the 6008 is unsuitable for this application, then kindly suggest a suitable device for this problem. Thanks in advance.

Trusted Enthusiast
Jochen
Posts: 2,475
0 Kudos

Re: Using USB-6008 for closed loop motor control

For closed loop servo motor control you could use a motion control board like the PCI-7342. This board runs the control algorithm in realtime on board and provides an easy to use API.

 

There are several other options but the key takeaways should be, that a) USB DAQ is not a valid solution for motion control tasks and b) deterministic realtime control is mandatory in most cases.

 

If you need further advice, please provide more specific information about your application requirements.

 

Jochen

Member
TheWisk
Posts: 7
0 Kudos

Re: Using USB-6008 for closed loop motor control

I seemingly have a similiar design problem to these other users, and for me, my application is very cost sensitive.  The 6008 unit costs $169 whereas some of the other mid-range options cost nearly 10x the $ amount. I noticed the one you quoted for instance is $1200.

 

Perhaps there is some link/guide/info somewhere that you might know of to help newer Motion control users like myself weigh the capabilities/limitations of the lower cost options to the capabilities/advantages of the higher cost options to figure out the absolute minimum cost needed for our applications?

 

Thanks!

 

 

 

Trusted Enthusiast
Jochen
Posts: 2,475
0 Kudos

Re: Using USB-6008 for closed loop motor control

Unfortunately I don't know a general decision matrix, that would help to select the most cost effective solution for a given set of requirements, but if you could post a description of your application and your motion control requirements here, I could provide at least some advice.

 

Please try to provide comprehensive information about what you are trying to accomplish. For the pure motion control part, please provide information about the following topics:

 

  • Motor type (servo, stepper, piezo,...)
  • Number of axes
  • Motor power and load inertia
  • Mechanical stage (rotational, lead screw,...)
  • Control type (position, velocity, torque)
  • Maximum velocity (rpm)
  • Required accuracy
  • Axis synchronisation (coordinated moves, gearing, camming,...)

There are many more parameters in this equation but I think you should get the idea, so please add whatever information could be relevant.

 

Depending on your requirments we might be able to find a low budget solution but it's very likely not a USB-6008, which is really by far the most improper NI product for motion control tasks.

 

Thanks,

Jochen