Example "Moving a Planar mover to Planar parts"

In this example, a Planar mover is moved onto two Planar parts.

Starting point

You start with a solution that contains a fully configured XPlanar Processing Unit. Two parts, a coordinate system and a mover are created under the XPlanar Processing Unit. A tile is created under each of the two parts.

Example "Moving a Planar mover to Planar parts" 1:

The following geometric situation is set: the two parts are next to each other and the mover starts in the middle of the left part (position P1). Both parts are not movable and the configuration is therefore static.

Example "Moving a Planar mover to Planar parts" 2:

The example is developed on the basis of this configuration.

Example "Moving a Planar mover to Planar parts" 3:

The creation of the initial situation is described in the XPlanar Processing Unit documentation.

Creating a Planar mover and a Planar environment

1. Create a Planar mover for this example, see Configuration.
2. Create a Planar environment, see Configuration.
3. Set the initial parameter XPlanar processing unit OID to the object ID of the XPlanar Processing Unit. This activates the Part feature for all MC Configuration objects (especially for the created Planar mover).

Creating a PLC

See preliminary steps Creating a PLC.
1. Use MAIN to create the mover(s) ("MC_PlanarMover") as follows.
Example "Moving a Planar mover to Planar parts" 4:
This/these represent(s) the mover(s) in the MC Configuration.
2. Create a Planar mover, a state variable for a state machine and a target position for a travel command of the mover, as shown below.
PROGRAM MAIN
VAR
    mover : MC_PlanarMover;
    state : UDINT;
    target_position : PositionXYC;
END_VAR
3. Then program a sequence in MAIN.
This program code activates the mover and moves it to the position x=100 and y=100, which is specified in the part coordinate system of the right part (its object Id is 16#01010030).
CASE state OF
  0:
    mover.Enable(0);
    state := 1;
  1:
    IF mover.MCTOPLC.STD.State = MC_PLANAR_STATE.Enabled THEN
      state := 2;
    END_IF
  2:
    target_position.SetValuesXYCReferenceId(100, 100, 0, 16#01010030);
    mover.MoveToPosition(0, target_position, 0, 0);
    state := 3;
END_CASE

Sending the command

4. To send the command, you must call the mover cyclically with its update method after END_CASE:
mover.Update();

When creating the PLC, a symbol of the "PLC Mover" is created, which can then be linked to the mover instance in the MC project.

1. To build, use the path PLC > Untitled1 > Untitled1 Project > Build.
Example "Moving a Planar mover to Planar parts" 5:
Subsequently, the Planar mover in the "MC Project" (double-click) can be linked with the Link To PLC... button on the Settings tab.
Example "Moving a Planar mover to Planar parts" 6:
In addition, the Planar mover in the "MC Project" (double-click) can be linked with the Link To I/O... button on the Settings tab.
Example "Moving a Planar mover to Planar parts" 7:

Activating and starting the project

1. Activate the configuration via the button in the menu bar Example "Moving a Planar mover to Planar parts" 8:.
2. Set the TwinCAT system to the "Run" state via the Example "Moving a Planar mover to Planar parts" 9: button.
3. Log in the PLC via the button in the menu bar Example "Moving a Planar mover to Planar parts" 10:.
4. Start the PLC via the Play button in the menu bar.

At the end of the state machine (state=3), the mover is in the desired position. The position is specified in the coordinate system and not, like the target_position, in the part coordinate system of the right-hand part (its object Id is 16#01010030). Both systems are shifted by 240 mm in the x-direction. It can also be seen that the axes a, b and z exhibit a slight noise. This is generated by the simulation of the XPlanar Processing Unit and has an effect on the initially accepted position when starting up.

Example "Moving a Planar mover to Planar parts" 11: