This is part of 2.1.0latest release.

About MotoLogix functions

  6 minutes   Antoine Rioual  

Explaining the life cycle and status signals of MotoLogix functions.

MotoLogix functions can be differentiated in a few categories:

  • System commands
    Have a short life cycle and are processed immediately (parallel).
  • Motion commands
    Have a long life cycle and are processed sequentially (buffered).
  • Common commands
    Have a short life cycle and are processed sequentially (buffered).

Later in this section we will explain the behaviour of each category but first we will look at basics around using MotoLogix functions.

Prerequisites

In general MotoLogix commands require:

  • The pendant keyswitch to be in remote
  • Robot standstill if they are writing to persistent storage (files which can be viewed on the pendant).
Detailed information about the prerequisites of each function can be found in the documentation of the Functions.

Volatile data

Most data sent by MotoLogix commands is stored in the robot controller’s volatile memory. This is important to know as it means that data sent by the commands:

  • Is lost after a reboot of the robot controller.
  • Is not visible on the programming pendant.
Never trust on existing data in the robot controller after a reboot or switching the pendant to teach.
Never trust on existing data in the robot controller after a reboot or switching the pendant to teach mode. After such events you always need to send the data before issueing any motion commands.

INFORM jobs

Even if MotoLogix in theory can be used parallel to INFORM jobs, it is advised to prevent such “hybrid” solutions and stick with a single technology.

For MotoLogix systems we advise to remove any INFORM jobs to prevent any technical issues or confusion.

Status signals

Detailed information about the status signals of each function can be found in the documentation of the Functions.

Some of the status signals have a kind of special behaviour which is important to understand before starting the programming.

  • Except for Sts_EN, most status signals retain their status until the next time the function is enabled.

  • This is by design (and useful for troubleshooting) but can lead to a timing problem in the application code as the function call is often processed below the state machine logic.

  • As a result, the transition of the state machine can occur too soon as the transition condition (e.g. Sts_DN) is not yet reset and still has the status from the previous run.

A code example might help to understand this phenomenon:

Example:

CASE state OF
...
10:
  // enabling the FB
  FB_Reset.Enable := TRUE;

  // condition to proceed after FB finished
  // --> Sts_DN still has its old status from previous run
  IF (FB_Reset.Sts_DN AND FB_Reset.Sts_EN) THEN
    state := 20;
  END_IF;

20:
  ...
END_CASE;

// FB call
FB_Reset(...);
// --> now Sts_DN has the new status
To prevent timing issues you should always include Sts_EN as condition. This signal becomes active after the function call was processed and thus helps filtering out any old status information.

Keep enabled

It is not allowed to reset the Enable input of a function before the lifecycle has completed.

This is important as one of the last tasks of the function will be to cleanup and prepare the interface for the next command.

Resetting the Enable input too early can mess up the MotoLogix command interface and lead to a hangup situation.

Another important reason to keep the function enabled “all the way” is to get updates on the status signals. Especially for motion commands it is crucial to know the state of each buffered- or executing command.

Monitor the exact state of each buffered motion command by keeping the Enable input active until the motion is completed (Sts_PC).

Commands

System commands

These instructions interact with the MotoLogix system state (see MLX.SystemState).

An example of a state change initiated by a system command is enabling the servo drives using MLxEnable.

Since system commands often need to be executed as soon as possible they do not use the command buffer mechanism but instead each system command has its own command bit in MLX.InternalData.WritePacket.signals.

System commands have a short life cycle and very few status bits:

system-command

eventdescription
t1 - t7Command executed successfully
t11 - t17Command executed with error

Motion commands

These instructions send motion commands to the robot controller’s motion queue.

This uses the command buffer mechanism in MLX.InternalData.WritePacket.Commands where up to 20 commands can be processed (sequentially) by the MotoLogix interface.

An example of a motion command is a Point to Point (PtP) motion using MLxRobotMoveAxisAbsolute.

Below timing diagram not only shows the larger amount of status signals but also the longer lifecycle. This due the fact that it depends on:

  • Duration of this motion.
  • Waiting to finish previous motions (in case of pre-sending motions – which is the usual case).

motion-command

eventdescription
t1 - t9Life cycle of 1st motion command
t4 - t14Life cycle of 2nd motion command
t31st motion command added to the motion queue
t4Pre-load 2nd motion command
t62nd motion command added to the motion queue
t6 - t82nd motion waiting
t81st motion finished, 2nd motion starts
t132nd motion finished

Common commands

This last category contains all other commands sent to the robot controller.

Some instructions (e.g. MLxRobotSetUserFrame are scheduled in the motion queue (just as the motion commands). Others have no relation with the motion queue.

These commands use the command buffer mechanism and will be processed (sequentially) by the MotoLogix interface as described earlier.

The timing diagram and status signals are similar to the system commands:

system-command

eventdescription
t1 - t7Command executed successfully
t11 - t17Command executed with error

Transitions

Looking at the status signals and timing diagrams we can say the following for motion commands:

The combination of Sts_PC and Sts_EN is useful as a transition condition in the application code – meaning that the motion is finished.
The combination of Sts_DN and Sts_EN is useful as condition to pre-send the next motion.

And for all other commands:

The combination of Sts_DN and Sts_EN is useful as a transition condition in the application code – meaning that the instruction is finished.

Timing

When enabling multiple MotoLogix command instances each of them will get a place allocated in the MotoLogix command buffer.

But if the application code is written in such way that the robot gets only a single move command at a time – which means that the robot motions cannot be blended – the same place in the command buffer will be reused.

In that case it is important that there is at least one plc scan between disabling the first and enabling the next. This is needed to cleanup the data and prepare the interface for the next command.

A good practice is using the CASE statement for programming your state machines and placing the FB calls below the state machine. This allows only one transition per PLC scan and prevents such timing issues.

example of non blending motion:

// cyclically reset the enable signals
MLxFB1.Enable := FALSE;
MLxFB2.Enable := FALSE;
...
// state machine logic
CASE state OF
...
10:
  // enabling the FB
  MLxFB1.Enable := TRUE;
  // condition to proceed after motion finished
  IF (MLxFB1.Sts_PC AND MLxFB1.Sts_EN) THEN
    state := 20;
  END_IF;
20:
  MLxFB2.Enable := TRUE;
  IF (MLxFB2.Sts_PC AND MLxFB2.Sts_EN) THEN
    state := 30;
  END_IF;
  ...
END_CASE;

// FB calls
MLxFB1(...);
MLxFB2(...);

Pages built with Hugo - 23 Apr 2024 11:54 CEST