Incorrect behaviour of IndReset after tool change

Options
Fabri91
Fabri91
edited June 21 in RAPID Programming
Hi all,

I'm having an odd issue with the IndReset command.

A robot that we're setting up can load two tools, each equipped with an external axis controlled by the robot's controller, and set up as separate mechanical units - i.e. either the TN1 or TN2 mechanical unit can be equipped, and the motors/encoders connect to the same drive.

Using the tools themselves works alright - at the end of the process IndReset is called to avoid having to "wind back" the tool's axis.

This works until a tool change from one tool to the other is commanded: at that point, calling IndReset (always called with the parameters \RefNum:=0 and \Fwd) causes the axis to be reset not in the vicinity of 0, but an integer number of rotations of the axis (not the motor) offset from this position.

In the linked video (available here) this occurs at the minute 1:35 - the reported angular position is also shown in the RAPID Watch at the bottom of the screen under the name "Eb".
Notice how the position reported by the TN2 mechanical unit jumps from 371.9° to 18011.9°, with an offset of exactly 49 rotations in this instance.

This seems different from the expected behaviour where, given the \RefNum:=0 parameter and the \Fwd parameter, where one would expect the axis to be reset to -348.1°, i.e. wound back two full rotations, in order to end up on the negative side of the reference position.

What could cause this difference in behaviour?

Once this issue occurs, subsequent calls to IndReset with the same options cause the axis to be reset to the same wrong value.

Performing a fine calibration on the axis solves the issue until a new tool change is called, where it occurs again.