Motion Axis Time Cam (MATC)

CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580,
Compact GuardLogix
5380, and
GuardLogix
5580 controllers
The Motion Axis Time Cam (MATC) instruction provides electronic camming of an axis as a function of time or between any two axes in the Master Driven mode.
When executed, the specified axis is synchronized with time or to the Master axis using a Cam Profile established by the
Logix Designer
Cam Profile Editor, or Motion Calculated Cam Profile (MCCP) instruction.
The instruction also provides an easy means to cancel a running time cam anywhere during the cam execution and replace it with a different profile. The replacement is done immediately or scheduled at a specific position in Master Driven mode.
The MATC instruction can be configured for either Time Driven or
  • Time Driven Mode: When executed, the Slave axis is synchronized with time by using the Cam Profile. Only immediate cam replacement is possible for Time Driven Mode.
  • Master Driven Mode: When executed, the Slave axis is synchronized to the Master axis by using the Cam Profile. MDAC instruction is used to set a Master: Slave relationship for Master Driven Mode. Refer to the MDAC Instruction for further reference.
  • This is a transitional instruction. Follow these steps when using it:
    • In ladder logic, insert an instruction to toggle the rung-condition-in from false to true each time the instruction should execute.
    • In a Structured Text routine, insert a condition for the instruction to cause it to execute only on a transition.
