Motion Setup Functions

Before you command motion to the controller, you must first use the motion setup functions to configure your task and axis motion settings. Default motion settings are stored in controller parameters by Machine Setup.

Task Programming Modes

Absolute and Incremental Move Targets

When you issue a MoveCcw(), MoveCw(), MoveLinear(), MoveRapid(), MovePt(), or MovePvt() motion function, the controller uses either incremental target mode or absolute target mode to determine the target position for the move:

  • In incremental target mode, move targets are distances relative to the current axis location.
  • In absolute target mode, move targets are positions relative to the zero location established by homing or the PositionOffsetSet() function.

You can change the target mode with the function that follows:

function SetupTaskTargetMode($targetMode as TargetMode)

Sets the target mode of the current task.

Arguments

$targetMode  The target mode to set.

IMPORTANT: The SetupTaskTargetMode() function does not apply to asynchronous motion, which includes the MoveAbsolute() and MoveIncremental() functions.

You can change the target mode at any time during program execution. The setting is modal and remains until you change the mode again. Use the DefaultTaskTargetMode Parameter to configure the target mode for a task after a controller reset.

Distance, Velocity, and Acceleration Units

Distance Units

After each controller reset, the controller interprets the position, velocity, or acceleration that you specify in your AeroScript program using the primary units configured for each axis.

  • Primary units are the positional units configured for each axis in Machine Setup. Common primary units are millimeters, micrometers, or degrees. The name of the unit for each axis is stored in the UnitsName Parameter.
  • Secondary units are an optional set of units that let you command motion using a positional units system that is different from your primary units. Secondary units are configured in Machine Setup with the SecondaryUnitsScaleFactor Parameter and the SecondaryUnitsName Parameter. Secondary units apply only to dominant axes. They do not apply to dependent axes.

You can use the function that follows to set the units to either primary or secondary on a given task.

function SetupTaskDistanceUnits($distanceUnits as DistanceUnits)

Sets the distance units of the current task.

Arguments

$distanceUnits  The distance units to set.

Velocity and Acceleration Units

Speeds and velocities that you specify in an AeroScript program are in primary units per time base or secondary units per time base, where the time base is either seconds or minutes. Use the function that follows to specify the time base that the task uses when you specify a speed or velocity.

function SetupTaskTimeUnits($timeUnits as TimeUnits)

Sets the time units of the current task.

Arguments

$timeUnits  The time units to set.

Accelerations that you specify in an AeroScript program are in primary units per second per second or secondary units per second per second. Accelerations are unaffected by the seconds or minutes mode of the task.

The DefaultTaskTimeUnits Parameter configures the time unit mode used by the task after a controller reset.

Velocity and Speed Scaling

For dependent axes or for a dependent feedrate (E), the DependentSpeedScaleFactor Parameter lets you scale the commanded velocity so that it has different units than primary units per time base. Different velocity units can help when you have rotational axes because axis velocities must be programmed in revolutions per minute (RPM), but units of the axis are in degrees. Refer to Axes Category for more information.

The AxisType Parameter determines if an axis is dominant or dependent.

Wait Modes

You can specify how the controller waits for MoveRapid(), MoveLinear(), MoveCw(), and MoveCcw() moves to complete by specifying a wait mode on the task.

function SetupTaskWaitMode($waitMode as WaitMode)

Sets the wait mode of the current task.

Arguments

$waitMode  The wait mode to set.

  • The In Position wait mode configures the controller to wait for "in position" before continuing to the next program line. In this mode, a move command is not complete until all axes are at their target positions. The InPositionDistance Parameter specifies the position error threshold below which an axis is considered in position.
  • The Move Done wait mode configures the controller to ignore the in position parameters. It waits for the final velocity command sent to the axis to be zero before it continues to the next program line.
  • The Auto wait mode configures the controller to wait the minimum quantity of time between moves. This decreases the cycle time of a program.

Wait modes apply to the end of a velocity profiled sequence and not to commands within the sequence. Refer to Velocity Blending Functions for more information.

The DefaultTaskWaitMode Parameter configures the wait mode used by the task after a controller reset.

Asynchronous motion functions such as MoveAbsolute(), MoveIncremental(), and MoveFreerun() do not cause the program to wait. To explicitly wait for an asynchronous motion function use the WaitForMotionDone() or WaitForInPosition() functions.

Axis Speeds

For moves that control each axis individually, you must specify a speed for each axis.

