Stop conveyor tracking and execute a linear motion.
This cancels the conveyor tracking, updates the object queue and issues a linear motion command.
It is not possible to blend from the conveyor tracking motion into this motion (there will be a very short standstill).
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 | FALSE |
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 | TargetPosition | MLxAppDataTeachPoint | MLxAppDataTeachPoint containing the target position. | |
input | ConveyorNumber | DINT | Index of the conveyor (internally used by robot controller). Valid values are 0-3. | |
input | ConveyorPosition | DINT | This value must be equal to the CurrentValue of the conveyor. | |
input | KeepInQueue | BOOL | 0 | If set to 1, this part will be moved to the robot specified in NewRobotQueue. If set to 0, the part will be removed from the queue and no longer tracked. |
input | NewRobotQueue | DINT | 0 | If KeepInQueue is set to 1, this parameter holds the robot to move the part to. If NewRobotQueue is the same as RobotNumber, the part is held in the current robot's queue. |
input | TargetType | BOOL | 0 | Axis/TCP position. 0= Axis position 1= TCP position. This will define which data inside the TeachPoint structure to use. In most cases, these values will be the same and lead to the same motion. However, if the data inside the TeachPoint has been modified manually, this parameter can be used to point to the new data. |
input | BlendFactor | DINT | 0 | Valid values: 0-8. This will define how much this motion should be blended into the next motion. Note: an additional motion will need to be added to the queue for this parameter to work correctly. See User Guide for detailed instructions on using this parameter. |
input | BlendType | BOOL | 0 | 0 = Blend based on command position 1 = Blend based on FB position (FPL) |
input | Speed | REAL | Speed to move the Robot. This will be in % Maximum if SpeedUnits = 0 and Absolute Units (mm/sec) if SpeedUnits = 1. | |
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 = % Maximum, 1 = Absolute Value in position units/sec | |
input | Acceleration | REAL | Acceleration rate in % of maximum. | |
input | Deceleration | REAL | Deceleration rate in % of maximum | |
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 will turn HIGH when tracking has been turned off, the object queue has been updated and the motion has been processed/queued. | |
output | Sts_IP | BOOL | In process bit. This Instruction is actively executing, but another instruction may be commanding the active movement. | |
output | Sts_AC | BOOL | Active bit. HIGH if this motion is currently executing. | |
output | Sts_PC | BOOL | Process complete bit. HIGH if this motion has reached the end of its commanded trajectory. | |
output | Sts_ER | BOOL | Error bit. Indicates an error during instruction execution. Call MLxGetErrorDetail for more information. | |
output | PercentComplete | SINT | Percentage of motion that is completed. | |
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)
- tracking motion status
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_PC
(process complete) 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). |
TargetPosition
MLxAppDataTeachPoint
Target position for this motion.
Depending on the setting of
TargetType
the
target can be:
- an axis position (
.AxisPosition
) indegrees
- a TCP position (
.TCPPosition.TCPPosition
) inmm
anddegrees
A TCP position relates to the active user frame. This is the frame
last set by
MLxRobotSetUserFrame
.
After a reboot the active user frame is reset.
ConveyorNumber
DINT
Index of the conveyor (internally used by robot controller). Valid values are 0-3.
ConveyorPosition
DINT
This value must be equal to the CurrentValue of the conveyor.
KeepInQueue
BOOL
This specifies what to do with the current tracking object:
- On a single robot conveyor tracking system the object can be removed.
- On more complex systems with multiple robots and load balancing the object might be moved to a another robot’s object queue.
value | explanation |
---|---|
0 | Remove from the object queue. |
1 | Move to another object queue (specified in
NewRobotQueue
). |
NewRobotQueue
DINT
This specifies the robot number of the object queue to move the object
to in case
KeepInQueue
is set to 1
.
If you want to keep the object in the current object queue this
parameter needs to get the same value as
RobotNumber
.
value | explanation |
---|---|
0-3 | Robot number of the object queue (use
MLxRobotGetProperties
to see the mapping). |
TargetType
BOOL
This defines the type of target for
TargetPosition
.
value | explanation |
---|---|
0 | Axis position |
1 | TCP position |
BlendFactor
DINT
With the BlendFactor parameter you define at what point the motion should begin to blend into the next queued motion.
Blending is key to a fast and smooth robot motion. For the best blending the robot controller requires at least 3 motions (active motion + 2 motions pre-loaded).
Basically there are 3 choices for blending:
- No blending
- Speed dependent blending (recommended)
- Blend by a predefined distance
The BlendFactor is also important for the last motion before a
standstill as it defines the point at which the Sts_PC
signal becomes
active.
Usually you want the robot to be exactly at the target position before
proceeding actions can follow (e.g. closing the gripper). This means you
have to set BlendFactor 0
. Other values will result in Sts_PC
becoming
high before the robot really reached the target position.
Blending between diffent kinds of motions
Previously it was not possible to blend between diffent kinds of
motions (e.g. point-to-point to linear motions or vice-versa) with
BlendFactors other than -1
.
- On YRC1000 and YRC1000micro this limitation was removed by a
system software upgrade
.
This requires parameter
S2C1586=1
. - On DX200 this limitation still exists.
No blending
BlendFactor 0
is used to disable blending for this motion. The robot
will move without cutting the corner. This will add some cycle time as the
robot will have a short standstill exactly on the target position.
Speed dependent blending
BlendFactor -1
is used for blending depending on the speed of the robot.
The faster the robot moves, the more it cuts the corners.
This setting is recommended for most cases as it works for any trajectory. However, if there is a risk of collision (and predictable blending is required) you should blend by a predefined distance.
Fixed distance blending
BlendFactor 1
to 8
are used for blending by predefined distances. This
leads to a predictable and consistent blending. However, when using one of
these predefined blending distances you have to make sure that the
setting is not too large for the motion segment, otherwise
it will not blend at all (resulting in non-smooth motion and increased
cycle time).
These distances are defined by robot parameters which can be changed by the customer. Below table shows the default settings.
parameter | distance [µm] | description |
---|---|---|
S1CxG 33 | 12500 | Blendfactor 1 |
S1CxG 34 | 25000 | Blendfactor 2 |
S1CxG 35 | 50000 | Blendfactor 3 |
S1CxG 36 | 100000 | Blendfactor 4 |
S1CxG 37 | 200000 | Blendfactor 5 |
S1CxG 38 | 300000 | Blendfactor 6 |
S1CxG 39 | 400000 | Blendfactor 7 |
S1CxG 40 | 500000 | Blendfactor 8 |
value | explanation |
---|---|
-1 | speed dependent blending |
0 | no blending |
1-8 | blending fine to coarse |
BlendType
BOOL
This specifies how the internal path planner should handle the blending into the next motion:
- Usually the blending can be based on the robot’s command position.
- Exception is a conveyor tracking motion with
BlendFactor 0
– in this case the blending needs to be based on the robot’s feedback position.
value | explanation |
---|---|
0 | blending based on the command position |
1 | blending based on the feedback position |
Speed
REAL
Speed to move the Robot.
Units depends on the
SpeedUnits
parameter.
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 specified as percentage
or in units/sec
.
value | explanation |
---|---|
0 | as % of maximum (range: 0.01-100 ) |
1 | as position units/sec (range: manipulator specific, see MLxRobotGetProperties ) |
Acceleration
REAL
Acceleration rate for the motion segment created by this instruction.
Usually a value around 80%
is fine. Higher values often do not really
improve the cycle time much further and instead just lead to more wear
and an increased energy consumption.
value | explanation |
---|---|
20-100 | acceleration rate in % of maximum (SCARA manipulators optionally can go up to 130%) |
Deceleration
REAL
Deceleration rate for the motion segment created by this instruction.
Usually a value around 80%
is fine. Higher values often do not really
improve the cycle time much further and instead just lead to more wear
and an increased energy consumption.
value | explanation |
---|---|
20-100 | acceleration rate in % of maximum (SCARA manipulators optionally can go up to 130%) |
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
Done bit. This will turn HIGH when tracking has been turned off, the object queue has been updated and the motion has been processed/queued.
Sts_IP
BOOL
Status in process signal which is high from the moment of enabling the FB (Sts_EN) until the motion has finished (Sts_PC).
This status signal is not used very often. A use case could be to display the pending state of a motion command where the command is in the robot controller’s motion queue waiting for earlier motion commands to be finished.
// pending state
Pending := (someMLxFB.Sts_IP AND NOT someMLxFB.Sts_AC);
Sts_AC
BOOL
Status active signal which tells that the motion issued by this instruction is currently executing.
While the motion is executing the
PercentComplete
status informs about the progress.
Sts_PC
BOOL
Status process complete signal which tells that the motion issued by this instruction is completed. This means the Enable input can now safely be disabled as the FB has completed its lifecycle.
The exact timing for switching Sts_PC
depends on the BlendFactor
which was specified for this motion.
Sts_PC
is often used as the transition condition the application logic
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.
PercentComplete
SINT
Informs about the progress of the motion segment created by this
instruction. The value is represented as whole number 0-100%
.
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
fbRobotConvSyncStopWithLinMot : ARRAY[0..0] OF MLxRobotConvSyncStopWithLinMot;
// fbRobotConvSyncStopWithLinMot[0].Enable := ;
// fbRobotConvSyncStopWithLinMot[0].RobotNumber := ;
// fbRobotConvSyncStopWithLinMot[0].TargetPosition := ;
// fbRobotConvSyncStopWithLinMot[0].ConveyorNumber := ;
// fbRobotConvSyncStopWithLinMot[0].ConveyorPosition := ;
// fbRobotConvSyncStopWithLinMot[0].KeepInQueue := ;
// fbRobotConvSyncStopWithLinMot[0].NewRobotQueue := ;
// fbRobotConvSyncStopWithLinMot[0].TargetType := ;
// fbRobotConvSyncStopWithLinMot[0].BlendFactor := ;
// fbRobotConvSyncStopWithLinMot[0].BlendType := ;
// fbRobotConvSyncStopWithLinMot[0].Speed := ;
// fbRobotConvSyncStopWithLinMot[0].UseRotationalSpeed := ;
// fbRobotConvSyncStopWithLinMot[0].SpeedUnits := ;
// fbRobotConvSyncStopWithLinMot[0].Acceleration := ;
// fbRobotConvSyncStopWithLinMot[0].Deceleration := ;
fbRobotConvSyncStopWithLinMot[0]( MLX := dummy );
// := fbRobotConvSyncStopWithLinMot[0].Sts_EN;
// := fbRobotConvSyncStopWithLinMot[0].Sts_DN;
// := fbRobotConvSyncStopWithLinMot[0].Sts_IP;
// := fbRobotConvSyncStopWithLinMot[0].Sts_AC;
// := fbRobotConvSyncStopWithLinMot[0].Sts_PC;
// := fbRobotConvSyncStopWithLinMot[0].Sts_ER;
// := fbRobotConvSyncStopWithLinMot[0].PercentComplete;