◆ MoveRelative() [1/3]

virtual void MoveRelative ( double  relativePosition,
double  vel,
double  accel,
double  decel,
double  jerkPct 
)
pure virtual

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

ℹ This function is avaliable in RapidCode and RapidSequencer

Part of the Motion method group.

Description:
MoveRelative command a relative point-to-point motion, with an S-Curve velocity profile. Axis will move relative increment distance from the currently commanded position.
Axis_Motion_Velocity_SCurve.jpg
S-Curve Velocity Profile
Parameters
relativePositionA relative increment, positive or negative.
velMaximum velocity, units/second.
accelMaximum accleration , units/second/second.
decelMaximum deceleration , units/second/second.
jerkPctJerk Percent, which defines the percentage of acceleration time which is smoothed, 0.0 to 100.0 .
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.
Sample Code:
RelativeMotion
// Command a relative to the current position
axis.MoveRelative(Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION, Constants.JERK_PERCENT); // Command a relative to the current position
axis.MotionDoneWait(); // Wait for motion to finish. (the motion should take 2.5 seconds)
//---TEST ASSERT---
Assert.That(axis.CommandPositionGet(), Is.EqualTo(Constants.POSITION), "The command position should be equal to POSITION");
// Move back to the start position by moving negative relative to current position
axis.MoveRelative(-1 * Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION, Constants.JERK_PERCENT);
axis.MotionDoneWait();
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
Axis_Motion_Profile_and_Parameters.jpg
Motion Scope:
Relative move profile shown below:
Axis_Motion_SCurve.jpg
See also
Different Motion Types, MoveSCurve, MoveTrapezoidal, MoveVelocity, MovePT, MovePVT
Examples
MotionHoldReleasedBySoftwareAddress.cpp.