For asynchronous moves such as MoveIncremental(), MoveAbsolute(), and MoveFreerun(), you must specify the speed as an argument to the function for each move. Refer to Motion Functions for more information.

For MoveRapid() moves, use the function that follows to set the speed of the axis. This function applies only to MoveRapid(). The speed that you set will be active on all tasks, not just the current task.

function SetupAxisSpeed($axis as axis, $speed as real)

Sets the speed of an axis for MoveRapid() motion.

Arguments

$axis  The axis on which to set the speed.

$speed  The speed to set.

The DefaultAxisSpeed Parameter configures the axis speed used by MoveRapid() after a controller reset.

You can also set the axis speed for rapid motion with the <Axis>F<Speed> syntax with no spaces. This is common in G-code motion programs that command G0 (Rapid).

Coordinated Speeds

Coordinated moves such as MoveLinear(), MoveCw(), and MoveCcw() use one feedrate that specifies coordinated speed, which is the combined vector speed. This feedrate is the speed of the path through space, not any one axis speed. The function that follows sets the coordinated speed on the current task.

function SetupCoordinatedSpeed($speed as real)

Sets the coordinated speed for dominant axes on the current task.

Arguments

$speed  The speed to set.

The DefaultCoordinatedSpeed Parameter configures the coordinated speed used by the task after a controller reset.

The SetupCoordinatedSpeed() function specifies the coordinated speed of all dominant axes in a move. If your move includes dependent axes, you must also specify the dependent coordinated speed with the SetupDependentCoordinatedSpeed() function.

function SetupDependentCoordinatedSpeed($speed as real)

Sets the coordinated speed for dependent axes on the current task.

Arguments

$speed  The speed to set.

Use the DefaultDependentCoordinatedSpeed Parameter to configure the dependent coordinated speed used by the task after a controller reset.

For coordinated moves that combine dominant and dependent axis motion, the controller uses the feedrate from the dominance mode. Refer to the Axes Category topic.

You can also set the dominant coordinated speed with the F command and the dependent coordinated speed with the E command. This method of specifying speeds is not required but is frequently used in G-code motion programs that command G1 (Linear), G2 (Cw), or G3 (Ccw).

Axis and Coordinated Ramping

The controller uses acceleration and deceleration ramping to gradually change speeds. Refer to Acceleration and Deceleration Ramping for detailed information about different ramp types, modes, and considerations. Ramping applies to all motion except gearing motion and camming motion. If you change the value of one or more of these parameters during motion, the changes do not have an effect until the next move starts.

Axis Ramping Type

Each axis-based MoveAbsolute(), MoveIncremental(), MoveFreerun(), or MoveRapid() move uses either a linear, sinusoidal, or s-curve ramp profile. Use the functions that follow from your AeroScript program to set these modes.

function SetupAxisRampType($axis as axis, $rampType as RampType)

Sets a ramp type for both accelerations and decelerations simultaneously for an axis.

Arguments

$axis  The axis on which to set the ramp type.

$rampType  The ramping type to set.

function SetupAxisRampType($axes[] as axis, $rampType as RampType)

Sets a ramp type for both accelerations and decelerations simultaneously for an axis.

Arguments

$axes  The axes on which to set the ramp type.

$rampType  The ramping type to set.

function SetupAxisRampType($axis as axis, $rampType as RampType, $rampTypeArg as real)

Sets a ramp type along with a ramp type value for both accelerations and decelerations simultaneously for an axis.

Arguments

$axis  The axis on which to set the ramp type.

$rampType  The ramping type to set.

$rampTypeArg  The ramping type additional argument. This is only used when $rampType is RampType.SCurve and represents the s-curve percentage.

function SetupAxisRampType($axes[] as axis, $rampType as RampType, $rampTypeArg as real)

Sets a ramp type along with a ramp type value for both accelerations and decelerations simultaneously for axes.

Arguments

$axes  The axes on which to set the ramp type.

$rampType  The ramping type to set.

$rampTypeArg  The ramping type additional argument. This is only used when $rampType is RampType.SCurve and represents the s-curve percentage.

function SetupAxisRampType($axis as axis, $rampTypeAccel as RampType, $rampTypeArgAccel as real, $rampTypeDecel as RampType, $rampTypeArgDecel as real)

Sets a ramp type along with a ramp type value for accelerations and decelerations separately for an axis.

Arguments

$axis  The axis on which to set the ramp type.

$rampTypeAccel  The ramping type to set during accelerations.

