1. Launch Lexium MDrive Software Suite.
  2. Launch Lexium MDrive Ethernet Interface.
  3. Select appropriate NIC adapter from the drop down menu and press the “Select” button. For the purpose of this example NIC adapter was used.
  4. Enter the IP address in the upper right corner and press “Connect” to establish communication. For the purpose of this example, the motor IP address was
  5. Press “Read All” to test communication and verify application protocol.
  6. The default application protocol for the Lexium MDrive is MODBUS/TCP. In order to create/save user-defined data types, we must change the application protocol from MODBUS/TCP to Ethernet/IP. Please select Ethernet/IP from the Application Protocol drop-down menu and press the “Set”  button.
  7. Press the “OK” button from the Fieldbus application change message and cycle power to the unit from the AC side of the power supply or press the “Reset Drive”   button to save
    the application protocol change.
  8. Press the “Connect” button in the upper right-hand corner to re-establish communications.
  9. Press the “Read All” button to verify that the application protocol change was successfully saved.
  10. Select E.I.P tab to configure implicit inputs and implicit outputs.
  11. Press the “Get”  button to receive the motors current implicit input and implicit output configuration.
  12. Modify the implicit input and implicit output configuration as necessary. Press “Set” after changes have been made.
  13. To create the user-defined data types that can be imported into RS Logix 5000, select File, then select “Save EIP User-Defined Data Types”
  14. Choose the location to save the implicit output user-defined data type and the implicit input user-defined data type. Please note it is not recommended to change the file name from the default value.
  15. Disconnect and Close the Lexium MDrive Ethernet Interface.


RS-422/485 MDrive products can appear to have a communications failure when it is merely in a mode that prevents it from responding to or echoing back, instructions in SEM Terminal.

Settings that can cause this include

  • Party Mode (PY=1)
  • Checksum (CK=1)
  • Echo Mode (EM=1or2)
  • Incorrect Baud Rate (BD)

Also, check the scroll bar in the terminal window. If it is not all the way down, you may not see what the driver sends back.

When you have communications problems, the simplest fix may be to set your driver back to factory defaults using the instruction “FD”. To prevent defaulting all the drivers in your system, you may want to plug your communications cable into only the driver you are working on.

Make sure that you have a backup copy of the all variable settings and program before doing this.

By inserting a string of text into one of the function keys in a Terminal window in SEMTerminal, it can be sent to the driver as a continuous string of characters:

(copy / paste string above) To do this, open SEM Terminal and click on the terminal window. If there is no terminal window open, open one using View > New Terminal Window.

Figure 1: Terminal window showing function key group

Right-click on the function key area at the bottom of the terminal window. The function key setup dialog will open.

Figure 2: Function key setup dialog
Pick one of the function keys and type something like “Reset FD” into the Caption. Then highlight, cut and paste the character string given above into the Contents window of that row and click on Done. When that function key is pressed, the string will be sent. Note that there are delays in this string and it takes about 4 seconds to complete. When you are able to communicate with the driver, type “S” then a carriage return. This will save the defaults.

If you still haven’t established communications, try setting SEM Terminal to different baud rates. This is done by Right-clicking the text area of the terminal window and select Preferences.

Figure 3: Terminal settings dialog
Figure 3: Terminal settings dialog


Then select the Comm Settings tab. Select the baud rate desired and make sure that the radio button for MDrive is selected. Select Done, then try your function key. You may have to try all the possible baud rates.

The MDrivePlus Motion Control products represent significant improvements over the legacy MDrives. Based on new patented technology, they feature a richer software command set, improved current control, and enhanced thermal dissipation.

Along with these improvements, there may be situations where the MDrivePlus are not “drop-in replacements” for existing legacy MDrives. Some customers may have software that will not run on MDrivePlus units without syntax modifications. There may be timing differences in some command executions that could affect system response. Additionally, it is recommended that customers with close tolerance or clearance situations study the mechanical drawings for the MDrivePlus units.

The following summarizes differences and steps required to successfully transition an application that uses a legacy MDrive to an MDrivePlus.


