Homing (CustomConfigSet) Stage Two Behaves Strangely if HomeTravelDistanceSet() is called

[RMP 8.1.3]

I’m trying to home to a network I/O, using HomeLimitCustomConfigSet(). I observe different behavior when I explicitly set Axis::HomeTravelDistanceSet.

If I don’t call it, homing completes as normal. If I call it, stage two never recognized that the I/O has gone low, and it just keeps moving in the reverse direction (forever? I’ve never been that patient).

Here’s what I’m doing:

for (auto& stage : std::vector<r::RSIHomeStage>{r::RSIHomeStageSTAGE_ONE, r::RSIHomeStageSTAGE_TWO,
			                                    r::RSIHomeStageSTAGE_THREE, r::RSIHomeStageSTAGE_FOUR}) {
	axis->HomeVelocitySet(stage,HOME_VELOCITY);
	axis->HomeAccelerationSet(stage,HOME_ACCEL);
	axis->HomeDecelerationSet(stage,HOME_DECEL);
	axis->HomeJerkPercentSet(stage,HOME_JERK_PCT);
	axis->HomeTravelDistanceSet(stage, HOME_TRAVEL_DISTANCE);
}

I haven’t tried the various permutations of stages. I’m just setting the same values for every stage.

If I comment out that last call, stage two behaves as I would expect (and as customEtherCATHome.cpp behaves).

customEtherCATHome.cpp behaves correctly, though it never calls HomeTravelDistanceSet(). If I add (four) call(s) to customEtherCATHome.cpp, it fails to notice the I/O change in stage two.

Here’s the trace when no travel distance is set:

(0:49:59.391) Axis (0) Home Method Rising Home (19). Home Stage (Stage Two) Home Switch Initial State (False)
(0:49:59.391) Axis (0) Home to Move to (Home) seeking state (True) with direction (Positive). Home Stage(Stage Two)
(0:49:59.403) Axis (0) Starting Velocity SCurve Move at Velocity (1.000000), Accel (1.000000), and Jerk (100.000000)
(0:50:2.10) Axis (0) Limit Found
(0:50:2.510) Axis (0) Home to Move to Switch(Home) with direction (Negative). Home Stage(Stage Two)
(0:50:2.524) Axis (0) Starting Velocity SCurve Move at Velocity (-1.000000), Accel (1.000000), and Jerk (100.000000)
(0:50:3.991) Axis (0) HomePositionSet()
(0:50:4.3) Axis (0) Home Moving to Zero. MoveSCurve with Velocity (1.000000), Accel (1.000000), Decel (1.000000), and Jerk (100.000000)

Here’s the corresponding trace when I set a travel distance:

(0:50:33.49) Axis (0) Home Method Rising Home (19). Home Stage (Stage Two) Home Switch Initial State (False)
(0:50:33.49) Axis (0) Home to Move to (Home) seeking state (True) with direction (Positive). Home Stage(Stage Two)
(0:50:33.61) Axis (0) Starting Velocity SCurve Move at Velocity (1.000000), Accel (1.000000), and Jerk (100.000000)
(0:50:36.364) Axis (0) Limit Found
(0:50:36.865) Axis (0) Home to Move to Switch(Home) with direction (Negative). Home Stage(Stage Two)
(0:50:36.879) Axis (0) Starting Velocity SCurve Move at Velocity (-1.000000), Accel (1.000000), and Jerk (100.000000)

It doesn’t seem to matter what I set the travel distance to (zero/nonzero), though I’ve only tried 0 and 1000.0.

The docs aren’t clear about whether some of the homing parameters should not be set for a specific stage. I just set them all to the same values for each stage.

@todd_mm

Using the Home[VADJ]Set functions without a stage will automatically use the values for all 4 stages. No need to loop through them. The stage overload is there so you can customize the different stages if needed.

HomeTravelDistanceSet is optional. Most customers use 0 which means an unlimited search for the appropriate limits. If you’d like to use a max travel for any given stage, you need to specify it for each given stage.

In your example, you should see Axis (…) Starting Relative Move (…) at Velocity (…), Accel (…), Decel (…), and Jerk (…).

Are you specifying a negative Max Travel?

I only tried 0 and 1000. Does this quantity have to be signed based on the direction of travel?

@todd_mm

It should take an absolute travel distance not a signed value. We handle assigned the appropriate sign ourselves. The 2nd log showed it doing an unlimited Velocity Move rather than a Relative (Max Travel) move. It didn’t evaluate MaxTravel for that stage as greater than 0 when executing. I’m not sure why.

I don’t recall if that log came from a run with the max travel set to 0 or 1000. I saw the same basic behavior (with the motors) either way. I can be more scientific about the test if that would help.

@todd_mm

Are you still seeing odd behavior with CustomConfigSet and HomeTravelDistanceSet? A log would be helpful.

Does it matter if I test this with 8.1.3 vs 8.1.6? I’m not quite ready for 8.1.6, but I can probably do 8.1.6 for the sake of this MWE.

So, I set the PUU to one motor revolution, set the vel/accel params to the same value for all stages, and varied only the travel distance (or not calling the API at all). I tried -100, 0, 100, and not calling the API.

The I/O used as the home switch is just a manual push button tied to input #7 on a Beckhoff DI-8. I start homing, press and hold the button, wait for the motor to change direction, let it run for a second, then release the button. My expectation is that the homing routine should end when I release the button (stage two complete, backed off home switch).

