Perform an absolute or relative move with a specified final velocity.
🔹 What is Velocity Motion?
An absolute or relative move with a specified, non-zero final velocity.
🔹 Why use Velocity Motion?
A move with final velocity will make an absolute or relative move, and upon reaching the specified position, continue moving at the specified final velocity (as if you had made a position move and then, immediately after, a velocity move). This motion will continue indefinitely until it is stopped, either manually or through the program. To command a move with final velocity, enter your desired final velocity as the last argument in your regular move command.
📜 Sample Code
int finalVelocity = 5;
axis.MoveSCurve(Constants.POSITION, // Command an SCurve move with a final velocity of FINAL_VELOCITY.
Constants.VELOCITY,
Constants.ACCELERATION,
Constants.DECELERATION,
Constants.JERK_PERCENT,
finalVelocity); // Once the commanded position has been reached, the motor will begin spinning with a speed of FINAL_VELOCITY, and continue to spin at that velocity until stopped.
// *NOTICE* The following constants must be configured before attempting to run with hardware.
constint NUM_AXES = 1; // The number of axes to configure
constint AXIS_INDEX = 0; // The index of the axis to configure
// Motion Parameters
constdouble POSITION_0 = 0;
constdouble POSITION_1 = 0.5;
constdouble VELOCITY = 1;
constdouble ACCELERATION = 10;
constdouble DECELERATION = 10;
constdouble JERK_PERCENT = 50;
constdouble FINAL_VELOCITY = 0.5;
std::cout << "SCurve Motion with Final Velocity:" << std::endl;
std::cout << "Moving to position: " << POSITION_1 << std::endl;
std::cout << "Final Velocity: " << FINAL_VELOCITY << std::endl;