using System.Threading;
Console.WriteLine("📜 Axis Motion: Point to Point");
const double POSITION = 10;
const double VELOCITY = 10;
const double ACCELERATION = 100;
const double DECELERATION = 100;
const double JERK_PERCENT = 50;
const double FINAL_VELOCITY = 5;
try
{
Console.WriteLine("\n1. Absolute Motion");
Console.WriteLine($" CommandPosition after absolute motion: {axis.CommandPositionGet()} (expected: {POSITION})");
Console.WriteLine("\n2. S-Curve Motion");
axis.
MoveSCurve(POSITION, VELOCITY, ACCELERATION, DECELERATION, JERK_PERCENT);
Console.WriteLine($" CommandPosition after s-curve motion: {axis.CommandPositionGet()} (expected: {POSITION})");
Console.WriteLine("\n3. Relative Motion");
axis.
MoveRelative(POSITION, VELOCITY, ACCELERATION, DECELERATION, JERK_PERCENT);
axis.
MoveRelative(-POSITION, VELOCITY, ACCELERATION, DECELERATION, JERK_PERCENT);
Console.WriteLine($" CommandPosition after relative motion: {axis.CommandPositionGet()} (expected: 0)");
Console.WriteLine("\n4. Final Velocity Motion");
axis.
MoveSCurve(POSITION, VELOCITY, ACCELERATION, DECELERATION, JERK_PERCENT, FINAL_VELOCITY);
Thread.Sleep(100);
Console.WriteLine($" CommandVelocity after final velocity motion: {axis.CommandVelocityGet()} (expected: {FINAL_VELOCITY})");
Console.WriteLine("\n5. Velocity Motion");
Thread.Sleep(100);
Console.WriteLine($" CommandVelocity after velocity motion: {axis.CommandVelocityGet()} (expected: {VELOCITY}) ");
}
finally
{
controller.Delete();
}
Constants used in the C# sample apps.
const int AXIS_0_INDEX
Default: 0.
double CommandPositionGet()
Get the current command position.
void MoveVelocity(double velocity)
void MoveTrapezoidal(double position, double vel, double accel, double decel)
Point-to-point trapezoidal move.
void MoveRelative(double relativePosition, double vel, double accel, double decel, double jerkPct)
Command a relative point-to-point S-Curve motion.
void MoveSCurve(double position, double vel, double accel, double decel, double jerkPct)
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...
int32_t MotionDoneWait()
Waits for a move to complete.
bool StatusBitGet(RSIEventType bitMask)
Return the state of a status bit.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
RSIEventType
Event Types or Status Bits.
Helpers namespace provides utility functions for common tasks in RMP applications.