ST_TimeSyncParameters

Configuration structure for the FB_TimeSync block

TYPE ST_TimeSyncParameters :
  STRUCT
    fDataCycleTime                : LREAL := 0.0;
    fThresholdForSync             : LREAL := 0.05;
    fMaxCycleIndexDifference      : LREAL := 7;
    iAgeOfDataLimit               : INT   := 7;
    iNoOfPeriodsForMeanDrift      : INT   := 1;
    fDelayTimeOffset              : LREAL := 0.0;
    fSlope1Numerator              : LREAL := 0.95;
    fSlope1Denominator            : LREAL := 0.5;
    iEndOfTransitionLimit         : INT   := 90;
    iNewDriftBendingCycles        : INT   := 90;
    iExtendedStartUpBlendingCycles: INT   := 90;
    bForceTimeMode                : BOOL  := FALSE;
    bAutomaticReInit              : BOOL  := FALSE;
    nSysCmd                       : DWORD := 1;
  END_STRUCT
END_TYPE

fDataCycleTime: Sender cycle time in [s]. If fDataCycleTime=0 it is assumed that sender and receiver operate with same cycle time. The cycle times must be even-numbered multiples of each other, i.e. tSender=2ms, tReceiver=4ms or tReceiver=1ms, for example. IffDataCycleTime<FB_TimeSync.fTaskCycleTime, the parameter fMaxCycleIndexDifference has to be adjusted accordingly (either by deactivating (=0) or be setting to a minimum value of FB_TimeSync.fTaskCycleTime/fDataCycleTime+2). The same applies to FB_TimeSync.iAgeOfDataLimit.

fThresholdForSync : Threshold value of the correction time from which synchronisation is activated. In order to avoid excessive differences between the extrapolated and the original values, bSynced=TRUE is only set if the correction time is smaller than the part of the cycle time specified by the parameter, i.e. if:

ABS(CorrectionTime)<(fThresholdForSync*TaskCycleTime)

fMaxCycleIndexDifference : Specifies the maximum value for the difference between the corrected and the original cycle index. If the actual value exceeds this value, error E_Sync_TimeSync_Error_MaxCycleIndexDiffExceeded is issued. fMaxCycleIndexDifference=0 deactivates this check. If the sender and receiver operate with different cycle times, fMaxCycleIndexDifference has to be adjusted as described under fDataCycleTime.

iAgeOfDataLimit: Maximum "age" of the data used in task cycles. For continuous reading, i.e. a new data set is received from the sender during each cycle, ST_TimeSyncDiagnostic.iConsecutiveEqualDataCounter =0. During each cycle in which the data remain constant the value is incremented by 1. In order to be able to respond to beat effects, the minimum value for is 1iAgeOfDataLimit. The higher the value, the more data lost during transfer, for example, are accepted. If the limits is exceeded, error E_Sync_TimeSync_Error_MaxDataAgeExceeded and bSynced=FALSE is displayed. iAgeOfDataLimit=0 deactivates the check. If the sender and receiver operate with different cycle times, iAgeOfDataLimit has to be adjusted as described under fDataCycleTime.

iNoOfPeriodsForMeanDrift : The drift between sender and receiver used for regulation is determined as the mean value between the last iNoOfPeriodsForMeanDrift values.

fDelayTimeOffset : Offset in [s] that is added to fCorrectionTime. Positive values refer to an additional extrapolation into the future, e.g. for compensating runtime differences.

Note

Any changes of this value have a _direct_ influence on the correction time fCorrectionTime and therefore on the extrapolated values (see FB_AxisExtrapolateValues or FB_AxisSync, for example). Accordingly, step changes in the kinematic variables used for control purposes caused by rapid changes in fDelayTimeOffset must be avoided. The greater fDelayTimeOffset, the greater the deviation between the values originally transferred and the extrapolated values. The parameter fMaxPositionDiff in the ST_AxisExtrapolateParameters, for example, must be adjusted accordingly.

The following two parameters are particularly relevant for strong fluctuations in phase difference:

fSlope1Numerator : Part of the correction that is executed within the time fSlope1denominator*fTaskCycleTime. In order to compensate the beat effects, the received cycle indices have to be corrected by +/- 1 between two step changes. If a discontinuity occurs significantly earlier than expected, the correction will not yet be completed, leading to a large difference to be corrected during the next cycle. The parameters fSlope1Numerator and fSlope1Denominator can be used to implement a disproportionately large part of the correction directly after a discontinuity. fSlope1Numerator specifies which part of the correction is implemented during the first period after a discontinuity, fSlope1Denominator specifies the length of the period as a fraction of the expected time between the beat effects. The scaling factor for the corrections during the remaining interval until the expected occurrence of the beat automatically results from the requirement that 100% of the correction must have been applied at the expected time of occurrence. The remaining part (1-fSlope1Numerator) of the correction is applied at time (1-fSlope1Denominator)*fTaskCycleTime. Once the expected time of occurrence of the beat has been reached, the correction remains constant.

The following slope values are used by default:

s1 = 0.95/0.5 =fSlope1Numerator/fSlope1Denominator

s2 = 0.05/0.5= (1-fSlope1Numerator)/ (1-fSlope1Denominator)

 

ST_TimeSyncParameters 1:

 

fSlope1Denominator : Specifies the time in fractions of the cycle time fTaskCycleTime, during which the part of the correction specified through fSlope1numerator is applied.

iEndOfTransitionLimit : Number of task cycles during which the difference between the sender and receiver cycle counter must remain constant, in order to identify a beat. Large values are required particularly for small beat frequencies. In this case, the low relative frequency of the two systems leads to a long transition phase. Cycle time jitter causes phases of constant counter difference, the length of which increases with decreasing system drift.

iNewDriftBendingCycles : Number of task cycles for linear transition when a new drift is determined. The stronger the deviation of the new drift from the previous value, the greater the change in correction time. In order to reduce the effects of this change, linear interpolation within iNewDriftBendingCycles cycles between the correction times determined with the old drift and the new drift is used. After iNewDriftBendingCycles only the current drift is used.

iTimeModeBlendingCycles : In TimeMode, the correction time is linearly reduced to 0 within iTimeModeBlendingCycles task cycles when a beat effect is identified. TimeMode is automatically active, as long as synchronisation could not be achieved (bSynced=FALSE). In this case, the function blocks (FB_AxisSync or FB_AxisExtrapolateValues) used evaluating the correction time should be used as in sync mode or discarded.

bForceTimeMode: Time mode is used continuously, i.e. the system does _not_ change to sync mode when the synchronisation conditions have been reached. TimeMode is automatically active, as long as synchronisation could not be achieved (bSynced=FALSE). In this case, the function blocks (FB_AxisSync or FB_AxisExtrapolateValues) used evaluating the correction time should be used as in sync mode or discarded.

bAutomaticReInit: Automatic reinitialisation after a fault. Faults are deleted and the startup phase initiated after a cycle. Activate with caution. Troubleshooting is made more difficult if the cause of the fault was not eliminated.

nSysCmd : reserved