Motion Direct Drive On (MDO)

This information applies to the
CompactLogix
5370,
ControlLogix
5570,
Compact GuardLogix
5370,
GuardLogix
5570, and
ControlLogix
5580 controllers.
Use the Motion Direct Drive On (MDO) instruction in conjunction with motion modules that support an external analog servo drive interface. This instruction activates the Drive Enable of the module, enabling the external servo drive, and also sets the output voltage of the drive of the servo module to the specified voltage level. The value for Drive Output may be specified in Volts or % of maximum axis’ Output Limit.
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
MDO_LD_avail_v31
Function Block
This instruction is not available in function block.
Structured Text
MDO(Axis,MotionControl, DriveOutput,DriveUnits);
Operands
Ladder Diagram and Structured Text
Operand
Type
ControlLoigx 5570, ControlLogix 5580, GuardLogix 5570, and GuardLogix 5580
Format
Description
Axis
AXIS_SERVO
Tag
Motion Axis of data type AXIS_SERVO only. 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.
Drive Output
SINT
INT
DINT
REAL
Immediate
or Tag
Voltage to output in % of servo Output Limit or in Volts.
Drive Units
Boolean
Immediate
How do you want to interpret the drive output?
0 = Volts
1 = Percent
See
Structured Text Syntax
for more information on the syntax of expressions within structured text.
Enter your selection for the operands that require you to select from available options:
This Operand
Has These Options Which You...
Enter As Text
Or Enter As a Number
DriveUnits
Volts
Percent
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’ drive enable bit is activated and the specified analog output is successfully applied.
.ER (Done) Bit 28
It is set to indicate that the instruction detected an error, such as if you entered a Drive Output value that was too large.
Description
For motion modules with an external servo drive interface, the MDO instruction can be used to directly enable the Drive Enable output of the axis and set the analog output to a specified level determined by the Drive Output parameter. The Drive Output parameter can be expressed as a voltage, or as a percent of the maximum configured output voltage value given by the Output Limit attribute.
The MDO instruction can only be used on a physical axis whose Axis Type is configured for Servo. The instruction only executes when the axis’ is in the Axis Ready state (for example, servo action is OFF). The resulting state of the axis is referred to as the Drive Control state.
The MDO instruction automatically enables the specified axis by activating the appropriate Drive Enable output before setting the servo module’s analog output to the specified voltage value. There is, typically, a 500 msec delay between the activation of the drive enable output and the setting of the analog output to the specified level to allow the drive’s power structure to stabilize. To minimize drift during this drive enabling delay, the output voltage to the drive is set to the Output Offset attribute value (default is zero). Thereafter the output voltage is given by the specified Drive Output value of the MDO instruction and indicated by the Servo Output status attribute value.
The 16-bit DAC hardware associated with various Logix servo modules limits the effective resolution of the Direct Drive Motion Control to 305 Milli (mu)V or 0.003%. In the case of Direct Drive operation, the module’s servo loop is inactive and bypassed. The Motion Direct Drive On instruction is only affected by the Servo Output Polarity configuration bit, the Output Offset, and Output Limit attributes for the axis. In the case where Output Limit configuration value is reduced below the current output voltage value, the Servo Output value is automatically clamped to the Output Limit value.
The most common use of this instruction is to provide an independent programmable analog output as an open loop speed reference for an external drive or for testing an external servo drive for closed loop operation.
To successfully execute a MDO instruction, the targeted axis must be configured as a Servo axis and be in the Axis Ready state, with servo action off. If these conditions are not met 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.
This 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.
Loss of Feedback When Using an MDO Instruction
If you experience a loss of feedback when issuing an MDO instruction and need to move the axis with an MDO instruction, follow these steps:
  1. Set the Feedback Fault Actions to Status Only.
  2. When a feedback fault occurs, issue an MSF instruction to turn the servo off.
  3. Issue an MAFR instruction to clear the feedback fault status.
The MDO instruction executes without another feedback fault shutting down the system. However, the feedback fault status remains feedback fault condition exists.
IMPORTANT:
  • Keep this in mind when using the previous steps:
  • Once feedback has been lost, the reported position may not be valid. To re-establish a valid position, perform another home operation.
  • If you need to issue another MDO instruction, such as to modify the output voltage, when the first MDO instruction is executing, you must first issue an MSF instruction to stop the servo and then issue an MAFR instruction to clear the feedback fault.
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 Axis operand. See
Common Attributes
for operand-related faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
The .EN, .DN, and .ER 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. If the EN bit is set to false, there is no action taken,
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.
Extended Error Codes
Extended Error Codes provide additional instruction specific information for the Error Codes that are generic to many instructions. See Error Codes (ERR) for Motion Instructions.
These Extended Error codes help to pinpoint the problem when the MDO instruction receives a Servo Message Failure (12) error message.
Extended Error Code (decimal)
Associated Error Code (decimal)
Meaning
Object Mode conflict (12)
SERVO_MESSAGE_FAILURE (12)
Axis is shutdown.
Status Bits
MDO Changes to Status Bits
Bit Name
State
Meaning
DriveEnableStatus
TRUE
Axis is in Drive Control state with the Drive Enable output active.
Examples
Example 1
The Drive Output operand is a DINT tag and Drive Units is "Volts"
Ladder Diagram
MDO_LD_ex1_v31
Structured Text
MDO(myAxis, myMotionControl, myDriveOutput_DINT, volts);
Example 2
The Drive Output operand is a REAL tag and Drive Units is "Percent"
Ladder Diagram
MDO_LD_ex1_v31
Structured Text
MDO(myAxis, myMotionControl, myDriveOutput_REAL, percent);
Example 3
The Drive Output operand is a DINT tag and Drive Units is “Volts”
Relay Ladder
L5K_MDO_LD_ex3_v31
Structured Text
MDO(myAxis, myMotionControl, myDriveOutput_REAL, percent);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.