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 Targeting Modes

When you issue a MoveRapid(), MoveLinear(), MoveCw(), MoveCcw(), MovePvt(), MovePt() 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 set the target mode with the function and TargetMode enum 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 the MoveAbsolute(), MoveIncremental(), and MoveFreerun() functions.

You can also use the G90 command to set the target mode to Absolute or the G91 command to set the target mode as Incremental.

The DefaultTaskTargetMode Parameter configures the target mode used by the task after a controller reset.

Task Waiting 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.

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

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. For more information, refer to Wait for Motion on the Motion Functions page.

  • The MoveDone wait mode configures the controller to wait for all axes to have a velocity command of zero before it continues to the next program line. This mode ignores the in-position parameters used for the InPosition wait mode.
  • The InPosition wait mode configures the controller to wait for all axes to have a velocity command of zero and to be "in position" before it continues to the next program line.
    • The InPositionDistance Parameter specifies the position error threshold below which an axis is considered to be "in position". The InPositionTime Parameter specifies the quantity of time the axis must be within the given threshold before the "in position" condition is true.
  • The Auto wait mode configures the controller to wait the minimum quantity of time between moves. This decreases the cycle time of a program.

You can set the wait mode with the function and enum that follow.

function SetupTaskWaitMode($waitMode as WaitMode)

Sets the wait mode of the current task.

Arguments

$waitMode  The wait mode to set.

You can also use the G359 command to set the wait mode to Auto, the G360 command to set the wait mode to MoveDone, or the G361 command to set the wait mode to InPosition.

The DefaultTaskWaitMode Parameter configures the wait mode that the task uses after a controller reset.

Position, Velocity, and Acceleration 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. The result is the units that follow for position, velocity, and acceleration.

Position:

Velocity:

Acceleration:

Distance Units

The controller lets you specify two different distance units.

Primary units are the positional units configured for each axis in Machine Setup. When in this mode, the controller uses the CountsPerUnit Parameter to define the number of encoder counts for each distance unit. 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 lets you command motion with 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. When in this mode, the controller uses the CountsPerUnit Parameter divided by the SecondaryUnitsScaleFactor Parameter to define the number of encoder counts for each distance unit.

IMPORTANT: Secondary units apply only to dominant axes. They do not apply to dependent axes.

The distance units that you specify have an effect on the units for position, velocity, and acceleration. For dominant axes, the unit are as follows.

Position:

Velocity:

Acceleration:

Use the function and enum that follow to set the distance units on a given task.

function SetupTaskDistanceUnits($distanceUnits as DistanceUnits)

Sets the distance units of the current task.

Arguments

$distanceUnits  The distance units to set.

You can also set the distance units mode of the task using either the G70 or G71 commands. The mode that these commands set the task to depend on the PrimaryUnitsMapping Parameter. For more information, refer to Distance Units Configuration.

There is not a parameter that configures the distance unit mode used by the task after a controller reset.

Time Units

The controller lets you specify two different time units, which are either seconds or minutes. The time units affect the units for velocity only, not acceleration. The time units for acceleration are always in seconds. For dominant or dependent axes, the units are as follows.

Position:

Velocity:

Acceleration:

You can use the function and enum that follow to set the time units 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.

You can also set the time units mode of the task with either the G75 or G76 commands. The DefaultTaskTimeUnits Parameter configures the time unit mode used by the task after a controller reset. For more information refer to Time Units Configuration.

Axis and Coordinated Speeds

The sections that follow include information for how to specify speeds for independent axis motion and coordinated motion.

Independent Axis Motion

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

For asynchronous moves such as MoveAbsolute(), MoveIncremental(), 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 is 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 set the speeds for individual axes during rapid motion with the <Axis>F<Speed> syntax with no spaces. This method is not required but is often used in G-code motion programs that command G0 (Rapid).

Coordinated Motion

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 only 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 coordinated speed used by the task after a controller reset.

You can set the dominant coordinated speed with the F code G-code command and the dependent coordinated speed with the E code G-code 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).

Velocity Scaling

For dependent axes or dependent feedrates (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.

By default, the controller interprets dominant coordinated speeds as distance units per time units. You can set this mode with the G94 command. To configure the task to work in a mode where the controller interprets all dominant coordinated speeds as the duration that is necessary to do a coordinated move, use the G93 command. To configure the task to scale dominant and dependent coordinated speeds at a speed proportional to the absolute value of the programmed spindle speed, use the G95 command.

IMPORTANT: You can use MFO to scale all programmed feedrates in a specified task.

Axis and Coordinated Ramping

The controller uses acceleration and deceleration ramping to gradually change speeds. Refer to Acceleration and Deceleration Ramping for information about different ramp types, modes, and related functions and parameters. 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.

Ramp Type

Each independent axis and coordinated move uses a linear, sinusoidal, or s-curve ramp profile. To set the ramp type, use the RampType enum with the SetupAxisRampType() function for independent axis moves or with the SetupCoordinatedRampType() function for coordinated moves.

Set Ramp Type for Independent Axis Moves

The MoveAbsolute(), MoveIncremental(), MoveFreerun(), and MoveRapid() independent axis moves use the functions that follow to set the ramp type.

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.

Set Ramp Type for Coordinated Moves

The MoveLinear(), MoveCw(), MoveCcw() coordinated moves use the functions that follow to set the ramp type.

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.

Ramp Mode

Each independent axis and coordinated move uses either rate-based or time-based ramping. It is more common to use rate-based ramping.

To set the units of ramp types, take note of the information that follows: 

  • 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.

IMPORTANT: You must use rate-based ramping with velocity blending. This is because the controller must make sure that acceleration and deceleration rate limits are not violated when it does calculations for lookahead. For more information, see Coordinated Acceleration Limiting.

To set the ramp mode, use the RampMode enum with the SetupAxisRampValue() function for independent axis moves or with the SetupCoordinatedRampValue() function for coordinated moves.

Set Ramp Mode for Independent Axis Moves

Use the SetupAxisRampValue() function to set the ramp mode for the independent axis moves, MoveAbsolute(), MoveIncremental(), and MoveFreerun().

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 a time-based) that the axis uses after a controller reset. The DefaultAxisRampRate Parameter and DefaultAxisRampTime Parameter specify the ramp rate or ramp time used by the default.

Set the Ramp Mode for Coordinated Axis Moves

Use the SetupCoordinatedRampValue() function to set the ramp mode for dominant axes for the coordinated moves, MoveLinear(), MoveCw(), or MoveCcw().

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 only dependent axes in a linear move, the controller only uses rate-based ramping.

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.

You can also invert the axis type of an axis with inverse dominance mode. For more information, refer to Inverse Dominance Mode on the G-Code Programming page.

The DefaultCoordinatedRampMode Parameter configures the coordinated ramp mode (rate-based or time-based) used by the task after a controller reset. The DefaultCoordinatedRampRate Parameter specifies the default ramp rate used by dominant axes, and the DefaultCoordinatedRampTime Parameter specifies the default ramp time used by both dominant and dependent axes.

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.