Manually jog the robot TCP (cartesian).
As the jog motion is build from a flow of small incremental jog motions, this command must be called repeatedly to achieve a smooth motion. More information on this in the feature discription .
💡 Check the sample implementation in the code examples .
Version history
0.2.0
Changes
Sts_ER
when MotoLogix command buffer is full
show full history
0.1.0
Changes
- source code ported
- version number reset
- now using semantic versioning
Prerequisites
prerequisite | state |
---|---|
Key switch | REMOTE |
MLX.JoggingMode | TRUE |
Overview
kind | name | type | default | comment |
---|---|---|---|---|
input | Enable | BOOL | Enable this Function Block. | |
input | RobotNumber | DINT | 0 | The robot commanded by this instruction instance. Valid values are 0 to MLX.NumberOfRobots-1. |
input | Directions | ARRAY[0..7] OF DINT | Defines the jog directions for each robot axis: 0 - No operation, 1 - Positive, (-1) - Negative. If robot has less than 8 axes, remaining values are ignored. | |
input | Speed | REAL | Speed to move axis | |
input | UseRotationalSpeed | BOOL | 0 | Units to use for Speed. 0 = (linear units)/sec, 1= deg/sec. When set to 1, the speed of a linear motion between two points is defined as the time is takes to rotate the product at the defined rotational speed. The rotation and linear translation will stop at the same time. |
input | SpeedUnits | DINT | 0 | 0=as percentage from max, 1=as position units/sec |
input | CoordFrame | DINT | 0=World, 1=Tool, 2=User | |
output | Sts_EN | BOOL | Enable bit. This bit will stay high as long as the instruction is enabled. | |
output | Sts_DN | BOOL | Done bit. This bit will turn high when the instruction has finished. | |
output | Sts_ER | BOOL | Error bit. Indicates an error during instruction execution. Call MLxGetErrorDetail for more information. | |
in_out | MLX | MLxData | The MLxData Controller Scope tag. |
Details
Enable
BOOL
For starting this function block. On a rising edge of this input the
internal processing will start which is indicated by the Sts_EN
status signal.
Internal processing steps typically involve:
- checking if required conditions are met
- sending command data to the robot controller (on the next possible occasion)
- receiving answer data from the robot controller
Since the status bits will only be updated as long as the Enable
is active, it is necessary to keep the input enabled until the FB has
completed its entire lifecycle which is signalled by the Sts_DN
(done) status signal.
Disabling the input too early can mess up the MotoLogix command interface and lead to a hangup situation.
RobotNumber
DINT
Specifies the motion device targeted by this MotoLogix function.
The MotoLogix data packet supports a maximum of 4 motion devices on one robot contoller. Examples of motion devices are:
- manipulators (e.g. GP7 robot)
- base axes (e.g. gantry system)
- station axes (e.g. servo gripper)
Each motion device gets its own RobotNumber
(and slot in the data packet).
Some examples:
two robots: R1
and R2
[0] // R1
[1] // R2
[2] // not used
[3] // not used
two robots on a linear track R1B1
and R2B2
[0] // R1
[1] // R2
[2] // B1
[3] // B2
robot with a servo gripper R1S1
[0] // R1
[1] // S1
[2] // not used
[3] // not used
The numbering is fixed in the configuration of the robot controller
(cannot be changed by MotoLogix).
MLxRobotGetProperties
can be used to read this configuration.
It will give you practical information for each motion device
such as: type, axis names, speed- and motion range.
value | explanation |
---|---|
0-3 | Robot number (use
MLxRobotGetProperties
to see the mapping). |
Directions
ARRAY[0..7] OF DINT
Defines the jog directions for each robot TCP axis:
[0] // X
[1] // Y
[2] // Z
[3] // Rx
[4] // Ry
[5] // Rz
[6] // Re (for 7-axis robots)
[7] // R8 (for 8-axis robots)
- Axes which are not relevant for the connected robot are ignored.
- Multiple axes can be moved at the same time.
value | explanation |
---|---|
-1 | Jog in negative direction |
0 | Standstill |
1 | Jog in positive direction |
Speed
REAL
Defines the speed for the TCP jog motion
(range: see
SpeedUnits
).
Allthough the jog speed is limited, this is not a safety speed – to
setup a safe jog environment the optional Functional Safety Unit (FSU
)
is required.
Setting the speed for a linear jog is a bit more complicated than for
an axis jog (e.g.
MLxRobotJogAxes
).
By default, the specified speed is interpreted as linear speed
(in absolute units or as percentage of this range). This is
good for jogging the translational axes (X
, Y
, Z
).
For jogging the rotational axes (Rx
, Ry
, Rz
) however, the speed
needs to be interpreted as rotational speed, which is done by setting
the
UseRotationalSpeed
parameter.
Failing to follow this rule leads to unexpected fast jog motion.
More information on this can be found at MLxRobotMoveLinearAbsolute .
UseRotationalSpeed
BOOL
Specifies how the speed setting for the robot motion should be interpreted.
value | explanation |
---|---|
0 | as linear speed |
1 | as rotational speed |
SpeedUnits
DINT
The desired speed for the linear motion can be be specified as %
or units/sec
.
value | explanation |
---|---|
0 | as percentage of maximum jog speed (range: 0.01-100% ) |
1 | as position units/sec – the type of units depends on the setting of
UseRotationalSpeed |
CoordFrame
DINT
Frame used for jog operation.
Value | Description |
---|---|
0 | World |
1 | Tool |
2 | User |
Sts_EN
BOOL
Status Enabled signal which tells that the FB is currently
enabled. It reflects the status of the Enable
input.
A common use for Sts_EN
is in combination with the Sts_DN
(or Sts_PC
) signal.
This filters the old status which is important because in
the PLC scan where the FB gets enabled the Sts_DN
still has the
status from its previous run (which is probably high) until the FB call
is processed.
CASE state OF
...
10:
// enabling the FB
someMLxFB.Enable := TRUE;
// condition to proceed after FB finished
// --> Sts_DN still has its old status from previous run
IF (someMLxFB.Sts_DN AND someMLxFB.Sts_EN) THEN
state := state + 10;
END_IF;
20:
...
END_CASE;
// FB call
someMLxFB(...);
// --> now Sts_DN has the new status
Sts_DN
BOOL
Status done signal which tells that the FB has finished.
This means the Enable
input can now safely be disabled as the FB has
completed its lifecycle.
This status signal keeps its status until the next time this FB is
enabled. See Sts_EN
on how to filter any old status.
Sts_ER
BOOL
Status error signal which tells that the FB has failed.
The Enable
input can now be disabled as the FB has aborted its lifecycle.
Now it is important to find the cause of the error. In most cases the robot controller has generated an alarm which explains what the problem is.
Recommended next steps:
- Read the alarm details using
MLxGetErrorDetail
- Fix the issue described in the alarm details (e.g. parameter out of range)
- Reset the alarm using
MLxReset
(also clears the motion queue) orMLxResetAndHold
(resets the alarm but leaves the motion queue in place). - Restart the application
If Sts_ER
becomes active but the robot controller does not generate an alarm
you should check the SystemState
and the conditions/prerequisites for
using the FB.
This status signal keeps its status until the next time this FB is
enabled. See Sts_EN
on how to filter any old status.
MLX
MLxData
The MotoLogix variable which acts as the shared memory for a MotoLogix system.
As the PLC runs through its scan cycle each active MotoLogix FB will read from- and write to this MotoLogix variable.
It is also used for processing the data red from- and sent to the robot controller.
There are a few important rules:
MLxCommunicationRead
must be called at the very beginning of the PLC scan cycle.MLxCommunicationWrite
must be called at the very end of the PLC scan cycle.- All other MotoLogix FB’s used in your application must be called inbetween.
- All off this must be handled by the same PLC task, respecting above rules.
Failing to follow above rules can lead to inconsistent data being sent to the robot controller which could result in unexpected motion.
Implementation
fbRobotJogTCP : ARRAY[0..0] OF MLxRobotJogTCP;
// fbRobotJogTCP[0].Enable := ;
// fbRobotJogTCP[0].RobotNumber := ;
// fbRobotJogTCP[0].Directions := ;
// fbRobotJogTCP[0].Speed := ;
// fbRobotJogTCP[0].UseRotationalSpeed := ;
// fbRobotJogTCP[0].SpeedUnits := ;
// fbRobotJogTCP[0].CoordFrame := ;
fbRobotJogTCP[0]( MLX := dummy );
// := fbRobotJogTCP[0].Sts_EN;
// := fbRobotJogTCP[0].Sts_DN;
// := fbRobotJogTCP[0].Sts_ER;