Robot.DefLinComp Method

Defines internal table of motor encoder "Linearity compensation" correction values that are automatically applied to encoder values.

Robot.DefLinComp ( robot, motor, enc_start, enc_step, num_cor, cor )

Prerequisites

Parameters

robot

An optional numeric expression that specifies the robot to be accessed (1-n).  If this value is 0 or unspecified, the Selected robot will be accessed.

motor

A required numeric expression that specifies the motor to compensate (1-n).

enc_start

A required numeric expression that specifies the first (and lowest) encoder count to be corrected.

enc_step

A required numeric expression that specifies the step size in encoder counts between successive encoder correction values.  Must be greater than 0 and can be a fractional value.

num_cor

A required numeric expression that specifies the number of encoder correction values that are defined in the cor array (1-n).  The number of values is only limited by the available system memory.  Increasing the number of correction values and decreasing the step size improves the compensation and only effects memory, not execution time.

cor

A required array of double precision values that specifies the correction in encoder counts at each sequential encoder position.  The corrections can include fractional encoder counts.  Positive values indicate that the encoder should be reading a higher value and negative numbers indicate the encoder reading should be lower.

Remarks

This method creates and defines an internal table of encoder correction values for the specified motor of a robot.  These corrections are automatically applied to each motor command and to each encoder reading.  This technique permits repeatable position errors to be corrected to yield more linear and accurate axis positioning.   In between correction values, the corrections are interpolated.  Outside of the correction range, the raw encoder value is utilized.

As soon as this method creates and initializes the correction data, it is immediately put into effect.

As a convenience, this instruction can be executed even when robot power is enabled.  So long as the corrections are small, this will result in a small instantaneous motion of the motor.

 

               

When first trying a new compensation data set, motor power should be disabled to avoid any sudden, high speed motor motions.

Correction data sets can be created for any motor of the robot that you wish to compensate.   It is not necessary to create a correction table for all motors.   Correction tables stay in effect until they are over-written or the controller is restarted.

Please see the "Motor Linearity Compensation" section in the Controller Software > Software Setup > Selected Setup Details and Procedures chapter of the PreciseFlex™ PreciseFlex Library for information on creating correction data sets and for more information on this technique.

Examples

Dim cor(2) As Double
cor(0) = 0
cor(1) = -18            ' First step is too short
cor(2) = 5.3            ' Second step is too long
Robot.DefLinComp(1, 1, 5000, 1000, 3, cor)

See Also

Robot Class