APIs, concepts, guides, and more

◆ HomeOffsetSet()

void HomeOffsetSet ( double offset)
Description:
During a master-based homing sequence (as configured by HomeMethodSet), the controller detects a specific physical event (like reaching a limit switch, detecting an index pulse, hitting a hard stop, etc.) which serves as the homing reference point.

This function, HomeOffsetSet, defines the position value (in UserUnits) that the axis coordinate system should report at the precise moment this reference event is detected.

The relationship is: Reported Axis Position = -offset when the reference event occurs.

By setting this offset, you establish the relationship between your logical user coordinate system (where zero or other key positions are) and the physical feature used for homing.

Example Use Cases:
  • Defining a Hard Stop Location: If you home to a physical hard stop and want that exact position to correspond to 50.0 UserUnits in your coordinate system, you would set offset = -50.0.
  • Aligning with an Index Pulse: If the homing method uses an encoder index pulse (Z signal) as the reference, setting offset = 0.0 would make the position zero precisely when the pulse is detected. Setting offset = 1.0 would make the position -1.0 when the pulse occurs.
  • Centering the Travel Range: If you home to one end of travel (e.g., a positive limit) and know the total travel range, you can set the offset to place zero in the middle. For example, homing to a positive limit representing the end of a 200-unit range, setting offset = -100.0 would make the limit position 100.0, placing zero at the midpoint.
Note
This parameter directly sets the coordinate value at the reference point (negated). It does not necessarily induce a separate move after the reference is found, that is done with the Axis::Home(bool) 'Move to Zero' parameter, which performs a distinct move after homing and offset application.
Parameters
offsetThe value such that -offset will be the axis position (in UserUnits) assigned when the homing reference event occurs.

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
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);
// 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
axis.ClearFaults();
axis.AmpEnableSet(false);
}
// handle errors as needed
finally
{
controller.Delete(); // dispose
}
static void CheckErrors(RapidCodeObject rsiObject)
Checks for errors in the given RapidCodeObject and throws an exception if any non-warning errors are ...
Definition _helpers.cs:15
Helpers class provides static methods for common tasks in RMP applications.
Definition _helpers.cs:5
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:5870
Axis * AxisGet(int32_t axisNumber)
AxisGet returns a pointer to an Axis object and initializes its internals.
RSINetworkState NetworkStateGet()
static MotionController * Get()
Get an already running RMP EtherCAT controller.
void Delete(void)
Delete the MotionController and all its objects.
Represents the RMP soft motion controller. This class provides an interface to general controller con...
Definition rsi.h:800
void ClearFaults()
Clear all faults for an Axis or MultiAxis.
int32_t AmpEnableSet(bool enable, int32_t ampActiveTimeoutMilliseconds=AmpEnableTimeoutMillisecondsDefault, bool overrideRestrictedState=false)
Enable all amplifiers.
RSINetworkState
State of network.
Definition rsienums.h:568
RSIAction
Action to perform on an Axis.
Definition rsienums.h:1115
See also
Home(bool)
HomeMethodSet
Master-based homing diagrams.
Examples
axis-homing-master-based.cs.