From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you setup the Z-index for Linear encoder

I am using a Mitutoyo linear encoder and USB-6210 to measure linear postion. I am able to get everything working properly per the attached vi. and have an acceptable output with the z-index disabled. When I enable the z-index and run the encoder along everytime the z-index is passed the output resets to a specific value (which makes sense for an angular encoder).  The way the vi. is setup matches the results I am getting.  It calls for a specific output value everytime the z-index is passed. I would like it to specify a distance per pulse instead of a specific value, as is done on the A and B input of the of the quadrature signal.  Any suggestions on how to setup this up.

 

Thanks

 

CN2

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

Here is the vi I am using

0 Kudos
Message 2 of 5
(6,328 Views)

The counter reset - or reload with a specific value - when crossing the Z index also makes sense with a linear encoder ! The index can be used as a reference mark that will initialize the counter, which is essential to get an absolute position measurement.

 

Enable this feature if you need it. Disable it if you don't.

 

  1. In your example, change the angular encoder measurement to CI Linear Encoder (click on the selector below the VI>>Counter Input>>Position>>Linear Encoder).
  2. Replace/rename the controls according to the inputs of the new VI and set their values according to your linear encoder.
  3. Rename the indicator in the while loop and... insert some delay to avoid a 100% CPU usage !
  4. The distance will be displayed according to your settings.
0 Kudos
Message 3 of 5
(6,318 Views)

 

JB thanks for the response. 

 

Is there any way to change the counter reset - or reload with a specific value - to a distance per z-index pulse.  The reason for this is that the linear encoder I am using has more than one z-index reference point. It is a 24" linear encoder with a z-index spaced every 2". So every time the z-index is passed it reloads with the same specific value even though the encoder is not in the same position! 

 

 

0 Kudos
Message 4 of 5
(6,309 Views)

 


CN2 a écrit :

 

Is there any way to change the counter reset - or reload with a specific value - to a distance per z-index pulse.  The reason for this is that the linear encoder I am using has more than one z-index reference point. It is a 24" linear encoder with a z-index spaced every 2". So every time the z-index is passed it reloads with the same specific value even though the encoder is not in the same position! 


I'm afraid not. At least I don't know how.

 

Here is what I would do :

 

  • Disable the Z index of the counter task.
  • Run an init procedure to initialize the counter with a known distance :
  1. move the linear encoder to one of its ends (--> limit switch)
  2. move to the first reference point of the linear encoder
  3. start the counter task without Z index and set its initial distance with this known distance
  4. if needed, recall the initialization procedure from time to time to reinitialize your counter
0 Kudos
Message 5 of 5
(6,295 Views)