Architecture and safety support
Architecture
Standard
Safety
CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, and GuardLogix 5570 controllers
Yes
No
Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers
Yes
No
Available Languages
Ladder Diagram
MATC_LD_v34
Function Block
This instruction is not available in function block.
Structured Text
MATC(Axis, MotionControl, Direction, CamProfile, DistanceScaling, TimeScaling, ExecutionMode, ExecutionSchedule, LockPosition, CamType, LockDirection, InstructionMode);
Operands
Ladder Diagram
Operand
Type
Tip:
AXIS_CONSUMED is supported by
Compact GuardLogix
5580,
CompactLogix
5380, and
CompactLogix
5480 controllers only.
Type
Tip:
AXIS_GENERIC is supported by the
ControlLogix
5570 and the
GuardLogix
5570 controllers only.
Format
Description
Axis
AXIS_CIP_DRIVE
AXIS_VIRTUAL
AXIS_CIP_DRIVE
AXIS_SERVO
AXIS_SERVO_DRIVE
AXIS_GENERIC
AXIS_GENERIC_DRIVE
AXIS_VIRTUAL
Tag
The type of the axis to which the cam profile applies. Ellipsis launches the Axis Properties dialog.
For controllers that support the REF_TO motion data types, the supported axis operand type can be replaced by an equivalent REF_TO type.
Motion Control
MOTION_INSTRUCTION
MOTION_INSTRUCTION
Tag
Structure used to access block status parameters.
Direction
DINT
DINT
Immediate
Relative direction of the Slave axis to the aster axis:
0 = Same – The Slave axis position values are in the same sense as the time or the Master axis position values.
1 = Opposite – The Slave axis position values are opposite sense of the time or the Master axis position value.
2 = Reverse – The current or previous direction of the cam is reversed on execution. When executed for the first time with Reverse selected, the control defaults the direction to Opposite..
3 = Unchanged – this allows other cam parameters to be changed without altering the current or previous camming direction. When executed for the first time with Unchanged selected, the control defaults the direction to Same.
Cam Profile
CAM_PROFILE
CAM_PROFILE_EXTENDED
CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580,
Compact GuardLogix
5380, and
GuardLogix
5580 controllers
Use the Motion Redefine Position (MRP) instruction to change the command or actual position of an axis. The value specified by Position is used to update the Actual or Command position of Axis. The position redefinition can be calculated on an Absolute or Relative basis. If Absolute is selected the Position value is assigned to the current Actual or Command position. If Relative is selected the Position value is added as a displacement to the current Actual or Command position. The process of redefining the current axis position has no affect on motion in progress as the instruction preserves the current servo following error during the redefinition process. As a result, axis position can be redefined on-the-fly without disturbing axis motion.
Available Languages
Ladder Diagram
MRP_LD_avail_v31
Function Block
This instruction is not available in function block.
Structured Text
MRP(Axis,MotionControl,Type,PositionSelect,Position);
Operands
Ladder Diagram and Structured Text
Operand
Type
Tip:
AXIS_CONSUMED is supported by
Compact GuardLogix
5580,
CompactLogix
5380, and
CompactLogix
5480 controllers only.
Type
Tip:
AXIS_GENERIC is supported by the
ControlLogix
5570 and the
GuardLogix
5570 controllers only.
Format
Description
Axis
AXIS_CIP_DRIVE
AXIS_VIRTUAL
AXIS_CIP_DRIVE
AXIS_VIRTUAL
AXIS_SERVO
AXIS_SERVO_DRIVE
Tag
Name of the axis to perform operation on.
Motion Control
MOTION_INSTRUCTION
Tag
Structure used to access instruction parameters.
Type
BOOLEAN
Immediate
The way you want the redefinition operation to work. Select either:
0 = absolute
1 = relative
Position Select
BOOLEAN
Immediate
Choose what position to perform the redefinition operation on. Select either:
0 = actual position
1 = command position
Position
REAL
Immediate or Tag
The value to use to change the axis position to or offset to current position.
See
Structured Text Syntax
for more information on the syntax of expressions within structured text.
For the operands that require you to select from available options, enter your selection as:
This Operand
Has These Options Which You
Enter as Text
Or Enter as a Number
Type
Absolute
Relative
0
1
PositionSelect
Actual
Command
0
1
MOTION_INSTRUCTION Structure
Mnemonic
Description
.EN (Enable) Bit 31
It is set when the rung makes a false-to-true transition and remains set until the servo message transaction is completed and the rung goes false.
.DN (Done) Bit 29
It is set when the axis' position action has been successfully redefined.
.ER (Error) Bit 28
It is set to indicate that the instruction detected an error, such as if you specified an unconfigured axis.
Description
The MRP instruction directly sets the actual or command position of the specified axis to the specified absolute or relative position. No motion is caused by this instruction—the current axis position is simply redefined. Select or enter the desired Axis, Type, Position Selection, and enter a value or tag variable for the desired New Position.
If the targeted axis does not appear in the list of available axes, the axis has not been configured for operation. Use the Tag Editor to create and configure a new axis.
The MRP instruction may be used while the axis is moving as well as when it is at rest. MRP is used to redefine position on-the-fly for certain registration, slip compensation, and re-calibration applications.
Selection
Description
Absolute Mode
When Absolute is selected or entered as the MRP Type, the New Position specifies the new absolute position of the axis. No motion occurs—the current axis position (actual or command) is simply redefined to be the specified new position.
If software overtravel limits are used (refer to Motion Axis Object specification for more information on software overtravel configuration), the new position must be between the Max Positive and Max Negative Travel configuration values. Otherwise a software overtravel fault is generated when the instruction is executed.
Important:
If software overtravel limit checking is in effect, execution of an MRP in Absolute Mode may invalidate the current Max Positive and Max Negative Travel limits in the absolute sense. Exercise caution when redefining the absolute position of an axis that has travel limits.
Absolute and relative mode MRP instructions have the same effect when the axis is not moving. When the axis is moving, however, absolute mode introduces a position error equal to the motion of the axis during the time it takes to execute the MRP instruction and assign the new position. Relative mode does not introduce this error and guarantees an exact correction independent of axis speed or position.
Relative Mode
When Relative is selected or entered as the MRP Type, the New Position value is used to offset the current position of the axis. No motion occurs—the current axis position (actual or command) is simply redefined to be the current position plus the specified new position.
In relative mode, axis position is redefined in such a way that no position errors are introduced if the axis is moving. It is particularly useful for unwinding axis position under program control rather than using the built-in rotary axis feature.
Absolute and relative mode MRP instructions have the same effect when the axis is not moving. When the axis is moving, however, absolute mode introduces a position error equal to the motion of the axis during the time it takes to execute the MRP instruction and assign the new position. Relative mode does not introduce this error and guarantees an exact correction independent of axis speed or position.
Actual Position
When Actual is selected or entered as the MRP Position Selection, the New Position is directly applied to the actual position of the physical axis. The command position of the axis is also adjusted along with the new actual position to preserve any position error which exists. This ensures that there is no unexpected motion of the axis when the positions are redefined. See the Motion Axis Object Specification for more discussion of command position, actual position, and position error.
Command Position
When Command is selected or entered as the MRP Position Selection, the New Position is directly applied to the command position of the servo or imaginary axis. For an axis with a Position Loop type of Feedback Only, the Command Position and the Actual Position are the same. The MRP can be used with ether the Command or Actual Position with the same effect. The actual position of servo axes is also adjusted along with the new command position to preserve any position error which exists. This ensures that there is no unexpected motion of the axis when the positions are redefined.
Command position is the desired or commanded position of a servo as generated by any previous motion instructions. Actual position is the current position of a physical or virtual axis as measured by the encoder or other feedback device. Position error is the difference between these two and is used to drive the motor to make the actual position equal to the command position. The Figure below shows the relationship of these three positions.
MRP Command postion
To successfully execute a MRP instruction, the targeted axis must be configured as either a Servo or Feedback Only axis. Otherwise, the instruction errs.
Important:
The instruction execution may take multiple scans to execute because it requires multiple coarse updates to complete the request. The Done (.DN) bit is not set immediately, but only after the request is completed.
In this transitional instruction, the relay ladder, toggle the Rung-condition-in from cleared to set each time the instruction should execute.
Master Driven Speed Control (MDSC) and the MRP Instruction
You can execute an MRP on the Master or the Slave axes or coordinate system when an MDSC is active.
The Master axis position is changed when an MRP is executed (goes IP) on the Master while it is moving in MDSC mode; the slave is not affected.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See
Common Attributes
for operand-related faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
The .EN, .DN, .ER, and .IP bits are cleared to false.
Rung-condition-in is false
The .EN bit is cleared to false if the .DN or .ER bit is true.
Rung-condition-in is true
The .EN bit is set to true and the instruction executes.
Postscan
N/A
Structured Text
Condition/State
Action Taken
Prescan
See Prescan in the Ladder Diagram table.
Normal execution
See Rung-condition-in is false, followed by rung is true in the Ladder Diagram table.
Postscan
See Postscan in the Ladder Diagram table.
Error Codes
See Error Codes (ERR) for Motion Instructions.
Extended Error Codes
Extended Error Codes provide additional instruction specific information for the Error Codes that are generic to many instructions. See
Motion Error Codes (.ERR)
for Motion Instructions. The following Extended Error codes help to pinpoint the problem when the MRP instruction receives a Servo Message Failure (12) error message.
Associated Error Code (decimal)
Extended Error Code (decimal)
Meaning
SERVO_MESSAGE_FAILURE (12)
Device in wrong state (16)
Redefine Position, Home, and Registration 2 are mutually exclusive.
Extended Error codes for the Parameter Out of Range (13) error code work a little differently. Rather than having a standard enumeration, the number that appears for the Extended Error code refers to the number of the operand as they are listed in the faceplate from top to bottom with the first operand being counted as zero. Therefore for the MRP instruction, an extended error code of 4 would refer to the Position operand’s value. You would then have to check your value with the accepted range of values for the instruction.
MRP Changes to Single Axis Status Bits
The AxisHomedStatus bit is not impacted by the execution of the MRP instruction. The status is the same before and after the MRP is execution. If the axis has been homed using the absolute home procedure, the AbsoluteReferenceStatus is set. AxisHomedStatus may also be set is the axis has not been subject to a power cycle. AbsoluteReferenceStatus is cleared when the MRP is executed and this is only true to Axis_Servo_Drive axis. This indicates the axis position is no longer referenced to the absolute home position.
Examples
Example 1
Ladder Diagram
MRP_LD_ex1_v31
Example 2
Ladder Diagram
MRP_LD_ex2_v31
CAM_PROFILE
CAM_PROFILE_EXTENDED
Array
Tag name of the calculated Cam Profile array that is used to establish the Time/Slave or Master/Slave position relationship. Only the zero array element ([0]) is allowed for the Cam Profile array. Ellipsis launches Cam Profile Editor.
Use the CAM_PROFILE_EXTENDED type for this operand to enable access to double precision (64-bit LREAL) cam data members.
Distance Scaling
REAL
REAL
Immediate or Tag
Scales the total distance covered by the Slave axis through the Cam profile.
Time Scaling
REAL
REAL
Immediate or Tag
When the Instruction Mode is Time Driven, scales the time interval covered by the Cam Profile.
When the Instruction Mode is Master Driven, scales the total distance covered by the Master axis through the Cam Profile.
Execution Mode
DINT
DINT
Immediate
Determines if the Cam profile is executed only one time or repeatedly.
0 = Once – Once started, the Slave axis follows the Cam profile until the Cam boundary is crossed. On crossing of the Cam boundary, Cam motion on the Slave axis stops and the Process Complete bit is set. The Time Cam Status bit in Slave axis’ Motion Status word is reset. The Slave motion does not resume if the time or Master axis moves back into the Cam profile range.
1 = Continuous – Once started the Cam profile is executed indefinitely. This feature is useful in rotary applications where it is necessary that the Cam position run continuously in a rotary or reciprocating fashion.
Execution Schedule
DINT
DINT
Immediate
Selects the method for executing the Cam profile.
0 = Immediate – The Slave axis is immediately locked to the time, or the Master axis and the camming process begins.
1 = Pending – Lets user blend a new Time cam execution after an in-process time cam is finished. When Pending is selected, the Lock Position is ignored.
Lock Position
REAL
REAL
Immediate
When the Instruction Mode is Master Driven, the Lock Position is the Master axis absolute position where the Slave axis locks to the Master axis and starts following the Master axis.
If Execution Schedule is Pending or Immediate, Lock Position is ignored.
If the Instruction Mode is Time Driven, Lock Position is ignored.
Cam Type
DINT
DINT
Immediate
0 = New Cam – New Cam should be used when the user wants the programmed cam to be a completely new cam. This is the default value for the Cam Type parameter and provides backward compatibility for the Studio 5000 Logix Designer application.
1 = Replace and Restart – The Replacement Cam replaces the Active Cam. The replacement happens without any consideration of velocity, acceleration, or jerk disturbances.
2 = Replace and Continue – The Replacement Cam replaces the Active Cam at any point, when it is in progress. At the replacement point the Replacement Cam starts to interpolate the Slave axis.
This operand is new with version 34 of
Logix Designer
.
Lock Direction
DINT
DINT
Immediate
Real or
Tag
When the Instruction Mode is Master Driven, this determines the direction of the Master axis that generates Slave motion according to the Cam profile.
0 = None
Note: If the Instruction mode is Time Driven, then Lock Direction should be None.
1 = Immediate Forward Only – The Slave axis is immediately locked when the Master axis is moving in the forward direction.
2 = Immediate Reverse Only - The Slave axis is immediately locked when the Master axis is moving in the reverse direction.
3 = Position Forward Only - The Cam profile starts when the Master axis position crosses the Lock Position in the forward direction.
4 = Position Reverse Only - The Cam profile starts when the Master axis position crosses the Lock Position in the reverse direction.
Instruction Mode
DINT
DINT
Immediate
Specifies if a MATC should be executed in:
0 = Time Driven Mode - When executed, the Slave axis is synchronized with time by using the Cam profile.
1 = Master Driven Mode - When executed, the Slave axis is synchronized to the Master axis by using the Cam profile
Structured Text
MATC (Axis, MotionControl, Direction, CamProfile, DistanceScaling, TimeScaling, ExecutionMode, ExecutionSchedule, LockPosition, CamType, LockDirection, InstructionMode);
The operands are the same as the operands for the relay ladder MATC instruction. For the array operands, you do not have to include the array index. If you do not include the array index, the instruction starts with the first element in the array ([0]).
For the array operands, you do not have to include the array index. If you do not include the index, the instruction starts with the first element in the array ([0]).
See Structured Text Syntax for more information on the syntax of expressions within structured text.
For the operands that require you to select from available options, enter your selection as:
This Operand
Has These Options Which You
Enter as Text
Or Enter as a Number
ExecutionMode
Once
Continuous
0
1
ExecutionSchedule
Immediate
Pending
0
1
CamType
New Cam
Replace and Restart
Replace and Continue
0
1
2
LockDirection
None
Immediate Forward Only
Immediate Reverse Only
Position Forward Only
Position Reverse Only
0
1
2
3
4
Instruction Mode
Time Driven Mode
Master Driven Mode
0
1
MOTION_INSTRUCTION Structure
Mnemonic
Description
.EN (Enable) Bit 31
It is set when the rung makes a False-to-True transition and remains set until the rung goes False.
.DN (Done) Bit 29
It is set when the time cam is initiated.
.ER (Error) Bit 28
It is set to indicate that the instruction detected an error, such as if you specified an unconfigured axis.
.IP (In Process) Bit 26
It is set on positive rung transition and cleared if either superseded by another Motion Axis Time Cam command, or cancelled by a stop command, merge, shut down, or servo fault.
.AC (Active) Bit 23
Tip:
Supported only on
This information applies to the
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370,
GuardLogix
5570,
Compact GuardLogix
5380,
CompactLogix
5380,
CompactLogix
5480,
ControlLogix
5580, and
GuardLogix
5580 controllers. Controller differences are noted where applicable.
. For other controllers, the .AC bit appears on the instruction faceplate but is inactive and is always equal to False.
It is set when the cam begins interpolation of the Slave axis.
It is reset when the Active cam execution completes or cancelled by a stop command, merge, shut down, or servo fault.
.PC (Process Complete) Bit 27
It is cleared on positive rung transition and set in ONCE Execution Mode, when the time in Time Driven Mode or position of the Master axis in Master Driven mode leaves the range defined by the active Cam profile.
TIP:
Version 34 and newer: The information in the MOTION_INSTRUCTION Structure Table pertaining to the .AC bit applies to the Compact GuardLogix (5380), CompactLogix (5380), CompactLogix (5480), ControlLogix (5580), GuardLogix (5580) and Logix Emulate series of controllers only. For other controllers, the .AC bit is shown on the instruction faceplate but is inactive and is always equal to False.
Description
The MATC instruction executes a Time Cam Profile set up by using the Motion Calculated Cam Profile (MCCP) instruction or by the Studio 5000 Logix Designer application Cam Profile Editor. No maximum velocity, acceleration, or deceleration limits are used in this instruction. The designated Cam profile derived from the associated cam table determines the speed, acceleration, and deceleration of the Slave axis.
WARNING:
The maximum velocity, acceleration, or deceleration limits established during axis configuration do not apply to electronic camming.
The Direction input parameter defines the direction of the Slave axis motion relative to the Master axis. As applied to the Slave axis, the camming direction can be explicitly set as the Same or Opposite or set relative to the current camming direction as Reverse or Unchanged.
The user can use the Distance and Time Scaling functionality to scale Slave motion based on a standard Cam Profile without creating a cam table and calculating a new Cam profile.
The Cam Profile can be executed Once or in Continuous mode by specifying the desired Execution Mode.
The user can also configure the Cam Profile to execute Immediately or Pending completion of a currently running Cam Profile via the Execution Schedule parameter.
To accurately synchronize the Slave axis position to the Master axis position, the user can specify an Execution Schedule setting and an associated Lock Position for the Master axis while the Instruction Mode is Master Driven. If executing in Time-Driven mode, the Lock Position is ignored.
The Cam Type selection allows the user to cancel a running cam and replace it with another cam immediately or schedule it to perform at a specific position in Master Driven mode.
Instruction Mode allows configuring cam execution to either Master Driven or Time Driven mode.
Camming Direction
Cams can be configured to add or subtract their incremental contribution to the axis command position. Control over this behavior is via the Direction parameter.
Camming in the Same Direction
When Same is selected or entered as the Direction for the MATC instruction, the Slave axis position values computed from the Cam Profile are added to the command position of the Slave axis. This is the most common operation, as the profile position values are used as entered in the original cam table. That is, consecutive-increasing profile values result in axis motion in the positive direction and vice versa.
Camming in the Opposite Direction
When Opposite is selected or entered as the Direction, the Slave axis position values computed from the Cam Profile are subtracted from the command position of the Slave axis. Thus, axis motion is in the opposite direction from that implied by the original cam table. In other words, consecutive increasing profile values results in axis motion in the negative direction and vice versa.
Preserving the Current Camming Direction
When Unchanged is selected or entered as the Direction, other position cam parameters can be changed while preserving the current or previous camming direction (same or opposite). This is useful when the current direction is not known or not important. For first-time execution of a cam with Unchanged selected, the control defaults the direction to Same.
Reversing the Current Camming Direction
When Reverse is selected, the current or previous direction of the position cam is changed from Same to Opposite or from Opposite to Same. For first-time execution of a cam with Reverse selected, the control defaults the direction to Opposite.
Specifying the Cam Profile
To execute a MATC instruction, a calculated Cam Profile data array tag must be specified.  Cam Profile array tags can be created by the
Logix Designer
tag editor or the MATC instruction by using the built-in Cam Profile Editor, or by executing an Motion Calculate Cam Profile (MCCP) instruction on an existing Cam array.
L5K_MATC Specify the Cam Profile
The data within the Cam Profile array can be modified at compile time by using the Cam Profile Editor, or at runtime with the Motion Calculate Cam Profile (MCCP) instruction. In the case of runtime changes, create a cam array in order to use the MCCP instruction. Refer to the MCCP instruction specification for more detail on converting Cam arrays.
MATC supports two types of Cam Profile array: CAM_PROFILE and CAM_PROFILE_EXTENDED. CAM_PROFILE is calculated from a CAM array. CAM_PROFILE_EXTENDED is calculated from a CAM_EXTENDED array, which provides better precision.
For CAM_PROFILE array, all but the status and type elements of the CAM_PROFILE array element structure are hidden in the Studio 5000 Logix Designer tag editor. Use the status parameter to indicate that the CAM_PROFILE array element has been calculated. If a camming instruction begins to execute with uncalculated elements in a CAM_PROFILE, an error occurs. The type parameter determines the type of interpolation applied between this cam array element and the next cam element (for example, linear or cubic).
For CAM_PROFILE_EXTENDED array, the status, master and slave values, type, and C0, C1, C2, C3 coefficients are visible in the Studio 5000 Logix Designer tag editor. Use the status parameter to indicate that the CAM_PROFILE array element has been calculated. If a camming instruction begins to execute with uncalculated elements in a CAM_PROFILE, an error occurs. The master and slave define the x and y value of the cam element. The type parameter determines the type of interpolation applied between this cam array element and the next cam element (for example, linear or cubic). The C0, C1, C2, and C3 are coefficients that define the shape between two cam elements.
WARNING:
Do not modify the Cam Profile array directly. Modifying the Cam Profile array can cause unintended motion or a motion fault.
Always use Motion Calculate Cam Profile (MCCP) or the Cam Profile editor to adjust the Cam Profile array.
Cam Profile Array Checks
The Status member of the first element in the Cam Profile array is special and used for data integrity checks. For this reason, the MATC must always specify the cam profile with the starting index set to 0. This first cam profile element Status member can have the following values:
Status Variables
Description
0
Cam Profile element has not been calculated.
1
Cam Profile element is being calculated.
2
Cam Profile element has been calculated
n
Cam Profile element has been calculated and is currently being used by (n-2) MAPC or MATC instructions.
Before starting a cam on a specified axis, the MATC instructions checks if the Cam Profile array has been calculated by checking the value of the first cam profile element’s Status member. If Status is 0 or 1 then the cam profile has not been calculated yet and the MATC instruction errors. If the Cam Profile array has been completely calculated (Status > 1), the instruction then increments the Status member indicating that it is in use by this axis.
When the cam completes, or terminates, the Status member of the first cam profile array element is decremented to maintain track of the number of cams actively by using the associated cam profile.
Linear and Cubic Interpolation
Time cams are fully interpolated. This means that if the current master time value does not correspond exactly with a point in the cam table associated with the cam profile, the Slave axis position is determined by linear or cubic interpolation between the adjacent points. In this way, the smoothest possible slave motion is provided.
Each point in the Cam array that was used to generate the Cam Profile can be configured for linear or cubic interpolation.
Electronic camming remains active through any subsequent execution of jog, or move processes for the slave axis. This allows electronic camming motions to be superimposed with jog, or move profiles to create complex motion and synchronization.
Scaling Time Cams
A time cam profile can be scaled in both time and distance when it is executed. This scaling is useful because it allows the stored cam profile to be used only for the form of the motion with the scaling used to define the time or distance over which the profile is executed.
L5K_Scaling Time Cams_v31
When MATC instruction specifies a Cam Profile array, the master coordinate values defined by the Cam Profile array take on the time units (seconds) and the slave values take on the units of the Slave axis. By contrast, the Time and Distance Scaling parameters are "unit less" values that are used as multipliers to the Cam profile.
By default, both the Time and Distance Scaling parameters are set to 1. To scale a time Cam profile, enter a Time Scaling or Distance Scaling value other than 1.
Increasing the Time Scaling value of a Cam profile decreases the velocities and accelerations of the profile, while increasing the Distance Scaling value increases the velocities and accelerations of the profile. To maintain the velocities and accelerations of the scaled profile approximately equal to those of the unscaled profile, the Time Scaling and Distance Scaling values should be equal. For example, if the Distance Scaling value of a profile is 2, the Time Scaling value should also be 2 to maintain approximately equal velocities and accelerations during execution of the scaled time cam.
WARNING:
Decreasing the Master Scaling value or increasing the Slave Scaling value of a position cam increases the required velocities and accelerations of the profile. This can cause a motion fault if the capabilities of the drive system are exceeded.
Execution Modes
The New Cam and Replacement Cam can have an Execution Mode of Once or Continuous. Execution Mode can be selected to determine how the cam motion behaves when the time moves beyond the end point of the Cam Profile defined by the original cam table.
Once
When Once is selected (default), the specified cam profile, once started, executes till the Cam boundary is crossed. When the Master axis moves outside the range of the profile, cam motion on the Slave axis stops and the Process Complete (. PC) bit of MATC Instruction is set and the Time Cam Status bit in Slave axis’ Motion Status word is reset.
The diagram illustrates the execution of New Cam in Time Driven Mode with Execution Schedule of Immediate and Execution Mode of Once.
When the Active Cam starts, the .IP and .AC bits are set. The Time Cam Status bit in Slave axis’ Motion Status word is also set. When the time moves beyond the range of the Cam profile, the Active Cam .PC bit gets set and the .IP and .AC bits are reset. The Time Cam Status bit in Slave axis’ Motion Status word is reset.
L5K_NewCamTimeDrivenModewithExecution Schedule_Immediate_and_Execution_Once_V34
Continuous
When Continuous Mode is selected, the Cam profile is executed indefinitely. With continuous operation, the slave positions are reset when the time moves beyond the end of the Cam profile causing the Cam profile to repeat indefinitely. This feature is useful in rotary applications where it is necessary that the time cam run continuously in a rotary or reciprocating fashion. To generate smooth continuous motion by using this technique, however, care must be taken in designing the cam points of the cam table so that there are no position, velocity, or acceleration discontinuities between the start and end points of the calculated Cam profile.
The diagram illustrates the execution of New Cam in Time Driven Mode with Execution Schedule of Immediate and Execution Mode of Continuous. At time value of 2, the Active Cam profile crosses the Cam boundary and the second cycle of the Cam profile starts, at time value of 4 the second cycle of Cam profile completes and the third cycle starts, this goes on indefinitely.
L5K_NewCamTimeDrivenModewithExecutionSchedule_Immediate_and_Execution_Mode_Continuous_V34
Execution Schedule
The Execution Schedule parameter controls the MATC instruction’s execution schedule. An Execution Schedule of Immediate (0) and Pending (1) is used in both Master Driven Mode and Time Driven Mode.
Immediate
By default, the execution schedule of MATC instruction is Immediate. In Immediate execution, the Slave axis is immediately locked to the time master coordinate, according to the specified Cam Profile. there is no delay in enabling of the time camming process.
Active Cam
In the Immediate Active Cam case, there is no delay in execution of the time cam. In this case, the Lock Position parameter is irrelevant.
The diagram illustrates Immediate Active Cam initiated in Time Driven Mode and Execution Mode of Once. When the camming process is initiated, the Slave axis synchronized with the time and follows the Cam Profile. The Time Cam Status bit is set at the beginning, and Time Cam Lock Status of the Slave axis’ Motion status word remains unchanged as it is unused in Time Driven mode. The Active Cam’s .PC bit is set when time moves beyond the range of the Cam Profile. The Time cam Status of the Slave axis’ Motion status word bit is reset then.
L5K_ImmediateActiveCaminitiatedTimeDrivenModeandExecutionModeofOnce_V34
Replace and Restart Cam
In the Immediate Replace and Restart cam case, the replacement cam replaces the Active Cam immediately.
The diagram illustrates Immediate Replace and Restart cam execution in Master Driven Mode, Execution Mode of Once and Lock Direction of Immediate Forward Only. The Active cam initiates the camming process, and the Replacement cam is initiated immediately.
The Time Cam Status and Time Cam Lock Status of the Slave axis’ Motion status word is set. The replacement Cam’s .PC bit is set when time moves beyond the range of the Replacement Cam Profile.
L5K_ImmedReplaceRestart_cam_execMastDMExecModeOnceLockDirImFwdOnly_V34
Replace and Continue Cam
In the Immediate Replace and Continue Cam case, the Replacement Cam replaces the Active Cam immediately at the point at which the replacement was initiated.
The diagram illustrates Immediate Replace and Continue cam execution with this configuration:
  • Slave Direction: Same
  • Execution Mode: Once
  • Execution Schedule: Immediate
  • Lock Direction: None
  • Lock Position: 0
  • Instruction Mode: Time Driven Mode
