Difference between revisions of "Program Examples:Backlash Compensation Table"
(Created page with "==Introduction== This article demonstrates the use of compensation tables for eliminating position backlash . [[File:BACKLASHCOMPENSATION.PNG|Backlash compensation value in ...") |
|||
Line 7: | Line 7: | ||
== Program == | == Program == | ||
− | First, | + | First, define two compensation tables each one for opposite directions: |
<pre> | <pre> | ||
− | + | common shared compAxAPlus as comp | |
− | + | common shared compAxAMinus as comp | |
</pre> | </pre> | ||
− | + | attach the axis, go to an initial position (-100): | |
<pre> | <pre> | ||
− | + | Attach AxA | |
− | + | Move A1 -100 | |
</pre> | </pre> | ||
+ | |||
+ | Define the number of points in each table (10): | ||
+ | |||
+ | <pre> | ||
+ | CreateComp compAxAPlus 10 | ||
+ | CreateComp compAxAMinus 10 | ||
+ | </pre> | ||
+ | |||
+ | Both are active between -100 and +100: | ||
+ | |||
+ | <pre> | ||
+ | CreateComp compAxAPlus 10 | ||
+ | CreateComp compAxAMinus 10 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | Set the both tables acting on same axis(AxA): | ||
+ | |||
+ | <pre> | ||
+ | CompSet compAxAPlus AxA On AxA | ||
+ | CompSet compAxAMinus AxA On AxA | ||
+ | </pre> | ||
+ | |||
Checking the actual compensation value from terminal should return 0 as no motion has been done: | Checking the actual compensation value from terminal should return 0 as no motion has been done: | ||
<pre> | <pre> | ||
− | - | + | compAxAPlus.MinPosition[1] = -100 |
− | + | compAxAPlus.MaxPosition[1] = +100 | |
+ | |||
+ | compAxAMinus.MinPosition[1] = -100 | ||
+ | compAxAMinus.MaxPosition[1] = +100 | ||
</pre> | </pre> | ||
+ | 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: | ||
+ | <pre> | ||
+ | for i = 1 to 10 | ||
+ | compAxAPlus.TargetData[1][i] = 0.1*i | ||
+ | compAxAMinus.TargetData[1][i] = -0.1*i | ||
+ | next | ||
+ | </pre> | ||
+ | |||
+ | Set direction of compensation activity, one table is only active in positive movement (vcmd > 0) direction the other is negative (vcmd <0): | ||
− | |||
<pre> | <pre> | ||
− | + | compAxAPlus.direction = 1 | |
+ | compAxAMinus.direction = -1 | ||
</pre> | </pre> | ||
− | + | ||
+ | Set both tables active, it means both will be active each one in different direction: | ||
<pre> | <pre> | ||
− | + | compAxAPlus.CompActive = 1 | |
− | + | compAxAMinus.CompActive = 1 | |
</pre> | </pre> | ||
− | + | ||
+ | Start Motion: | ||
+ | |||
<pre> | <pre> | ||
− | + | 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 | ||
</pre> | </pre> | ||
− | |||
+ | Detach the axis: | ||
<pre> | <pre> | ||
− | + | Detach AxA | |
− | + | End Program | |
</pre> | </pre> |
Revision as of 08:14, 29 September 2014
Introduction
This article demonstrates the use of compensation tables for eliminating position backlash .
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