LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Motor Control USING (2) NI-9481 and NI-9221 ENCODER TESTER

First off I am a new to the labview world and I am having a real tough time. I am using NI cDAQ-9174. It has for four slots in which I am using two NI-9481 and one NI-9221. I am trying to control a motor with an encoder wheel. The motor have has TACHOMETER, SPEED/TORQUE, and PWM DIRECTION connecting in the NI-9481.The objective is to do an encoder test, getting square waveform with limits of both encoder A and B signals. The power supply is 24VDC and 5 VDC. The motor’s shaft has an half an encoder wheel in which I have to use labview to get the shaft to stop in a position that will enable me to lift the half of encoder wheel of the shaft. This program will be designed to test multiple motors and encoders at once. I can seem to get a good graph form the readings, and I get the motor to run but I can’t seem to get any reading out of it nor stop it in a certain position. I would really like to make a reset VI that can reset the position and the reading if pushed. Also would like to use a start sequence button, so if pushed the sequence will run taking all required data and checking for errors. Also would like to have an end sequence button to stop the start sequence and begin another. ANY SUGGESTIONS... I NEED ALL THE HELP I CAN GET

0 Kudos
Message 1 of 9
(2,962 Views)

Hey ifgyuikfuy,

 

It might be helpful if you narrow down what might be going on with your program to one specific issues that you are having. You gave a bunch of information but it would be helpful to narrow it down to one specific issue that you are having that I could help with.

 

Regards,

 

Doug B

Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(2,928 Views)

The biggest issue that I am having is  that I can not get a solid waveform from the encoders while the motor is running. The Only wave I get is mostly noise. I need a a good solid square waveform of the encoders with limits. That is the first issue I need to solve. ANy suggestions?

 

Thanks for your help

0 Kudos
Message 3 of 9
(2,920 Views)

Hey jpow,

 

What encoder are you using and how do you have it connected to your system? The NI 9401 is a C Series module that we make that has built in encoder functionality that might be very helpful. Take a look at this article from our site:

 

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

 

This should be able to get you started on the right path.

 

Hope This Helps,

 

Doug B

Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(2,903 Views)

Thanks I got that waveform to work now. Here the next problem i am having. I am using the two NI-9481 in a cDAQ09174 and 8 relays. I am wanting to create a PID control. The objective is to control a synchronous motor and have it stop at a precision point. Is there a way using that NI device to create a Precision Motor Controller?

0 Kudos
Message 5 of 9
(2,879 Views)

To add on to the last question and post, The Motor has a Proximity Sensor on it that will spike when the shaft of the motor needs to stop. How can I control the motor to do that?

0 Kudos
Message 6 of 9
(2,872 Views)

Hey jpow,

 

Here is an example on how to do PID motor control in LabVIEW. 

 

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

 

There are also many other PID control examples on our website that might be useful if this isn't exactly what you are looking for.

 

Regards,

 

Doug B

Applications Engineer
National Instruments
0 Kudos
Message 7 of 9
(2,853 Views)

Thank you for the advice for the PID controller. But Do you know of any way of taking data from a waveform and using that data to stop that motor. I need some type of logic command that will see when the spike of the sensor on the waveform and know onec the data goes over a certain value to stop the motor. Any suggestions Still Using NI-9221 and NI-9481 both in a cDAQ-9174

0 Kudos
Message 8 of 9
(2,840 Views)

jpow,

 

You can build in logic by comparing your input to any number you want and comparing the two using a lesser than? greater than? etc. call in LabVIEW. If the data you are pulling goes greater than your set point you can program it to shut down the motor.

 

Hope This Helps,

 

Doug B

Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(2,822 Views)