flex_load_scurve_time |
Load S-Curve Time
Usage
status = flex_load_scurve_time(u8 boardID, u8 axisOrVectorSpace, u16 sCurveTime, u8 inputVector);
Purpose
Loads the s-curve time 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 |
sCurveTime | u16 | smoothing time in update sample periods |
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.
sCurveTime is the time in update sample periods over which the acceleration profile is smoothed as it transitions from zero to the programmed value and back to zero. The s-curve range is from 1 to 32,767 with a default of 1 sample period.
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 smooths the acceleration and deceleration portions of a motion profile, resulting in less abrupt transitions from Start Motion to acceleration, acceleration to constant velocity, constant velocity to deceleration, and deceleration to stop. Using s-curve acceleration limits the jerk in a motion control system.
Officially, jerk is defined as the derivative of acceleration (change of acceleration per unit time) and is measured in units of counts (steps)/s3. This function, however, allows you to load s-curve time in update sample periods rather than have to deal with the obscure units of jerk.
With the default s-curve time of one (1) sample period, there is virtually no effect on the motion profile, and the standard trapezoidal trajectory is executed. As s-curve time increases, the smoothing affect on the acceleration and deceleration portions of the motion profile increase, as shown in the following figure. Large values of s-curve time can override the programmed values of acceleration and deceleration by sufficiently smoothing the profile such that the acceleration and deceleration slopes are never reached.
![]() |
Note A large s-curve values makes the time to accelerate to the commanded velocity longer. Therefore, the time it takes to reach the target position is also longer. If the s-curve value is too large, the value is ignored and full acceleration is used. This happens when the acceleration and deceleration become too long to perform smoothly. |
You can load s-curve time to individual axes or to a vector space for smoothing all axes in the vector space. When sent to a vector space, the s-curve time is broadcast to all axes in the vector space to change the per-axis s-curve times. If you later want to operate an axis independently with a different s-curve time, you must execute this function again for that axis.
![]() |
Note All axes in a vector space must have the same s-curve time for best vector accuracy. |
Remarks
This section includes information about how the behavior of this function differs among the controllers that support it.
NI SoftMotion Controller Considerations
The following list includes considerations you must make when you are using this function with the NI SoftMotion Controller:
- When you use this function with the NI SoftMotion Controller, sCurveTimeupdate is the smoothing time in the host loop period.
- National Instruments suggests you use the Load Move Constraints function with the NI SoftMotion Controller instead of using this function.