Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

ni 9401

Ok, I have (4) rotary encoders (1600pulses/reve) each.  I also have (2) Ni 9401's mounted in slots 5 and 6 of my C-Daq chassis.  I followed the quadrature encoder measurements: How to guide with no positive results.  I've set up a variety of tasks in MAX (count edges, frequency measure, angular postion, etc) All I really want to do is measure the angular velocity of each of the encoders.  At most I should see around 3M encoder pulses per second when the machine the encoders are mounted to is running. 

When attempting to count rising edges (on one encoder) I set up a  count edges task in MAX when I run the task and I rotate the encoder REALLY slow for 1 revolution I can get ~1600 pulses.  If I rotate the encoder fast I get a different and lower value.  Also if I rotate in a CCW direction I get one value but the CW direction will yield a diffent count result.  I am at a loss here.  I've acquired the A and B encoder signals with analog outputs and they are indeed square waves 90degrees out of phase.  

 

A couple other things.  I've noticed that I cannot create a task that will incorportate all 4 encoders.  Also, I was referencing the 100kHz time base initially, but the timebase cannot be used by multiple counters simultaneously.  Attempts to use the 20MHz timebase have failed.  

Any help would be greatly appreciated.  This was supposed to be a quick job and has taken alot longer than anticipated.  

0 Kudos
Message 1 of 6
(5,108 Views)

Hi Joe,


Thanks for posting.  The fact that the pulses from your encoder are not being recognized at high rates would seem to indicate a signal integrity issue.  I'd imagine that as you increase your angular velocity, the pulses begin to look less and less like a true square wave.  Can you acquire the analog signal at the full 3Mhz to see its characteristics on a scope?  Also, do you have a link to the spec sheet for the encoders that you are using?

 

To answer your other questions: The 9172 chassis has two counters, so you will not be able to incorporate all 4 encoders--our Counter/Timer boards provide multiple counters, but are only available in PCI or PXI form factors.  You won't be able to use the 20MHz timebase for your sample clock in counter tasks on the cDAQ chassis because this would require a data rate of 640 Mbit/s (20 MHz * 32 bit counter)--the maximum data rate for USB 2.0 is 480 Mbit/s.  The timebase that you reference does not affect the rate that the count register increments, but rather how often you read data from the count register.  I hope this answers your questions, if you let me know where I can find the specs on your encoders I can continue to look into the cause of your main issue.  Thanks!

 

-John

Message Edited by John P on 10-10-2008 07:35 PM
John Passiak
0 Kudos
Message 2 of 6
(5,088 Views)

John,

   Thanks for the response.  Per your request see the following URL for a spec sheet on the rotary encoders.  http://www.renishaw.com/media/pdf/en/16c0039e39c049629aab7d80fb677fe5.pdf  Specifically these are RE22 I series encoders. 

 

I plugged in a NI 9205 into slot 2 of the chassis and was able to capture the A and B signals from one of the encoders. The signals looked good even at rotational rates that screwed up the counter.  I learned about the limits of the counters last week during a 2 hr phone conversation with NI tech support.  All I really need out of this system is (4) angular velocities.  Is there no way to utilize this 20Mhz clock to send me out a frequency measurement?  Is there more info on C-DAQ's oscillator and access to the clocks available? 

 

And for the Rant....

Needless to say I was a bit upset that I couldn't find this info or perhaps I just couldn't understand the manuals that accompany the C-DAQ system.  I was under the false impression that the NI9401's could use or share the chassis oscillator signal to perform counting operations on up to 4 channels.  (2 per module).    

Perhaps I'm mistaken, but I thought this was a fairly standard concept.  Monitoring frequency and position with an encoder.  There is even a document in developer zone on quadrature encoding with the NI 9401.  The speeds I'm talking about are not obsurd, the encoders, while they have a fine pitch, are also fairly standard in industry, why then am I required to utilize a timebase that cannot work with USB coms? 

 

So now I've got (4) encoders that I've got to jury rig into something useful.  I told this to the tech support person I spoke to and I'd like to shout out to others since I can't be the only one experiencing this phenomenon......FIX YOUR MANUALS!!!   They are very weak on configurations.  I'm not even going to get into the utilization of the shunt calibration circuits on the NI 9237's. 

 

Disclaimer:

Look, I've been working with NI gear for over 10 years.  I love the stuff.  I recommend it on just about every job I do.  I've pulled off some crazy stuff with the C-DAQ system in particular, so I want NI to realize that it really pains me to throw out negative comments.  By the way, tech support was very good as usual.  I just didn't like their answers.

        Joe

0 Kudos
Message 3 of 6
(5,067 Views)

Thanks for the link to the spec sheet.  I'm still a little confused about the way you are acquiring the signal.  The 9205 has an aggregate sample rate of 250kHz--if you are reading both A and B inputs at the same time that would be 125kHz/ch.  To accurately characterize a square wave you should be sampling well above Nyquist.  At what rate does the counter begin to miss pulses?

   

I am still leaning towards this being a signal integrity issue--the counters on the 9172 can count edges reliably at up to 20 MHz.  I would be interested to know more about the cabling/shielding involved.  Are you following the recommended connection diagram (shown below) from the RE22 specifications

 

 

Encoder Termination

 

 

The cDAQ-9172 product page mentions that the chassis has two counters in the Overview section--more information can be found in the 9172 User Guide and Specifications (the counters section starts on page 40).  If you let me know which documentation gave the impression that the 9172 posesses 4 counters I can look into correcting it.

 

Also, I think I might not have been clear about the 20 MHz clock.  You cannot use this as a timebase to sample the count register--as mentioned before this would require a data rate not possible using USB 2.0 (I don't think you really want to acquire 640 Mbit/s per counter anyway).  The count register itself updates based off of an 80 MHz internal timebase and will count external signals at up to 20 MHz.  The sample clock is just the rate that you read data from the count register, and does not affect how quickly the register can count edges.

 

A 3 MHz square wave should be well within spec for the counters aboard the 9172.  The speeds you are talking about are not absurd for counting operations.  The fact that you followed the devzone article leads me to believe that you have the channels set up right.  I would double-check your wiring and make sure to follow the recommended termination procedure mentioned above.

Message Edited by John P on 10-13-2008 07:12 PM
John Passiak
0 Kudos
Message 4 of 6
(5,049 Views)

You might also try generating a 3 MHz pulse train from one of your counters and measuring with the other--this would be a great test to make sure that your NI hardware is functioning properly.

 

-John

John Passiak
0 Kudos
Message 5 of 6
(5,039 Views)

John,

    Thanks for the continued effort.  I will review your latest post in more detail after I get a cup of coffee.  I just wanted to quickly respond to the sampling rate issue....  3M is not correct (my bad)  The encoders I'm using have 1600 pulses per rev.  the encoder should not exceed 1300 RPM or 34560 pulses / sec.  Sorry for the error.  I was using the 9205 to monitor the A and B pulse trains on only one encoder sampling at 100kHz per channel.  More to follow...

0 Kudos
Message 6 of 6
(5,030 Views)