Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Maintaining logging rate while measuring low rotational velocity using a myDAQ and a quadrature encoder

What I have been trying to log the rotational velocity of a motor every 10ms using two myDAQs and a quadrature encoder.  One myDAQ figures out the if the motor is spinning CW or CCW using the encoder position and the other measures the rotational speed using the CI period function on one of the encoder gates.

 

I am having an issue of maintaining the logging rate when the rotational speed becomes too low.

 

For example: Say the rotational speed of the motor is enough to maintain a 200hz pulse frequency from the encoder. If The motor slows down beyond this point the loop period drops below the required 10ms. Eventually the logging loop period will reach 20ms if I set the timeout on the read sample icon to zero.

In there a way to at least maintain the 10ms sampling rate at least to around 100hz pulse frequency?   preferably I would like it to maintain the logging rate all the way down to 0hz

 

 

P.S. i had already tested the idea of deriving the velocity based off of the position of the encoder. the measurements were too noisy given the clock only has ms resolution.

 

I am using Labivew 2010 student edition and Windows 7 32bit

0 Kudos
Message 1 of 2
(6,055 Views)

Hey defhammer, this is Paul with Applications Engineering at NI.

 

I'm not sure if the approach you've taken is going to work in a looped situation.

 

The reason that your loop is getting held up is the DAQmx read function is not returning quick enough, because its not getting enough samples.

 

You may be able to get around this by placing a DAQmx timing function in between your Create Task and Start Task functions, configuring it to 'implicit' mode , and configuring the sample mode to 'continuous' as shown below:

 

1684433.png

 

You may also need to check out some of our other period measurement shipping examples, which can be found in LabVIEW by going to Help>Find Examples>Browse>Hardware Input and Output>DAQmx>Counter Measurements>Period or Pulse Width.

 

Let us know how that works out for you.

 

Regards,

Paul Davidson
National Instruments
Product Owner - ni.com Chat
0 Kudos
Message 2 of 2
(6,042 Views)