From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

dc motor position control

Hello,

 

I am novice in Labview. I am hoping that this is the right section to post this question. I am using a cRio 9076 Module with NI-9264 and NI-9205 analogue output and input cards. I am trying to control (PID) a motor with encoder on its back(http://www.pololu.com/catalog/product/1447). I have attached a the VI which counts the high pulses of both channels. I want to uses the pulse count to control the motor, i.e i want to set the motor to certain position by sending analogue signal by setting the desired pulse.

 

I have made a VI for control. I dont know whether i am going the right way to control. I can only increase the analogue voltage. But cannot decrease it in the controller

 

Any help would be graetly appreciated.

 

Download All
0 Kudos
Message 1 of 2
(5,531 Views)

Hi

 

To start with, how fast do you need to sample the encoder? I'm trying to figure out the specs, it looks like a slow speed motor, so sampling at 1kHz (which is the scan mode you are using) may be fast enough to detect all the encoder pulses. If you need to sample faster than 1kHz you'll have to use FPGA mode.

 

It looks like your edge detection fo the encoder is set up correctly. Is the motor position or speed controlled by the analogue voltage? As far as I can see from the specs, the motor ranges between 40-80 rpm depending on the input voltage. 

 

If you want to do PID control, there is functionality available in the "PID & Fuzzy logic" toolkit, if you have access to that.

 

You'll need to put in some code to translate the encoder pulses into a current speed so that you can perform the control.

Ian S
Applications Engineer CLA
National Instruments UK&Ireland
0 Kudos
Message 2 of 2
(5,499 Views)