Difference between revisions of "Compensation Table"

From SoftMC-Wiki
Jump to: navigation, search
(Specification)
 
(21 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Languages|Compensation_Table}}
 
=Introduction=
 
=Introduction=
Groups allow you to control multiple axes as a single mechanism. With  
+
Groups allow you to control multiple axes as a single mechanism. With groups, the position command and feedback signals are no longer single  
groups, the position command and feedback signals are no longer single  
+
values, but instead, are vectors with two or three elements. Velocity and acceleration no longer apply to a motor, but instead, apply to the combination  
values, but instead, are vectors with two or three elements. Velocity and  
 
acceleration no longer apply to a motor, but instead, apply to the combination  
 
 
of two or three motors moving in concert.
 
of two or three motors moving in concert.
Some applications require high accuracy in position, so compensate for  
+
 
mechanical inaccuracies in the system is required. The MC allows you to  
+
Some applications require high accuracy in position, so compensate for mechanical inaccuracies in the system is required. The softMC allows you to  
define a table of corrections for one or more axes. This table defines a  
+
define a table of corrections for one or more axes. This table defines a correction to the positioned command given to the axes, depending on its  
correction to the positioned command given to the axes, depending on its  
+
location or other axes locations. This correction is achieved every cycle. The compensation table is usually created by high accuracy tools and  
location or other axes’ locations. This correction is achieved every SERCOS
+
is then used by the softMC to correct small inaccuracies. The correction can also take affect when the target axis is part of a group.
cycle. The compensation table is usually created by high accuracy tools and  
+
 
is then used by the MC to correct small inaccuracies. The correction can also  
 
take affect when the target axis is part of a group.
 
 
=Specification=
 
=Specification=
 
The compensation table is constructed from N axes, for which compensation  
 
The compensation table is constructed from N axes, for which compensation  
Line 21: Line 18:
 
units) must be equally spaced and monotonously increasing, while the  
 
units) must be equally spaced and monotonously increasing, while the  
 
“compensations” (in target user position units) are the corrections added to  
 
“compensations” (in target user position units) are the corrections added to  
the “target” axes.
+
the “target" axes.
 +
 
 
A compensation table of 3 axes source on 3 axes target is shown below.
 
A compensation table of 3 axes source on 3 axes target is shown below.
 
{|border="1"
 
{|border="1"
Line 59: Line 57:
 
|-
 
|-
 
|}
 
|}
The value in the table is locked and calculated according to the source axis'
+
 
PCMD and is linearly transformed. The “source” axes determine the  
+
The value in the table is locked and calculated according to the source axis PCMD and is linearly transformed. The source axes determine the  
correction value, depending on location. The “target” axes are corrected.
+
correction value, depending on location. The target axes are corrected.  
The table has a “header” which consists of the number of axes in the table  
+
 
followed by the number of compensation points defined for each axis. The  
+
The table has a header which consists of the number of axes in the table  
table can be created the MC using TARGETDATA, SOURCEDATA, and  
+
followed by the number of compensation points defined for each axis.  
CREATECOMP, or can be loaded from a binary file with a .CMP extension.
+
 
The correction takes affect when ALL the “source” axis position feedbacks
+
The table can be created by the softMC using [[MC-Basic:compTable.TARGETDATA|TargetData ]], [[MC-Basic:compTable.SOURCEDATA|SourceData]], and  
reach the first (i.e., the minimal) value in the table. The target axes are added  
+
[[MC-Basic:CREATECOMP|CreateComp]], or can be loaded from a binary file with a .CMP extension.
and the value calculated in the table to its current PCMD and PFB.
+
 
148 Rev GAxy-Systems 12/2008 BASIC Moves Development Studio
+
The correction takes affect when all source axis position feedback reach the first (i.e., the minimal) value in the table. The target axes are added and the value calculated in the table to its current PCMD and PFB.
The values in the “source” columns are in absolute units, while the “target”
+
 
values are in relative units (i.e., the value specified in the table is added to  
+
The values in the source columns are in absolute units, while the target values are in relative units (i.e., the value specified in the table is added to the current position of the axis, whether it is a geared, cammed or a regular axis). A value different from 0 at the beginning of the table causes a jump at  
the current position of the axis, whether it is a geared, cammed or a regular  
+
the target axes whenever the source axes get to the minimum value specified in the table.
axis). A value different from 0 at the beginning of the table causes a jump at  
+
 
