Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder use with myRIO

Hi, 

 

I'm using myRIO obtain the encoder A,B phase data(1024P/R) to calculate the postion and RPM with motor, use the myRIO → Encoder.vi 

 

to get the Counter value and direction, but have a problem that rotate 360 degree but counter value get more than 1024.

 

I don't know what happend, need some help

 

YCSu_0-1686151847929.png

 

and another question is, I have a DAQ 9215 + 9171, but I can't use  DAQ-assistant to easily get the angular position like the Youtube video,

Is my DAQ didn't support to do that?

 

Thanks you,

Harry

 

 

0 Kudos
Message 1 of 5
(2,896 Views)

Both the myRIO and the cDAQ system (9171 with the 9215) are both examples of LabVIEW Real-Time peripherals, running some version of the LabVIEW Real-Time Linux OS.  When submitting code (thank you!) for such systems, it is helpful to send the entire Project (right-click the Project folder, choose "Send to:", "Compressed (zipped) folder", and attach the .zip file).

 

When I try to open your VI, everything is OK until I try to open the Express VI to understand the problem, and LabVIEW tells me "the target doesn't support this Express VI".  It is looking for this VI to be in a LabVIEW RT Project.  I could create one, using my own myRIO, but it would be better for me to see your code in your Project's context.

 

I suspect you are having a similar problem with the cDAQ.  Could you provide me with a reference to the YouTube video so I can understand what you are trying to do?  [I again suspect the problem is the Project context is missing].

 

Bob Schor

 

 

0 Kudos
Message 2 of 5
(2,804 Views)

Thanks for your reply, 

 

For MyRIO, I use the method like the video: https://youtu.be/gs3Zb3VbhN8 

but I got the wrong number on Counter Value (Use encoder OEW2-1024-2MHT-050-00EA)

have 1024P/R, but I got more than 1024

 

For DAQ, I try the method like the video: https://youtu.be/YGRKAxjYDes 

want to get the Angular postion 

but for my DAQ(9171 and 9215) doesn't find the I/O can use for that in DAQ assistant

 

Here is my VI code for my question

about MyRIO, can open the -- byMYRIO.vi -- 

and -- Test01.vi -- that I use the another way to count value, have good result by only a little error for 1024P/R

but I have no idea to calculate A/B phase the direction for rotation

 

about DAQ, can open the -- byDAQ.vi --

but I can't find the funtion that I want to use, so this VI doen's work.

 

Thanks, I really appreciate for your relpy.

0 Kudos
Message 3 of 5
(2,736 Views)

The myRIO digital inputs are direct inputs without any filtering at all. You most likely want to have some bounce filters implemented to avoid the fast FPGA code to detect additional edges while the actual encoder switches from high to low and vice versa. This could be implemented as simple RC filters on the input but I prefer to use a programmable input bounce filter on the input lines directly in the FPGA code itself.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 5
(2,726 Views)

Unfortunately, I do not have your hardware, and do not have CompactDAQ drivers installed on my system.  But here are a few things you should try:

  1. Open MAX.  Plug in your 9171 with the 9215 installed.  Make sure it is turned on.
  2. Can you see it in MAX?  I added a simulated 9171 and MAX found it (see below).
  3. I can't open a Test Panel (because I don't have the driver), but you should be able to do so.  Can you get it to "do anything sensible"?
  4. If so, go try the U-tube video again.

As it happens, I'm about to use some Counter/Timers on a USB-6212.  I really dislike the Dreaded DAQ Assistant (which I call the DDA), and stopped using it within a year of its being introduced.  Go on the Web and find "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications" (or something close to that title) and learn that for most things, you only need 3 or 4 DAQmx functions, especially once you learn how to configure Channels and Tasks (you can do that in the Project).

Simulated cDAQ-9171 with 9215Simulated cDAQ-9171 with 9215

 Here's my current MAX configuration.  The simulated cDAQ is shown in yellow.  You should see it in "shades of gray" on your system, and should be able to run some Test Panels and get simple DAQmx tasks to run.

 

Bob Schor

 

0 Kudos
Message 5 of 5
(2,718 Views)