The RMP Motion Controller APIs

◆ CompensatorPointCountSet()

void CompensatorPointCountSet ( int32_t  compensatorNumber,
int32_t  pointCount 
)
Parameters
compensatorNumberwhich compensator to configure?
pointCountthe number of points which will be stored in the table
Description:
CompensatorPointCountSet sets the number of Compensator points allocated on the controller. This must be configured before creating Axis or MultiAxis objects, as these counts change the dynamic memory allocation inside the controller's firmware.
Remarks
This function is also available in RapidSequencer.

Part of the Compensator method group.

Sample Code:
Compensator1D
// To use a compensator space in memory must be reserved before creating axis objects. For this sample app we will create two overlapping compensation tables.
controller.CompensatorCountSet(2);
// To know how much memory will be required for the compensator table you must first know your MIN, MAX, and DELTA. See our compensator topic page for more information.
const int MIN = 0; // The smallest value in counts on the input axis where a table will be applied to the output axis.
const int MAX = 200; // The largest value in counts on the input axis where a table will be applied to the output axis.
const int DELTA = 10; // The number of encoder counts on the input axis between values in the table.
const int POINTS = ((MAX - MIN) / DELTA) + 1; // The space required in memory for the table to be held. (21)
// Compensator table values use Axis COUNTS NOT user units to be applied to the output axis.
double[] TABLE0 = new double[POINTS] { 0, 1000, -5000, -10000, 10000, 5000, -5000, 2500, 0, 2500, 5000, 7500, 1000, 1250, 1000, 7500, 5000, 2500, 0, -2500, -1000 };
double[] TABLE1 = new double[POINTS] { 0, 500, 0, 0, 0, 0, 0, 0, 0, 0, 1000, -5000, -1000, 1000, 5000, -5000, 2500, 0, -1000, 0, 0 };
// Reserve space in memory for the compensator tables.
controller.CompensatorPointCountSet(Constants.COMP_NUM_ZERO, TABLE0.Length);
controller.CompensatorPointCountSet(Constants.COMP_NUM_ONE, TABLE1.Length);
controller.AxisCountSet(2);
Axis moving_axis = CreateAndReadyAxis(Constants.MAIN_AXIS_NUMBER); // Helper function to setup an axis
Axis follower_axis = CreateAndReadyAxis(Constants.DRIVEN_AXIS_NUMBER); // Helper function to setup an axis
// NOTE the three following values must be equal before a compensator can be configured. Otherwise an error will be thrown. See topic page for more info.
if (controller.CompensatorPointCountGet(Constants.COMP_NUM_ZERO) == TABLE0.Length && POINTS == TABLE0.Length)
{
// Initalize the Compensator
controller.CompensatorConfigSet(Constants.COMP_NUM_ZERO, moving_axis, RSIAxisMasterType.RSIAxisMasterTypeAXIS_ACTUAL_POSITION, MIN, MAX, DELTA, follower_axis, RSICompensatorOutputType.RSICompensatorOutputTypeSINGLE, TABLE0);
// You can also configure multiple overlaping compensation tables. Note the first compensator remains in SINGLE mode but the second is set to ADDITIVE
controller.CompensatorConfigSet(Constants.COMP_NUM_ONE, moving_axis, RSIAxisMasterType.RSIAxisMasterTypeAXIS_ACTUAL_POSITION, MIN, MAX, DELTA, follower_axis, RSICompensatorOutputType.RSICompensatorOutputTypeADDITIVE, TABLE1);
}
Note
This should be done after Creating the Controller and before any other RapidObject creation as it will invalidate non-Controller Objects.
See also
CompensatorCountSet
Examples
Compensator.cs.
RSI::RapidCode::MotionController::CompensatorPointCountGet
int32_t CompensatorPointCountGet(int32_t compensatorNumber)
Get the number of points for use with a Compensator.
RSI::RapidCode::RSIAxisMasterType
RSIAxisMasterType
Sources available to a slave Axis for electronic gearing & camming.
Definition: rsienums.h:1150
RSI::RapidCode::MotionController::CompensatorPointCountSet
void CompensatorPointCountSet(int32_t compensatorNumber, int32_t pointCount)
Set the number of points for use with a Compensator.
RSI::RapidCode::RSICompensatorOutputType
RSICompensatorOutputType
Compensator output types.
Definition: rsienums.h:1324
RSI::RapidCode::MotionController::AxisCountSet
void AxisCountSet(int32_t axisCount)
Set the number of allocated and processed axes in the controller.
RSI::RapidCode::MotionController::CompensatorCountSet
void CompensatorCountSet(int32_t compensatorCount)
Set the number of Compensators available in the firmware.
RSI::RapidCode::MotionController::CompensatorConfigSet
void CompensatorConfigSet(int32_t compensatorNumber, int32_t firstInputAxisNumber, RSIAxisMasterType firstInputAxisType, double firstInputAxisMinimum, double firstInputAxisMaximum, double firstInputAxisDelta, int32_t secondInputAxisNumber, RSIAxisMasterType secondInputAxisType, double secondInputAxisMinimum, double secondInputAxisMaximum, double secondInputAxisDelta, int32_t outputAxisNumber, RSICompensatorOutputType outputType, const double *const table)
Configure a 2D compensator.