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 SetupTaskTargetMode() function and the enum TargetMode.

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 MotionDone 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 SetupTaskWaitMode() function and the enum WaitMode.

You can also use the G359 command to set the wait mode to Auto, the G360 command to set the wait mode to MotionDone, 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 and secondary.

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 SetupTaskDistanceUnits() function and the enum DistanceUnits to set the distance units on a given task.

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 G-Code Programming.

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 SetupTaskTimeUnits() function and the enum TimeUnits to set the time units that the task uses when you specify a speed or velocity.

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 SetupAxisSpeed() function 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.

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 SetupCoordinatedSpeed() function sets the coordinated speed on the current task.

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.

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 SetupAxisRampType() function to set the ramp type.

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 SetupCoordinatedRampType() function to set the ramp type.

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().

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().

When there are only dependent axes in a linear move, the controller only uses rate-based ramping.

You can also invert the axis type of an axis with inverse dominance mode. For more information, refer to G-Code Programming 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 SetupCoordinatedAccelLimit() and SetupDependentCoordinatedAccelLimit() functions that follow.

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.