04-30-2015 07:04 AM
Hello, I'm working on compactRIO 9012 and I want to calculate the angular position from an encoder, I have the NI 9505 as acquisition module, is there any predefined function on labview that calculate the angular position, I have seen some exemples that only uses DAQmx to do it.
help please.
04-30-2015 07:35 AM
04-30-2015 08:05 AM - edited 04-30-2015 08:06 AM
hello, thank you for answering , no I didn't know that it exist 😛 could you please tell me where to found it, actually it's my first time on labview 😉
04-30-2015 08:07 AM - edited 04-30-2015 08:12 AM
Hi ramlus,
I have the NI 9505 as acquisition module, is there any predefined function on labview that calculate the angular position
As far as I can see from the NI9505 example project your module does NOT output any information about encoder state, it just uses the encoder internally to control your motor.
You will need some other way to read the encoder information - like a DIO module with counter capability…
The NI9505 is no "acquisition module", it's a driver for brushed servo motors!
@Maxime:
On the cRIO RT target you will not be able to use any DAQmx functions or DAQmx tasks defined in MAX…
Edit:
You can access the Encoder AB signals on the FPGA level. There you could create your own counter routine!
You also have "Encoder Index" and "Drive Direction" available…
04-30-2015 09:07 AM
05-02-2015 11:18 AM - edited 05-02-2015 11:20 AM
hello,
yes indeed I acquired the encoder and I have two LEDs (A and B), the "Encoder Index" and the "Drive Direction" ,but the problem is that I don't know how to use them to calculate the angular position : / I have not find tutorials with the cRIO, could you help me please.
05-03-2015 03:09 AM
Figure 6 in this tutorial gives one example of code for calculating position from a quadrature encoder using FPGA.
If none of that makes sense, try starting with the RIO Getting Started guide and reading about FPGA interface mode.
05-04-2015 06:34 AM - edited 05-04-2015 06:37 AM
Hello,
thank you for your help,
I followed the tutorial you gave me , I can not tell if the values I get are fair or not ,and I have some questions :
how to know the number of pulse per revolution??
and is it normal to get a negative value of Velocity??
should I connect a motor (to the encoder ) to work properly because for now I 'm turning it myself
cordially
05-04-2015 06:41 AM
Hi ramlus,
I can not tell if the values I get are fair or not
You're the one who has the test setup in front - so you're the one who should know the expected RPM values!
how to know the number of pulse per revolution??
You're the one who has the test setup in front - so you're the one who should know which sensor is used in the setup!
and is it normal to get a negative value of Velocity??
It is normal when you use a quadrature encoder. This type of encoder can also detect direction of rotation and so outputs "negative" speed for opposite direction…
One question: How do you determine your loop iteration speed? Your RPM calculation strongly depends on iteration time - but you don't seem to use any time measurement in the loop…