flex_load_acceleration

NI-Motion Functions

flex_load_acceleration

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

Load Acceleration/Deceleration

Usage

status = flex_load_acceleration(u8 boardID, u8 axisOrVectorSpace, u16 accelerationType, u32 acceleration, u8 inputVector);

Purpose

Loads the maximum acceleration and/or deceleration value for an axis or vector space.

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 to control
accelerationType u16 selector for acceleration, deceleration, or both
acceleration u32 acceleration value in counts/s2 or steps/s2
inputVector u8 source of the data for this function

Parameter Discussion

axisOrVectorSpace is the axis or vector space to control. Valid values are NIMC_AXIS1 through NIMC_AXIS30 or NIMC_VECTOR_SPACE1 through NIMC_VECTOR_SPACE15. 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.

accelerationType is the selector for loading acceleration, deceleration or both acceleration and deceleration (default).

accelerationType Constant accelerationType Value
NIMC_BOTH 0 (default)
NIMC_ACCELERATION 1
NIMC_DECELERATION 2

acceleration is the acceleration (and/or deceleration) value in counts/s2 (servo axes) or steps/s2 (stepper axes).

inputVector indicates the source of the data for this function. Available input vectors include immediate (0xFF), variable (0x01 through 0x78), or indirect variable (0x81 through 0xF8). Refer to Input and Return Vectors for more detailed information.

Using This Function

This function specifies the maximum rate of acceleration and/or deceleration for individual axes or vector spaces. When executed on a vector space, the value controls the vector acceleration (deceleration) along the vector move path.

You can use this function to load separate limits for acceleration and deceleration or to set them both to the same value with one call. These parameters are double-buffered so you can load them on the fly without affecting the move in process, and they take effect on the next Start Motion or Blend Motion call. After they are loaded, these parameters remain in effect for all subsequent motion profiles until re-loaded by this function. You do not need to load acceleration before each move unless you want to change the acceleration and/or deceleration value.

Acceleration defines how quickly the axis or axes come up to speed and is typically limited to avoid excessive stress on the motor, mechanical system, and/or load. A separate, slower deceleration is useful in applications where coming to a gentle stop is important.

Note  Use Load Move Constraints to load the acceleration in less than 1 count/s2.

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:

  • Acceleration and deceleration values are converted to an internal 16.16 fixed-point format in units of counts/s2 before being used by the trajectory generator. You can calculate the minimum acceleration increment with the following formula:

    minimum acceleration/deceleration = Amin × ()2

    where: Amin is 1/65,536 counts/sample2 or steps/sample2 and Ts is the sample period in seconds per sample.

  • For a typical servo axis with 2,000 counts per revolution operating at the 250 ms update rate, calculate the minimum acceleration/deceleration increment using the following equation:

    × = 0.122070 counts/s

  • You can calculate the maximum acceleration/deceleration using the following equation:

    maximum acceleration/deceleration = Amax × ()2

    where: Amax is 32 counts/sample and Ts is the sample period in seconds per sample, and is constrained according to the following equations:

    acceleration 256 × deceleration
    deceleration 65536 × acceleration

  • If you are doing onboard programming and are using inputVector to get the data this function needs, notice that this function reads the variables starting at the memory address pointed to by inputVector in the following order: accelerationType, acceleration.

NI SoftMotion Controller Considerations

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

  • Use Load Counts/Steps per Revolution to set countsOrSteps value to 1. Otherwise, NI-Motion returns an error.
  • The range of acceleration/deceleration values is not limited by the fixed 16.16 calculation, and the NI SoftMotion Controller maintains full 64-bit precision.
  • For the inputVector parameter, the NI SoftMotion Controller supports only the immediate return vector (0XFF).