Back to top

Rehoming in a Pipe Network application

Typically in many applications, homing motion is done first, and  then addition motion related to manual or automatic modes of operation.

In the pipe network homing is typically done at the axis level with Axis block function calls before a pipe is connected to the axis block. Once a pipe is connected to the axis then the axis motion is a sum of the Axis motion plus the motion that comes through the as shown here:

image

 

If rehoming after pipe motion has been commanded through a pipe by a MLMst, MLPmp , or MLSmp pipe blocks care must be taking to account for the position that comes through a pipe network block. Often this position will be set to 0.For example if after an initial home the MLMst block is used to command a position of 5000. When a rehome is then done the pipe network position must be cleared or a 5000 offset will remain.

One method to eliminate the pipe position would be to include the following in the homing code:

        Before  the homing move disconnect the pipe and force the Master position to 0. Example:

       MLCNVDisconnect( PipeNetwork.CNV1);

       MLMstForcePos( PipeNetwork.SMotion1,LReal#0.0 );

 

      After the homing move and typically MLAxisWritePos can be called to reset position, reconnect the pipe

      MLCNVConnect( PipeNetwork.CNV1, PipeNetwork.Axis1 );

 

Comments

mahendra.kane's picture
mahendra.kane
I had a similar problem in my KAS program recently.
I was using MlMstAbs to run all axes synchronously with the Master & then using MlAxisAbs, MlAxisRel commands for individual axes motions afterwards.
I found that after MlMstAbs is used, the pipe position was not getting resetted automatically which was causing additional position offset when I was using MlAxisAbs, MlAxisRel.

It was really difficult to find out in the KAS help (which in general is really good) about how to reset the Pipe position of individual axis.
After much struggle, I finally found the solution as below-

(I disconnected the pipes from Master when I wanted to make individual move)
         MlCnvDisConnect(PipeNetwork.CNV_A1);
         MlCnvDisConnect(PipeNetwork.CNV_A2);
         MlCnvDisConnect(PipeNetwork.CNV_A3);
          
         MlMstForcePos(PipeNetwork.MASTER, LREAL#0.0);          
        
         MlAxisWritePos(PipeNetwork.AXI_A1_Axis,MlAxisReadActPos(PipeNetwork.AXI_A1_Axis));
         MlAxisWritePos(PipeNetwork.AXI_A2_Axis,MlAxisReadActPos(PipeNetwork.AXI_A2_Axis));
         MlAxisWritePos(PipeNetwork.AXI_A3_Axis,MlAxisReadActPos(PipeNetwork.AXI_A3_Axis));

(I re-wrote the actual position of axis using MlAxisWritePos in order to reset the Pipe position of each axis)
......(machine logic)


....
         MlCnvConnect(PipeNetwork.CNV_A1, PipeNetwork.AXI_A1_Axis);
          MlCnvConnect(PipeNetwork.CNV_A2, PipeNetwork.AXI_A2_Axis);
          MlCnvConnect(PipeNetwork.CNV_A3, PipeNetwork.AXI_A3_Axis);

(I connected the pipes back to Master when I wanted to make next MlMstAbs move)


I think there is scope to improve KAS help on this aspect.
May be a small example explaining the way to reset pipe position when Master & axes commands are mixed in same project will be helpful.

I also propose KAS development team to create new readymade function like MlAxisResetPipePos.
This will remove all confusion about resetting pipe position.