The Active cam initiates the camming process, and the Replacement cam replaces the Active Cam immediately. The Slave axis is synchronized with the Time and follows the Replacement Cam Profile.
The Time Cam Status of the Slave axis’ Motion status word is set. The replacement Cam’s .PC bit is set when time moves beyond the range of the Replacement Cam Profile.
L5K_ImmediateReplaceandContinuecamexecution_V34
Pending Cam Execution: Alternatively, the MATC instruction’s execution can be deferred pending completion of an executing Time cam. An Execution Schedule selection of Pending is blends two Time Cam profiles without stopping motion.
The Pending execution feature is useful in applications like high-speed packaging when a Slave axis must be locked into a Master axis and accelerated by using a specific profile to the proper velocity. When this acceleration profile is done, it must blend into the operating profile, which is typically executed continuously. To stop the Slave axis, the operating profile is blended into a deceleration profile such that the axis stops at a known location as shown in the diagram.
L5K_PendingCamExecution_V34
To confirm smooth motion across the transition, the profiles must be designed such that no position, velocity, or acceleration discontinuities exist between the end of the current profile and the start of the new one. This is done by using the Studio 5000 Logix Designer application Cam Profile Editor.
If an Execution Schedule of Pending is selected without a corresponding Active Cam profile in process, the MATC instruction executes but no camming motion occurs until another MATC instruction with a non-pending Execution Schedule is initiated. This allows pending Cam Profiles to be preloaded prior to executing the initial cam. This method addresses cases where immediate cams would finish before the pending cam could be reliably loaded.
Replacement Cam effect on a Pending Cam :This diagram shows an example of how Pending Cam is affected when a Replacement Cam starts. The status transitions are indicated by the dotted vertical lines in the diagram. When the Replacement Cam executes, the Pending Cam’s .IP bit is set and the Replace and Restart Cam Profile runs.
(1) Active Cam starts in Time Driven Mode with Lock Direction of Immediate Forward only.
(2) Pending Cam is enabled and waiting for the completion of the Active Cam. The Pending Cam’s. IP and .DN bits are set.
(3) Replacement Cam executes in Time Driven mode before the end of the Active Cam profile completes. The Pending Cam’s .IP bit resets and no change in .AC bit.
(4) Cam Complete. The Replacement Cam’s .PC bit is set.
If the Cam Type is Replace and Restart or Replace and Continue with the Execution Schedule of Pending, then the MATC instruction’s .ER flag is set.
Both the Pending Cam and an Active Cam must be in the same instruction mode - either both must be in Time Driven Mode, or both must be in Master Driven Mode. An instruction that pends a Cam to an Active Cam in a different mode causes the Active Cam’s .ER to set.
All pending Cams must use the Immediate Forward or the Immediate Reverse Lock Direction. A pending Cam with a specified Lock Position with a Position Forward Only or Position Reverse Only Lock Direction causes a LOCK_DIRECTION_CONFLICT (95) error. (See MDSC Error Codes for a list of runtime error codes.) A second pending Cam overlays the first pending Cam in memory.
L5K_ReplacementCamEffectonPendingCam_V34
Cam Type
The Cam Type parameter indicates that the programmed cam is a new or replacement cam.
The selection allows the user to choose:
  • New Cam
  • Replace and Restart
  • Replace and Continue
