10-12-2010 04:58 AM
Hello!
New here and have started working on NI stuff recently. I'm trying to read position and frequence from encoder with 9411. I have one 1-channel encoder and one 2-channel encoder. From the 1-channel encoder I'm reading the frequence and the 2-channel encoder is for position. The problem is tha when my inverter starts the 9411 gets false readings and the counter will fail. When searching the forum and internet I've found that threre are digital filters for the counter but after trying it I found that it will only work on older cDaq 9172 - not the cDaq 9178 we have. I've tried to do an digital to analog conversion and the add a filter. This way I could get the frequency (allthough I have problems when the motor dosn't turn = 0Hz) but reading the pulse count I haven't figured out yet. Is there some other way to use digital filters on 9178 or what should I do?
My motor is running between 0-80 Hz and the encoder has 10 pulses per revolution so it's not very fast signal.
10-12-2010
02:45 PM
- last edited on
06-12-2024
08:06 AM
by
Content Cleaner
Hi tuusinii,
Unfortunately, you are correct that digital filtering has not yet been implemented on the 2nd generation cDAQ (although we are investigating the possibility of doing so... I would encourage you to make a post to our official DAQ Idea Exchange so others can weigh in on the matter).
Having said that, I think the following example should help you out:
Software-Defined Digital Filtering for 2nd Generation cDAQ
The idea is to use a buffered counter input to measure every consecutive semi-period (including noise), then use a software-defined threshhold to determine which pulses are valid. Adding up the high and low pulses during a single valid period and inverting the result should give you a frequency that is unaffected by noisy transitions as long as the threshhold is set appropriately.
Best Regards,
10-13-2010 12:27 AM
Hello!
Thanks for the tip - it looks promising and I'll look it in detail today.
10-13-2010 03:05 AM
Tried the example code, but had some problems. The VI dosen't read any pulses from my 9411 even if in the explorer I can see the counter reading the pulses and on my other VI-it reads the pulses - allthough wrong because of the noise. I have the two wires from the 2-channel encoder on pins 0 and 2 and the one here with 1-channel encoder in input 6 which according my understanding are the default places for ctr0 and ctr1. What could be wrong? I looked the numbers after the read and there isin't anything but zeros (so freq will be zero) only time I get some readings is when I'll make the noise happen (starting a motor with brake on). Then the frequence is anything from 1-couple thousands because of the noise glitches. It seems like there isin't a data for to read even if the explorer sees them? What could I have wrong or understand wrong on that example. (By the way I'm using LW 8.6 and waiting for a upgrade this year, if that makes a difference...)
10-13-2010 11:22 AM - edited 10-13-2010 11:25 AM
Hi tuusinii,
The semi-period measurement requires the signal to be connected to the Gate input of the counter, which is PFI 4 (pin 7) for counter 1 by default. I believe you have it connected to the Source of counter 1 (PFI 3, which is pin 6). Try changing the connection, and make sure that the Minimum Pulse Width is set appropriately for your input signal so that both high and low pulses are guaranteed to be counted.
Best Regards,
10-14-2010 12:08 AM
Hello!
Yes, that was the problem and I got it figured out yesterday. I got it working but ended up just reading the pulses by digital input and do my own calculation because it seemed work better because it made calculating the pulses easier. But I'll look back to this as an second option. The digital filter would just have been much cleaner solution. I hope that it comes in future.
03-04-2012 09:29 PM
John, is this filtering available for 9174 and Labview Base 2011?
03-05-2012
12:50 PM
- last edited on
06-12-2024
08:07 AM
by
Content Cleaner
Hi dav2010,
Filtering was not available for the 9174 upon release but it has since been added (in DAQmx 9.4). So if you have a version of DAQmx prior to 9.4 (e.g. 9.3.5 which was shipped with the Fall 2011 Driver DVD) you will need to upgrade DAQmx.
Best Regards,
03-05-2012 01:35 PM
Hi John,
Can you please direct me to the filtering? I have been running DAQmx 9.4 device driver for some time now; upgraded a while back. How can I access the filter function?
Thanks,
Dave
03-05-2012
02:31 PM
- last edited on
06-12-2024
08:08 AM
by
Content Cleaner
Hi Dave,
You will just have to set the corresponding property. For example, see this KB (LabVIEW, C, and .NET are all going to have slightly different methods for configuring the filter). The underlying description of what the hardware does can be found in the user manual.
Best Regards,