Software / Programming Issues

HT Command (Hold Current Delay Time)
The HT command functions differently when transitioning from legacy to plus MDrive units. In legacy units HT=0 will set the delay time to 0, with the unit shifting immediately to holding current percent from run current.

HT=0 in plus units will cause the units to never transition to hold current and the unit will be at the run current percent at all times. HT =1 is the smallest delay time allowable on plus units.

Legacy progams with HT=0 should be modified to HT=1 for the same performance and to avoid issues with motor over-heating.

Commands and Variables:
New commands in the MDrivePlus products were developed to add more programming options for OEMs. Existing legacy MDrive applications that use these new commands for user-defined labels or variables will not run properly on the MDrivePlus products. Legacy MDrive programs that use labels or variables that coincide with new commands need to have those labels or variables renamed.

Here is an alphabetical listing of MDrivePlus commands that should be not be used as a label or variable:

C1 EE I9 – I12 MR QD TP
C2 EF I13 MS R1 – R4 TR
CL ES IL O9 – O12 S V

New Command to MDrivePlus
Reserved Word, not accessible

Command syntax changes
Command syntax changes may be an issue prior to firmware version 3.004. Units shipped after December 1, 2006 have version 3.004. MDrivePlus products with earlier firmware require a space between the command and value with motion commands, while variable assignments needed an equal sign.

Pre ver. 3.004:

Ver. 3.004 and later:

Some MDrivePlus commands vary in execution time from legacy MDrive. Approximate timing for MDrivePlus command execution:

PG addr 282 mSec
PR Mv 1.4 mSec
PR er 1.5 mSec
S 600 mSec

The following times for MDrivePlus are from command entry until the motor begins to move:

MR dist 3.5 mSec
MA pos 3.5 mSec
SL vel 0.7 mSec
HI type 0.7 mSec
HM type 0.7 mSec


Electrical Issues

Auxiliary power source through the communication cable MD-CC400-000 is discontinued via IMS Product Advisory dated November 17, 2006. It is recommended that users with existing cable assemblies cover the jack access hole to prevent use. Do not use Communication Ground on Communications Port (P2) for the Auxiliary Power Supply.

The open state of a sinking I/O point for MDrivePlus is now 2.3vdc where legacy MDrive was 5vdc. For example: With S1=0,0,0, the open circuit voltage on I/O 1 will read 2.3vdc.

RS-485 Connector Changes (P2):

10 Pin IDC (RD option)

Signal Legacy MDrive MDrive Plus
TX+ 9 9,1
TX– 8 8,2
RX+ 6 6,3
RX– 7 7,4
Gnd 10 10 – Comm Gnd –
100 Ohms to Motor Gnd
(1–5 no connection) 5 – Aux Power In


Mechanical Issues

MDrivePlus products have some dimensional differences from legacy MDrive in regard to housing geometry and overall depth. If the end user’s fit and clearance is in question, careful review of the published mechanical drawings will be required.



What is noise?

“Noise” or “Interference” consists of unwanted electrical signals which superimposes on and masks the desired signal. Designing a control system is challenging enough, but designing a control system that has noise immunity adds a whole other dimension. Ideally, you want the noise-to-signal ratio to be as small as possible. Noise is always present in a system that involves high power and small signal circuitry. The key is to manage the noise so that it does not interfere with the performance of the system at hand.


Sources of noise

Sources of noise can be external to the stepper motor system as well as within. The most common external sources are relays and motors. Internally, the relatively high current motor drivers are the source. All bi-polar stepper motor drivers apply a chopping function to the applied voltage of each phase. This chopping enables use of higher voltages than the motor is rated for, achieving higher speeds while keeping the motor from getting too hot. The combination of the chopping and inductance of the motor creates noise on the ground plane. This [ground plane noise] can be introduced into nearby external systems if proper wiring and shielding precautions are not taken. The result can be intermittent failures of the system as a whole.

