Console.WriteLine("📜 Compensator: Single Axis");
const int INDEX_ZERO = 0;
const int MIN = 10;
const int MAX = 110;
const int DELTA = 10;
const int POINTS = ((MAX - MIN) / DELTA) + 1;
double[] table = new double[POINTS] { 0, 2, -3, -5, -3, 2, -3, 0, 2, -3, -5 };
Console.WriteLine($"Range: {MIN} to {MAX}, Delta: {DELTA}");
Console.WriteLine($"Points: {POINTS}");
Console.WriteLine("Compensator Table:");
for (int i = 0; i < POINTS; i++)
{
int inputPos = MIN + (i * DELTA);
Console.WriteLine($"@ Pos: {inputPos}, Compensate by: {table[i]}");
}
try
{
controller.CompensatorCountSet(1);
controller.CompensatorPointCountSet(compensatorNumber: INDEX_ZERO, pointCount: table.Length);
Axis axis = controller.AxisGet(axisNumber: 0);
if (controller.CompensatorPointCountGet(INDEX_ZERO) == table.Length && POINTS == table.Length)
{
controller.CompensatorConfigSet(
compensatorNumber: INDEX_ZERO,
inputAxis: axis,
inputAxisMinimum: MIN,
inputAxisMaximum: MAX,
inputAxisDelta: DELTA,
outputAxis: axis,
table: table);
axis.AmpEnableSet(true);
axis.MoveSCurve(position: MIN + DELTA);
axis.MotionDoneWait();
double compPos = axis.CompensationPositionGet();
Console.WriteLine($"Compensation position: {compPos} (expected: {table[1]})");
if (compPos != table[1])
throw new Exception("❌ Compensator compensation position does not match expected value.");
}
}
finally
{
controller.CompensatorCountSet(0);
controller.Delete();
}
Represents a single axis of motion control. This class provides an interface for commanding motion,...
static MotionController * Get()
Get an already running RMP EtherCAT controller.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
RSICompensatorOutputType
Compensator output types.
RSIAxisMasterType
Sources available to a slave Axis for electronic gearing & camming.
Helpers namespace provides utility functions for common tasks in RMP applications.