Program Examples:Backlash Compensation Table

From SoftMC-Wiki
Revision as of 15:52, 23 November 2016 by Rasty (talk | contribs) (added xreference)
Jump to: navigation, search

Introduction

This article demonstrates the use of compensation tables for eliminating position backlash .

Backlash compensation value in different movement directions

Program

First, define two compensation tables each one for opposite directions:

common shared compAxAPlus  as comp
common shared compAxAMinus as comp

attach the axis, go to an initial position (-100):

  Attach AxA    
  Move A1 -100

Define the number of points in each table (10):

  CreateComp compAxAPlus  10
  CreateComp compAxAMinus 10

Both are active between -100 and +100:

  CreateComp compAxAPlus  10
  CreateComp compAxAMinus 10


Set the both tables acting on same axis(AxA):

   CompSet compAxAPlus  AxA On AxA
   CompSet compAxAMinus AxA On AxA


Checking the actual compensation value from terminal should return 0 as no motion has been done:

   compAxAPlus.MinPosition[1] = -100
   compAxAPlus.MaxPosition[1] = +100

   compAxAMinus.MinPosition[1] = -100
   compAxAMinus.MaxPosition[1] = +100

Set the compensation values linearly between 0.1 for -100 and 1.0 for +100 for positive direction and -0.1 to -1.0 for negative direction:

   for i = 1 to 10
      compAxAPlus.TargetData[1][i] = 0.1*i
      compAxAMinus.TargetData[1][i] = -0.1*i
    next 

Set direction of compensation activity, one table is only active in positive movement (vcmd > 0) direction the other is negative (vcmd <0):

    compAxAPlus.direction = 1
    compAxAMinus.direction = -1  


Set both tables active, it means both will be active each one in different direction:

    compAxAPlus.CompActive = 1
    compAxAMinus.CompActive = 1


Start Motion:

    AxA.PositionBacklashAlpha = 0.9

    Sleep 100
    Move AxA 99.9 Abs = 1  Vcruise = 10000
    Delay AxA 100    
    Move AxA -99.9  Abs = 1 Vcruise = 10000
    Delay AxA 100    


Detach the axis:

  Detach AxA    
  End Program


SEE ALSO