the target axes whenever the source axes get to the minimum value  
 
specified in the table.
 
 
The difference between the corrected position (COMPPCMD) and the actual  
 
The difference between the corrected position (COMPPCMD) and the actual  
 
position feedback determines the position error of the target axes. PCMD  
 
position feedback determines the position error of the target axes. PCMD  
Line 82: Line 78:
 
source3.pcmd=4.5) is searched in the table and linearly transformed from the  
 
source3.pcmd=4.5) is searched in the table and linearly transformed from the  
 
previous points in the table to give the correction for the target positions.
 
previous points in the table to give the correction for the target positions.
 +
 
While the source axis continues its movement along the specified zone, the  
 
While the source axis continues its movement along the specified zone, the  
 
target axes change their positions according to the table. When one of the  
 
target axes change their positions according to the table. When one of the  
Line 91: Line 88:
 
While the compensation table is active, the values of the table cannot be  
 
While the compensation table is active, the values of the table cannot be  
 
changed. After the table is created, only the “target” values can be change.
 
changed. After the table is created, only the “target” values can be change.
7.1.2. Access Data
+
==Access Data==
 
The compensation table data is arranged in the form of following target data  
 
The compensation table data is arranged in the form of following target data  
 
for the points for each individual axis. If there are three axes (A1, A3, A3),  
 
for the points for each individual axis. If there are three axes (A1, A3, A3),  
 
there are three (N1, N2, N3) compensation points defined. To calculate the  
 
there are three (N1, N2, N3) compensation points defined. To calculate the  
index to access the table with the indexes i, j, k for A1,A2,A3, use:
+
index to access the table with the indexes i, j, k for A1,A2,A3, use:<br/>
index = i + j*N1 + k*N1*N2 .
+
index = i + j*N<sub>1</sub> + k*N<sub>1</sub>*N<sub>2</sub>
  
=Definition==
+
==Definition==
 
The compensation table is defined as a global variable.
 
The compensation table is defined as a global variable.
 
  Common shared comp1 as comp
 
  Common shared comp1 as comp
Line 115: Line 112:
 
Another way to create a compensation table is to directly load it from a binary  
 
Another way to create a compensation table is to directly load it from a binary  
 
file stored on the Flash disk. The structure of the compensation file is:
 
file stored on the Flash disk. The structure of the compensation file is:
*Header – <number of axes> <number of points axis1> ….<number of points  
+
*Header – <number of axes> <number of points axis1> ….<number of points axisn> (integer 4 bytes)
axisn> (integer 4 bytes)
+
*Source data – <min axis1> <max axis1>…..<min axisn><max axisn> (double 8 bytes)
*Source data – <min axis1> <max axis1>…..<min axisn><max axisn> (double 8  
+
*Target data – target values for axis1,…….target values for axisn. (double 8 bytes)
bytes)
 
*Target data – target values for axis1,…….target values for axisn. (double 8  
 
bytes)
 
 
The file can be created directly from Basic Moves by loading a list of values  
 
The file can be created directly from Basic Moves by loading a list of values  
 
(arranged as described above) in a .CSV format into the MC's Flash as a  
 
(arranged as described above) in a .CSV format into the MC's Flash as a  
binary file with the CMP extension (see LOADCOMPDATA and  
+
binary file with the CMP extension (refer to [[MC-Basic:LOADCOMPDATA|LoadCompData]] and  
STORECOMPDATA in the MC Reference manual).
+
[[MC-Basic:STORECOMPDATA|StoreCompData]]).
  
 
==Set and Query Values==
 
==Set and Query Values==
Line 133: Line 127:
 
  ?Comp1.sourcedata[2][24]
 
  ?Comp1.sourcedata[2][24]
 
  Read the source value index 23 of Axis1
 
  Read the source value index 23 of Axis1
 +
 
==Activate Table ==
 
==Activate Table ==
After defining the correction table turn it ON/OFF with COMPACTIVE.  
+
After defining the correction table turn it ON/OFF with [[MC-Basic:compTable.COMPACTIVE|CompActive]].  
 