$rampTypeArgAccel  The ramping type additional argument for accelerations. This is only used when $rampTypeAccel is RampType.SCurve and represents the s-curve percentage.

$rampTypeDecel  The ramping type to set during decelerations.

$rampTypeArgDecel  The ramping type additional argument for decelerations. This is only used when $rampTypeDecel is RampType.SCurve and represents the s-curve percentage.

function SetupAxisRampType($axes[] as axis, $rampTypeAccel as RampType, $rampTypeArgAccel as real, $rampTypeDecel as RampType, $rampTypeArgDecel as real)

Sets a ramp type along with a ramp type value for accelerations and decelerations separately for axes.

Arguments

$axes  The axes on which to set the ramp type.

$rampTypeAccel  The ramping type to set during accelerations.

$rampTypeArgAccel  The ramping type additional argument for accelerations. This is only used when $rampTypeAccel is RampType.SCurve and represents the s-curve percentage.

$rampTypeDecel  The ramping type to set during decelerations.

$rampTypeArgDecel  The ramping type additional argument for decelerations. This is only used when $rampTypeDecel is RampType.SCurve and represents the s-curve percentage.

The DefaultAxisRampType Parameter configures the axis ramp type used by the axis after a controller reset.

Axis Ramping Mode, Rate, and Time

Each axis-based MoveAbsolute(), MoveIncremental(), MoveFreerun(), or MoveRapid() move can specify either rate-based ramping or time-based ramping. It is more common to use rate-based ramping.

  • If you specify rate-based ramping, you must specify an acceleration rate in distance units per second per second.
  • If you specify time-based ramping, you must specify an acceleration time in seconds.

Use the functions that follow from your AeroScript program to set the ramping modes and values of coordinated moves on the task.

function SetupAxisRampValue($axis as axis, $rampMode as RampMode, $rampValue as real)

Sets a ramp value for both accelerations and decelerations simultaneously for an axis.

Arguments

$axis  The axis on which to set the ramp value.

$rampMode  The ramping mode to set.

$rampValue  The ramp value to set.

function SetupAxisRampValue($axes[] as axis, $rampMode as RampMode, $rampValue as real)

Sets a ramp value for both accelerations and decelerations simultaneously for axes.

Arguments

$axes  The axes on which to set the ramp value.

$rampMode  The ramping mode to set.

$rampValue  The ramp value to set.

function SetupAxisRampValue($axis as axis, $rampModeAccel as RampMode, $rampValueAccel as real, $rampModeDecel as RampMode, $rampValueDecel as real)

Sets a ramp value for accelerations and decelerations separately for an axis.

Arguments

$axis  The axis on which to set the ramp value.

$rampModeAccel  The ramping mode to set during accelerations.

$rampValueAccel  The ramp value to set during accelerations.

$rampModeDecel  The ramping mode to set during decelerations.

$rampValueDecel  The ramp value to set during decelerations.

function SetupAxisRampValue($axes[] as axis, $rampModeAccel as RampMode, $rampValueAccel as real, $rampModeDecel as RampMode, $rampValueDecel as real)

Sets a ramp value for accelerations and decelerations separately for axes.

Arguments

$axes  The axes on which to set the ramp value.

$rampModeAccel  The ramping mode to set during accelerations.

$rampValueAccel  The ramp value to set during accelerations.

$rampModeDecel  The ramping mode to set during decelerations.

$rampValueDecel  The ramp value to set during decelerations.

The DefaultAxisRampType Parameter configures the axis ramp mode (rate-based or time-based) used by the axis after a controller reset. The DefaultAxisRampRate Parameter and DefaultAxisRampTime Parameter specify the ramp rate or ramp time used by default.

Coordinated Ramping Type

Each coordinated MoveLinear(), MoveCw(), MoveCcw() move uses a linear, sinusoidal, or s-curve ramp profile. Use the functions that follow from your AeroScript program to set these modes.

function SetupCoordinatedRampType($rampType as RampType)

Sets a coordinated ramp type for both accelerations and decelerations simultaneously for dominant axes on the current task.

Arguments

$rampType  The ramping type to set.

function SetupCoordinatedRampType($rampType as RampType, $rampTypeArg as real)

Sets a coordinated ramp type along with a ramp type value for both accelerations and decelerations simultaneously for dominant axes on the current task.

Arguments

$rampType  The ramping type to set.

$rampTypeArg  The ramping type additional argument. This is only used when $rampType is RampType.SCurve and represents the s-curve percentage.

