Motion Coordinated Change Dynamics (MCCD)
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.
IMPORTANT:
Tags used for the motion control attribute of instructions should only be used once. Re-use of the motion control tag in other instructions can cause unintended operation. This may result in damage to equipment or personal injury.
IMPORTANT:
Risk of Velocity and/or End Position Overshoot
If you change move parameters dynamically by any method, that is by changing move dynamics (MCD or MCCD) or by starting a new instruction before the last one has completed, be aware of the risk of velocity and/or end position overshoot.
A Trapezoidal velocity profile can overshoot if maximum deceleration is decreased while the move is decelerating or is close to the deceleration point.
An S-curve velocity profile can overshoot if:
maximum deceleration is decreased while the move is decelerating or close to the deceleration point; or
maximum acceleration jerk is decreased and the axis is accelerating. Keep in mind, however, that jerk can be changed indirectly if it is specified in % of time
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 |
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.
Available Languages
Ladder Diagram
Function Block
This instruction is not available in function block.
Structured Text
MCCD(CoordinateSystem, MotionControl, MotionType, ChangeSpeed, Speed, SpeedUnits, ChangeAccel, AccelRate, AccelUnits, ChangeDecel, DecelRate, DecelUnits, ChangeAccelJerk, AccelJerk, ChangeDecelJerk, DecelJerk, JerkUnits, Scope);
Operands
There are data conversion rules for mixed data types within an instruction. See
Data Conversion
.Inputs
This table explains the instruction inputs.
Operand | Type | Format | Description |
---|---|---|---|
Coordinate System | COORDINATE_SYSTEM | tag | Coordinated group of axes. For controllers that support the REF_TO motion data types, the coordinate system operand type can be replaced by the REF_TO_COORDINATE_SYSTEM type. |
Motion Control | MOTION_INSTRUCTION | tag | Structure used to access instruction status parameters. |
Motion Type | DINT | immediate | 1 = Coordinated Move |
Change Speed | DINT | immediate | 0 = No 1 =Yes |
Speed | SINT, INT, DINT, or REAL | immediate tag | [coordinate units] |
Speed Units | DINT | immediate | 0 = Units per Sec 1 = % of Maximum 4 = Units per MasterUnit |
Change Accel | DINT | immediate | 0 = No 1 = Yes |
Accel Rate | SINT, INT, DINT, or REAL | immediate tag | [coordinate units] |
Accel Units | DINT | immediate | 0 = Units per Sec 2 1 = % of Maximum 4 = Units per MasterUnit 2 |
Change Decel | DINT | immediate | 0 = No 1 =Yes |
Decel Rate | SINT, INT, DINT, or REAL | immediate tag | [coordinate units] |
Decel Units | DINT | immediate | 0 = Units per Sec 2 1 = % of Maximum 4 = Units per MasterUnit 2 |
Change Accel Jerk | DINT | immediate | 0 = No 1 = Yes |
Accel Jerk | SINT, INT, DINT, or REAL | immediate tag | You must always enter a value for the Accel Jerk operand. This instruction only uses the value if the Profile is configured as S-curve. Accel Jerk is the acceleration jerk rate for the coordinate system. Use these values to get started. Accel Jerk = 100 (% of Time) Jerk Units = 2 |
Change Decel Jerk | DINT | immediate | 0 = No 1 = Yes |
Decel Jerk | SINT, INT, DINT, or REAL | immediate tag | You must always enter a value for the Decel Jerk operand. This instruction only uses the value if the Profile is configured as S-curve. Decel Jerk is the deceleration jerk rate for the coordinate system. Use these values to get started. Decel Jerk = 100 (% of Time) Jerk Units = 2 |
Jerk Units | DINT | immediate | 0 = Units per sec 3 1 = % of Maximum 2 = % of Time (use this value to get started) 4 = Units per MasterUnit 3 6 = % of Time Master Driven |
Scope | DINT | immediate | 0 = Active Motion 1 = Active and Pending Motion |
Structured Text
When entering enumerations for the operand value in structured text, multiple word enumerations must be entered without spaces. For example: when entering Decel Units the value should be entered as unitspersec
2
rather than Units per Sec2
as displayed in the ladder logic.See
Structured Text Syntax
for more information on the syntax of expressions within structured text. For the operands that have enumerated values, enter your selection.
This Operand | Has These Options Which You | |
---|---|---|
Enter as Text | Or as | |
Coordinate System | No enumeration | tag |
Motion Control | No enumeration | tag |
Motion Type | coordinatedmove | 1 = Coordinated Move |
Change Speed | no yes | 0 = No 1 = Yes |
Speed | No enumeration | immediate or tag |
Speed Units | unitspersec %ofmaximum unitspermasterunit | 0 1 4 |
Change Accel | no yes | 0 = No 1 = Yes |
Accel Rate | No enumeration | immediate or tag |
Accel Units | unitspersec2 %ofmaximum unitspermasterunit2 | 0 1 4 |
Change Decel | no yes | 0 = No 1 = Yes |
Decel Rate | No enumeration | immediate or tag |
Decel Units | unitspersec2 %ofmaximum unitspermasterunit2 | 0 1 4 |
Change Accel Jerk | no yes | 0 = No 1 = Yes |
Accel Jerk | No enumeration | immediate or tag You must always enter a value for the Accel operand. This instruction only uses the value if the Profile is configured as S-curve. Use this value to get started. Accel Jerk = 100 (% of Time) |
Change Decel Jerk | no yes | 0 = No 1 = Yes |
Decel Jerk | No enumeration | immediate or tag You must always enter a value Decel Jerk operand. This instruction only uses the value if the Profile is configured as S-curve. Use this value to get started. Decel Jerk = 100 (% of Time) Jerk Units = 2 |
Jerk Units | unitspersec3 %ofmaximum %oftime unitspermasterunit3 %oftimemasterdriven | 0 1 2 (use this value to get started) 3 6 |
Scope | activemotion activeandpendingmotion | 0 = Active Motion 1 = Active and Pending Motion |
Outputs
The following table explains the instruction outputs.
Mnemonic | Description |
---|---|
.EN (Enable) Bit 31 | The Enable bit is set when the rung transitions from false to true. It resets when the rung transitions from true to false. |
.DN (Done) Bit 29 | The Done bit resets when the rung transitions from false to true. It sets when target position is calculated successfully. |
.ER (Error) Bit 28 | The Error bit resets when the rung transitions from false to true. It sets when target position fails to calculate successfully. |
Description
MCCD is a transitional instruction:
- In relay ladder, toggle the Rung-condition-in from false to true each time the instruction should execute.
- In structured text, condition the instruction so that it only executes on a transition.
Coordinate System
The Coordinate System operand specifies the set of motion axes that define the dimensions of a coordinate system. The coordinate system supports up to three (3) primary axes.
Motion Type
The motion type operand determines which motion profile to change. Currently Coordinated Move is the only available option.
Coordinated Move - when selected, the Coordinated Move option changes the motion of the currently active move in the coordinate system.
Change Speed
The Change Speed operand determines whether or not to change the speed of the coordinated motion profile.
- No - no change is made to the speed of the coordinated motion.
- Yes - the speed of the coordinated motion is changed by the value defined in the Speed and Speed Units operands.
Speed
The Speed operand defines the maximum speed along the path of the coordinated move.
Speed Units
The Speed Units operand defines the units applied to the Speed operand either directly in coordinate units of the specified coordinate system or as a percentage of the maximum values defined in the coordinate system.
Change Accel
The Change Accel operand determines whether or not to change the acceleration of the coordinated motion profile.
- No - no change is made to the acceleration of the coordinated motion.
- Yes - the acceleration of the coordinated motion is changed by the value defined in the Accel Rate and Accel Units operands.
Accel Rate
The Accel Rate operand defines the maximum acceleration along the path of the coordinated move.
Accel Units
The Accel Units operand defines the units applied to the Accel Rate operand either directly in coordinate units of the specified coordinate system or as a percentage of the maximum values defined in the coordinate system.
Change Decel
The Change Decel operand determines whether or not to change the deceleration of the coordinated motion profile.
- No - no change is made to the deceleration of the coordinated motion.
- Yes - the deceleration of the coordinated motion is changed by the value defined in the Decel Rate and Decel Units operands.
Decel Rate
The Decel Rate operand defines the maximum deceleration along the path of the coordinated move.
Decel Units
The Decel Units operand defines the units applied to the Decel Rate operand either directly in coordinate units of the specified coordinate system or as a percentage of the maximum values defined in the coordinate system.
Impact of Changes to Acceleration and Deceleration Values on Motion Profile
The following graph illustrates what could happen when a MCCD instruction is used to reduce the acceleration as velocity approaches maximum. The new acceleration Jerk Rate becomes smaller, further limiting the maximum change in acceleration. Velocity overshoot occurs due to the additional time required for acceleration to reach zero. Another profile is generated to bring velocity back to the programmed maximum.
Effect of Change to Acceleration
This graph illustrates what could happen when an MCCD instruction is used to reduce the deceleration as velocity and position approach their target endpoints. The new deceleration Jerk Rate becomes smaller. The time required to decelerate to zero causes velocity to undershoot, passing through zero and becoming negative. Axis motion also reverses direction until velocity returns to zero. An additional profile is generated to bring position back to the programmed target.
Effect of Change to Deceleration
Change Accel Jerk
The Change Accel Jerk operand determines whether or not to change the acceleration jerk of the coordinated motion profile.
- No - no change is made to the acceleration jerk of the coordinated motion.
- Yes - the acceleration of the coordinated motion is changed by the value defined in the Accel Jerk Rate and Jerk Units operands.
Accel Jerk
Accel Jerk defines the maximum acceleration jerk for the programmed move. For more information on calculating Accel Jerk, refer to the Jerk Units below.
Change Decel Jerk
The Change Decel Jerk operand determines whether or not to change the deceleration jerk of the coordinated motion profile.
- No - no change is made to the deceleration jerk of the coordinated motion.
- Yes - the deceleration of the coordinated motion is changed by the value defined in the Decel Jerk Rate and Jerk Units operands
Decel Jerk
Decel Jerk defines the maximum deceleration jerk for the programmed move. For more information on calculating Decel Jerk, refer to the Jerk Units.
Jerk Units
The jerk units define the units that are applied to the values entered in the Accel Jerk and Decel Jerk operands. The values are entered directly in the position units of the specified coordinate system or as a percentage. When configured using % of Maximum, the jerk is applied as a percentage of the Maximum Acceleration Jerk and Maximum Deceleration Jerk operands specified in the coordinate system attributes. When configured using % of Time, the value is a percentage based on the Speed, Accel Rate, and Decel Rate specified in the instruction.
If you want to convert engineering units to % of Time, use these equations.
If you want to convert % of Time to engineering units, use these equations.
Scope
Choosing Active Motion for the Scope operand specifies that the changes affect only the motion dynamics of the active coordinated motion instruction. Choosing Active and Pending Motion specifies that the changes affect the motion dynamics of the active coordinated motion instruction and any pending coordinated motion instruction in the queue. Currently the queue size is limited to one instruction after the active instruction.
Changing Between MDSC and Time Driven Modes in Master Driven Speed Control (MDSC)
You cannot change from Master Driven Mode to Time Driven Mode or vice versa with an MCCD instruction. You receive a runtime error if you attempt to change modes.
Fault Codes
For the Master Driven Speed Control (MDSC) function, an error will occur at runtime if you attempt to change the mode of the system from Master Driven to Time Driven or from Time Driven to Master Driven.
Extended Error Codes
Extended Error codes help to further define the error message given for this particular instruction. Their behavior is dependent upon the Error Code with which they are associated.
The Extended Error Codes for Servo Off State (5), Shutdown State (7), Axis Type Not Servo (8), Axis Not Configured (11), Homing In Process Error (16), and Illegal Axis Data type (38) errors all function in the same fashion. A number between 0...n is displayed for the Extended Error Code. This number is the index to the Coordinate System indicating the axis that is in the error condition. See Motion Error Codes (ERR) for Motion Instructions.
For the MCCD instruction, Error Code 13 - Parameter Out of Range, Extended Errors return a number that indicates the offending parameter as listed on the faceplate in numerical order from top to bottom beginning with zero. For example, 2 indicates the parameter value for Move Type is in error.
Referenced Error Code and Number | Extended Error Numeric Indicator | Instruction Parameter | Description |
---|---|---|---|
Parameter Out Of Range (13) | 2 | Move Type | Move Type is either less than 0 or greater than 1. |
Parameter Out Of Range (13) | 4 | Speed | Speed is less than 0. |
Parameter Out of Range (13) | 7 | Accel Rate | Accel Rate is less than or equal to 0. |
Parameter Out of Range (13) | 10 | Decal Rate | Decel Rate is less than or equal to 0. |
For the Error Code 54 – Maximum Deceleration Value is Zero, if the Extended Error returns a positive number (0-n) it’s referring to the offending axis in the coordinate system. Go to the Coordinate System Properties General Tab and look under the Brackets ([ ])column of the Axis Grid to determine which axis has a Maximum Deceleration value of 0. Click on the ellipsis button next to the offending axis to access the Axis Properties screen. Go to the Dynamics tab and make the appropriate change to the Maximum Deceleration Value. If the Extended Error number is -1, this means the Coordinate System has a Maximum Deceleration Value of 0. Go to the Coordinate System Properties Dynamics Tab to correct the Maximum Deceleration value.
MCCD Changes to Status Bits:
For the Master Driven Speed Control (MDSC) function, when the MCCD is executed (goes IP), the CalculatedDataAvailable (CDA) status bit is cleared (as specified by the Scope variable of the MCCD instruction), in each MCLM and MCCM instruction tag, which indicates that the Event Distances has been computed. (The Scope variable specifies either the Active Motion instruction or Active Motion and Pending instruction (that is, all instructions, in the queue)).
After the MCCD is complete and the Event Distances have been recomputed, the CalculatedDataAvailable status bit is set again. Therefore, look at the CalculatedDataAvailable status bit after the MCCD instruction has been completed to determine when to use the recomputed Event Distances.
If a MCCD is executed (goes IP), the CDA bit is cleared. The Calculated Data for the move is recomputed using the new dynamics parameters. The CDA bit is set again when computations are complete. The Calculated Data that is recomputed is measured from the original Motion Start Point (MSP) to the Event Distance point using the new dynamics parameters as changed by the MCCD instruction - not from the point of the MCCD.
Note that if the MCCD changes the speed to 0, the Event Distance is not recomputed; the CDA bit is not set. The Event Distance is however recomputed if a second MCCD is issued to restart the motion. The recomputed Calculated Data includes the duration of the stopped motion.
If the Event Distance is set to 0, the Calculated Data is set to equal the position that equals the length of the move. This may be one or two coarse update periods before the PC bit is set because of an internal delay. The end position is typically achieved in the middle of a coarse update period, which adds up to one additional coarse update period to the delay. Therefore, if the master is moved a distance equal to the Calculated Data, you must wait up to 2 iterations more for the PC bit of the slave move to be 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 the incorrect type is passed to the Coordinate System operands. See
Index Through Arrays
for array-indexing faults.Execution
Ladder Diagram
Condition/State | Action Taken |
---|---|
Prescan | The .EN, .DN, and .ER bits are cleared to false. |
Rung-condition-in is false | The .EN bit is cleared to false if either 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-condition-in is true in the Ladder Diagram table. |
Postscan | See Postscan in the Ladder Diagram table. |
Example
Ladder Diagram
Structured Text
MCCD(myMccdCoordinateSystem, myMccdMotionControl, CoordinatedMove, Yes, MyMccdSpeed, Unitspersec, Yes, MyMsccdAccelRate, Unitspersec2, Yes, MyMccdDecelRate, Unitspersec2, Yes, 100.0, Yes, 100.0, %ofTime, ActiveMotion);
Provide Feedback