Before activating, a check is performed to insure that the table is valid (the  
 
Before activating, a check is performed to insure that the table is valid (the  
 
points are evenly spaced and increasing). After validation and enabling the  
 
points are evenly spaced and increasing). After validation and enabling the  
Line 145: Line 140:
 
before reaching the end of the table.
 
before reaching the end of the table.
 
}}
 
}}
 +
 
==Query  the Actual Positions==
 
==Query  the Actual Positions==
The actual positions are return by COMPPCMD and COMPPFB. These  
+
The actual positions are return by [[MC-Basic:axis.COMPPOSITIONCOMMAND|CompPcmd]] and [[MC-Basic:axis.COMPPOSITIONFEEDBACK|CompPfb]]. These  
properties can be operated as the master source for a slave – geared or  
+
properties can be operated as the master source for a slave – geared or cammed. PCMD and PFB return the command and feedback positions without compensation.
cammed. PCMD and PFB return the command and feedback positions  
+
 
without compensation.
 
 
==Multi-Dimensional Correction==
 
==Multi-Dimensional Correction==
 
In the following example, the correction is performed on several axes. In the  
 
In the following example, the correction is performed on several axes. In the  
Line 168: Line 163:
 
  Comp1.TargetData[3][3*9*4] = 0.02 ‘Setting the target
 
  Comp1.TargetData[3][3*9*4] = 0.02 ‘Setting the target
 
  Comp1.CompActive=1
 
  Comp1.CompActive=1
From now on, any movement on any of the axes in the table generates  
+
From now on, any movement on any of the axes in the table generates compensation.
compensation.
+
=Example=
 +
See: '''[[:file:Application_Note_Compensation_Example_V1.PDF| Application_Note_Compensation_Example.PDF]]'''

Latest revision as of 03:24, 16 May 2017

Language: English  • 中文(简体)‎

Introduction

Groups allow you to control multiple axes as a single mechanism. With groups, the position command and feedback signals are no longer single values, but instead, are vectors with two or three elements. Velocity and acceleration no longer apply to a motor, but instead, apply to the combination of two or three motors moving in concert.

Some applications require high accuracy in position, so compensate for mechanical inaccuracies in the system is required. The softMC allows you to define a table of corrections for one or more axes. This table defines a correction to the positioned command given to the axes, depending on its location or other axes locations. This correction is achieved every cycle. The compensation table is usually created by high accuracy tools and is then used by the softMC to correct small inaccuracies. The correction can also take affect when the target axis is part of a group.

Specification

The compensation table is constructed from N axes, for which compensation is defined. The number of rows in the table will be:
k1*k2*….*kn
where k1 through kn are the number of correction points defined for the axes A1 through An, respectively. The “source” positions (in source axis position units) must be equally spaced and monotonously increasing, while the “compensations” (in target user position units) are the corrections added to the “target" axes.

A compensation table of 3 axes source on 3 axes target is shown below.

The Header
3 10 2
Source - axis location Target - axis compensation
1 3.1 4.5 0 0.5 0.9
2 3.1 4.5 0.9 0.51 0.2
6 3.1 4.5 2.0 0.5 0.9
1 3.2 4.5 0 0.1 0.9
2 3.2 4.5 0.65 0.01 0.9
6 3.2 4.5 3.0 0.22 0.9
6 4 4.5 2.0 0.2 0.9
1 3.1 5.0 0 0.1 0.87
6 4 5.0 1 1 1.2

The value in the table is locked and calculated according to the source axis PCMD and is linearly transformed. The source axes determine the correction value, depending on location. The target axes are corrected.

The table has a header which consists of the number of axes in the table followed by the number of compensation points defined for each axis.

The table can be created by the softMC using TargetData , SourceData, and CreateComp, or can be loaded from a binary file with a .CMP extension.

The correction takes affect when all source axis position feedback reach the first (i.e., the minimal) value in the table. The target axes are added and the value calculated in the table to its current PCMD and PFB.

The values in the source columns are in absolute units, while the target values are in relative units (i.e., the value specified in the table is added to the current position of the axis, whether it is a geared, cammed or a regular axis). A value different from 0 at the beginning of the table causes a jump at the target axes whenever the source axes get to the minimum value specified in the table.

The difference between the corrected position (COMPPCMD) and the actual position feedback determines the position error of the target axes. PCMD returns the position of the generator before correction. The source PFB (for example, source1.pcmd=1, source2.pcmd=3.2, source3.pcmd=4.5) is searched in the table and linearly transformed from the previous points in the table to give the correction for the target positions.

