LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a usb 6008 to control a motor

Hi, Im currently working on a university project where I control a DC motor using Pulse width modulation signals generated by labVIEW. This signal will them be amplified by a circuit before entering the motor. (5v signal from DAQ)

I'm new to labview and its interface so I have been searching the forums for information on this function however I would still like to clear up a few questions. 

1. I have heard that using the usb 6008 is not the best option, however I already have a 6008 and would not like to spend more on another DAQ. I have found a code that will allow me to generate a PWM signal (see link). Will this signal suffice? 

 

http://digital.ni.com/public.nsf/allkb/1561D31534F07D608625727900391114

 

I have also seen another forum thread which mentions the code PWM_6008freqvary posted by MickeyD. 

 

http://forums.ni.com/t5/Digital-I-O/Generating-a-PWM-using-USB-6008/td-p/421654

 

Im not too sure which one of these codes I need to use to run the motor.

 

Sorry, this description is a bit vague however if you need more information please post up your question and ill reply as soon as possible 

 

 

0 Kudos
Message 1 of 7
(3,504 Views)

Read the second thread you have a link to. While both of these will produce PWM signals, the first one is a couple of orders of magnitude too slow to do anything useful in control the speed of a motor, what you would see would be the motor run at the full speed, then stop for a period, then run at full speed, rather than at the "average of on and off"  as the Pulse Widths will be very long relative to the motor's response. The second one has a better chance, IF all you want to do is run the motor. If there is any other calculations ...   Look at both and try and get an understanding of what they are doing. For PWM speed control of a motor you really need a pretty fast pulse width, and probably some filtering to smooth out the resulting "harsh" waveform, giving you the "average" voltage resulting from the PWM.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 2 of 7
(3,488 Views)

Ah thanks LV_Pro I understand what you're saying. I had a good feeling that second posting was the more appropiate code. 

 

Yes I do have more to do than just run the motor. The main application of my motor is to lower a dead weight of around 3-4 kg for 30 cm and then stop. So what im planning to do is use a microswitch when when the weight touches it, the motor automatically stops. Is there any additional code function that will help me achieve this? and will it work for a usb 6008?

 

Thanks

0 Kudos
Message 3 of 7
(3,479 Views)

bump

0 Kudos
Message 4 of 7
(3,448 Views)

The USB6008 has both digital output and digital inputs, not sure how they are divided. It also has analog inputs, either type of input could be used to monitor the switch, so in the loop generating output pulses you could also watch for the switch activation and stop outputting to the motor. I would caution not to just open the path to the motor for a couple of reasons, 1 - the amplifier you are using to provide the drive level signal to the motor might not handle an open circuit well (might even be damaged), 2 - some dc motors, under load, may free wheel if drive is removed. The later also posses a problem, how to "stop" the motor.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 7
(3,428 Views)

Yeah that would pose a problem..., do you know of any ways to cut the signal to the motor without opening the path? 

0 Kudos
Message 6 of 7
(3,400 Views)

I had a look through a video of PWM control : 

 

http://www.youtube.com/watch?v=Er8ZGfTCQLI

 

This seems a lot simpler and easier to generate. However she uses a 6211. Will that be much a of a problem? 

0 Kudos
Message 7 of 7
(3,392 Views)