Synchronized movement with a rotary table

INFORMATION

The MOVIKIT® Robotics add-on ConveyorTracking is required to run this application example.

For synchronized movement with a rotary table (rotary table tracking), moving USER coordinate systems are used as in "conveyor tracking".

The function is used analogously to the procedure described in chapter Synchronized movement with a conveyor belt (conveyor tracking). However, note the following differences:

  • The following type must be selected in the configuration:

stConfigRotaryTable.eUserCoordSysType :=
SEW_MK_Robotics.SEW_RobUserCs.SEW_IRobUserCs.
   E_UserCoordSysType.Rotary;

  • The position signal lrSetpointPosition is the continuous sequence of the angles of rotation around the Z-axis of the USER coordinate system of the rotary table in degrees. lrSetpointPosition should be within the [-180°, 180°] range. Other values are automatically illustrated in this range.
  • Changing directly from/to the rotary table USER coordinate system is only possible from/to BASE.

 

This results in the following sample code in the IEC program:

  1. Create a ConveyorOrRotaryTable function block instance and a configuration variable. You can use, for example, the declaration part of the User_PRG program.

fbRotaryTable :

SEW_MK_Robotics.SEW_RobUserCs.ConveyorOrRotaryTable;

stConfigRotaryTable :

SEW_MK_Robotics.SEW_RobUserCs.SEW_IRobUserCs.ST_Config;

  1. Make the configuration and the connection to the robot. Use the User_PRG.Init action, for example. If necessary, replace the name "MyRobot" in "Interface_MyRobot" and "HMI_MyRobot" with the name of the robot in your MOVISUITE® project.

(* Typ *)

stConfigRotaryTable.eUserCoordSysType := SEW_MK_Robotics.

SEW_RobUserCs.SEW_IRobUserCs.E_UserCoordSysType.Rotary;

(* Nullpunkt des Drehtischs bzw. des USER-Koordinatensystems relativ zu BASE *)

stConfigRotaryTable.alrOrigin[1] := 200.0; // mm in X-Richtung

stConfigRotaryTable.alrOrigin[2] := 0.0; // mm in Y-Richtung

stConfigRotaryTable.alrOrigin[3] := 0.0; // mm in Z-Richtung

stConfigRotaryTable.alrOrigin[4] := 0.0; // Grad um Z-Achse

stConfigRotaryTable.alrOrigin[5] := 0.0; // Grad um Y-Achse

stConfigRotaryTable.alrOrigin[6] := 0.0; // Grad um X-Achse

(* Positive Drehrichtung des Drehtischs Z_negative, Z_positive (Default) *)

fbRotaryTable.eMotionDirection := SEW_MK_Robotics.
SEW_RobUserCs.SEW_IRobUserCs.E_CartesianDirection.Default;

(* Anbindung an den Roboter *)

fbRotaryTable.stConfig := stConfigRotaryTable;

Interface_MyRobot.LinkIUserCoordSys_Segment(fbRotaryTable);

HMI_MyRobot.fbSimu3D.AddUserCS(fbRotaryTable, 1);

xInitDone := (* xInitDone AND *) fbRotaryTable.Init();

  1. Assign the position profile of the USER coordinate system continuously in the HighPrio task of the fbRotaryTable.lrSetpointPosition property. Preferably use the User_PRG.ReadActualValues action for this.
    • Example: USER coordinate system is moved by means of sine. To that end, define, for instance, a variable lrSinArg in the declaration part of the User_PRG program.

lrSinArg := lrSinArg + 0.0001;

fbRotaryTable.lrSetpointPosition :=

120.0(* Grad *) * SIN(lrSinArg);

The SRL program and the notes regarding changing the coordinate system are the same as in chapter Synchronized movement with a conveyor belt (conveyor tracking).