New Cam
New Cam should be used when the user wants the programmed cam to be a completely new cam. This is the default value for the Cam Type parameter and provides backward compatibility for the Studio 5000 Logix Designer application.
New Cam starts its cam profile at the beginning or when the Pending Cam starts after the Active Cam is complete.
The diagram illustrates the execution of a New Cam. The left side shows the execution in Time Driven Mode, where the Slave axis is synchronized with time using cam profile. The right side shows the execution of the same profile in Master Driven Mode where the Slave axis is locked to the Master axis.
L5K_ExecutionNewCam_V34
Replace and Restart
Use the enumeration Replace and Restart to replace the current running cam. The replacement happens without any consideration of velocity, acceleration, or jerk disturbances.
The user is responsible for minimizing any velocity, acceleration, or jerk disturbances through proper Cam design.
The diagram illustrates the execution of Replace and Restart in Time Driven Mode with Execution Schedule of Immediate and Execution Mode of Once.
When the Active Cam starts, the Slave axis is synchronized with time by using the cam profile. The Active Cam profile is replaced with the Replacement Cam when it is initiated, and then the Slave axis starts moving according to the Replacement Cam profile synchronized in time until the cam completes.
L5K_ReplaceRestart TimeDrivenMode_with_ExecutionSchedule_Immediate and ExecutionMode_Once_V34
Replace and Continue
Use the enumeration Replace and Continue to replace the Active Cam at any point when it is in progress. At the replacement point, the Replacement Cam starts to interpolate the Slave axis.
The diagram illustrates the execution of a Replace and Continue in Master Driven Mode with Execution Schedule of Immediate and Execution Mode of Continuous.
The green dotted line indicates the positions of Slave axis if the Replacement Cam started at the same time as Active Cam. The blue dotted line indicates the Slave axis positions if the Active Cam continued execution beyond the replacement point. The change in Slave Position at the replacement point is due to the cam profile defined for the Replacement Cam.
L5K_Replace and Continue in Master Driven Mode with Execution Schedule of Immediate_V34
Lock Direction
Lock Direction indicates the direction of the Master axis that generates the Slave motion. In Time Driven Mode, time cams are programmed with a Lock Direction of None.
In Master Driven Mode, the time cams are programmed with a following Lock Direction and are used for Cam Type Replace and Restart and Replace and Continue.
Immediate Forward Only: The Replacement Cam replaces the Active Cam immediately when Master axis is moving in the forward direction.
Immediate Reverse Only: The Replacement Cam replaces the Active Cam immediately when Master axis is moving in the reverse direction.
The diagram illustrates Immediate Replace and Restart Cam execution in Master Driven Mode with Execution Mode of Once and Lock Direction is Immediate Reverse Only.
(1) Active Cam Start: The Active Cam with Lock Direction of Immediate Forward only starts when Master axis moves in the forward direction. The Time Cam Status and Time Cam Lock Status of the Slave axis’ motion status word bits are set.
(2) Active Cam Unlocked: Due to Master axis reversal, the Active Cam is unlocked, and the Time Cam Lock Status of the Slave axis’ Motion status word is reset.
(3) Replacement Cam Start: While Master axis is moving in the reverse direction, the Replacement Cam replaces the Active Cam immediately and Replacement Cam’s .AC bit is set indicating that the Replacement Cam is interpolating the Slave axis. The Time Cam Lock Status of the Slave axis’ Motion status word is set.
The Replacement Cam’s .PC is set when Master axis moves beyond the range of the Replacement Cam Profile. The Time Cam Status and Time Cam Lock Status of the Slave axis’s Motion status word bits are reset then.
L5K_ImmediateReplaceandRestartCamExecution_V34
Position Forward Only: The Replacement Cam replaces the Active Cam when the cam reaches the replacement point, while the Master axis moves in the forward direction.
Position Reverse Only: Same as Position Forward Only except that the Master axis is moving in the reverse direction.
The diagram illustrates Immediate Replace and Continue Cam execution in Master Driven Mode.
(1) Active Cam Start: The Active Cam with Lock Direction of Immediate Forward only starts when Master axis moves in the forward direction. The Time Cam Status and Time Cam Lock Status of the Slave axis’ motion status word bits are set.
(2) Active Cam Unlocked: Due to Master axis reversal, the Active Cam is unlocked, and the Time Cam Lock Status of the Slave axis’ Motion status word is reset.
(3) Replacement Cam Start: While the Master axis is moving in the reverse direction, the Replacement Cam is initiated with Active Cam still unlocked with following configuration:
  • Execution Schedule: Immediate
  • Lock Direction: Position Reverse Only
  • Execution Mode: Once
  • Lock Position: 10
  • Instruction Mode: Master Driven Mode
  • Replacement at Lock Position
