Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with DAQ vi for speed and position control please

Hello everyone!  

Here its the deal, am new to this LabView stuff so hope I can explain myself good on here.  I am trying to control a Pittman servo motor with a buit in encoder using DAQ NI PCI-6251with the CB-68LP terminal block.  To drive the motor am using DC servo amplifier ofcourse.  So I was able to build a position control VI and worked just fine (see attached position gen voltage VI).  Now am trying to run the same motor but instead of position I want to to speed control (See attached PID gen votage VI).  Correct me if am wrong to do speed control I need to frequency, because that is what will determine my velocity right. well I just don't know to which pin from my DAQ will be my reference for my motor to follow.  I mean for my my position control I have my built in encoder from the motor as follows ch-A -> pin 37, ch-B ->45, Vcc-Pin9=5v, and my ground. in my amplifier I have Neg enable, Pos Enable, Amp enable, Ref input(-), Ref GND all to one single common node ground, and my Ref input (+) to pin 22 AO0.  I have tryed connecting my Ref input (+) to the pins that would output a frequency and no luck.  am missing something in my VI or connection?. I mean How should I initialize the DAQ in my vi for speed control? Thanks in advance.

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

Hi Juan,

 

The way the speed control would work is to read in the frequency like you are doing and feed that through your PID controller. As far as the ouput, the frequency value that you get out of your PID controller is going to be representative of the new "speed" that you should run the motor at to compensate for your speed offset from your desired value. The frequency range should corrospond to a range of DC voltage values that will control the full speed range of your motor. You can use a DAQmx Counter Ouput Frequency Task using a fixed frequency and a variable duty cycle, essentially controlling the DC level of the motor voltage with a PWM signal. The duty cycle of the counter output signal that is to be fed into your DC motor will determine the voltage and therefore speed of the motor. If your motor takes a voltage higher than 5V, which is the max supplied by the counter output, then you'll have to use an external voltage source to drive the motor. The range of voltage values that will be used by this source will have to be mapped to the frequency output range of the PID.  

 

Chris N White

0 Kudos
Message 2 of 2
(2,823 Views)