Learn how to configure different characteristics for an axis.
More...
- 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.
📜 Axis Settling
Configure the following characteristics for axis:
1. Fine Position Tolerance.
2. Coarse Position Tolerance.
3. Velocity Tolerance.
4. Settling Time Tolerance.
Settling Time is the amount of time that a move must be within the position Fine band, in order for the move to be considered complete.
const double POSITION_TOLERANCE_FINE = 200;
const double POSITION_TOLERANCE_COARSE = 300;
const double VELOCITY_TOLERANCE = 12000;
const double SETTLING_TIME = 5;
axis.PositionToleranceFineSet(POSITION_TOLERANCE_FINE);
axis.PositionToleranceCoarseSet(POSITION_TOLERANCE_COARSE);
axis.VelocityToleranceSet(VELOCITY_TOLERANCE);
axis.SettlingTimeSet(SETTLING_TIME);
var posTolFine = axis.PositionToleranceFineGet();
var posTolCoarse = axis.PositionToleranceCoarseGet();
var velTol = axis.VelocityToleranceGet();
var setTime = axis.SettlingTimeGet();
Learn more in topic page.
📜 Amp Fault Configuration
The program will configure the amp fault input for a motor.
A motor's amp fault input has three items to configure:
1. Event Action (any MPIAction such as MPIActionE_STOP)
2. Event Trigger (a trigger polarity, active HIGH or LOW)
3. Duration (requires the limit condition to exist for a programmable number of seconds before an event will occur)
The duration described above is a configuration that provides filtering of the amp fault input by requiring the input to remain active for the defined duration.This will effectively keep the amp fault from activating prematurely due to electrical noise on the amp fault input.
const double AMP_FAULT_DURATION_TIME = 1;
axis.AmpEnableSet(false);
axis.AmpFaultActionSet(
RSIAction.RSIActionABORT);
axis.AmpFaultTriggerStateSet(false);
axis.AmpFaultDurationSet(AMP_FAULT_DURATION_TIME);
var isEnabled = axis.AmpEnableGet();
var faultAction = axis.AmpFaultActionGet();
var faultTriggerState = axis.AmpFaultTriggerStateGet();
var faultDuration = axis.AmpFaultDurationGet();
Learn more in topic page.
📜 Set User Units
Learn how to get and set User Units.
const int ENCODER_RESOLUTION_BITS = 20;
double USER_UNITS = Math.Pow(2, ENCODER_RESOLUTION_BITS);
axis.UserUnitsSet(USER_UNITS);
axis.ErrorLimitTriggerValueSet(1);
var userUnits = axis.UserUnitsGet();
Learn more in topic page.
📜 Stop Rate
Learn how to set the stop rate.
const double STOP_RATE_DEFAULT = 1.0;
const double ESTOP_RATE_DEFAULT = 0.05;
const double ESTOP_DECELERATION_RATE = 1000;
axis.StopTimeSet(STOP_RATE_DEFAULT);
axis.EStopTimeSet(ESTOP_RATE_DEFAULT);
axis.EStopDecelerationSet(ESTOP_DECELERATION_RATE);
Learn more in topic page.
📜 Hardware Limits
Learn how to get and set hardware limits.
const bool ACTIVE_HIGH = true;
const bool ACTIVE_LOW = false;
const double HW_POS_DURATION_TIME = 0.01;
const double HW_NEG_DURATION_TIME = 0.01;
axis.HardwarePosLimitActionSet(
RSIAction.RSIActionE_STOP);
axis.HardwarePosLimitTriggerStateSet(ACTIVE_HIGH);
axis.HardwarePosLimitDurationSet(HW_POS_DURATION_TIME);
var hPosLimAct = axis.HardwarePosLimitActionGet();
var hPosLimTrigState = axis.HardwarePosLimitTriggerStateGet();
var hPosLimDur = axis.HardwarePosLimitDurationGet();
axis.HardwareNegLimitActionSet(
RSIAction.RSIActionE_STOP);
axis.HardwareNegLimitTriggerStateSet(ACTIVE_LOW);
axis.HardwareNegLimitDurationSet(HW_NEG_DURATION_TIME);
var hNegLimAct = axis.HardwareNegLimitActionGet();
var hNegLimTrigState = axis.HardwareNegLimitTriggerStateGet();
var hNegLimDur = axis.HardwareNegLimitDurationGet();
Learn more in topic page.
📜 Phantom Axis
This sample application demonstrates how to set up a phantom axis.
Phantom axes can be used to test your applications when the network is unavailable or you need more axes than are currently connected to your network.
controller.AxisCountSet(controller.AxisCountGet() + 1);
int axisNumber = controller.AxisCountGet() - 1;
axis = controller.AxisGet(axisNumber);
axis.ErrorLimitActionSet(
RSIAction.RSIActionNONE);
axis.HardwareNegLimitActionSet(
RSIAction.RSIActionNONE);
axis.HardwarePosLimitActionSet(
RSIAction.RSIActionNONE);
axis.SoftwareNegLimitActionSet(
RSIAction.RSIActionNONE);
axis.SoftwarePosLimitActionSet(
RSIAction.RSIActionNONE);
const double positionToleranceMax = Double.MaxValue / 10.0;
axis.PositionToleranceCoarseSet(positionToleranceMax);
axis.PositionToleranceFineSet(positionToleranceMax);
Learn more in topic page.