When Master axis starts moving in reverse direction and reaches the Lock position of 10 units, then the Replacement Cam’s .AC bit is set indicating that the Replacement Cam is interpolating the Slave axis.
The Replacement Cam’s .PC bit is set when Master axis moves beyond the range of the Replacement cam Profile. The Time Cam Lock Status of the Slave axis’s Motion status word bit is reset then.
L5K_Immediate Replace and Continue Cam execution in Master Driven Mode_V34
Stopping a Cam
Like other motion generators (for example, jog, move, gear) Active Cams must be stopped by the various stop instructions, MAS, or MGS. Cam motion must also stop when the ControlLogix processor changes OS modes. The MAS instruction, in particular, must be able to specifically stop the camming process. This behavior should be identical to the MAS functionality that stops a gearing process.
Merging from a Cam
Like other motion generators (for example, jog, move, gear) Active Cams must also be compliant with motion merge functionality. Moves and Jogs, in particular, must be able to merge from active camming. This behavior should be identical to the merge functionality applied to a gearing process.
IMPORTANT:
The MATC instruction execution completes in a single scan, thus the Done (.DN) bit and the In Process (.IP) bit are set immediately. The In Process (.IP) bit remains set until the initiated Time Camming process is superseded by another MATC instruction, or stopped by a Motion Axis Stop command, Merge operation, or Servo Fault Action.
Structure
See Input and Output Parameters Structure for Single Axis Motion Instructions for the input and output parameters that are available for the MATC instruction via the Master Driven Speed Control (MDSC) function. Before any of these parameters is active, you must execute an MDAC instruction and it must be active (IP bit is set).
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. A major fault can occur if an uninitialized reference or a reference of incorrect type is passed to the Axis Operand. See Index through Arrays for array-indexing faults.
Execution Conditions
In Structured Text, EnableIn is always True during a normal scan. If the instruction is in the control path activated by the logic, it executes.
Ladder Diagram
Condition/State
Action Taken
Prescan
The .EN, .DN, .ER, .IP, .AC and .PC bits are cleared to False.
Postscan
No Action taken
EnableIn is false
This condition can only occur during Normal Scan mode.
The .EN bit is cleared to false if either the .DN or .ER bit is true.
EnableIn is true and .EN bit is false
This condition can only occur during Normal Scan mode.
The .EN bit is set to true and the instruction executes according to the latest version of the Motion Instruction PISD document.
EnableIn is true and .EN bit is true
This condition can only occur during Normal Scan mode.
No Action taken
Error Codes
See Motion Error Codes (.ERR) for Motion Instructions.
Extended Error Codes
Extended Error Codes provide additional instruction-specific information for the Error Codes that are generic to many instructions. Extended error codes for the PARAMETER_OUT_OF_RANGE(13) error code lists a number that refers to the number of the operands, as they are listed in the faceplate, from top to bottom, with the first operand being counted as zero. Therefore, for the MATC instruction, an extended error code of 5 would refer to the Time Scaling operand’s value. You would then have to check your value against the accepted range of values for the instruction.
SEGMENT field
The .SEGMENT field for the ILLEGAL_CAM_TYPE (28), ILLEGAL_CAM_ORDER (29) or INVALID_CAM_PROFILE_ELEMENT (179) error codes indicate the Cam Profile array element that contains, respectively, an invalid Cam Profile type (not linear or cubic), a non-ascending Master position or an invalid value (such as overflow or not a number). Therefore, INVALID_CAM_PROFILE_ELEMENT with .SEGMENT field value of 3 indicates that the fourth element (or [3]) of the Cam Profile array contains the invalid number. Use the Motion Calculate Cam Profile (MCCP) instruction or Cam Profile editor to recalculate the Cam Profile and ensure the master and slave values do not contain an invalid value.
Status Bits
Time Cam Status
This Status bit indicates that the MATC profile is in progress and sets when the MATC command is initiated on the Slave axis.
Resets with either of these conditions:
  • The Active or Replacement Cam completes with Execution Mode is Once.
  • The Slave axis is stopped (MAS, MCS) with Stop Type All or Time Cam.
  • The Slave axis shuts down (MASD, MGSD, MCSD).
