APIs, concepts, guides, and more

◆ MoveSCurve() [3/3]

void MoveSCurve ( double position,
double vel,
double accel,
double decel,
double jerkPct,
double finalVel )

MoveSCurve with a final velocity, instead of ending the point-to-point move at zero velocity.

Parameters
finalVelFinal velocity.

Command a point-to-point S-Curve motion.

Parameters
positionTarget Position in UserUnits.
velMaximum velocity, UserUnits/second.
accelAverage acceleration , UserUnits/second/second. (peak up to 2× accel when jerkPercent = 100, see below)
decelAverage deceleration , UserUnits/second/second. (peak up to 2× decel when jerkPercent = 100, see below)
jerkPctJerk Percent, which defines the percentage of acceleration time which is smoothed, 0.0 to 100.0 .

Description:

MoveSCurve command a point-to-point motion, with an S-Curve velocity profile. This type of motion has an "S" shape to the acceleration and deceleration phases. It uses the JerkPercent parameter to decide how much of the acceleration and deceleration phases is curved. A JerkPercent of zero produces a trapezoidal profile.

Note
In most cases, a servo motor has a feedback device mounted. Depending on feedback device resolution, one motor shaft rotation will produce fixed value of counts. Example: motor has a resolution of 8192 counts. This means if 8192 is entered as distance to move, motor will move single revolution. User can implement UserUnitsSet() to change to a different unit (ex: mm, inches, etc) from encoder counts.
Warning


Using a non-zero JerkPercent increases the maximum acceleration above the user-specified average.
If your system can’t handle the higher peak, you risk overshoot or excessive load. The relation between average acceleration and maximum acceleration is:

\[ Maximum Acceleration \;=\; \frac{accel}{1 - \bigl(jerkPercent \times 0.005\bigr)} \]

  • accel: the requested (average) acceleration value given in the MoveSCurve command.
  • jerkPercent: the percent of time with non-zero jerk (0–100) given in the MoveSCurve command.
  • Maximum Acceleration: the resulting peak commanded acceleration.

See the S-Curve Motion concept page for more information.

Warning


Using a non-zero JerkPercent increases the maximum deceleration above the user-specified average.
If your system can’t handle the higher peak, you risk overshoot or excessive load. The relation between average deceleration and maximum deceleration is:

\[ Maximum Deceleration \;=\; \frac{decel}{1 - \bigl(jerkPercent \times 0.005\bigr)} \]

  • decel: the requested (average) deceleration value given in the MoveSCurve command.
  • jerkPercent: the percent of time with non-zero jerk (0–100) given in the MoveSCurve command.
  • Maximum Deceleration: the resulting peak commanded deceleration.

See the S-Curve Motion concept page for more information.

Part of the Motion method group. See the S-Curve Motion concept page for more information.

Sample Code:
SCurveMotion
axis.MoveSCurve(Constants.POSITION); // Command SCurve Motion. This overload willuse default velocity, acceleration, deceleration, jerk values for the axis. See axis config to learn how to set those values.
axis.MotionDoneWait(); // Wait for motion to finish
Note
Non-Blocking Execution Motion commands return instantly and do not pause code execution. Use MotionDoneWait() post-call to block execution until motion completes, or MotionDoneGet() to poll for completion.
RapidSetup:
Go to axis screen->Motion Profile box (left) to select type of motion
Go to axis screen->Motion Parameters box (right) to select values for motion
Motion Scope:
An S-Curve velocity (non-constant acceleration) profile shown below:
See also
S-Curve Motion, MoveSCurve, MoveRelative, MoveVelocity, MovePT, MovePVT DefaultVelocitySet, DefaultAccelerationSet, DefaultDecelerationSet, DefaultJerkPercentSet