Motion Run Axis Tuning (MRAT)
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.Use the Motion Run Axis Tuning (MRAT) to command the motion module to run a tuning motion profile for the specified axis. The tuning motion profile consists of one or more acceleration and deceleration ramps induced by applying fixed voltages to the servo’s drive output. Note that this instruction does not at any time close the servo loop. While this instruction takes no explicit input parameters, it does derive input from the Axis Tuning Configuration parameters. The result of executing the MRAT instruction is a set of measurement data that is stored in the Axis Object for subsequent use with the Motion Apply Axis Tuning (MAAT) instruction.
- 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
MRAT(Axis,MotionControl);
Operands
Ladder Diagram and Structured Text
Operand | Type CompactLogix 5370, Compact GuardLogix 5370, Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480 | Type ControlLogix 5570, GuardLogix 5570, ControlLogix 5580, and GuardLogix 5580 controllers | Format | Description |
Axis | AXIS_CIP_DRIVE | AXIS_CIP_DRIVE AXIS_SERVO AXIS_SERVO_DRIVE REF_TO_AXIS_CIP_DRIVE REF_TO_AXIS_SERVO REF_TO_AXIS_SERVO_DRIVE | Tag | Name of the axis on which to perform the operation. 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 | Tag | Structure used to access instruction status parameters. |
See Structured Text Syntax for more information on the syntax of expressions within structured text.
Mnemonic | Description |
.DN (Done) Bit 29 | It is set after the tuning process has been successfully completed. |
.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 after the tuning process is complete, or terminated by a stop command, shutdown, or a servo fault |
.PC (Process Complete) Bit 27 | It is set after the tuning process has been successfully completed |
Description - AXIS_SERVO, AXIS_SERVO_DRIVE
The MRAT instruction is used to execute a tuning motion profile on the specified axis. During this brief tuning motion profile, the motion module makes timing and velocity measurements that serve as input data for a subsequent Motion Apply Axis Tuning (MAAT) instruction. MRAT requires no explicit input parameters; simply enter or select the desired physical axis.
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 MRAT instruction uses axis configuration parameters as input and output. The input configuration parameters that MRAT uses are shown in this table.
Axis Parameter | Data Type | Units | Meaning |
Tuning Direction | Boolean | - | Direction of Tuning Motion
(0-Fwd, 1-Rev). |
Tuning Travel Limit | Real | pos units | Maximum allowed excursion of Axis. |
Tuning Velocity | Real | pos units/sec | Top Speed of Tuning Profile. |
Dumping Factor | Real | - | Damping Factor used to calculate the maximum Position Servo Bandwidth. |
Based on the above configuration parameters, MRAT execution generates a motion event on the specified axis that consists of a single triangular velocity profile or a series of three such profiles. Tune Velocity must be within the maximum speed capability of the drive and motor. The configured value for Tune Velocity should be set to the desired maximum operating speed of the axis so that the resulting tuning parameters are based on the dynamics of the system at that speed.
If the External Vel Servo Drive configuration bit parameter is TRUE, indicating interface to an external velocity servo drive, three pulses are applied to the axis. The tuning velocity profile for this case is shown in this diagram.
Tuning Velocity Profile when True
If the External Vel Servo Drive configuration bit parameter is FALSE, indicating interface to an external torque servo drive, only one pulse is applied to the axis. The tuning velocity profile is shown below.
Tuning Velocity Profile when False
The axis configuration parameters that MRAT generates as output depend on the External Drive configuration. If the External Vel Servo Drive configuration bit parameter is TRUE, indicating interface to an external velocity servo drive, these output parameters are generated.
Axis Parameter | Data Type | Units | Meaning |
Tune Status | Real | - | Status Report of the Tuning Process. |
Tune Accel Time | Real | seconds | Measured Acceleration Time of Tuning Profile. |
Tune Decel Time | Real | seconds | Measured Deceleration Time of Tuning Profile. |
Tune Accel | Real | pos units/sec2 | Calculated Acceleration Time of Tuning Profile. |
Tune Decel | Real | pos units/sec2 | Calculated Deceleration Time of Tuning Profile. |
Tune Velocity Scaling | Real | mV/KCPS | Measured Velocity Scaling factor of axis Drive/Motor/Encoder system. |
Tune Rise Time | Real | mV/KCPS | Measured Rise Time of Tuning Step Response Profile. |
Tune Velocity Bandwidth | Real | Hertz | Computed Bandwidth of External Velocity Servo Drive |
If the External Vel Servo Drive configuration bit parameter is FALSE, indicating interface to an external torque servo drive, these output parameters are generated.
Axis Parameter | Data Type | Units | Meaning |
Tune Status | Real | - | Status Report of the Tuning Process. |
Tune Accel Time | Real | seconds | Measured Acceleration Time of Tuning Profile. |
Tune Decel Time | Real | seconds | Measured Deceleration Time of Tuning Profile. |
Tune Accel | Real | pos units/sec2 | Calculated Acceleration Time of Tuning Profile. |
Tune Decel | Real | pos units/sec2 | Calculated Deceleration Time of Tuning Profile. |
Effective Inertia | Real | mV/KCPS | Computed Effective Inertia of Drive/Motor system. |
Position Servo Bandwidth | Real | Hertz | Calculated Maximum Position Servo Loop Bandwidth. |
The above output parameters generated by the MRAT instruction serve as inputs to a subsequent MAAT instruction which performs further tuning calculations and applies the results to various axis’ servo and dynamic configuration parameters.
Description - AXIS_CIP_DRIVE
The MRAT instruction is used to execute a tuning motion profile on the specified CIP axis. MRAT requires no explicit input parameters; simply enter or select the desired physical axis.
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 MRAT instruction uses the CIP Axis configuration parameters as input and output. The input configuration parameters that MRAT uses are shown in this table.
Axis Parameter | Data Type | Units | Meaning |
Tuning Direction | Short Integer | - | It determines the direction of the motion profile initiated by the Inertia Test service associated with the MRAT instruction. 0 = Unidirectional Forward 1 = Unidirectional Reverse 2 = Bi-Directional Forward 3 = Bi-Directional Reverse. |
Tuning Travel Limit | Real | Position Units | It is used by the Inertia Test service, associated with the MRAT instruction, to limit the excursion of the axis during the test. |
Tune Speed | Real | Position Units/sec | The Tuning Speed attribute value determines the maximum speed used by the Inertia Test service initiated motion profile. This attribute should be set to the desired maximum operating speed of the motor prior to running the test. |
Tuning Torque | Real | % Rated | It determines the maximum torque used by the Inertia Test service initiated motion profile. This attribute should be set to the desired maximum safe torque level prior to running the test. The default value is 100%, which yields the most accurate measure of the acceleration and deceleration capabilities of the system. |
Damping Factor | Real | - | It is used in calculating the maximum Position and Velocity Servo Bandwidth values during execution of the MRAT instruction. |
The input configuration parameters can also be set using the
Axis Properties - Autotune
dialog box.The Loop Response selection is used by the software to determine the value for the Damping Factor.
Loop Response | Damping Factor |
Low | 1.5 |
Medium | 1.0 |
High | 0.8 |
Based on the above configuration parameters, MRAT execution generates a motion event on the specified axis that consists of a triangular velocity profile. The tuning procedure will measure maximum acceleration and deceleration rates based on ramps to and from the Tuning Speed. Thus, the accuracy of the measured acceleration and deceleration capability is reduced by tuning at a speed other than the desired operating speed of the system.
The axis configuration parameters that MRAT generates as output for CIP axis are shown in this table:
Axis Parameter | Data Type | Units | Meaning |
Tuning Status | Integer | - | The Tune Status attribute returns status of the last run Inertia Test service that initiates a process on the targeted drive axis. |
Tune Accel Time | Real | Seconds | Measured Acceleration time in seconds of the Tuning profile. |
Tune Decel Time | Real | Seconds | Measured Acceleration time in seconds of the Tuning profile. |
Tune Accel | Real | Position Units/sec2 | Measured Acceleration of the Tuning profile. |
Tune Decel | Real | Position Units/sec2 | Measured Deceleration of the Tuning profile. |
Tune Inertia Mass | Real | % Motor Rated / (Motor Units/Sec2) | The estimated inertia or mass for the axis as calculated from the measurements made during the tuning process. |
Tune Friction | Real | % Rated | The amount of friction measured during Tuning profile. This value can be used to configure the Friction Compensation feature of the drive. |
Tune Load Offset | Real | % Rated | This value represents the active load offset measured during the Tune profile. This value can be used to set the Torque Offset of the drive to cancel out the active load torque/force. |
Position Servo Bandwidth | Real | Hertz | It represents the unity gain bandwidth of the position loop that is used to calculate the position loop gains. |
Velocity Servo Bandwidth | Real | Hertz | It represents the unity gain bandwidth of the velocity loop that is used to calculate the velocity loop gains. |
The above output parameters generated by the MRAT instruction serve as inputs to compute the Position and Velocity loop gains, Position and Velocity Error Tolerances, Feed Forward Gains, Load Ratio, Maximum Acceleration, Maximum Deceleration, System Inertia, System Acceleration and Friction Compensation.
If the Gain Tuning Config Bits parameter bit zero is the Run Inertia Test Bit. This bit determines whether or not the MRAT tuning instruction will send a Test Inertia service to the drive to perform an inertia measurement. If this bit is set, the Inertia Test shall be performed. If the bit is clear, the MRAT will immediately complete without an inertia measurement. It will only calculate the Pos and Velocity Servo Loop Bandwidths based on the Loop response or the Damping factor.
Tune Status Parameter
Conditions may occur that make it impossible for the controller to properly perform the tuning operation. When this is the case, the tuning process is automatically aborted and a tuning fault reported that is stored in the Tune Status output parameter (GSVable). It is also possible to manually abort a tuning process using a Motion Axis Stop (MAS) instruction which results in a tuning fault reported by the Tune Status parameter. This table shows possible values for Tuning Status.
Status Code | Code | Meaning |
Tune Success | 0 | Tune process has been successful. |
Tune In Process | 1 | Tuning is in progress. |
Tune Aborted | 2 | Tuning Process was aborted. |
Tune Time-out | 3 | Tuning Process has timed out. |
Tune Servo Fault | 4 | Tuning Process Failed due to Servo Fault. |
Tune Travel Fault | 5 | Axis reached Tuning Travel Limit. |
Tune Polarity Fault | 6 | Axis motion heading in wrong direction due to incorrect motor/encoder polarity configuration. |
Tune Speed Fault | 7 | Axis tuning speed too low to achieve minimum measurement accuracy. |
Tune Configuration Fault | 8 | The specified axis tuning configuration is not allowed and a fault occurs. |
Tune Not Allowed In Axis Test Mode | 128 | The axis that is in Axis Test Mode. |
IMPORTANT:
The Tune Status Parameter is not to be mistaken for the .STATUS sub-tag of the MRAT instruction.
To successfully execute a MRAT instruction on an axis, the targeted axis must be configured as a Servo Axis Type, the axis must be in the Axis Ready state and Axis Test Mode must be disabled. If any of these conditions are not met then the instruction returns an error.
IMPORTANT:
When the MRAT instruction is initially executed the In Process (.IP) bit is set and the Process Complete (.PC) bit is cleared. The MRAT instruction execution can take multiple scans to execute because it requires transmission of multiple messages to the motion module. The Done (.DN) bit, is not set immediately, but only after these messages are successfully transmitted. The In Process (.IP) bit is cleared and the Process Complete (.PC) bit is set at the same time that the Done (.DN) bit is set.
In this transitional instruction, the relay ladder, toggle the Rung-condition-in from cleared to set each time the instruction should execute.
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 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 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 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. The following Extended Error Codes help to pinpoint the problem when the MRAT instruction receives an error message.
Associated Error Code (decimal) | Extended Error Code (decimal) | Meaning |
SERVO_MESSAGE_FAILURE (12) | Process terminated on request (1) | Tune execution followed by an instruction to shutdown/disable drive, or a motion stop instruction or a Processor change requests a cancel of Tune. |
SERVO_MESSAGE_FAILURE (12) | Object Mode conflict (12) | Axis is in shutdown. |
SERVO_MESSAGE_FAILURE (12) | Device in wrong state (16) | Incorrect Tune Process order. (SERCOS) |
TUNE_PROCESS_ERROR (14) | Tune Test prohibited (1) | Axis Test Mode enabled- Tune Test is not supported in this configuration. |
Status Bits
MRAT Changes to Status Bits
Bit Name | State | Meaning |
DriveEnableStatus | TRUE | Axis is in Drive Control state with the Drive Enable output active while the Tuning Profile is running. |
TuneStatus | TRUE | The axis is running a tuning process. |
Example 1
When the input conditions are true, the controller commands the servo module to run a tuning motion profile for Axis1.
Ladder Diagram
Neutral Text for Ladder Diagram Normal Scan
MRAT (Axis1, MRAT_1);
Structured Text
MRAT(Axis1, MRAT_1);
Example 2
When the input conditions are true, the controller commands the servo module to run a tuning motion profile for Axis1 through a reference to it.
Ladder Diagram
Neutral Text Representation for RLL
MRAT(Ref_Axis1, MRAT_1);
Structured Text
MRAT(Ref_Axis1, MRAT_1);
Provide Feedback