LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use incremental rotary encoder to measure the absolute position and velocity

Hi all,

 

I faced a problem by using incremental rotary encoder to measure the absolute position of the rotation. 

 

I'm not using NI-Daqmx but NI-motion module. In NI-motion module, I use read encoder position.vi to read the position of the encoder. 

 

However, the readings is in incremental form. I'm doing the feedback control, so I need the absolute position and velocity.

 

Is there any functions or vi in the labview that can be used to transform the information of incremental encoder to the absolute one?

 

Thanks

 

Jun Wong

0 Kudos
Message 1 of 6
(3,723 Views)

Jun,

 

1. The incremental encoder provides incremental position. After switching on the encoder power the encoder counts upwards or downwards. For the absolute position you need the index (R or I) signal. I don't know which type of incremental encoder you have but there should be A, B and (I or R) signals. The index signal should reset the counter to zero setting this way a pseudo-absolute-position (which is lost after the first switch of). Most of the motion controllers have a mode, just after switch on, in which the controller search for the Index. This mode is called Homing. 

 

2. Velocity. It's very simple. You sample the position with a fix sampling clock. Let's say: 10kHz. The speed is: (Actual Position - Previous Position) / Sampling Period. Pos[n] = 10.000inc, Pos[n-1] = 9.900inc. Speed = 10.000 - 9.900 / (1/10kHz) = 1.000.000 inc/sec. If one increment is 0.0001mm then the speed is 100mm/sec.

 

Paul 

Message 2 of 6
(3,711 Views)

Hi Paul,

 

Thanks for the reply. I have successfully done the absolute position reading.

 

However, for the velocity, how to use sampling clock? Is it a vi or have to program it in labview?

 

Sorry because i'm still new in Labview.

 

Regards,

Jun

0 Kudos
Message 3 of 6
(3,703 Views)

Hi Paul, 

 

I found the sample clock vi. It is in Daqmx Timing.vi But it is in the Daqmx module. However, my controller does not support NI-Daqmx module.

 

Is there any way to take sampling without the delay time just like sample clock?

 

Thanks.

 

Jun

 

0 Kudos
Message 4 of 6
(3,700 Views)

Jun,

 

I do not have  the Motion module so I do not know how it samples the encoder data.  Look in the help files or manual for that module to see what is says.  Velocity is often a desired parameter for a motion system.  Perhaps the Motion module will calculate the velocity for you.

 

As Paul pointed out, you need to know the time between samples to get velocity.  If you cannot get the sampling rate from the Motion module, you may be able to get a crude approximation by recording the Tick count at the times when you read encoder data.

 

Lynn

0 Kudos
Message 5 of 6
(3,687 Views)

Thanks for the reply.

 

I have overcome my problems. Thanks for the advices and helps. Appreciate very much.

 

 

0 Kudos
Message 6 of 6
(3,683 Views)