APIs, concepts, guides, and more

◆ Home() [1/2]

void Home ( )
Description:
Home executes the homing routine as configured with the other homing methods. At the completion of finding the index / marker pulse, or the desired switch, the Axis will set the Home Offset, and then move to the zero position. If you don't want the Axis to move to zero after homing, use the overloaded method and set "moveToZero" false.

Part of the Homing method group.

Sample Code:
Axis: Homing
/* This sample application demonstrates master-based homing using the RapidCode .NET API.
Master-based homing is when the RMP controller executes the homing routine instead of the drive.
*/
using RSI.RapidCode; // RSI.RapidCode.dotNET;
Console.WriteLine("📜 Axis Homing: Master-Based");
// set sample config params
const RSIHomeMethod HOME_METHOD = RSIHomeMethod.RSIHomeMethodImprovedFALLING_HOME_NEGATIVE_START_POSITIVE_MOMENTUM;
// get rmp controller
MotionController controller = MotionController.Get();
try
{
Helpers.CheckErrors(controller);
// check is network is started
if (controller.NetworkStateGet() != RSINetworkState.RSINetworkStateOPERATIONAL)
{
Console.WriteLine("Network not started. Please start it before running this app.");
return;
}
// get axis
Axis axis = controller.AxisGet(axisNumber: 0);
Helpers.CheckErrors(axis);
// configure limit action
axis.HardwareNegLimitActionSet(RSIAction.RSIActionSTOP); // neg limit action set to STOP
// configure homing parameters
axis.HomeMethodSet(HOME_METHOD); // set the homing method
axis.HomeVelocitySet(10); // set the home velocity
axis.HomeSlowVelocitySet(1); // set the slow home velocity (used for final move if necessary)
axis.HomeAccelerationSet(100); // set the acceleration used for homing
axis.HomeDecelerationSet(100); // set the deceleration used for homing
axis.HomeOffsetSet(0.5); // set position offset from home (zero) position
// execute homing routine
axis.Home();
// check if homing was successful
if (axis.HomeStateGet() == true)
Console.WriteLine("Homing successful");
// clean up
Helpers.AbortMotionObject(axis);
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
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.
Represents a single axis of motion control. This class provides an interface for commanding motion,...
Definition rsi.h:5863
RSINetworkState
State of network.
Definition rsienums.h:568
RSIAction
Action to perform on an Axis.
Definition rsienums.h:1115
Helpers namespace provides utility functions for common tasks in RMP applications.
Definition helpers.h:21
Notes:
Be sure to set Home Action to ::RSIActionSTOP. Also set HW Positive/Negative Limit actions to STOP if homing with limit switches.
See also
HomeMethodSet, HomeOffsetSet, HomeVelocitySet, HomeAccelerationSet, HomeDecelerationSet, HomeActionSet
Master-based homing.
Examples
PathMotion.cpp, and axis-homing-master-based.cs.