Lookahead Synchronization

For some advanced motion features, the controller must execute the program before it causes the motion so that it can precalculate the moves and speeds. This operation is called lookahead. When lookahead is active, the active line of the program does not always correspond to the program line that commanded the motion. When this occurs, synchronization between the program and the motion becomes less rigid.

These advanced motion features make lookahead active:

  • Corner Rounding
  • Cutter Offset Compensation
  • Cutter Radius Compensation
  • Velocity Blending

To configure the maximum number of program lines that the controller can execute before the motion, use the MaxLookaheadMoves Parameter. If the coordinated ramp rate is low or if the coordinated speed is very high, it might be necessary for you to increase the value of this parameter.

Function Synchronization During Lookahead

When lookahead is active, some AeroScript operations look as if they occur out of sequence because the controller must execute program lines before it causes the motion. Examples of AeroScript operations that look out of sequence include:

  • Variables that the controller assigns after a MoveRapid(), MoveLinear(), MoveCcw(), or MoveCw() move might update before the move occurs. This is because the controller assigns global variables and program variables while the AeroScript program is precalculating moves. Thus, the controller can use global variables and program variables as move targets during a lookahead sequence.
  • The controller reads I/O while the AeroScript program is precalculating the moves. This means that the controller reads I/O immediately during program execution. The I/O reads are not always synchronized to motion during lookahead.

Some AeroScript functions are always synchronized to motion. These functions are synchronized when lookahead is active or not active. When the controller executes the AeroScript program before motion, the program executes through the synchronized function. But before the program can execute that function, it waits for all motion that is commanded before the function to complete.

Tip: Use the sync() statement to synchronize a function that is not on the list of AeroScript Functions Always Synchronized with Motion. For more information, see Synchronizing Function Calls with Motion.

AeroScript Functions Always Synchronized with Motion

Motion-Related Functions

  • Dwell()
  • MoveDelay()
  • SetupAxisRampType()
  • SetupAxisRampValue()
  • SetupAxisSpeed()
  • SetupCoordinatedRampType()
  • SetupCoordinatedRampValue()
  • SetupCoordinatedSpeed()
  • SetupDependentCoordinatedRampRate()
  • sync() statement
  • TuningSetFeedforwardGains() (only when you specify Aff or Vff gains)

I/O Functions

  • AnalogOutputSet()
  • DigitalOutputSet()
  • GalvoLaserOutput()
  • VirtualBinaryInputSet()
  • VirtualBinaryOutputSet()
  • VirtualRegisterInputSet()
  • VirtualRegisterOutputSet()

PSO Functions

  • PsoBitmapConfigureArray()
  • PsoDistanceConfigureAllowedEventDirection()
  • PsoDistanceConfigureArrayDistances()
  • PsoDistanceConfigureCounterReset()
  • PsoDistanceConfigureFixedDistance()
  • PsoDistanceConfigureInputs()
  • PsoDistanceConfigureScaling()
  • PsoDistanceCounterOff()
  • PsoDistanceCounterOn()
  • PsoDistanceEventsOff()
  • PsoDistanceEventsOn()
  • PsoEventConfigureMask()
  • PsoEventContinuousOff()
  • PsoEventContinuousOn()
  • PsoEventGenerateSingle()
  • PsoLaserEventsOff()
  • PsoLaserEventsOn()
  • PsoOutputConfigureOutput()
  • PsoOutputConfigureSource()
  • PsoOutputOff()
  • PsoOutputOn()
  • PsoReset()
  • PsoTransformationConfigure()
  • PsoTransformationOff()
  • PsoTransformationOn()
  • PsoWaveformApplyPulseConfiguration()
  • PsoWaveformApplyPwmConfiguration()
  • PsoWaveformConfigureDelay()
  • PsoWaveformConfigureMode()
  • PsoWaveformConfigurePulseArrayCounts()
  • PsoWaveformConfigurePulseArrayOnTimes()
  • PsoWaveformConfigurePulseArrayTotalTimes()
  • PsoWaveformConfigurePulseFixedCount()
  • PsoWaveformConfigurePulseFixedOnTime()
  • PsoWaveformConfigurePulseFixedTotalTime()
  • PsoWaveformConfigurePulseMask()
  • PsoWaveformConfigurePulseTruncation()
  • PsoWaveformConfigurePwmOnTimes()
  • PsoWaveformConfigurePwmTotalTime()
  • PsoWaveformExternalSyncConfigureDelayMode()
  • PsoWaveformExternalSyncOff()
  • PsoWaveformExternalSyncOn()
  • PsoWaveformOff()
  • PsoWaveformOn()
  • PsoWaveformScalingConfigure()
  • PsoWaveformScalingOff()
  • PsoWaveformScalingOn()
  • PsoWindowConfigureArrayRanges()
  • PsoWindowConfigureArrayUpdateDirection()
  • PsoWindowConfigureCounterReset()
  • PsoWindowConfigureEvents()
  • PsoWindowConfigureFixedRange()
  • PsoWindowConfigureInput()
  • PsoWindowCounterSetValue()
  • PsoWindowOutputOff()
  • PsoWindowOutputOn()