Components of noise and how to manage them
In order to manage noise it is important to understand its components. Noise [Interference] is categorized into two groups: radiated and conducted. Radiated interference is transmitted by electromagnetic fields and picked up by the antenna effect of other equipment. If it were always possible to isolate susceptible receivers and radiating sources from one another, radiated interference would be more manageable. As distance increases, radiation fields become weaker thus energy becomes dampened along a conduction path. Unfortunately with today’s limited system real-estate, distance isn’t usually an option. Reducing the antenna effect and adding shielding, controls this type of interference. (Improper shielding can cause more problems than no shielding at all. (See Wiring and Noise Shielding Best Practices.)

Conducted interference is that which is introduced into a circuit by either direct or indirect coupling. Both direct and indirect coupling are classified into three specific types: Resistive, Capacitive, and Inductive. These types of coupling are most frequent where common return circuits and power supply grounds exist. Conducted interference can originate from a variety of sources, such as relay and switch contacts, fan motors, power switching or digital devices with short rise and fall times. The effect of conducted interference cannot be eliminated as easily as shielding eliminates the effect of radiated interference. Good wiring practices are necessary to minimize Conducted interference. Give close consideration to connections to and from power supplies. Give particular attention to common grounds. Ultimately, the whole system must be referenced to them. (See Wiring and Noise Shielding Best Practices.)

How to detect noise

The first step in troubleshooting a noise problem is acquiring the right tools for the task. An isolated Oscilloscope is the chosen tool for detecting noise. A battery powered scope [if one is available] achieves the best circuit isolation, however a scope with an isolated ground will still be an effective tool. Also, keep in mind that a Digital scope may mask the noise depending on it’s sample rate and frequency response. Therefore, an Analog Oscilloscope is better than a Digital scope for detecting asynchronous signals of high frequency such as noise. Along with the scope, a wiring diagram and a basic knowledge of the systems operation are the best tools. The next step is to simplify the system. Start by removing power; then disconnect all system components from the Stepper driver that are not absolutely necessary for basic motion. Keep an open mind, even experiment a little by using a jumper wire to introduce noise and simulate the failure mode you are experiencing. Remember there may be more than one noise source.

SEM encourages our customers to ask questions and take advantage of our Application Support Team early in your design. We can review your system and make suggestions on the interfacing and wiring practices. We may suggest other tips that are application specific, but as a starting point refer to Wiring and Noise Shielding Best Practices for the basic rules.

Check Hardware and wiring

Check power supply and cabling
  • Check cabling and connections from:
    1. AC Line to DC motor voltage supply.
    2. DC supply to Lexium MDrive.
  • When power is ON, LED 1 on the upper-right of the Lexium MDrive heat sink should be solid green.
Check Communications adapter and cabling – SEM MD-CC404/5-000
  • Ensure the adapter is firmly seated in the USB port of your PC or notebook
  • Verify that the DB9 is firmly seated and the screws are tightened. If M12, verify the connector is fully inserted, and the bayonet-lock is engaged.
Check Communications adapter and cabling – Third-party adapter/cable
  • Ensure the adapter is firmly seated in your PC or notebook
  • Verify that the DB9 is firmly seated and the screws are tightened. If M12, verify the connector is fully inserted, and the bayonet-lock is engaged.
  • Ensure the crossover between the interface and Lexium MDrive (Rx—Tx / Tx—Rx).
  • Using a multimeter, ring out the cable conductors to verify correct connection of all signals

Check software settings

Verify selected COM Port settings
  1. Open both the Motion Control Programmer settings dialog and the Computer’s Device Manager. Verify that the selected COM port matches what the adapter is installed on.
  2. In the device manager, right-click on the COM port, select “Properties.”
  3. Verify that the adapter drivers are operating correctly as indicated in the “Device status” text area (1). Do not close the properties dialog.
  4. Click the “Port Settings” tab of the COM Port properties dialog, verify the selected BAUD rate matches that set in the Motion Control Programmer Terminal settings dialog.
Verify Lexium MDrive settings
  1. On the Motion Control Programmer, select the menu View > Find Comm. Settings, Click Find (1).
  2. Wait while the test runs through the various BAUD Rates/Settings. If settings differ from the defaults, adjust the settings to match the Lexium MDrive.

If still unable to establish communications, perform a loop back test to identify where in the communications chain the error is occurring.

Loop-back test procedure

  1. Ensure the MDrive product is in a powered down state.
  2. Disconnect the cable from the MDrive communication port.
  3. Add jumpers as shown in the drawings below.
  4. Type characters into the terminal window.
  5. If characters now echo to the terminal screen, there is a communication problem with the Lexium MDrive product.
  6. If typed characters are still not visible, there is a problem with the adapter cable, Motion Control Programmer configuration, or personal computer communication port.

The following diagrams are oriented with the cable end facing the user.

MD-CC404-000 Communication Converters (Lexium MDrive DB9)

FIgure 1: DB9 Loop back

MD-CC200-000 or MD-CC400-001 Communication Converters

Figure 2: IDC loopback wiringiMD-CC402-001 Communication Converter

Figure 3: 10-pin wire crimp (Hirose) loopback wiring

MD-CC401-001/MD-CC405-000 Communication Converter


Figure 4: M12 loopback wiring

Party Mode Exception

If the loop back test results indicate a functioning communication link, there is still a chance that the MDrive is communicating properly, but configured in the party mode and you don’t know the device name.

The following command sequence will retrieve the MDrive’s name. There maybe no terminal feedback while typing the characters. Type: [CTRL + J]*PR[space]DN[CTRL + J]. The MDrive should return its name in quotes. Further communication then can be carried out by properly addressing the unit by name. The following command sequence will place the MDrive in the factory default state: [CTRL + J]*FD[CTRL + J]. All parameters will be replaced with the factory defaults and all programs erased. There will be no terminal feedback while typing the reset characters and the SEM copyright sign on message will be the result.


The motor power supply input common (GND) is connected internally to the common of the communication port. When two or more units are connected in the party mode, or multi-drop configuration, a “ground loop” is created.

This occurs because the common (communication ground) which connects the communication ports of all connected devices is in parallel with the system power common. This can allow the motor power current to flow through the communication port of another device and vice versa.

Figure 1 shows this recirculation where I1 represents the total current, I2 is return current through the power ground path, and I3 is the current recirculating through the communication ground path.

Recriculating currents in RS-422 multipoint system
Figure 1: Recirculating currents in RS-422 multipoint system

Eliminating the recirculating current in this system is accomplished quite easily by:

  • Using an isolated communication converter such as the MD-CC40x-001.*
  • Connecting the isolated ground of the communication converter direct to power ground.
  • Leave the communication ground pin on the device open. Communications will still be grounded via power common without the path for recirculating currents.

Figure 2 shows an example of this connection scheme.

Recirculating currents eliminated
Figure 2: Recirculating currents eliminated

Allowing resident MCode program scripts to function in protocol EtherNet/IP with Lexium MDrive Ethernet devices that include TCP/IP application version and up, is now available.

Lexium MDrive Ethernet TCP/IP Configuration Utility contains an “E.I.P.” tab with a frame in the lower left-hand corner labeled “I/O Implicit connection test”. Two Boolean entities are described as follows on their function regarding the enabling of resident program operation with EIP.

To allow resident MCode program scripts to run:

  1. Turn off I/O implicit writes.
    • If ‘Halt Motion’ is ON, an ‘EX 1’ will be issued on every valid EIP implicit I/O connection and an ‘Esc’ will be issued on an I/O connection lost.
    • If ‘Halt Motion’ is OFF, then no ‘EX 1’ or ‘Esc’ commands are issued allowing an ‘SU’ label to be used in an MCode script.
  2. Observe the following closely in your MCode script to be executed via EIP:
    • Always use “H 1000” on the first line following all “SU” labels or methods residing @ address “1”.
    • Do not use or save any “PR”, “L” or “EM” mnemonics in resident programs or saved parameter statements.The following additions have been added to the explicit EIP class 0x64
  3. The following additions have been added to the explicit EIP class 0x64:
    Access Class Instance Attrib Data type Mnemonic
    WO 0x64 0x01 0x06 MDRV_STRING EX
    RO 0x64 0x01 0x07 MDRV_BIT BY
    RW  0x64 0x01 0x08 MDRV_I32 V1
    RW 0x64 0x01 0x09 MDRV_I32 V2
    RW 0x64 0x01 0x0A MDRV_I32 V3
    RW 0x64 0x01 0x0B MDRV_I32 V4
    RW  0x64 0x01 0x0C MDRV_I32 V5
    RW 0x64 0x01  0x0D  DRV_I32 V6
    RW 0x64 0x01  0x0E MDRV_I32  V7
    RW 0x64 0x01 0x0F MDRV_I32 V8

    Note variables V1 through V8 need to be defined as user variables in order to be utilized.

When determining the torque requirements of a Stepper Motor application, the effects of Inertia are often over looked.  Many stepper applications are low-performance systems that accelerate and run at a low velocity, then decelerate to a stop.

These systems typically do not require careful inertia calculations to size correctly since most of the torque seen by the drive is friction and load torque that does not vary significantly with changes in inertia.  In this case, the torque required is:

Torque (oz-in)


where F = force in ounces

r = radius in inches.

Torque (T) is equal to force (F) times the radius at which that force acts (r).  The units that are easiest relating to the torque produced by stepper are ounces and inches, so T (oz·in) = F (oz) · r(in) so the units are simple.

When designing systems that are higher in performance, the torque resulting from the acceleration of system inertia may far exceed the torque from friction and load.  In these systems, you must add the torque resulting from acceleration to the torque resulting from friction and load.

Inertia calculations seem intimidating to many people, but there are many online aids that can help.  The basic formula is very similar to one that almost everyone knows:  F=MA which says that force is equal to mass times acceleration.   The one that calculates torque due to inertia has the form: T=I α which says that torque required (T) is equal to moment of inertia (I) times the angular acceleration (α).  The units are far from simple, so here the ones easiest to use with oz · in: T (oz·in) = I (oz· in· sec2 ) · α (radians).

Stepper Motors
Figure 1: Stepper Motors

The capabilities of the different stack length motors are often confusing to people specifying them and designing them into systems.  The best way to think of the capabilities of the different stack lengths of a particular frame size is to think of the trade-offs.  The smaller MDrive stack length has lower torque that persists to a higher speed.  The larger stack length MDrives have the much higher torque that falls off much more rapidly as speed increases.  This is due to substantially higher inductance in the longer stack lengths.  This higher inductance results from the two things that create the inductance in the first place: iron and copper.  Longer stack length motors have more of both.

Iron and copper are also great at producing magnetism and thereby torque.  By their nature, steppers require the interruption and reversal of motor phase current. The higher the inductance, the more time this takes.   The result is that the current in a phase will be switched before it has been able to rise to the nominal value.  Since full current is never reached, the torque output is lower.

This is all very important when gearing is being selected.  There are times when the application needs more torque than a triple stack can provide, so gearing is added. Since the torque falls off with speed is so severe with the triple, some applications that use gearing are done with single stack motors since they can run faster which is required by the gear ratio.

Steppers are different from other motors in that they produce great torque at low speeds, but at higher speeds, that torque starts to fall off quickly (more so in larger stack sizes).  In other motors, like AC or DC motors, the torque is quite constant from low speeds up to some base speed like 1800 RPM or 3600 RPM.  Above that speed, the torque will then start to fall off.  Since they hold their torque to this higher RPM, they have much higher power because power is the product of both speed and torque.

When upgrading a system component from MDrive to Lexium MDrive the key difference in programming is in how the I/O points are configured and used.. In the MDrive the non-isolated I/O points may be programmed as inputs or outputs.

In the Lexium MDrive, the I/O points are fixed as inputs and outputs. In MDrive programs, the sink/source state of the I/O point is set in the user program. In the Lexium MDrive the sink/source state is set by the bias of the Reference input.

The other key difference is the Analog Input. In the MDrive, the input is 10-bit, with a range of 0 to 1024. The Lexium MDrive has a 12-bit analog input with a range of 0 to 4096. Programs not using I/O can generally be loaded onto the device and work without modification. The sample program we will convert uses an input to trigger a routine that will slew the axis a multiple of the analog input and one output set up as a moving output. The program is labeled as SU, so that it will execute on power up or reset.

Program Code (MDrive MCode)

Below is the MDrive MCode program. The bold highlighted lines of code will need to be changed in order to port the program over to a Lexium Motion product.

The first point we will change is I/O #1

Modify the Input

MDrivePlus Lexium MDrive
S1=0,1 Is=1,0

The S1—S4 command has been changed to Is for input setup and Os for output setup In the example, I/O #1 is set as a general purpose input with a sinking interface. To modify the command to function with the Lexium MDrive, The Is (Input setup) command is used by entering Is=[input number],[input function]. Is=1,0 then sets input 1 as a gen- eral purpose input. The available input functions are listed below:

Input Function Table
0 General purpose input
1 Homing function, will function as specified by the homing command (HM).
2 Limit +, will function as specified by the limit command (LM).
3 Limit —, will function as specified by the limit command (LM).
4 G0 input, will run program at address 1 upon activation.
5 Soft stop, stops motion with deceleration and halts program execution. If program is paused (PS), input is ignored.
6 Pause, pause/resume program with motion
7 Jog +, Will Jog motor in the positive direction at Max. Velocity (VM). The Jog Enable (JE) Flag must be set for this to function.
8 Jog —, Will Jog motor in the negative direction at max. velocity (VM). The jog enable (JE) flag must be set for this to function.
11 Reset, When set as RESET input, then the action is equivalent to a ^C entered into a terminal. Note: If setting the input to sourcing, active true, ground the input first or a reset will occur.
12 Capture input will operate with the Trip Capture (TC) trip to run a subroutine when active NOTE: THIS FUNCTION APPLIES TO INPUT 1 ONLY!

Modify the Output

In this program, an output is setup to be active during a move. To change this to function with a Lexium MDrive we will use the Os (output setup) command.

MDrivePlus Lexium MDrive
S2=17,1 Os=1,17

As with the input, the Os command replaces the S2 command in the form of Os=[outut number],[function], in this case Os=1,17 The available output functions are listed on the next page.

Output Function Table
16 USER: General purpose user output.
17 MOVING: output will be active while the axis is in motion.
18 ERROR: will be active when a software error occurs.
19 STALL: Indicates a stall has been detected [Closed loop models only].
20 VCHANGE: velocity changing indicates the axis is accelerating or decelerating.
21 LOCKED ROTOR: indicates the rotor is in a locked state [Closed loop models only].
23 MOVINGPOS: indicates the axis is moving to a specified position.
24 HMT ACTIVE: indicates when HMT is active [Closed loop models only].
25 MAKE UP ACTIVE: indicates when HMT is making up steps [Closed loop models only].
28 TRIP OUT, applies to output 3 only, active low only. Os=3,28,0
29 ATTENTION: indicates a status or statuses as configured by the AO variable.

Modify the Analog Input

To setup the Analog input we will return to the Is (input setup) command.

MDrivePlus Lexium MDrive
S5=9,0 Is=5,9,0

To set the analog input to voltage mode, 0 to +5VDC level the Is command is used as IS=5, [mode],[level] or Is=5,9,0 The parameters for the IS=5 command are listed below.

Analog input mode table
9 Voltage mode
10 Current mode
Analog level table
0 0 to +5V (voltage mode), 0 to 20 mA (current mode)
1 0 to 10V (voltage mode), 4 to 20 mA (current mode)

Modify the Analog Input scaling

The analog input on the Lexium MDrive is 12-bit instead of ten, to set the program to have the same scale factor we need to divide the scale by 4

MDrivePlus Lexium MDrive
SL=I5*100 SL=I5*25

This will give us the same slew rate as with the MDrivePlus.