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:

  • Velocity Blending
  • Cutter Radius Compensation
  • Corner Rounding

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: If you want to synchronize a function that is not in one of the lists that follow, synchronize it with motion by using the sync() statement.

AeroScript Functions That Are Always Synchronized with Motion

Motion-Related Functions

  • Dwell()
  • MoveDelay()
  • SetupAxisRampType()
  • SetupAxisRampValue()
  • SetupAxisSpeed()
  • SetupCoordinatedRampType()
  • SetupCoordinatedRampValue()
  • SetupCoordinatedSpeed()
  • SetupDependentCoordinatedRampRate()
  • sync() statement

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()
  • PsoWaveformApplyPulseConfiguration()
  • PsoWaveformApplyPwmConfiguration()
  • PsoWaveformConfigureDelay()
  • PsoWaveformConfigureMode()
  • PsoWaveformConfigurePulseArrayCounts()
  • PsoWaveformConfigurePulseArrayOnTimes()
  • PsoWaveformConfigurePulseArrayTotalTimes()
  • PsoWaveformConfigurePulseFixedCount()
  • PsoWaveformConfigurePulseFixedOnTime()
  • PsoWaveformConfigurePulseFixedTotalTime()
  • PsoWaveformConfigurePulseMask()
  • PsoWaveformConfigurePulseTruncation()
  • PsoWaveformConfigurePwmOnTimes()
  • PsoWaveformConfigurePwmTotalTime()
  • PsoWaveformExternalSyncOff()
  • PsoWaveformExternalSyncOn()
  • PsoWaveformOff()
  • PsoWaveformOn()
  • 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 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 Radius 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()
  • AppMessage*() functions
  • AppDataCollection*() functions
  • Callback()
  • CammingOn()
  • CammingFreeTable()
  • CornerRoundingOff() (only during Velocity Blending)
  • CornerRoundingSetAxes()
  • CornerRoundingSetTolerance()
  • CTransformationDisable()
  • CTransformationEnable()
  • DataCollection*() functions
  • Directory*() functions
  • Disable()
  • DriveArrayRead()
  • DriveArrayReadFast()
  • DriveArrayWrite()
  • DriveBrakeOff()
  • DriveBrakeOn()
  • DriveDataCaptureConfigureArray()
  • DriveDataCaptureConfigureInput()
  • DriveDataCaptureConfigureTrigger()
  • DriveDataCaptureOff()
  • DriveDataCaptureOn()
  • DriveGetItem()
  • DrivePulseStreamConfigure()
  • DrivePulseStreamOff()
  • DrivePulseStreamOn()
  • DriveSetAuxiliaryFeedback()
  • DriveSetPositionFeedback()
  • Dwell() (only during Velocity Blending)
  • Enable()
  • FaultAcknowledge()
  • FaultThrow()
  • File*() functions
  • GalvoConfigureLaserDelays()
  • GalvoConfigureLaserMode()
  • GalvoConfigureLaser1PulseWidth()
  • GalvoConfigureLaser2PulseWidth()
  • GalvoConfigureLaserOutputPeriod()
  • GalvoConfigureStandbyPeriod()
  • GalvoConfigureSuppressionPulseWidth()
  • GalvoEncoderScaleFactorSet()
  • GalvoProjectionOff()
  • GalvoProjectionOn()
  • GalvoProjectionSetCoefficients()
  • GalvoRotationSet()
  • GalvoWobbleOff()
  • GalvoWobbleOn()
  • GalvoWobbleSetConfiguration()
  • Home()
  • HomeAsync()
  • IfovOff()
  • IfovOn()
  • IfovSetAxisPairs()
  • IfovSetSize()
  • IfovSetSyncAxes()
  • IfovSetTime()
  • IfovSetTrackingAcceleration()
  • IfovSetTrackingSpeed()
  • JoystickAxisGroupAdd()
  • JoystickAxisGroupRemoveAll()
  • JoystickRun()
  • MoveAbsolute()
  • MoveFreerun()
  • MoveFreerunStop()
  • MoveIncremental()
  • MoveOutOfLimit()
  • MovePt()
  • MovePvt()
  • MoveToLimitCcw()
  • MoveToLimitCw()
  • NormalcySetAxes()
  • NormalcySetTolerance()
  • ParameterSetAxisStringValue()
  • ParameterSetAxisValue()
  • ParameterSetSystemStringValue()
  • ParameterSetSystemValue()
  • ParameterSetTaskStringValue()
  • ParameterSetTaskValue()
  • Program*() functions
  • ProgramExit()
  • SafeZoneBoundaryAdd()
  • SafeZoneBoundaryRemove()
  • SafeZoneBoundaryRemoveAll()
  • SafeZoneOff()
  • SafeZoneOn()
  • SafeZoneSetType()
  • SetupCoordinatedAccelLimit()
  • SetupDependentCoordinatedAccelLimit()
  • SignalLogTrigger()
  • TaskFeedholdOff()
  • TaskFeedholdOn()
  • TaskInterruptMotionOff()
  • TaskInterruptMotionOn()
  • TaskMfo()
  • TaskMso()
  • TaskRetraceClearHistory()
  • TaskRetraceOff()
  • TaskRetraceOn()
  • TaskSetError()
  • TaskSetWarning()
  • ThermoCompConfigureMode()
  • ThermoCompOff()
  • ThermoCompOn()
  • ThermoCompReset()
  • ThermoCompSetValues()
  • ThermoCompUpdateInterval()
  • ThermoCompUpdateOnce()
  • ThermoCompUpdatePause()
  • ThermoCompUpdateResume()
  • TransformationDisable()
  • TransformationEnable()
  • TuningSetFeedforwardGains()
  • TuningSetMotorAngle()
  • TuningSetMotorCurrent()
  • TuningSetServoLoopGains()
  • WaitForInPosition()
  • WaitForMotionDone()
  • wait() statement

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 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 Cutter Radius Compensation, Corner Rounding, 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, 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.
  • Obey the steps in Optimizing Performance in Velocity Blending.