How to Use an External Axis

To use multiaxis PLCopen Function Blocks with an externally sensed axis as master axis the following structure can be used for the axis implementation:

../_images/99805b227bc424ab0a331390001d1693

Structure synchronization to an external axis

The use of a feed forward filter Function Block is needed if the slave axis has to follow the position of the external axis. In this case there will be a time delay between sensing the position of the external axis and moving the follower axis along the sensed position. The filter Function Block will then add a certain distance to the external axis’ position depending of its speed.

The filter Function Block MATH_LINEAR_REGRESSION from the library MathFunctions_AC500_V23 can be used here.

../_images/d28a5d4b00f63b300a3313900002ad0f

Filter Function Block to feed forward an externally sensed position

For an axis which is following the external axis, the value “mcActualValue” for the input “MasterValueSource” for multi-axis PLCopen Function Blocks has to be used.

When the filter Function Block MATH_LINEAR_REGRESSION is used to process an actual position, 2 different purposes are fulfilled:

  • A jitter or noise can be compensated
  • It is possible to calculate a forecast-position to compensate for a delay in position measurement

Note

Process the actual position or any other master axis always before the slave axis.

Otherwise, an additional 1 cycle-delay is introduced.

The MATH_LINEAR_REGRESSION-block calculates the progress for a variable which is captured in equidistant periods of time and is assumed to follow a linear curve. It uses the Gauss “least squares” -algorithm to do so. The line is calculated in a way that the sum of squares for the distances from the measured points to the assumed straight line is minimized.

A noise or jitter influence of the value is compensated and a predictive value for the variable with an adjustable forecast horizon can be calculated.

Linear equation:

../_images/c0ec1c39fd482d880a317f3457cdf121

Sum of squares:

../_images/0020d97ffd4836da0a317f345d8d4e14

The gradient and offset for the line are calculated in a way that “sum” is minimized. Then these 2 values are used to calculate the forecast value:

../_images/e5da9852fd63957f0a317f34153cb521

FORECAST=0 would mean: value right now, no future or past considered.

When the ACTUAL value is a modulo value, for example a single turn encoder or a rollover axis, this has to be considered in the calculation. The 2 input values POSITIVE_LIMIT and NEGATIVE_LIMIT can be used to configure this. They define the upper and lower limit for ACTUAL. Also, the NEXT_BINARY will as a result be limited to these borders.

Example

../_images/2917861ffd48315e0a317f3405b041ee

Next Value_Forecast