Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Monitor V & I applied to DC motor + Control speed of motor

Hi,

I am a grad student and I think my knowledge of LabVIEW is just about 1 on a scale of 10.0.
For a class project, I need to control the speed of a small 20V DC motor. I also need to monitor the voltage and the current that is being applied to the motor. I have the following at our lab.

  • NI 6221 (M-Series DAQMx)
  • LabVIEW 8.0
  • Optical Photo micro sensor (Transmissive): EE-SX1042.
  • A transparent glass disk, which I am planning to use it as an incremental encoder by drawing a radial line with a black marker.
  • A power MOSFET, IRF530N.
  • A current transducer LA55-P. [gives an instantaneous o/p current signal of 50mA]

 

After doing a bit of research in the NI forum, I came across this page according to which NI 6221 is NOT a recommended NI product to connect to Encoders.

 

So here are my questions:

  1. Can I use the NI-6221 to accomplish my objective?
  2. Any suggestions on the simple incremental encoder that I am trying to use?
  3. Can you please point me to some examples VIs where I could understand, learn and use it to acquire the data from the encoder?
  4. Do I need anything else apart from the above?
Thanks

0 Kudos
Message 1 of 8
(4,655 Views)
Hi UBAP,

Thanks for contacting National Instruments support. No problem that you are new to LabVIEW - we will do our best to help you along the way!

The Developer Zone did not suggest your 6221 simply because it only has two counters, and our counter/timer boards typically have more than that. Because the 6221 has two counters, this board will be good for your application as long as you do not need to measure more than 2 encoders or use more than the two on-board counters. There are many example for counter/timers in LabVIEW which you can begin with and alter to make your own. These can be found here: Help » Find Examples... » go to the 'Search' Tab » enter in "counter/timer" and then double click on the 1 keyword that comes up.

I cannot recommend much about the encoder, but there is a possibility that someone may post to this thread with suggestions. Good luck with the project!
David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 8
(4,630 Views)
Thanks for the post David,
I also need to control the speed of the motor [possibly by PWM - ?] (inaddition to counting the pulses).

Hope, somebody "pretty sooooooon" finds my silly project as interesting as the story of the daughter of Anna Nicole's !!  🙂 

Well, thaks for you again for pointing me in the right direction!!

UBAP.

0 Kudos
Message 3 of 8
(4,624 Views)
UBAP,

Here is some great information on PWM, if that is what you need to control your motor. Please take a look at this Developer Zone document, and KB 3AKA5THD. These are just a few of the items I found by searching our website. I would highly encourage doing the same to find more articles.

Message Edited by David L. on 02-13-2007 09:16 AM

David L.
Systems Engineering
National Instruments
0 Kudos
Message 4 of 8
(4,609 Views)
Hi David and "Others"

Here is what I am trying to achieve.
Objective: To control the motor speed using a single pulse/rev incremental encoder using PWM control. Again, I am using M-series NI 6221 (68 Pin DAQ card) with LabVIEW8.0.
I've attached a picture of the flow chart and the VI that I built untill now. I am stuck here.

Please assist me!! Also, please correct me if I am going in the wrong direction.

Thanks




Message Edited by UBAP on 02-14-2007 01:18 PM

Message Edited by UBAP on 02-14-2007 01:20 PM

0 Kudos
Message 5 of 8
(4,583 Views)
UBAP,

I would suggest using a frequency counter instead of a 'cnt edges'. Counting edges will always count up, and I believe, will eventually require some complex math to see what the actual speed of the motor is. A frequency counter will give you the frequency of the edges, and then you can calculate the speed of the motor from that. If it happens that your motor sends out one pulse per rotation, then you automatically have your speed. If not, you can take the frequency and simply calculate the true speed based off of how far apart the edges are and how many edges there are. Please see the example below as for how to continuously acquire your frequency. I took the LabVIEW shipping example "Meas Dig Frequency-Low Freq 1 Ctr", and put a while loop around the acquisition along with a 100ms wait in the loop so that it does not hog your processor. Best luck with the project.
David L.
Systems Engineering
National Instruments
0 Kudos
Message 6 of 8
(4,559 Views)
Thanks David,
Did the same. I guess it works now... I am planning to test my code. Any ideas how to isolate the parameters that I want to measure [motor voltage, motor current and encoder signals] from that of computer?

Voltages are around 10 to 20 Volts.
and max current is around 0.1Amp.
Do you think optoisolators would be good? if yes can u suggest me any...and if no, any other ideas?

Thanks

0 Kudos
Message 7 of 8
(4,519 Views)
UBAP,

The 6221 specifications states that it will output +/- 10V and +/-5mA. An optoisolator will work if you provide enough voltage and current from an external source to drive your motor. I do not have any recommendations, but would check with the motor manufacturer for possible suggestions. You do not need to worry about isolating measurements from the computer, as the DAQ card will take care of this.
David L.
Systems Engineering
National Instruments
0 Kudos
Message 8 of 8
(4,502 Views)