Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Z index handling

Hi to all!

The purpose of my application: monitoring of the motion control system.

Monitored equipment:

1.       Motion controller + motor.

        http://www.yetmotion.com/YetIsrael/Products.asp?Currentcategory_id=44&Currenttat_category_id=70

        http://www.yetmotion.com/YetIsrael/ProductDetails.asp?ID=15

 

Monitoring equipment:

1.       NI PXI-6602

2.       Quadrature encoder with Z – index. (The encoder is connected to the shaft of the motor).

Right now the encoder not defined. Instead of the encoder I’m using PG-out of my motion controller. It works exactly as usual quadrature encoder.  

The application is written in labview 8.2.1 and right now it is nothing more than "Meas Angular Position-Buffered-Cont-Ext Clk.vi" from labview examples. 

I need an application that performs counter reset not each z-index.

My motion controller implements command such as SLIDE(velocity), Home_C and so on.

Command sequence (for my motion controller):

Slide 1000 – my motor revolves with 1000rpm (The duration of the movement is not configured).

After 10 min the position is 312445878 ticks (The number is for exemplifying).

In my encoder Z-index comes every 16384 ticks

Home_C 100 – perform homing on C-pulse. (Go to the Z-index and reset the actual position of my controller).

 

In this example Z-index happened 312445878/16384=19070 times, and only when I send Home_C command, on the next Z-index it will reset the position value.

So, what I want is that PXI-6602 will monitor the actual position value according to the circumstances.

 

Thanks in advance!

Izia

 

YET

www.yetmotion.com

0 Kudos
Message 1 of 7
(5,495 Views)

Hi Izia,

From your description, it sounds like you could just use an edge-counting task. You can use the Aux signal of the counter to control the direction of the count.  The result would be the total number of ticks over the measured time.

Please let us know if you have further questions.

Luke
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(5,486 Views)
Hi Luke!
 
Thank you for the quick response.
 
Actually i'm a very new labview user, so i'm not sure that i understand your answer.
"use an edge-counting task" - what does it mean? Should i create edge-counting task and use it instead of the position capturing task?
If  so, how would i reset the counter value on desired Z-Index?
 
Best regards
 
Izia
YET
0 Kudos
Message 3 of 7
(5,477 Views)

Hi Izia,

Technically, a position-capture task is an edge-counting task with a little more configuration done for you.  In this case, you are probably best to use one of the Angular Position examples.  The example that you specified should work fine.  I think that I originally misunderstood the question.

In order to reset the z index count, you will need to configure the z index using the DAQmx Create Channel function.  From the LabVIEW help:

z index enable specifies whether to use Z indexing for the channel.

z index value specifies in units the value to which to reset the measurement when signal Z is high and signal A and signal B are at the states you specify with z index phase.

z index phase specifies the states at which signal A and signal B must be while signal Z is high for NI-DAQmx to reset the measurement. If signal Z is never high while signal A and signal B are high, for example, you must choose a phase other than A High B High.

When signal Z transitions to high and how long it stays high varies from encoder to encoder. Refer to the documentation for the encoder to determine the timing of signal Z with respect to signal A and signal B.

A High B High (10040)

Reset the measurement when signal A and signal B are high.

A High B Low (10041)

Reset the measurement when signal A is high and signal B is low.

A Low B High (10042)

Reset the measurement when signal A is low and signal B high.

A Low B Low (10043)

Reset the measurement when signal A and signal B are low.

Lastly, I recommend that you look at this knowledge base article for more information about resetting the z index.

I think that the example you are using should give the desired results if configured correctly.  Please let us know if you have further questions.

Thanks,

Luke
Applications Engineer
National Instruments
Message 4 of 7
(5,458 Views)
Hi luke!
 
The link that you attached is not working, so i can't get the information 😞
 
In case you discribed, when z index enable variable is set to True, the application will reset counter value to 0 at each z index ! And i can't change z index enable variable while the vi is running. So i cant get value greater than one revolution -16384 ticks.
I need application to count continiously and clear the encoder only when i need the counter to be cleared.
 
 
Izia
0 Kudos
Message 5 of 7
(5,446 Views)

If  I follow correctly, you'd like to reset the counter value on a Z-index pulse, but not on *every* Z-index pulse.  Only under certain conditions would you want the Z-index pulse to cause a reset.  Is this right?

This could be a little tricky, but the basic idea would be to use the Z-index pulse indirectly.  Configure a previously-unused counter for a triggered single pulse generation with a very short pulse.  The pulse needs to be shorter than the true Z-index pulse so that it will occur completely within the expected A,B phase.  You should use the absolute minimum value for "initial delay", which is 2 ticks of the timebase.  Also your triggered pulse's falling edge should occur earlier than the the true Z-index pulse can, after considering the variability due to speed.

Your triggered pulse output should then be wired over to the encoder channel's Z-index input (the Gate pin).  Configure your triggered pulse task early in your app but don't start it yet.  When your app detects the conditions for enabling the count reset to occur, *then* you start the task.  The next Z-index pulse will trigger your output pulse which will in turn reset the encoder count within the same A,B phase that the true Z-index would have.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 7
(5,422 Views)
Hello Kevin!
 
Finally someone understands my question!
You are right, the implementation will be tricky, but it better than nothing!
 
I'll try to make this tomorrow.
 
Meanwhile, thank you very much for the idea.
 
Izia
0 Kudos
Message 7 of 7
(5,417 Views)