Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to build a circuit on Mydaq to control Motor using PWM

Hi all,

 

I want to generate PWM from Labview and to drive a DC motor. I have searched online and found a way where I can generate the PWM, but I do not know what circuit to build on the breadboard connected to Mydaq. Please, any help would be much appreciated!

 

-C

0 Kudos
Message 1 of 18
(13,307 Views)

Hey CharDiss,

 

You're going to have to give us a lot more information on what it is you're trying to do.  If you just want to output PWM there is no circuit necessary, you could generate a square wave using analog or digital IO and connect directly to a pin.  This, however will be logic level output and not powerful enough to drive a motor.  If you want to drive a motor you'll need a motor driver.  Do you have one?  If so which one? 

 

The more information you provide the faster we can help you.

 

Thanks,

 

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

Message 2 of 18
(13,305 Views)

Hi,

 

Thanks a lot for your reply. Well basically what I want to accomplish at the end is to have the motor rotating in both clockwise and anticlockwise directions. To cause the motor to rotate, the only way I know how is via PWM. I'm still first year engineering and I'm really new to this. What is a motor driver? Can I buy it? This is the video that I found on youtube to generate a PWM signal: 

 

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

 

 

 

0 Kudos
Message 3 of 18
(13,290 Views)

Hey CharDiss,

 

The ELVIS (and most other controllers) are designed as logic devices and not able to generate high current on their outputs.  So for example the analog output on the ELVIS can probably output a couple mA max.  This is not enough to spin most motors.

 

A motor drive takes the logic signals from a controller (such as ELVIS) and generates the high current outputs to drive the motor.  There are different types of drives for different types of motors.

 

Here are some examples:

 

Stepper Motor Drive

H-Bridge for DC Motors

(Servos can be driven with PWM for control and a direct external power connection for power, no drive required typically).

 

Let us know if that helps or if you have more questions.

 

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

0 Kudos
Message 4 of 18
(13,264 Views)

Hi Sammy,

 

I also has the same problem.

I am using NI myDAQ to generate digital pulses to control the full controlled 3 phase converter drive to drive my DC motor. But i am unable to generate digital signals by comparing two signals(sine and triangle) using myDAQ. please give me a valuable solution. i am attaching the error what we are getting. Please give me the solution to rectify the problem.

Download All
0 Kudos
Message 5 of 18
(12,839 Views)

Hi sivakumard,

 

Even though comparing a sine and triangle waves is a correct way to generate digital pulses in many applications, it is mainly used on low level hardware approaches such as when using an inverting aplifier to drive a motor and etc.

 

Do you have a particular need to do so? If not, the suggested way is to simply use the pulse generation functionality of DAQ Assistant as mentioned by Sammy_K. Alternatively you can develop the same approach in lower level DAQ VIs as explained and shown on the following community example:

 

https://decibel.ni.com/content/docs/DOC-17537

 

Please also give this white-paper a read as it explains PWM generation using DAQmx in greater detail:

 

http://www.ni.com/white-paper/2991/en/

 

Hope that helps. If you need more information, a simple google search on "PWM generation using DAQmx/myDAQ" or equivalent should bring-up a good number of results as it is a quite common usage of our DAQ hardware.

 

Best of luck with your application!

______________________________________________________

Mark N
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 6 of 18
(12,786 Views)

Hi There,

 

I'm currently learning Labview by example, for now just controlling by PWM an LED with a potentiometer. I have connected a potentiometer to one of the analogue channels, so I can control the duty cycle with it. This part works well and it is responsive.

 

I have seen the tutorials that you mention, they use the audio channels or counters. But I cant find any good example using digital output. I have tried to drive the DO at different frequencies and sample rates. I found is that the LED flickers a lot, I have tried to raise both values but it does not behave as I expected. What is the maximum frequency that I can drive the DO, as far as I know at around 170 Hz the flicker should not be noticeable.

Last question: What are the differences between the signal generators in Labview???

 

 

Greets,

Jose Vidal

Download All
0 Kudos
Message 7 of 18
(11,838 Views)

You're using software timing so you may be running into issues with your OS slowing your loop enough that you're having that issue.

0 Kudos
Message 8 of 18
(11,826 Views)

Do you have some suggestions to verify what is the issue or you are going to tell me that Hi tech piece of equipment like mydaq can not drive a led, I could do the same job with a 555.

0 Kudos
Message 9 of 18
(11,812 Views)

If you want to "drive" the LED, why not just turn it on?  You're seeing to work specifically with the frequency.  That's not purely driving the LED.  If you post disingenuous questions, do you expect serious answers?

0 Kudos
Message 10 of 18
(11,809 Views)