Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

read velocity (DAQ6221 / using VC++2003 for programming)

read speed (DAQ6221 /  using VC++2003 for programming)

 

I have DAQ6221.

I want measure velocity of my servomotor.

 

I could not find any function about velocity.

 

i tried to measure angular postion, and devide it by sampling time.

the accuracy at heigh speed is ok.

but at low speed accuracy is not good.

 

i want know how to measure velocity when the speed is low.

 

 

Message Edited by jinyjie on 11-19-2008 08:26 AM
0 Kudos
Message 1 of 4
(3,216 Views)

In order to best answer this question, I'll need to get some information about your system.  I assume you are using a digital encoder to measure the angular position.  Is this correct?  Also, how many pulses per revolution does your encoder return and what angular velocity (in RPM) of the shaft?.  What kind of accuracy do you need on your velocity measurement?

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 4
(3,198 Views)

I want measure motor’s velocity and acceleration.
But could not found any functions or examples about velocity and acceleration.
Os, I tried to measure the angular position, and then divided by sampling time for obtain velocity.
My encoder : 2500puls/revolution
Motor : velocity is lower than 100RPM
I use DAQ6221 for torque control, so the accuracy is important
I want make the error as low as possible, with DQA6221.

Message Edited by jinyjie on 11-21-2008 10:08 AM
0 Kudos
Message 3 of 4
(3,193 Views)

The best way to try an measure angular velocity and acceleration is to count the pulses from your encoder and to compare them in software to the frequency of the pulses.  This will require that we create two tasks in your Visual C++ program and then compare the outputs of both tasks to calculate velocity and acceleration. 

 

First, we will need to configure a task that counts the pulses coming in from your encoder.  This can be done fairly simply.  Just refer to the Visual C++ example called "CountDigEvents".  This will use one of your two counters, so we will need to hook your encoder up to this channel.

 

Second, we will need to configure a task to measure the frequency of your pulses.  To do this, set up a task similar to what you will find in the "MeasDigFrequency_LowFreq1Ctr" example.  You will also need to add a reference to the "DAQmxSetCIFreqDigFltrTimebaseSrc" property and refer it to the 20 MHz timebase.  You will also need to use the "DAQmxSetCIFreqDigFltrTimebaseRate " and set it to 20MHz.  This will insure that the frequency calculation uses the faster timebase, resulting in more accurate frequency measurements.

 

Finally, you will need to calculate your velocity based on the frequency and number of pulses at intervals during your acquisition, and calculate the acceleration at various intervals of your velocity measurements.  This setup will require quite a bit of programming but it is doable and will hopefully be accurate enough for your purposes.

 

How quickly and precisely do you need to control your motor?

Message Edited by Seth B. on 11-24-2008 04:21 PM
Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 4 of 4
(3,168 Views)