Execution Mode
Bit Name
Statement
Once
Continuous
Time Cam Status
Sets when the MATC command is initiated on the Slave axis
TRUE
TRUE
Resets when the Master axis crosses the cam boundary.
TRUE
FALSE
Time Cam Lock Status
The Time Cam Lock Status bit is valid only in Master Driven mode and when the Execution schedule is Immediate. The Time Cam Lock Status bit indicates that the status when the Master axis starts driving the Slave axis based on the cam profile and Slave Direction and sets when the Master axis satisfies these conditions: Execution Mode, Lock Direction, and Lock Position.
Resets with either of these conditions:
  • The Master axis crosses the cam boundary when the Execution Mode is Once.
  • The Master axis is moving in the reverse direction of that specified in the Lock direction.
  • The Slave axis is stopped (MAS, MCS) with Stop Type All or Time Cam.
  • The Slave axis shuts down (MASD, MGSD, MCSD).
Execution Mode
Bit Name
Statement
Once
Continuous
Time Cam Lock Status
Sets when the Master axis starts driving the Slave axis according to the cam profile.
TRUE
TRUE
Resets when the Master axis crosses the cam boundary.
TRUE
FALSE
Bit Name
Statement
Lock Direction
Time Cam Lock Status
Sets when the Master axis satisfies these conditions: Execution Mode, Lock Direction. Lock Position is ignored.
Immediate Forward Only
Immediate Reverse Only
Sets when the Master axis satisfies these conditions: Execution Mode, Execution Schedule, Lock Direction, and Lock Position.
Position Forward Only
Position Reverse Only
Time Cam Pending Status
This Status bit indicates that the MATC profile is pending the completion of an executing cam profile and sets when these conditions are met:
  • The MATC with Execution Schedule Pending is initiated.
  • Replacement Cam is initiated with Instruction Mode Master Driven and the Lock Direction.