[RMP 8.1.6]

Axis #0
CTB D3: 2541/65542
PUU: 131072
Homing Method: 19 (RSIHomeMethodRISING_HOME)
Home Offset: 0
Home Velocity: 1 (PUU/sec)
Home Acceleration: 1 (PUU/sec/sec)
Home Deceleration: 1 (PUU/sec/sec)
Home Jerk Percent: 100 %
Home Action: 2
Position Error Action: 0

Home Switch I/O: Beckhoff - DI8: 2/66072658 #6/Bit-0
Host(0x06B7C040) F/W(0x0323C040)
Mask(0x00000001) Digital?(1) IsOutput?(0)
State: clear
(-~-> Node) Host(0x06B7C040) F/W(0x0323C040) Mask(0x00000001)
(-~-> NetworkInput) Host(0x06B7C040) F/W(0x0323C040)
Using: Host(0x06B7C040) F/W(0x0323C040), Bit #0


RapidCodeHomeTrace.1.NoTravelDistance.txt

Homing succeeded as expected.

(24:42:12.624) Axis (0) Home Method Rising Home (19).  Home Stage (Stage Two)  Home Switch Initial State (False)
(24:42:12.624) Axis (0) Home to Move to (Home) seeking state (True) with direction (Positive).  Home Stage(Stage Two)
(24:42:12.636) Axis (0) Starting Velocity SCurve Move at Velocity (1.000000), Accel (1.000000), and Jerk (100.000000)
(24:42:16.142) Axis (0) Limit Found
(24:42:16.642) Axis (0) Home to Move to Switch(Home) with direction (Negative).  Home Stage(Stage Two)
(24:42:16.656) Axis (0) Starting Velocity SCurve Move at Velocity (-1.000000), Accel (1.000000), and Jerk (100.000000)
(24:42:18.359) Axis (0) HomePositionSet()
(24:42:18.371) Axis (0) Home Moving to Zero.  MoveSCurve with Velocity (1.000000), Accel (1.000000), Decel (1.000000), and Jerk (100.000000)

RapidCodeHomeTrace.1.TravelDistance0.txt

Stage Two Never Completed (move to back off home switch never ended)

(24:32:27.830) Axis (0) Home Method Rising Home (19).  Home Stage (Stage Two)  Home Switch Initial State (False)
(24:32:27.830) Axis (0) Home to Move to (Home) seeking state (True) with direction (Positive).  Home Stage(Stage Two)
(24:32:27.842) Axis (0) Starting Velocity SCurve Move at Velocity (1.000000), Accel (1.000000), and Jerk (100.000000)
(24:32:32.255) Axis (0) Limit Found
(24:32:32.755) Axis (0) Home to Move to Switch(Home) with direction (Negative).  Home Stage(Stage Two)
(24:32:32.769) Axis (0) Starting Velocity SCurve Move at Velocity (-1.000000), Accel (1.000000), and Jerk (100.000000)

RapidCodeHomeTrace.1.TravelDistance100.txt

Stage Two Never Completed (move to back off home switch never ended)

(24:33:53.385) Axis (0) Home Method Rising Home (19).  Home Stage (Stage Two)  Home Switch Initial State (False)
(24:33:53.385) Axis (0) Home to Move to (Home) seeking state (True) with direction (Positive).  Home Stage(Stage Two)
(24:33:53.397) Axis (0) Max Travel for Stage (Stage Two) is set to (100.000000)
(24:33:53.397) Axis (0) Starting Relative Move (100.000000) at Velocity (1.000000), Accel (1.000000), Decel (1.000000), and Jerk (100.000000)
(24:33:57.812) Axis (0) Limit Found
(24:33:58.312) Axis (0) Home to Move to Switch(Home) with direction (Negative).  Home Stage(Stage Two)
(24:33:58.327) Axis (0) Max Travel for Stage (Stage Two) is set to (100.000000)
(24:33:58.327) Axis (0) Starting Relative Move (-100.000000) at Velocity (1.000000), Accel (1.000000), Decel (1.000000), and Jerk (100.000000)

RapidCodeHomeTrace.1.TravelDistance-100.txt

Stage Two Never Completed (move to back off home switch never ended)

(24:49:48.677) Axis (0) Home Method Rising Home (19).  Home Stage (Stage Two)  Home Switch Initial State (False)
(24:49:48.677) Axis (0) Home to Move to (Home) seeking state (True) with direction (Positive).  Home Stage(Stage Two)
(24:49:48.689) Axis (0) Starting Velocity SCurve Move at Velocity (1.000000), Accel (1.000000), and Jerk (100.000000)
(24:49:52.524) Axis (0) Limit Found
(24:49:53.25) Axis (0) Home to Move to Switch(Home) with direction (Negative).  Home Stage(Stage Two)
(24:49:53.40) Axis (0) Starting Velocity SCurve Move at Velocity (-1.000000), Accel (1.000000), and Jerk (100.000000)

Here’s the program I was running: home_to_io_poc.cpp.
I manually changed values and recompiled.

The issue (resolved in 10.3.4) was related to setting HomeTravelDistanceSet(STAGE_FOUR). In the latest documentation, it notes that the max travel distance for STAGE_FOUR is not used.

Thank you for posting your sample code, it helped us identify the problem! 10.3.4 is in the portal and ready for download.

1 Like