APIs, concepts, guides, and more
Absolute Motion

Use Absolute Motion to move directly to a specified position, ensuring the axis reaches a defined destination regardless of its previous position.

🔹 What is Absolute Motion?

An absolute motion always moves to a specified position without being affected by the previous motion.

🔹 Why use Absolute Motion?

Absolute Motion makes it very easy for us to reach a specified destination.

Note
An Absolute move will move the axis to position 25 rather than 25 units ahead of the current position.
A Relative move will move the axis 25 units ahead of the current position, rather than to position 25.

In our API an absolute motion will let us move a single axis with a trapezoidal profile to an absolute distance.

Note
You can change the velocity, acceleration, and deceleration of a moveSCurve that is executing on the fly simply by calling the function again with different parameters.

📜 Sample Code

  • C#

    public const double POSITION = 2; // Specify the position to travel to.
    public const double VELOCITY = 200; // Specify your velocity. - units: UserUnits/Sec
    public const double ACCELERATION = 100; // Specify your acceleration. - units: UserUnits/Sec^2
    public const double DECELERATION = 100; // Specify your deceleration. - units: UserUnits/Sec^2
    public const double JERK_PERCENT = 50; // Specify your jerk percent (0.0 to 100.0)
    axis.MoveTrapezoidal(Constants.POSITION, Constants.VELOCITY, Constants.ACCELERATION, Constants.DECELERATION);// Command simple trapezoidal motion.
    axis.MotionDoneWait();// Wait for motion to be done

  • C++

    // *NOTICE* The following constants must be configured before attempting to run with hardware.
    const int NUM_AXES = 1; // The number of axes to configure
    const int AXIS_INDEX = 0; // The index of the axis to configure
    // Motion Parameters
    const double POSITION_0 = 0;
    const double POSITION_1 = 0.5;
    const double VELOCITY = 1;
    const double ACCELERATION = 10;
    const double DECELERATION = 10;
    const double JERK_PERCENT = 50;
    const double FINAL_VELOCITY = 0.5;
    std::cout << "Absolute (Trapezoidal) Motion:" << std::endl;
    std::cout << "Moving to position: " << POSITION_1 << std::endl;
    axis->MoveTrapezoidal(POSITION_1, VELOCITY, ACCELERATION, DECELERATION);
    axis->MotionDoneWait(TIMEOUT);
    std::cout << "Motion Complete" << std::endl;
    std::cout << "Moving back to position: " << POSITION_0 << std::endl;
    axis->MoveTrapezoidal(POSITION_0, VELOCITY, ACCELERATION, DECELERATION);
    axis->MotionDoneWait(TIMEOUT);
    std::cout << "Motion Complete\n" << std::endl;