Functions That Lookahead Cannot Look Through

There are some functions that the controller cannot execute in advance during lookahead. When the controller encounters one of these functions, lookahead stops temporarily. Then the controller operates as follows for features that are active and also require lookahead:

  • If Corner Rounding is active, the controller does not round the corner.
  • If Cutter Radius Compensation or Cutter Offset Compensation is active, the controller does not put an arc at the end of the move. But it does end the move at the cutter offsets and tries to put a correction arc at the start of the next move. If the intersection of the two moves makes an outside corner, the correction continues and the controller applies an arc. If the intersection of the two moves makes an inside corner, overcut occurs and the controller applies the cutter offsets by blending them across the length of the second move. Because of this risk during cutter compensation, Aerotech recommends that you do a lead-off move before one or more of the functions that the controller cannot look through during lookahead. To see these functions, refer to the list that follows.
  • During a Velocity Blending sequence, the motion decelerates to zero velocity if the controller encounters one or more of the functions that it cannot look through during lookahead. Refer to the list that follows.

Functions That the Controller Cannot Look Through During Lookahead

  • Abort()
  • AcknowledgeAll()
  • AnalogOutputConfigureAxisTrackingMode()
  • AnalogOutputConfigureVectorTrackingMode()
  • AppDataCollectionAddAxisSignal()
  • AppDataCollectionAddIndustrialEthernetMappingSignal()
  • AppDataCollectionAddSystemSignal()
  • AppDataCollectionAddTaskSignal()
  • AppDataCollectionAutoSaveOff()
  • AppDataCollectionAutoSaveOn()
  • AppDataCollectionConfigure()
  • AppDataCollectionReset()
  • AppFrequencyResponsePerformStabilityAnalysis()
  • AppFrequencyResponseTriggerMultisine()
  • AppFrequencyResponseTriggerMultisinePlus()
  • AppFrequencyResponseTriggerSinusoid()
  • AppFrequencyResponseTriggerWhiteNoise()
  • AppIndicatorOff()
  • AppIndicatorOn()
  • AppMessageBox()
  • AppMessageDisplay()
  • AppMessageDisplayDismiss()
  • AppMessageFileOpen()
  • AppMessageFileSave()
  • AppMessageInputBox()
  • AppMessageMenu()
  • AutofocusOff()
  • AutofocusOn()
  • CalibrationLoad()
  • CalibrationUnload()
  • Callback()
  • CammingFreeTable()
  • CammingOn()
  • CommandQueuePause()
  • CommandQueueStart()
  • CommandQueueStop()
  • ConfiguredParameterGetAxisStringValue()
  • ConfiguredParameterGetAxisValue()
  • ConfiguredParameterGetSystemStringValue()
  • ConfiguredParameterGetSystemValue()
  • ConfiguredParameterGetTaskStringValue()
  • ConfiguredParameterGetTaskValue()
  • CornerRoundingOff() (only during Velocity Blending)
  • CornerRoundingSetAxes()
  • CornerRoundingSetTolerance()
  • CTransformationDisable()
  • CTransformationEnable()
  • CutterCompensationSetAxes()
  • CutterCompensationSetOffsets()
  • CutterCompensationSetRadius()
  • DataCollectionAddAxisSignal()
  • DataCollectionAddSystemSignal()
  • DataCollectionAddTaskSignal()
  • DataCollectionReset()
  • DataCollectionStart()
  • DataCollectionStop()
  • DateTimeExtractDay()
  • DateTimeExtractDayOfWeek()
  • DateTimeExtractDayOfYear()
  • DateTimeExtractHour()
  • DateTimeExtractMinute()
  • DateTimeExtractMonth()
  • DateTimeExtractSecond()
  • DateTimeExtractYear()
  • DateTimeGet()
  • DirectoryCount()
  • DirectoryFileCopy()
  • DirectoryFileCount()
  • DirectoryFileDelete()
  • DirectoryFileExists()
  • DirectoryFileGetFileName()
  • DirectoryFileMove()
  • DirectoryGetName()
  • Disable()
  • DriveAnalogAccelerationFeedforwardConfigureInput()
  • DriveAnalogAccelerationFeedforwardOff()
  • DriveAnalogAccelerationFeedforwardOn()
  • DriveAnalogCurrentControlConfigureInput()
  • DriveAnalogCurrentControlOff()
  • DriveAnalogCurrentControlOn()
  • DriveAnalogPositionControlConfigureInput()
  • DriveAnalogPositionControlConfigureSpeedClamp()
  • DriveAnalogPositionControlOff()
  • DriveAnalogPositionControlOn()
  • DriveAnalogVelocityControlConfigureInput()
  • DriveAnalogVelocityControlOff()
  • DriveAnalogVelocityControlOn()
  • DriveAnalogVelocityFeedforwardConfigureInput()
  • DriveAnalogVelocityFeedforwardOff()
  • DriveAnalogVelocityFeedforwardOn()
  • DriveArrayRead()
  • DriveArrayReadFast()
  • DriveArrayWrite()
  • DriveBrakeOff()
  • DriveBrakeOn()
  • DriveDataCaptureConfigureArray()
  • DriveDataCaptureConfigureInput()
  • DriveDataCaptureConfigureTrigger()
  • DriveDataCaptureOff()
  • DriveDataCaptureOn()
  • DriveDataCaptureReset()
  • DriveEncoderOutputConfigureDivider()
  • DriveEncoderOutputConfigureInput()
  • DriveEncoderOutputOff()
  • DriveEncoderOutputOn()
  • DriveGetItem()
  • DrivePulseStreamConfigure()
  • DrivePulseStreamOff()
  • DrivePulseStreamOn()
  • DriveSetAuxiliaryFeedback()
  • DriveSetPositionFeedback()
  • Dwell() (only during Velocity Blending)
  • Enable()
  • FaultAcknowledge()
  • FaultThrow()
  • FileBinaryReadFloat32()
  • FileBinaryReadFloat32Array()
  • FileBinaryReadFloat64()
  • FileBinaryReadFloat64Array()
  • FileBinaryReadInt16()
  • FileBinaryReadInt16Array()
  • FileBinaryReadInt32()
  • FileBinaryReadInt32Array()
  • FileBinaryReadInt64()
  • FileBinaryReadInt64Array()
  • FileIniDeleteKey()
  • FileIniDeleteSection()
  • FileIniFindSection()
  • FileIniReadValue()
  • FileIniWriteValue()
  • GalvoConfigureLaser1PulseWidth()
  • GalvoConfigureLaser2PulseWidth()
  • GalvoConfigureLaserDelays()
  • GalvoConfigureLaserMode()
  • GalvoConfigureLaserOutputPeriod()
  • GalvoConfigureStandbyPeriod()
  • GalvoConfigureSuppressionPulseWidth()
  • GalvoEncoderScaleFactorSet()
  • GalvoProjectionOff()
  • GalvoProjectionOn()
  • GalvoProjectionSetCoefficients()
  • GalvoRotationSet()
  • GalvoWobbleOff()
  • GalvoWobbleOn()
  • GalvoWobbleSetConfiguration()
  • Home()
  • HomeAsync()
  • IfovOff()
  • IfovOn()
  • IfovSetAxisPairs()
  • IfovSetSize()
  • IfovSetSyncAxes()
  • IfovSetTime()
  • IfovSetTrackingAcceleration()
  • IfovSetTrackingSpeed()
  • JoystickAxisGroupAdd()
  • JoystickAxisGroupRemoveAll()
  • JoystickRun()
  • MessageLogClear()
  • MessageLogWrite()
  • MoveAbsolute()
  • MoveFreerun()
  • MoveFreerunStop()
  • MoveIncremental()
  • MoveOutOfLimit()
  • MovePt()
  • MovePvt()
  • MoveToLimitCcw()
  • MoveToLimitCw()
  • NormalcySetAxes()
  • NormalcySetTolerance()
  • ParameterSetAxisStringValue()
  • ParameterSetAxisValue()
  • ParameterSetSystemStringValue()
  • ParameterSetSystemValue()
  • ParameterSetTaskStringValue()
  • ParameterSetTaskValue()
  • ProgramExit()
  • ProgramLoad()
  • ProgramPause()
  • ProgramReset()
  • ProgramRestart()
  • ProgramRun()
  • ProgramStart()
  • ProgramStepInto()
  • ProgramStepOut()
  • ProgramStepOver()
  • Three or more consecutive PSO*() functions

  • SafeZoneBoundaryAdd()
  • SafeZoneBoundaryRemove()
  • SafeZoneBoundaryRemoveAll()
  • SafeZoneOff()
  • SafeZoneOn()
  • SafeZoneSetType()
  • SetupCoordinatedAccelLimit()
  • SetupDependentCoordinatedAccelLimit()
  • SignalLogTrigger()
  • SocketClose()
  • SocketGetReadBytesAvailable()
  • SocketGetWriteBytesAvailable()
  • SocketReadFloat32()
  • SocketReadFloat32Array()
  • SocketReadFloat64()
  • SocketReadFloat64Array()
  • SocketReadInt16()
  • SocketReadInt16Array()
  • SocketReadInt32()
  • SocketReadInt32Array()
  • SocketReadInt64()
  • SocketReadInt64Array()
  • SocketReadInt8()
  • SocketReadInt8Array()
  • SocketReadString()
  • SocketReadUInt16()
  • SocketReadUInt16Array()
  • SocketReadUInt32()
  • SocketReadUInt32Array()
  • SocketReadUInt8()
  • SocketReadUInt8Array()
  • SocketTcpClientCreate()
  • SocketTcpClientIsConnected()
  • SocketTcpServerAccept()
  • SocketTcpServerCreate()
  • SocketTcpServerIsClientPending()
  • SocketWriteFloat32()
  • SocketWriteFloat32Array()
  • SocketWriteFloat64()
  • SocketWriteFloat64Array()
  • SocketWriteInt8()
  • SocketWriteInt8Array()
  • SocketWriteInt16()
  • SocketWriteInt16Array()
  • SocketWriteInt32()
  • SocketWriteInt32Array()
  • SocketWriteInt64()
  • SocketWriteInt64Array()
  • SocketWriteString()
  • SocketWriteUInt16()
  • SocketWriteUInt16Array()
  • SocketWriteUInt32()
  • SocketWriteUInt32Array()
  • SocketWriteUInt8()
  • SocketWriteUInt8Array()
  • TaskClearError()
  • TaskClearWarning()
  • TaskControlAllow()
  • TaskControlRestrict()
  • TaskFeedholdOff()
  • TaskFeedholdOn()
  • TaskGetErrorMessage()
  • TaskGetWarningMessage()
  • TaskInterruptMotionOff()
  • TaskInterruptMotionOn()
  • TaskMfo()
  • TaskMso()
  • TaskRetraceClearHistory()
  • TaskRetraceOff()
  • TaskRetraceOn()
  • TaskSetError()
  • TaskSetWarning()
  • ThermoCompConfigureMode()
  • ThermoCompOff()
  • ThermoCompOn()
  • ThermoCompReset()
  • ThermoCompSetValues()
  • ThermoCompUpdateInterval()
  • ThermoCompUpdateOnce()
  • ThermoCompUpdatePause()
  • ThermoCompUpdateResume()
  • TransformationDisable()
  • TransformationEnable()
  • TuningSetFeedforwardGains() (only when you specify gains other than Aff or Vff)
  • TuningSetMotorAngle()
  • TuningSetMotorCurrent()
  • TuningSetServoLoopGains()
  • wait() statement
  • WaitForInPosition()
  • WaitForMotionDone()
  • WorkOffsetConfigureOffset()
  • WorkOffsetDisable()
  • WorkOffsetEnable()
  • WorkOffsetResetConfiguration()

How To Prevent Problems During Lookahead

Lookahead can cause unwanted slowdowns, overcuts, or performance problems if it is configured incorrectly, or if specified conditions occur in your AeroScript program. To prevent these problems, use the suggestions that follow:

  • During a Cutter Radius Compensation or Cutter Offset Compensation sequence, in the program or in an immediate command that you issue on the same task, try to use only the functions that the controller can look through during lookahead. To prevent overcut, do a lead-off move before you issue one or more functions that the controller cannot look through during lookahead.
  • During a Corner Rounding sequence, in the program or in an immediate command that you issue on the same task, use only the functions that the controller can look through during lookahead. This prevents incorrect rounding.
  • If you do not want deceleration to occur during a Velocity Blending sequence, in the program or in an immediate command that you issue on the same task, do not use commands that force a deceleration to zero velocity. And, do not issue an immediate command that contains a function that must have more than one millisecond to complete. For more information, see Conditions that Cause Decelerations During Velocity Blending and Task Scheduling.
  • Do not use coordinated speeds that are higher than necessary or that the axis cannot achieve. Use the SetupCoordinatedSpeed() function to set your coordinated speed to a satisfactory speed. A coordinated speed that is too high causes the controller to precalculate more moves, which can decrease performance and use more computation time. It can also cause the MaxLookaheadMoves Parameter to limit the controller and cause one or more unwanted decelerations to zero velocity.
  • Do not use ramp rates that are lower than necessary. A ramp rate that is too low causes the controller to precalculate more moves, which can decrease performance and use more computation time. It can also cause the MaxLookaheadMoves Parameter to limit the controller and cause one or more unwanted decelerations to zero velocity.
  • If the moves in your AeroScript program are in a Corner Rounding, Cutter Offset Compensation, Cutter Radius Compensation, or Velocity Blending sequence, make sure that you do not put too many non-motion program lines between these moves. As an alternative, do large sections of non-motion actions out of lookahead sequences by issuing the G40, G149, CornerRoundingOff(), or VelocityBlendingOff() functions before the section of non-motion actions. If you cannot stop lookahead, move the non-motion section into a subroutine and use the sync() statement to call the subroutine. Too many non-motion lines between moves in a lookahead sequence can decrease performance and use more computation time. It can also cause the MaxLookaheadMoves Parameter to limit the controller, which causes unwanted slowdowns.
  • If you use a sync() statement to synchronize a function call with motion, make sure that you are using the correct syntax. For more information, see Syntax for Calling a Function Synchronously.
  • Obey the steps in Optimizing Performance in Velocity Blending.