Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Cam position in terms of a reference crank pulse?

We are using a PCI 6624 counter/timer to find the position of a cam tooth with respect to the crank position of an engine. We have 2 cams and the reference is a 60-1 teeth crank wheel (60 teeth with 1 missing...which means each tooth is 360/60=6 degrees). The 1 missing tooth is to reset the counter to 0 and count again to 60 (or 0 degrees and upto 360 degrees).  We use 3 channels, 1  carries the crank(reference), and the other 2 channels carry  2 cam signals( one pulse for every 360 degrees but position might vary).

All the 3 clocks have to be started at the same time for position synchronization. If we can run a loop which will execute only when the crank pulse goes high or low (like a frequency in trigger) then this would be easy but we are able to run the loop only periodically like 30ms or so, which means we can never count all the teeth on the crank and the cam position in terms of crank angles cannot be obtained from this. But we know the hardware is capable of recording all the pulse (in a buffer and output the latest one) since we operate only in kHz. Please advice. A sample program would really help.
0 Kudos
Message 1 of 4
(4,399 Views)
Hi Sarr,

That's an interesting application.  I think some clarification would be helpful.  In general, counters are useful for a number of measurement tasks, including those listed below:

1.  Event counting
2.  Time measurements - including period, pulse width, frequency, and two-signal edge-separation measurements
3.  Position measurements - reading encoder signals

Based on your description, I believe that a two-signal edge-separation measurement would be helpful by allowing you determine the time offset between your crank (reference) and cam signals.  There are LabVIEW DAQmx shipping examples (installed with the driver) that demonstrate how to do two-signal edge-separation.  These are located in the Example Finder under Hardware Input and Output >> DAQmx >> Counter Measurements >> Two-Signal Edge-Separation

If this does not provide the functionality you need, it would be helpful to think of your application in terms of the measurement types described above.  Do you need to do a position measurement task, or perhaps pulse width or frequency measurement?  Once you narrow this down, you can find the appropriate examples to start from in LabVIEW. 

I hope this information helps!

Best regards,
0 Kudos
Message 2 of 4
(4,386 Views)
We can do simple edge counting and stuff like that, but what we need to do is buffer the crank position and the absolute time of that pulse so we can interpolate/ extrapolate to obtain the cam position with a resolution greater than 6 degrees ( interval between 2 crank pulse is 6 degrees). But we don't know how we can buffer and recall the entire buffer instead of reading the latest value alone. Is it possible to talk to you (or another apps engg) over phone and discuss the issue in detail? Thanks.
0 Kudos
Message 3 of 4
(4,378 Views)
Hi Sarr,

It is definitely possible to do buffered measurements.  There are shipping examples listed in the Example Finder in LabVIEW that demonstrate how to do this.  These are located under Hardware Input and Output  >> DAQmx >> Counter Measurements.  Under each subcategory in this folder, there are examples that show how to do buffered measurements. 

In general, a buffered counter measurement means that values are latched into a memory buffer.  With some of the measurement types (event counting, position measurement), an external clock signal on the gate of the counter controls when the value of the count register is latched into memory.  Knowing the frequency of the external clock allows you to calculate the rate of change of your signal. 

With other types of counter measurements (period or pulse width measurement, frequency measurement, two-signal edge-separation), the latching is controlled by the signal itself, and buffering simply allows you to do a continuous measurement.  With no external clock as a reference, there is no way to know exactly when the values are being latched into memory. 

From what I've understood of your application, it sounds like you could benefit from either a buffered position measurement (using an encoder) task, or a regular or buffered two-signal edge-separation task.  Please refer to the examples to learn how to program these tasks. 

Best regards,
0 Kudos
Message 4 of 4
(4,366 Views)