Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

disturbance of counter value with NI 9401

Hello,

I send this message because I have a problem with a counter on an NI 9401on cDAQ-9178.

I measure an angular position with two pulse signals (increment on channel A and decrement  on channel B). There is one signal and it is a relay that directs the signal to channel A or B.

You can see details on the attached file.

I purchased a sample of the counter every 10ms.

Everything works fine except when an AC motor of the machine starts or stops.

When the AC motor starts or stops the counter value change by an offset (see attached file). If the counter is counting, I observe a negative offset. If the counter is counting down, I see a positive offset.

If they are electrical noises, why will not offset in the direction of signal?

How to fix the problem?

 

Thank you for your help.

 

 

 

Bonjour,

J'envoi ce message car j'ai un problème sur un compteur avec une carte NI 9401 sur un cDAQ 9178.

Je mesure une position angulaire avec deux signaux impulsionnels (Incrémentation sur la voie A et décrémentation sur la voie B). Il y a un seul signal et c'est un relai qui oriente le signal vers la voie A ou B.

Vous pouvez voir les détails sur la photo jointe.

Je fais une l'acquisition d'un échantillon du compteur toutes les 10ms.

Tout fonctionne très bien sauf quand un moteur asynchrone de la machine démarre ou s'arrête.

Au démarrage ou à l'arrêt du moteur assynchrone le compteur prend un offset (voir fichier joint). Si compteur est en comptage, j'observe un offset négatif. Si le compteur est en décomptage, j'observe un offset positif.

 

Si ce sont des parasites, pourquoi l'offset ne va pas dans le sens du signal?

Comment corriger le problème?

 

Synthèse.jpg

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

Hi BGR72,

 

It sounds likely that you are picking up electrical noise.  The noise would be picked up more on the disconnected channel since it is not being driven by a low impedance source.

 

Based on your attached graphs, the noise appears to be a fast series of several short pulses that are much shorter than the pulses that you are intending to measure.  If so, digital filtering might be a good solution as you can choose to reject pulses below a certain width--you should be able to find a cutoff such that the fast glitchy noise pulses are ignored but the longer steady encoder pulses are accepted.  Digital filtering is only available starting with DAQmx 9.4 for the 9178.  However, you can't use digital filtering in the DAQ Assistant.  You would need to use the DAQmx API in a programming language such as LabVIEW, C/C++, or .NET.

 

If you are open to changing your external connections, the undriven PFI line could be grounded instead of left floating (you would probably need a different type of switch) which would hopefully remove the noise altogether.  Before changing your switch, you can test out this possible solution by connecting one of the lines to your signal source, the other to ground, and turning on your motor to see if the noise goes away.

 

 

Best Regards,

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

Think you John,

 

After some modifications, the problem has evolved. Now the offset signal (noise) is only on the signal connected.
I'm downloading the NI-DAQmx version 9.40 to apply digital filtering on counting.
The filter should be set in MAX or in LabVIEW? (my program uses Labview tasks set in Max).
Could you give me more details on the configuration of the filter on the counter. (on image, the configuration of my task with DAQmx 9.2.3


Best Regards


Après quelques modifications, le problème a évolué. Maintenant l'offset de signal (le bruit) est seulement sur le signal connecté.

Je télécharge la version Ni-DAQmx 9.40 pour pouvoir appliquer un filtrage numérique sur le comptage.

Le filtrage doit-il être paramétré dans MAX ou dans Labview ? (mon programme Labview utilise des taches configurées dans Max).

Pouvez-vous me donner plus de détails sur la configuration du filtrage sur le comptage. (en image, la configuration de ma tache avec DAQmx 9.2.3

 

 

 

ConfigMax.gif

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

Hi BGR72,

 

Unfortunately you can't set the filtering directly from MAX.  You'll have to use one of the lower level APIs to enable it.  As an example, in LabVIEW you would just need to set the following properties before starting your task:

 

2011-11-04_142147.png

 

The minimum pulse width would depend on the characteristics of the noise you are picking up as well as the pulse width of your actual encoder pulses.  You want the minimum pulse width to be wide enough to block all of the noise, but short enough to guarantee the passing of the encoder pulses.

 

 

Best Regards,

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

Hi John

 

Thank you for the clarity of your answer.
While it will be cleaner to remove the cause of the noise (we tried, it's not easy), the solution of the filtering can be a great help, especially as the frequency of the noise ismuch higher than that of the signal .
I can not make the change now because the machine is in the customer's plant. I'll make the change next time.

Thank you for all

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