APIs, concepts, guides, and more
Axis: Configuration

Learn how to configure different settings for an axis.

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.


In this page:


📜 Axis: Hardware Limits

Learn how to configure Hardware Limits 📖 including trigger states, duration settings, and actions for axis safety and protection.

// parameters
const int TRIGGER_STATE = 1; // The state that triggers the positive software limit, active high = 1, active low = 0.
const double DURATION = 0.01; // How long the hardware limit must be in the trigger state to be considered triggered.
const RSIAction ACTION = RSIAction::RSIActionABORT; // the action to take when the positive hardware limit is triggered.
// set
axis->HardwarePosLimitTriggerStateSet(TRIGGER_STATE);
axis->HardwarePosLimitDurationSet(DURATION);
axis->HardwareNegLimitTriggerStateSet(TRIGGER_STATE);
axis->HardwareNegLimitDurationSet(DURATION);
// get
int posTriggerState = axis->HardwarePosLimitTriggerStateGet();
double posDuration = axis->HardwarePosLimitDurationGet();
RSIAction posAction = axis->HardwarePosLimitActionGet();
int negTriggerState = axis->HardwareNegLimitTriggerStateGet();
double negDuration = axis->HardwareNegLimitDurationGet();
RSIAction negAction = axis->HardwareNegLimitActionGet();

Source: axis-configuration.cpp


📜 Axis: Settling Criteria

Learn how to configure Settling 📖 criteria to determine when an axis has successfully reached its target position.

// parameters
const double POSITION_TOLERANCE_FINE = 200; // Tolerance for when a move is considered complete.
const double POSITION_TOLERANCE_COARSE = 300; // Tolerance for when a move is considered "near" complete.
const double VELOCITY_TOLERANCE = 12000; // Tolerance for when a velocity move is considered complete.
const double SETTLING_TIME = 5; // how long the axis must be within tolerance to be considered settled.
// set
axis->PositionToleranceFineSet(POSITION_TOLERANCE_FINE);
axis->PositionToleranceCoarseSet(POSITION_TOLERANCE_COARSE);
axis->VelocityToleranceSet(VELOCITY_TOLERANCE);
axis->SettlingTimeSet(SETTLING_TIME);
// get
double posTolFine = axis->PositionToleranceFineGet();
double posTolCoarse = axis->PositionToleranceCoarseGet();
double velTol = axis->VelocityToleranceGet();
double setTime = axis->SettlingTimeGet();

Source: axis-configuration.cpp


📜 Axis: Stop Rate

Learn how to configure Stopping Rates 📖 for controlled deceleration when stopping axis motion.

// parameters
const double STOP_RATE_DEFAULT = 1.0; // Specify the default STOP rate in seconds.
const double ESTOP_RATE_DEFAULT = 0.05; // Specify the default ESTOP rate in seconds.
const double ESTOP_DECELERATION_RATE = 1000; // specify the default ESTOP deceleration rate in seconds.
// set
axis->StopTimeSet(STOP_RATE_DEFAULT);
axis->EStopTimeSet(ESTOP_RATE_DEFAULT);
axis->EStopDecelerationSet(ESTOP_DECELERATION_RATE);
// get
double stopRate = axis->StopTimeGet();
double eStopRate = axis->EStopTimeGet();
double eStopDeceleration = axis->EStopDecelerationGet();

Source: axis-configuration.cpp


📜 Axis: User Units

Learn how to configure Counts Per Unit (User Units) 📖 to set up proper scaling between user units and encoder counts.

// parameters
const int ENCODER_RESOLUTION_BITS = 20; // The number of bits defining the encoder resolution
const double USER_UNITS = std::pow(2, ENCODER_RESOLUTION_BITS); // The number of user units per revolution
// (2^20 = 1,048,576 user units per revolution)
// set
axis->UserUnitsSet(USER_UNITS);
// get
double userUnits = axis->UserUnitsGet();

Source: axis-configuration.cpp


📜 Axis: Phantom Axis

Learn how to create Phantom Axes 📖 that can be used for virtual axis operations.

// get the axis
Axis *axis = controller->AxisGet(AXIS_INDEX);
// configure the axis as a phantom axis
// these limits are not meaningful for a Phantom Axis (e.g., a phantom axis has no actual position so a position error trigger is not necessary)
// therefore, you must set all of their actions to "NONE".
axis->PositionSet(0); // Set the position to 0
axis->ErrorLimitActionSet(RSIAction::RSIActionNONE); // Set Error Limit Action.
axis->AmpFaultActionSet(RSIAction::RSIActionNONE); // Set Amp Fault Action.
axis->AmpFaultTriggerStateSet(1); // Set Amp Fault Trigger State.
axis->HardwareNegLimitActionSet(RSIAction::RSIActionNONE); // Set Hardware Negative Limit Action.
axis->HardwarePosLimitActionSet(RSIAction::RSIActionNONE); // Set Hardware Positive Limit Action.
axis->SoftwareNegLimitActionSet(RSIAction::RSIActionNONE); // Set Software Negative Limit Action.
axis->SoftwarePosLimitActionSet(RSIAction::RSIActionNONE); // Set Software Positive Limit Action.
axis->HomeActionSet(RSIAction::RSIActionNONE); // Set Home Action.
// reduce from max slightly, so XML to string serialization and deserialization works without throwing System.OverflowException
const double positionToleranceMax = std::numeric_limits<double>::max() / 10.0;
axis->PositionToleranceCoarseSet(positionToleranceMax); // set Settling Coarse Position Tolerance to max value
// set Settling Fine Position Tolerance to max value (so Phantom axis will get immediate MotionDone when target is reached)
axis->PositionToleranceFineSet(positionToleranceMax);
axis->MotorTypeSet(RSIMotorType::RSIMotorTypePHANTOM); // Set the MotorType to phantom

Source: phantom-axis.cpp