flex_load_rpm

NI-Motion Functions

flex_load_rpm

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 Velocity in RPM

Usage

status = flex_load_rpm(u8 boardID, u8 axisOrVectorSpace, f64 RPM, u8 inputVector);

Purpose

Loads velocity for an axis or vector space in RPM.

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
RPM f64 velocity in RPM
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.

RPM is the double precision floating point velocity value in RPM. The RPM range 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 trajectory velocity for individual axes or vector spaces. When executed on a vector space, the value controls the vector velocity along the vector move path. For velocity control applications, the sign of the loaded velocity specifies the move direction. This function requires previously loaded values of either counts per revolution (for servo axes) or steps per revolution (for stepper axes) to operate correctly.

RPM is double-buffered so you can load it on the fly without affecting the move in process, and it takes effect on the next Start Motion or Blend Motion call. After it is loaded, this parameter remains in effect for all subsequent motion profiles until re-loaded by this function. You do not need to load velocity before each move unless you want to change the velocity.

Note  The velocity loaded with this function is the maximum move velocity. Actual velocity attainable is determined by many factors including PID tuning, length of move, acceleration and deceleration values, and physical constraints of the amplifier/motor/mechanical system.

You also can load velocity in counts/s or steps/s by calling the Load Velocity function.
Tip  Use Load Move Constraints instead of this function for more move options.
Note  Refer to Function Execution Times for benchmark timing information about your controller.

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:

  • For 73xx motion controllers, RPM 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 RPM value.

    Note  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.
  • Velocity values in RPM are converted to an internal 16.16 fixed-point format in units of counts (steps) per sample period (update period) before being used by the trajectory generator. NI-Motion can control velocity to 1/65,536 of a count or step per sample. You can calculate this minimum velocity increment in RPM with the following formula:

    minimum RPM = Vmin × () × 60 × ()

    where:
    Vmin is 1/65,536 count/sample or step/sample,
    Ts is the sample period in seconds per sample,
    60 is the number of seconds in a minute, and
    R is the counts/steps per revolution. For a typical servo axis with 2,000 counts per revolution operating at the 250 µs update rate, the minimum RPM increment is:

    × 4,000 × = 0.00183105 RPM

    You can calculate the maximum velocity in RPM with the following equation:

    maximum RPM = Vmax × 60 ×

    where:
    Vmax is 20 MHz for servos,
    8 MHz for steppers on a 7350 controller,
    4 MHz for steppers on a 7330/40/90 controller, and
    R is the counts/steps per revolution,

    and is constrained by acceleration/deceleration according to the following equation:

    velocity (65536 × deceleration) – acceleration

    where velocity is in counts/sample and acceleration and deceleration are in counts/sample2.

    From the example, the maximum RPM is:

    (20 × 106) × = 600,000 RPM

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

  • Use Load Move Constraints to load the velocity in user units/second.
  • The NI SoftMotion Controller does not convert velocity values in RPM to a 16.16 fixed point number. All calculations performed by the NI SoftMotion Controller maintain f64 precision.
  • For the inputVector parameter, the NI SoftMotion Controller supports only the immediate return vector (0XFF).