flex_stop_motion

NI-Motion Functions

flex_stop_motion

Device Compatibility

Device Compatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Xenus
Y
NI SoftMotion Controller for CANopen—Accelnet
Y

Stop Motion

Usage

status = flex_stop_motion(u8 boardID, u8 axisOrVectorSpace, u16 stopType, u16 axisOrVSMap);

Purpose

Stops motion on a single axis, single vector space, multiple axes, or multiple vector spaces. Three types of stops can be executed: decelerate to stop, halt stop, and kill stop.

Tip  Refer to the Remarks section for information about how the behavior of this function differs between controllers.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axisOrVectorSpace u8 axis or vector space selector
stopType u16 type of stop to execute
axisOrVSMap u16 bitmap of axes or vector spaces to stop

Parameter Discussion

axisOrVectorSpace can select an axis (NIMC_AXIS1 through NIMC_AXIS30), vector space (NIMC_VECTOR_SPACE1 through NIMC_VECTOR_SPACE15), multiple axes (NIMC_AXIS_CTRL), or multiple vector spaces (NIMC_VECTOR_SPACE_CTRL). When simultaneously stopping multiple axes or vector spaces, the axisOrVSMap parameter indicates which axes or vector spaces are involved. On motion controllers that support fewer than thirty axes, configuring non-existent axes or vector spaces returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes and Vector Spaces for axis and vector space resource IDs.

stopType is the type of stop to execute.

stopType Constant stopType Value Action
NIMC_DECEL_STOP 0 decelerate smoothly to a stop
NIMC_HALT_STOP 1 immediate, full torque/stop
NIMC_KILL_STOP 2 zero the command and activate the inhibit/output

axisOrVSMap is the bitmap of axes or vector spaces to stop. It is only required when multiple axes or vector spaces are selected with the axisOrVectorSpace parameter. NI-Motion ignores additional axes and vector spaces if you select non-existent axes.

When stopping axes (axisOrVectorSpace = NIMC_AXIS_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0

For D1 through D15:
   1 = Stop axis
   0 = Do not stop axis

When stopping vector spaces (axisOrVectorSpace = NIMC_VECTOR_SPACE_CTRL):

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
VS 15 ... VS 10 VS 9 VS 8 VS 7 VS 6 VS 5 VS 4 VS 3 VS 2 VS 1 0

For D1 through D15:
   1 = Stop vector space
   0 = Do not stop vector space

To stop a single axis or vector space, set the axisOrVectorSpace selector to the specified axis or vector space. The axisOrVSMap bitmap is ignored.

To stop multiple axes, the axisOrVectorSpace selector is set to NIMC_AXIS_CTRL and the axisOrVSMap bitmap defines the axes to stop. Similarly, to stop multiple vector spaces, the axisOrVectorSpace selector is set to NIMC_VECTOR_SPACE_CTRL and the axisOrVSMap bitmap defines the vector spaces to stop.

Note  It is not possible to combine the stop of an axis and the stop of a vector space in a single use of this function. To accomplish this, create a single axis vector space and then execute a multi-vector space stop.

Using This Function

This function is used to stop a motion profile on axes or vector spaces, either simultaneously or individually. You can execute three different types of stops with the Stop Motion function: decel stop, halt stop, and kill stop.

Decel Stop

When a decel stop is executed (NIMC_DECEL_STOP), the axis, axes, or vector space(s) immediately begin to follow the deceleration portion of their trajectory profile as controlled by previously loaded deceleration and s-curve parameters. The actual stopped position is therefore dependent upon this deceleration trajectory.

Halt Stop

In contrast, a halt stop (NIMC_HALT_STOP) has the following behavior depending on the state of the axis:

  • If the axis is not moving and not energized, the axis is energized.
  • If the axis is not moving and energized, calling a halt stop has no effect.
  • If the axis is moving:
    • On servo axes, full torque is applied to stop the motor(s) as quickly as possible.
    • On stepper axes, the step pulses are ceased as soon as the command is received by the motion controller. However, it is possible that there may be a small amount of following error after halting the move. This following error will be compensated for with a pull-in move during the next move.
    In both cases, NI-Motion attempts to stop the motor(s) with a near infinite rate of deceleration. There is no trajectory profile and motion is not controlled by previously loaded deceleration and S-curve parameters.
Note  For stepper axes configured for p-command mode, ensure that the axis is not moving before halting an axis that was previously killed to avoid position error between the controller and the drive. In this case, a call to halt stop while the axis is moving resets your reference position to an undefined location, and you should perform a Find Home reference move before executing another move.

Kill Stop

On servo axes, a kill stop (NIMC_KILL_STOP) disables the control loop and zeros the output DAC, allowing frictional forces alone to stop the motion. On stepper axes, a kill stop ceases the stepper pulse generation as soon as the command is received by the motion controller. On both axis types, there is no trajectory profile during a kill stop. If enabled, the inhibit output is activated to inhibit (disable) the servo amplifier or stepper driver. You can enable the inhibit outputs and set their polarity as active high or active low with the Configure Inhibit Outputs function.

Caution  When an axis is killed, the motor is allowed to freewheel, and could possibly move if external forces are acting on it. If the axis moves into an enabled limit switch, the axis is energized and held in position. If you do not want the axis to become energized under any circumstances, you must disable the axis after killing it.

The Stop Motion function may or may not affect the motion of other axes that are not explicitly referenced in the function. If a slave axis is killed, master-slave gearing is automatically disabled.

Example 1

To execute a multi-axis kill stop on axes 1 through 4, call the Stop Motion function with the following parameters:
   axisOrVectorSpace = NIMC_AXIS_CTRL
   stopType = NIMC_KILL_STOP
   axisOrVSMap = 0x1E

The axisOrVSMap value of 0x1E corresponds to the following bitmap:

D15 ... D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0
0 ... 0 0 0 0 0 0 1 1 1 1 0

Example 2

To decelerate stop motion on vector space 1, call the Stop Motion function with the following parameters:
   axisOrVectorSpace = NIMC_VECTOR_SPACE1
   stopType = NIMC_DECEL_STOP
   axisOrVSMap = Don't care

Remarks

This section includes information about how the behavior of this function differs among the controllers that support it.

NI 73xx Controller Considerations

The following list includes considerations you must make when you are using this function with a 73xx motion controller:

  • If an axis that is part of a vector space is individually killed, the other axes in the vector space are decel stopped. If a program attempts to start axes that have been manually stopped by the host computer, it is overruled and put into the paused state.

NI SoftMotion Controller Considerations

The following list includes considerations you must make when you are using this function with the NI SoftMotion Controller:

  • If an axis that is part of a vector space is individually killed, the other axes in the vector space are also killed.
  • You can execute this function only on an axis that is enabled.
  • You cannot execute this function on multiple axes using the NIMC_AXIS_EX_CTRL resource parameter with axes sixteen through thirty.