Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

I don't get the desired pulse out from a counter in a PXIe-6363 on every Nth pulse in.

Solved!
Go to solution

I am measuring some characteristics of encoder pulses. I need to generate a pulse OUT that flip-flops at every Nth encoder pulse in.

This generated pulse will be used to trigger analog acquisition andcounter measurements on other counters in the PXIe-6363.

I attached my code. I expected to have a pulse out with equal length of high and low level.

This is not the case. What am i doing wrong here? I am using PXIe-6363.

Scientia est potentia!
0 Kudos
Message 1 of 10
(3,733 Views)

Hey magyar,

Trying to get some more information from you. 

-First, is your ctr3out looped back to an AI channel?  What are your signal connections (and what are the two graphs on the front panel)?

-What does the rightmost subVI do (seems to be labeled "6363 CNT3")

-If you do a quick Counter Input Pulse Measurement (ticks) on the input signal (PFI5, I believe), do you get constant pulses? (high/low ticks?)

 

-gaving

0 Kudos
Message 2 of 10
(3,721 Views)

I am working on a test sequencer.

I have many tasks in a programmable state machine.

 

The VI on the right is a functional global. I need to keep the reference open since I need the pulses generated continuously as long as I am using the software. This little code is part of an interactive setup TASK.

 

You are right,the CNTR3 output is connected to ai0.

The encoder signals are connected as such:

CHA to cntr0SOURCE and ai2 (visualisation and pulse width measurment)

CHA is also fed to cntr3SOURCE. cntr3 supposed to count "n=ppr" ticks (low and high being the same length.

 

CHB to cntr1SOURCE and ai3 (visualisation and pulse width measurment)

 

The encoder resoluton (pulses per motor revolution=ppr) gives me the number of ticks I need to count. 

The pulse widht of the encoder pulses varies somewhat from one pulse to the other, that is the quantity I need to measure and I need to trigger at the same rotational position of my motor.

Scientia est potentia!
0 Kudos
Message 3 of 10
(3,719 Views)

Interesting behavior...

 

Could you try adding digital filtering to the timebase of your counter output task?

 

2011-02-22_122100.png

I believe you'll have to also configure the filtering on your encoder task since it uses the same PFI line.  You can't configure the same PFI line to have multiple filtering settings for different tasks.

 

The reason I'm recommending this is that my hunch is that extra transitions are being picked up by the counter when the multiplexer switches from 0V on ai0 (ctr3 output) to 4V on the other channels (or vice-versa).  You might try changing your ai task to just include the single ai channel connected to ctr3 to see if this is the case.

 

 

Best Regards,

John Passiak
Message 4 of 10
(3,696 Views)

Hey magyar,

So what you're saying is that your Counter Output Tick Source is varying?? 

Does the variation in the counter output pulse seem to correlate with the variation in your ticks source signal (from the encoder)??

 

-gaving

0 Kudos
Message 5 of 10
(3,685 Views)

  The encoder pulses are not a perfect copy of each other. Pulse width and cycle length could vary 20-30% from one pulse to the next.

 I don't think, a counter should care about that. I just want the output to go high for n counts (one motor revolution) and go low for another n counts, and so on until I stop it a few hours later.

 This way I can trigger my CNTR0 and CNTR1 from the same motor position.

 I did that a few years ago with a PCI-6221 card and the generated output pulses triggered the acquisition on a PCI-5102. In fact, that software is used daily in our production department.

 

Scientia est potentia!
0 Kudos
Message 6 of 10
(3,680 Views)

"multiplexer switches from 0V on ai0 (ctr3 output) to 4V"

I just realised that all my signals should be 5V square waves and they are not.

Do I have a voltage devider again between my 10Kohm output resistor and some imput resistance?

Maybe it is time for the unit gain bufer?

Scientia est potentia!
0 Kudos
Message 7 of 10
(3,677 Views)

John P, gaving,

I connected anoder encoder that has active outputs (instead of the 10Kohm output).

I do not have the problem anymore. The counter gives me the pulses I want and all my signals are 5V square waves as they should be.

I guess it is time for adding a unit gain amplifier to get atround the 10kohm output resistance of my older encder.

Thank you for all of you for your time and attention.

Scientia est potentia!
0 Kudos
Message 8 of 10
(3,669 Views)
Solution
Accepted by topic author magyar

Hi magyar,

 

It's not a voltage divider (input impedance of the 6363 is >10 GOhm), but instead what we refer to as "ghosting" where the high source impedance increases the settling time of the multiplexer and causes channels to affect one another.  The behavior you were reporting in your other post has the same cause.

 

I think the same behavior is also causing dupilcate counts to be registered in the case when the ctr output is 0V and the encoder output is 5V (or perhaps in transiiton from 0 to 5V).  When the MUX switches from the 0V to the 5V channel, it takes time to charge the 100 pF capacitor on the ADC.  The amount of time that it takes is relatively high due to the 10kOhm resistor (on your encoder) that the capacitor is charging through.  During this time, the line (as seen by the counter source input) is evidently being pulled below the TTL threshhold and causing a duplicate edge to be registered.

 

        2011-02-22_174731.png

 

Digital filtering still might not be a bad idea even with the active drive encoder given that the counter source line is still connected to input of a multiplexer--when there's any doubt I usually include it for good measure.

 


Best Regards,

John Passiak
Message 9 of 10
(3,644 Views)

Thank you for the clarification.

Scientia est potentia!
0 Kudos
Message 10 of 10
(3,632 Views)