While the source axis continues its movement along the specified zone, the target axes change their positions according to the table. When one of the sources goes beyond the max value there are no more correction added for any of the axes in the table (correction=0). A jump may occur. Correction values are assumed very small and will not cause a large jump in the target axis. VOSPD and PEMAX are affected by the corrected position. Change these values accordingly to avoid exceeding the maximum values. While the compensation table is active, the values of the table cannot be changed. After the table is created, only the “target” values can be change.

Access Data

The compensation table data is arranged in the form of following target data for the points for each individual axis. If there are three axes (A1, A3, A3), there are three (N1, N2, N3) compensation points defined. To calculate the index to access the table with the indexes i, j, k for A1,A2,A3, use:
index = i + j*N1 + k*N1*N2

Definition

The compensation table is defined as a global variable.

Common shared comp1 as comp
CreateComp Comp1 3 ,4, 8
Creates a table with 3*4*8 number of rows and 
6 number of columns – 3 for the source & 3 for the target.
CompSet Comp1 A1 ,A3, A4 on A2, A6, A5
Sources A1 A3 A4 and targets A2 A6 A5 respectively.

The maximum and minimum positions of the table are set for every axis in the compensation table as well as a multiplier:

Comp1.minposition[2] = 1.32
Comp1.maxposition[2] = 4.5
Set the maximum value for the second axis in the table

Load/Save From a File

Another way to create a compensation table is to directly load it from a binary file stored on the Flash disk. The structure of the compensation file is:

  • Header – <number of axes> <number of points axis1> ….<number of points axisn> (integer 4 bytes)
  • Source data – <min axis1> <max axis1>…..<min axisn><max axisn> (double 8 bytes)
  • Target data – target values for axis1,…….target values for axisn. (double 8 bytes)

The file can be created directly from Basic Moves by loading a list of values (arranged as described above) in a .CSV format into the MC's Flash as a binary file with the CMP extension (refer to LoadCompData and StoreCompData).

Set and Query Values

While the compensation table is not active, you can change a specific target value.

Comp1.targetdata[1][23] = 3
Set a new compensation value of index 23 of Axis1
?Comp1.sourcedata[2][24]
Read the source value index 23 of Axis1

Activate Table

After defining the correction table turn it ON/OFF with CompActive. Before activating, a check is performed to insure that the table is valid (the points are evenly spaced and increasing). After validation and enabling the target axis, positions of the target axes are corrected using the value calculated from the compensation table. If a target axis is disabled, the correction takes effect only after the axis is enabled.

NOTE-Info.svgNOTE
A jump may occur when the compensation procedure starts

from a point other than the start point of the table. A jump may also occur if the compensation process is disabled before reaching the end of the table.

Query the Actual Positions

The actual positions are return by CompPcmd and CompPfb. These properties can be operated as the master source for a slave – geared or cammed. PCMD and PFB return the command and feedback positions without compensation.

Multi-Dimensional Correction

In the following example, the correction is performed on several axes. In the described system, there are three axes (X, Y, Z). The X, Y, Z position corrections are determined according to the location of the X, Y, and Z axes.

The table is composed from 4, 9, 3 entries for X, Y, Z axes, respectively.

Common shared comp1 as comp ‘This declares a table in the system.
CreateComp comp1 4 ,9, 3
Comp1.minposition[1] = 0.1 ‘Setting min for the X
Comp1.maxposition[1] = 9 ‘Setting max for the X
Comp1.minposition[2] = 1.1 ‘Setting min for the Y
Comp1.maxposition[2] = 2 ‘Setting max for the Y
Comp1.minposition[3] = 3 ‘Setting min for the Z
Comp1.maxposition[3] = 3.12 ‘Setting max for the Z
CompSet comp1 ax1 ,ax2, ax3 on ax1 ,ax2, ax3 ‘Declare before target data definition
Comp1.TargetData[1][1] = 0.01 ‘Setting the target
Comp1.TargetData[3][3*9*4] = 0.02 ‘Setting the target
Comp1.CompActive=1

From now on, any movement on any of the axes in the table generates compensation.

Example

See: Application_Note_Compensation_Example.PDF