Sample apps showing how the position of an axis can be driven by that of another 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.
- Precondition
- This sample code presumes that the user has set the tuning paramters(PID, PIV, etc.) prior to running this program so that the motor can rotate in a stable manner.
📜 Camming
This sample application allows you to command a nonlinear coordinated motion betweentwo axes.
Moving Axis Axis: this axis/motor may or may not be controlled by the motion controller.
Driven Axis: the motion controller controls the position of this axis/motor as a function of the position of the Moving axis.
- Precondition
- User Units must be set to 1 ❗️
Axis moving_axis = controller.
AxisGet(Constants.MAIN_AXIS_NUMBER);
Axis follower_axis = controller.
AxisGet(Constants.DRIVEN_AXIS_NUMBER);
const double MAIN_VELOCITY = 50;
const double MAIN_ACCELERATION = 20;
double[] movingAxisDistances = { 5, 10, 8 };
double[] followerAxisPositions = { 10, 20, 10 };
movingAxisDistances,
followerAxisPositions,
movingAxisDistances.Length);
Learn more in the concept page.
📜 Gearing
Axis gearing on the XMP is based off of a Axis, RSIAxisMasterType, numerator, and denominator.
The Axis points to a Moving Axis axis to gear to.
The RSIAxisMasterType specifies what feedback source to gear to. The ratio between the lead and follower axes is set by a ratio of two longs – a numerator and a denominator.
Axis moving_axis = controller.
AxisGet(Constants.MAIN_AXIS_NUMBER);
Axis follower_axis = controller.
AxisGet(Constants.DRIVEN_AXIS_NUMBER);
int numerator = 2;
int denominator = 1;
numerator,
denominator);
Constants.VELOCITY,
Constants.ACCELERATION,
Constants.DECELERATION,
Constants.JERK_PERCENT);
Learn more in the concept page.