function SetupCoordinatedRampType($rampTypeAccel as RampType, $rampTypeArgAccel as real, $rampTypeDecel as RampType, $rampTypeArgDecel as real)

Sets a coordinated ramp type along with a ramp type value for accelerations and decelerations separately for dominant axes on the current task.

Arguments

$rampTypeAccel  The ramping type to set during accelerations.

$rampTypeArgAccel  The ramping type additional argument for accelerations. This is only used when $rampTypeAccel is RampType.SCurve and represents the s-curve percentage.

$rampTypeDecel  The ramping type to set during decelerations.

$rampTypeArgDecel  The ramping type additional argument for decelerations. This is only used when $rampTypeDecel is RampType.SCurve and represents the s-curve percentage.

The DefaultCoordinatedRampType parameter configures the coordinated ramp type used by the task after a controller reset.

Coordinated Ramping Mode, Rate, and Time

Each coordinated MoveLinear(), MoveCw(), or MoveCcw() move can specify either rate-based ramping or time-based ramping. It is more common to use rate-based ramping.

  • If you specify rate-based ramping, you must specify an acceleration rate in distance units per second per second.
  • If you specify time-based ramping, you must specify an acceleration time in seconds.

You must use rate-based ramping with velocity blending because the controller does all lookahead computations by making sure that acceleration and deceleration rate limits are not violated. See Velocity Blending Functions for more information.

Use the functions that follow from your AeroScript program to set the ramping modes and values of coordinated moves on the task.

function SetupCoordinatedRampValue($rampMode as RampMode, $rampValue as real)

Sets a coordinated ramp value for both accelerations and decelerations simultaneously for dominant axes on the current task.

Arguments

$rampMode  The ramping mode to set.

$rampValue  The ramp value to set.

function SetupCoordinatedRampValue($rampModeAccel as RampMode, $rampValueAccel as real, $rampModeDecel as RampMode, $rampValueDecel as real)

Sets a coordinated ramp value for accelerations and decelerations separately for dominant axes on the current task.

Arguments

$rampModeAccel  The ramping mode to set during accelerations.

$rampValueAccel  The ramp value to set during accelerations.

$rampModeDecel  The ramping mode to set during decelerations.

$rampValueDecel  The ramp value to set during decelerations.

When there are no dominant axes in the move, you must specify a ramp rate that the controller will use. This occurs when dependent axes use rate-based ramping or with inverse-dominance mode (see G98 and G99).

function SetupDependentCoordinatedRampRate($rampValue as real)

Sets a coordinated ramp rate for both accelerations and decelerations simultaneously for dependent axes on the current task.

Arguments

$rampValue  The ramp rate value to set.

function SetupDependentCoordinatedRampRate($rampValueAccel as real, $rampValueDecel as real)

Sets a coordinated ramp rate for accelerations and decelerations separately for dependent axes on the current task.

Arguments

$rampValueAccel  The ramp rate value to set during accelerations.

$rampValueDecel  The ramp rate value to set during decelerations.

The DefaultCoordinatedRampMode Parameter configures the coordinated ramp mode (rate-based or time-based) used by the task after a controller reset.

Coordinated Acceleration Limiting

You can use the MoveLinear(), MoveCw(), and MoveCcw() coordinated move functions in a velocity blending sequence so that the controller does not decelerate to zero between each move. Changes in direction along the vector can cause individual axes to over-accelerate even though the combined vector acceleration is specified correctly. Because of this, you may want the controller to automatically lower the speed to limit the acceleration effects. You can set an acceleration limit for the axes in a coordinated motion sequence with the functions that follow.

function SetupCoordinatedAccelLimit($accelLimitNonTangent as real, $accelLimitCircular as real)

Sets the maximum acceleration of coordinated motion on dominant axes on the current task.

Arguments

$accelLimitNonTangent  The maximum acceleration of axes at non-tangent portions of a motion path.

$accelLimitCircular  The maximum acceleration of axes at curved parts of a motion path.

function SetupDependentCoordinatedAccelLimit($accelLimitDependent as real)

Sets the maximum acceleration of coordinated motion on dependent axes on the current task.

Arguments

$accelLimitDependent  The maximum acceleration of axes at all portions of a motion path.

The DefaultCoordinatedAccelLimit Parameter, DefaultCoordinatedCircularAccelLimit Parameter, and the DefaultDependentCoordinatedAccelLimit Parameter configure the acceleration limits used by the task after a controller reset.

See Velocity Blending Functions for more information about how to configure velocity blending sequences with acceleration limiting.