Examples of various ways to home a drive.
Console.WriteLine("📜 Axis Homing: DS402 Drive");
const int offsetIdx = 0x607C;
const int offsetSub = 0x0;
const int offsetSize = 4;
const int offsetVal = 0;
const int methodIdx = 0x6098;
const int methodSub = 0x0;
const int methodSize = 1;
const int methodVal = 24;
const int targetSpeedIdx = 0x6099;
const int targetSpeedSub = 0x1;
const int targetSpeedSize = 4;
const int targetSpeedVal = 2;
const int originSpeedIdx = 0x6099;
const int originSpeedSub = 0x2;
const int originSpeedSize = 4;
const int originSpeedVal = 10;
const int accelIdx = 0x609A;
const int accelSub = 0x0;
const int accelSize = 4;
const int accelVal = 100;
const int CTRL_WORD_PREP_HOMING = 15;
const int CTRL_WORD_START_HOMING = 31;
const int DELAY_MS = 20;
const int STATUS_TARGET_REACHED = 0x400;
const int STATUS_HOMING_ATTAINED = 0x1000;
const int STATUS_HOMING_ERROR = 0x2000;
try
{
if (controller.NetworkStateGet() !=
RSINetworkState.RSINetworkStateOPERATIONAL)
{
Console.WriteLine("Network not started. Please start it before running this app.");
return;
}
Axis axis = controller.AxisGet(axisNumber: 0);
controller.SampleWait(DELAY_MS);
controller.SampleWait(DELAY_MS);
controller.SampleWait(DELAY_MS);
bool cancelHome = false;
while ((!cancelHome) && ((statusWord & STATUS_TARGET_REACHED) == 0))
{
}
if ((statusWord & STATUS_HOMING_ATTAINED) == STATUS_HOMING_ATTAINED)
Console.WriteLine("Axis homed successfully");
else if ((statusWord & STATUS_HOMING_ERROR) == STATUS_HOMING_ERROR)
Console.WriteLine("Error occurred during homing");
}
finally
{
controller.Delete();
}
Constants used in the C# sample apps.
const int AXIS_0_INDEX
Default: 0.
uint32_t NetworkIndexGet(RSINetworkIndexType indexType)
Get the PDO array index for an axis signal mapping.
void OperationModeSet(RSIOperationMode mode)
Set the axis operation mode.
NetworkNode * NetworkNode
Gets the associated NetworkNode object.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
void NetworkOutputOverrideValueSet(int32_t index, uint64_t outputValue)
Sets a PDO output directly.
static MotionController * Get()
Get an already running RMP EtherCAT controller.
void NetworkOutputOverrideSet(int32_t index, bool outputOverride)
Set NetworkOutputValue to override RMP cyclic value.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
void ServiceChannelWrite(int32_t index, int32_t subIndex, int32_t byteCount, int32_t sdoValue)
Write a number in the SDO.
uint16_t StatusWordGet(int32_t axisIndex)
Get the DS402 status word.
MotionController * rsiControl
Gets the parent MotionController object.
RSINetworkState
State of network.
RSIOperationMode
DS402 modes of operation.
RSINetworkIndexType
Network PDO index types for configuring axis input/output mappings.
Helpers namespace provides utility functions for common tasks in RMP applications.
Console.WriteLine("📜 Axis Homing: AKD Drive");
try
{
if (controller.NetworkStateGet() !=
RSINetworkState.RSINetworkStateOPERATIONAL)
{
Console.WriteLine("Network not started. Please start it before running this app.");
return;
}
Axis axis = controller.AxisGet(axisNumber: 0);
{
Console.WriteLine("Wrong Axis type. This sample requires an AKD Axis.");
return;
}
System.Threading.Thread.Sleep(100);
Console.WriteLine("HOME.MOVE command sent");
UInt16 statusWord;
int isHomed = 0;
while (isHomed != 1)
{
isHomed = statusWord >> 12;
}
Console.WriteLine("Axis homed");
}
finally
{
controller.Delete();
}
void OriginPositionSet(double position)
Set the origin position.
void ErrorLimitActionSet(RSIAction action)
Set the action that will occur when the Error Limit Event triggers.
char * AKDASCIICommand(const char *const command)
Send a Kollmorgen AKD ASCII command (NodeType must equal KOLLMORGEN_AKD).
RSINodeType TypeGet()
Get the node type, as determined by the Vendor ID and Product Code.
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
void Abort()
Abort an axis.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
int32_t NumberGet()
Get the axis number.
RSIAction
Action to perform on an Axis.
RSINodeType
Valid Node types.
Console.WriteLine("📜 Axis Homing: Master-Based");
try
{
if (controller.NetworkStateGet() !=
RSINetworkState.RSINetworkStateOPERATIONAL)
{
Console.WriteLine("Network not started. Please start it before running this app.");
return;
}
Axis axis = controller.AxisGet(axisNumber: 0);
Console.WriteLine("Homing successful");
}
finally
{
controller.Delete();
}
void HardwareNegLimitActionSet(RSIAction action)
Set the action that will occur when the Hardware Negative Limit Event triggers.
void HomeSlowVelocitySet(double velocity)
Set the slow home velocity.
void HomeVelocitySet(double velocity)
Set the home velocity.
void Home()
Execute the homing routine.
void HomeDecelerationSet(double decel)
Set the decleration to be used for homing when using the switch is not detected before the HomeTravel...
void HomeAccelerationSet(double accel)
Set the deceleration used for homing.
void HomeMethodSet(RSIHomeMethod method)
Set the method to be used for homing.
bool HomeStateGet()
Get the home state.
void HomeOffsetSet(double offset)
Sets the user coordinate value assigned to the detected homing reference point.