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:
- 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;
- Make the configuration and the connection to the robot. Use the User_PRG.Init action, for example. If necessary, replace the name "Robot" in "Interface_Robot" and "HMI_Robot" with the name of the robot in your MOVISUITE® project.
(* Typ *)
stConfigRotaryTable.eUserCoordSysType := SEW_MK_Robotics.
SEW_RobUserCs.SEW_IRobUserCs.E_UserCoordSysType.Rotary;
(* Zero point of the rotary table or of the USER coordinate system relative to BASE *)
stConfigRotaryTable.alrOrigin[1] := 200.0; // mm in X-direction
stConfigRotaryTable.alrOrigin[2] := 0.0; // mm in Y-directtion
stConfigRotaryTable.alrOrigin[3] := 0.0; // mm in Z-direction
stConfigRotaryTable.alrOrigin[4] := 0.0; // degrees around Z-axis
stConfigRotaryTable.alrOrigin[5] := 0.0; // degrees around Y-axis
stConfigRotaryTable.alrOrigin[6] := 0.0; // degrees around X-axis
(* Positive direction of rotation of the rotary table Z_negative, Z_positive (default) *)
fbRotaryTable.eMotionDirection := SEW_MK_Robotics.
SEW_RobUserCs.SEW_IRobUserCs.E_CartesianDirection.Default;
(* Connection to the robot *)
fbRotaryTable.stConfig := stConfigRotaryTable;
Interface_Robot.LinkIUserCoordSys_Segment(fbRotaryTable);
HMI_Robot.fbSimu3D.AddUserCS(fbRotaryTable, 1);
xInitDone := (* xInitDone AND *) fbRotaryTable.Init();
- 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).