Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder noise problems

I am using a 6602 card with a counter in a simple pulse generation mode, and a rotary magnetic encoder.
I am trying to send a pulse after the certain position change. we have a standard encoder, and we are using the 6602 card with a programmed single pulse train generation counter. A channel of the encoder is set as a source, and after 50 pulses it is suposed to give a pulse. The problem is however when the encoder due to some noise factor sends pulses without a movement. This is not a problem with a position measurement, as it also has B channel to detect the change of the direction.
Is there a posibility to restart the delay counter, while reading the AqB signal, without a involvement of the software program?

0 Kudos
Message 1 of 5
(7,602 Views)
Hi Mirko Fodor, 

Please correct me if my understanding of your problem is incorrect. First I will restate it then offer a few suggestions.

You have a rotary encoder, a pulse output is created when  50 increments of revolution have occurred. This output is wired to the Gate of a Counter on the NI 6602.
 A single pulse on the Gate of this counter will create a Single Pulse Train from the NI 6602.

The problem is that occasionally noise on the output of the encoder will cause a false trigger of the NI 6602.

The question is, how do I restart the counter in hardware?

This sounds like a application for re-triggerable pulse train generation. The behavior of this will be: a finite pulse train is generated when  a
 trigger is received on the gate. When a second trigger is received (after pulse train is finished generating) then it will generate the pulse train again. 
This behavior will continue until the task is stopped.

Secondly,  the NI 6602 can perform Debouncing/Glitch removal . This will effectively filter out inputs that are smaller in pulsewidth than the filter setting.
This might help with the false triggering it  sounds like you are encountering.

There is a good re-triggerable example in the NI Example Finder. In LabVIEW, click Help->Find Examples then search for retriggerable.

Please post back if I have not answered your question. I would advise:
   1.Start with the re-triggerable example, understand how it works.
   2. Look at the Debouncing/Glitch KnowledgeBase article.
   3. Implement the re-triggerable and Debounce concepts in your application.
  
Hope this helps!

Have a great NYE,

MatthewW
Applications Engineer
National Instruments


0 Kudos
Message 2 of 5
(7,569 Views)

I am sorry if my explanation is a bit hard to understand. I will try to be more accurate.


We need to generate a pulse, after the exact position change.

So the idea was to use a single-triggered pulse generation counter that would generate a desired pulse after the 50 pulses from the incremental encoder. The A channel of the encoder is wired to the source of the pulse generation counter. Gate of the counter is a digital line which is controlled through a software program. So the software command for the gate signal is followed by the start movement command.


The problem is: we only have wired one channel of the incremental encoder  to the single-triggered pulse generation counter. The encoder noise due to the mechanical vibrations generates extra pulses. This is especially a problem, when the encoder detects  movement of +1 -1 arround a stable position, after the gate pulse has been set, and robot axis still did not start its movement.


Is there any way I can use a counter when working in a position measurement mode to generate a pulse, since then it gives the exact position?


0 Kudos
Message 3 of 5
(7,549 Views)
 Hi Mirko,

 I believe I understand your application now:

 You want to count 50 pulses from your incremental encoder then generate a pulse output.

 Right now it sounds like your are doing the following:
  1. Using a counter on your NI 6602 to measure the angular position
  2. When the position is reached that corresponds to 50 pulses then you turn a digital output high
  3. Another counter on the NI 6602 is armed and waiting for a digital trigger, on receipt of the trigger it then generates a pulse.

 It is not possible (that I know of) for a NI 6602 running a angular position task to generate a pulse output when a certain
  position has been reached in hardware, this will need to be a software timed decision.

Why is the incremental encoder wired to the source of your counter?

I'm afraid this will always be a software timed event, the transition from measuring the position to generating a pulse (or pulse train).
This could be as fast as a millisecond if your VI was properly constructed.

If you need just a single pulse then why not use the software digital output to send a High then Low?

If you need a pulse train then look at the shipping examples that are included with Labview.

I'm attaching a quick example in Labview 8.2 that shows one concept that should work for you. This one count's edges then triggers a pulse train.


Have a great evening,

MatthewW
Applications Engineer
National Instruments

 


0 Kudos
Message 4 of 5
(7,528 Views)
I checked the example, and it works now fine together with the filter.  Thank you for your help.
0 Kudos
Message 5 of 5
(7,503 Views)