The RMP Motion Controller APIs
Motion: MoveSCurve

Learn how to configure use the MoveSCurve function in RapidScript.

Warning
This is a sample program to assist in the integration of the RMP motion controller with your application. It may not contain all of the logic and safety features that your application requires. We recommend that you wire an external hardware emergency stop (e-stop) button for safety when using our code sample apps. Doing so will help ensure the safety of you and those around you and will prevent potential injury or damage.

The sample apps assume that the system (network, axes, I/O) are configured prior to running the code featured in the sample app. See the Configuration page for more information.
Precondition
This sample application requires at least one axis (can be a phantom)


📜 MoveSCurve Sample App
A sample application that:
  1. Configures the axis.
  2. Prepares the axis for motion.
  3. Performs an SCurve move and waits for it to complete.
  4. Prints the final position of the axis.

1void main()
2{
3 // The index of the axis (0 refers to the first axis in the network)
4 uint32 axisIndex = 0;
5
6 // Set the motion parameters
7 double goalPosition = 1.0; // Move 1 unit (revolutions)
8 double velocity = 1000.0; // Move at a velocity of 1 unit per second
9 double acceleration = 10000.0;
10 double deceleration = 10000.0;
11 double jerkPercent = 50.0;
12
14 // Move the axis using the set parameters.
15 AxisMoveSCurve(axisIndex, goalPosition, velocity, acceleration, deceleration, jerkPercent);
17
18 // Wait until the axis is done moving.
19 int32 timeoutMs = 50;
20 int32 elapsedMs = AxisMotionDoneWait(axisIndex, timeoutMs);
21
22 print("Time elapsed (milliseconds): " + elapsedMs);
23 print("Done Moving! Axis is at position: " + AxisCommandPositionGet(axisIndex));
24}

Learn more in topic page.