flex_load_rpsps

NI-Motion Functions

flex_load_rpsps

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 Accel/Decel in RPS/sec

Usage

status = flex_load_rpsps(u8 boardID, u8 axisOrVectorSpace, u16 accelerationType, f64 RPSPS, u8 inputVector);

Purpose

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

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
RPSPS f64 acceleration value in revolutions/s/s
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

RPSPS is the double precision floating point acceleration and/or deceleration value in motor revolutions/s/s (RPS/s). The range for acceleration in RPS/s depends upon the motor counts or steps per revolution and the trajectory update rate.

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 in revolutions/s2. When executed on a vector space, the value controls the vector acceleration (deceleration) along the vector move path. This function requires previously loaded values of either counts per revolution (for servo axes) or steps per revolution (for stepper axes) to operate correctly.

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.

Tip  Use Load Move Constraints instead of this function for more move options.

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:

  • RPS/s values stored in onboard variables are in double-precision IEEE format (f64). Refer to Using Inputs and Return Vectors with Onboard Variables for information about the number of variables required to hold an RPS/s value.
  • NI-Motion firmware uses a 16.16 fixed-point format internally to represent velocity in counts/sample period or steps/sample period and acceleration/deceleration in counts/sample period2 or steps/sample period2. If you change counts or steps per revolution or change the update rate using Enable Axis, you must reload the velocity and acceleration/deceleration.
  • You also can load acceleration and deceleration in counts/s2 or steps/s2 by calling the Load Acceleration/Deceleration function.
  • 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, RPSPS.
  • Acceleration and deceleration values in RPS/s are converted to an internal 16.16 fixed-point format in units of counts/sample2 or steps/sample2 before being used by the trajectory generator. You can calculate the minimum acceleration increment in RPS/s with the following formula:

    RPS/s = Amin × ()2 ×

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

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

    × = 0.122070 RPS/s

  • You can calculate the maximum RPS/s using the following equation:

    maximum RPS/s = Amax × ()2 × ()

    where:
    Amax is 32 counts/sample
    Ts is the sample period in seconds per sample, and
    R is the counts or steps per revolution,

    and is constrained according to the following equations:

    acceleration 256 × deceleration
    deceleration 65536 × acceleration

  • Use Load Velocity and Load Acceleration/Deceleration for faster performance.

NI SoftMotion Controller Considerations

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

  • The minimum acceleration/deceleration value is not limited by the fixed 16.16 calculation. This function takes the acceleration/deceleration value as an f64.
  • For the inputVector parameter, the NI SoftMotion Controller supports only the immediate return vector (0XFF).