Resets with either of these conditions:
  • The current Time cam process completes (.PC bit) sets.
  • Time Cam Lock Status sets.
  • The Slave axis is stopped (MAS, MCS) with Stop Type All or Time Cam.
  • The Slave axis is shut down (MASD, MGSD, MCSD).
Execution Schedule
Bit Name
Statement
Immediate
Pending
Time Cam Pending Status
Bit Status in Execution Schedule
FALSE
TRUE
Bit Name
Statement
Execution Schedule
Time Cam Pending Status
Sets until the Master axis satisfies these conditions based on Execution Mode, Lock Direction, and Lock Position.
Replacement Cam with:
Immediate Forward Only
Immediate Reverse Only
Position Forward Only
Position Reverse Only
The diagram illustrates Immediate Replace and Continue Cam execution in Master Driven Mode.
(1) Active Cam Start
The Active Cam with Lock Direction of Immediate Forward only starts when the Master axis moves in the forward direction. The Time Cam Status and Time Cam Lock Status of the Slave axis’ motion status word bit sets. The Time Cam Pending Status bit of the Slave axis’ Motion Status bit is Unchanged.
(2) Active Cam Unlocked
Due to Master axis reversal, the Replacement Cam unlocks, and the Time Cam Lock Status of the Slave axis’ Motion status word resets. The Time Cam Status of the Slave axis’ Motion Status bit is Unchanged.
(3) Replacement Cam Start
While the Master axis is moving in the reverse direction, the Replacement Cam initiates with Active Cam still unlocked with this configuration:
  • Execution Schedule: Immediate
  • Lock Direction: Position Reverse Only
  • Execution Mode: Once
  • Lock Position: 10
  • Instruction Mode: Master Driven Mode
The Time Cam Pending Status of the Slave axis’ Motion status word bit sets. The Time Cam Status and the Time Cam Lock Status of the Slave axis’ Motion Status bits are Unchanged.
(4) Replacement at Lock Position
When the Master axis starts moving in the reverse direction and reaches the Lock position of 10 units, the Time Cam Lock Status of the Slave axis’ Motion status word bit sets, and the Time Cam Pending Status of the Slave axis’ Motion status word bit resets. The Time Cam Status of the Slave axis’ Motion Status bit is Unchanged.
L5K_Immediate Replace and Continue Cam execution in Master Driven Mode_V34_2
Master Driven Speed Control (MDSC) and Motion Direct Command Support
The Motion Direct commands are not available in the instruction tree for the MATC instruction. You must program an MATC in one of the supported programming languages before you execute an MAM or MAJ in Time Driven Mode. A runtime error occur if an MATC is not previously executed in an MAM and MAJ in Master Driven Mode.
Example
Relay Ladder Logic
MATC_LDexample_v34
Structured Text
MATC(Axis1,matc_motion_ctrl,1,cam_profile[0],2,2,Once,Immediate,0,NewCam,None,TimeDrivenMode);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.