<< Click to Display Table of Contents > 

SAMLight Manual > Motion Control Settings > Other motion controller > Type 5 - IMS MDrive

Type 5 - IMS MDrive
Previous pageReturn to chapter overviewNext page

Key features

Available for USC and RTC controller cards

Up to 7 axes can be controlled

Axes operate in party mode and move at the same time (without synchronization)

The MDrive motor is controlled via a serial port, e.g. COM port of the PC or the RS-232 interface of an USC controller card

Homing procedures available

 

Required settings

Before SAMLight can communicate and control the MDrive motor you need to define some parameters directly at your MDrive motor (e.g. via IMS Terminal or Windows HyperTerminal, refer to 'Hardware settings (type 5)' described below).

Control all MDrives in IMS Terminal or Windows HyperTerminal before you try to control them by SAMLight to make sure the settings of the MDrives are correctly. Use the same settings for the HyperTerminal as for SAMLight ('PortName', 'PortParity' and 'PortBaudRate').

Set 'Type=5' in sc_motion_settings.txt in <SCAPS>\system\

Define sc_motion_mdrive_settings.txt in <SCAPS>\system\ like described below.

Enable 'Motion Control' in SAMLight (Settings→System→Extras).

 

How to create the settings file

The file 'sc_motion_mdrive_settings.txt' is a plain text file that contains different configuration parameters.

A line which begins with a # sign is interpreted as a comment and will be ignored.

All parameters have to start exactly at the beginning of a line.

Use integers for every parameter value, decimal points will be ignored.

Global parameters have to be specified only once at the head of the settings file.

Axis-specific parameters have to be defined for all axes separately.

The axis-specific and the optional parameter have to be arranged in one block of parameters per axis. Each block begins with the parameter 'axis'.

The optional parameters do not have to be specified in the case you do not want to use them.

A parameter gets defined by typing <parameter>=<value>, parameter and values are described below,
e.g. 'axis=0' defines the parameter 'axis' with the value '0'

 

Hardware settings (type 5): These settings have to be defined directly at every MDrive motor.

 

warning

Connect only one motor for the hardware settings to the COM port and repeat this steps for each MDrive motor.

Necessary steps for every motor before SAMLight can control MDrive motors.

Before SAMLight can communicate and control the MDrive motor you need to define the following parameters directly at your MDrive motor (e.g. via IMS Terminal or Windows HyperTerminal). The actual MDrive commands may vary  a bit compared to the commands you find here. For further information see the MDrive manual.

Suggested MDrive command

Function

PR AL

Prints all MDrive values:
Echoes all motor parameters. While party mode is disabled no prefix '?' is used.

DN=?

Defines device name:

'?' has to be a single capital character. Use a unique value '?' for each MDrive motor.

E.g. 'DN=X' (if party mode is disabled)

PY=1

Enables party mode:

Party mode is necessary to address the commands from SAMLight to the right MDrive motor, even you want to use only one motor.

If the MDrive is in party mode you need to specify every command with the prefix '?' which corresponds to the device name. This is necessary to address commands to the right device because all motors communicate through a single COM port.

?IP

Initializes parameters for the '?'-axis:

Discards all temporary changes and applies the stored values of the MDrive motor.

?EM=2

Disables Echo mode for the '?'-axis:

Suppresses echoing of almost all MDrive commands.

?DE=1

Enable the motor driver for the '?'-axis.

?S

Saves settings for the '?'-axis:

E.g. 'XS' (if party mode is enabled)

E.g. 'S' (if party mode is disabled)

?PR AL

Prints all MDrive values for the '?'-axis:
Echoes all parameters stored directly at the motor.

 

Global parameters (type 5): These parameters have to be defined once at the head of the settings file.

 

PortName

Defines the serial port  used for the MDrive motors.

Value

Function

COM#

Uses a COM port of the PC where '#' is the port number (e.g. 'COM1').

USC-1

Uses the RS-232 interface of the USC card at the 37-pin connector (CH_0). For further information please refer to the corresponding USC manual.

USC-2

 

PortParity

Defines the parity mode for the COM port.

Value

Function

0

No parity

1

Odd parity

2

Even parity

3

Mark parity

4

Space parity

The default value that is used by most IMS MDrives is '0'.

 

PortBaudRate

Defines the data rate for the COM port.

Unit: Bd (bit/s)

The default value that is used by most IMS MDrives is '9600'.

 

TimeOut

Sets the connection timeout.

Unit: s

Sets how long it shall tries to access the communication between interface and the motion controller. If you have connection problems the debug mode (see below) could be helpful.

 

Debug

Enables the debug log.

Value

Function

0

Disable debug mode

1

Enable debug mode

Enables debug mode to log debug information in <SCAPS>\system\sc_motion_mdrive_debuglog.txt'. Only enable this option if you need it, because there can be huge amounts of data that are logged into this file.

 

DisableHomingDuringStartUp

No homing on startup.

Value

Function

0

Enable homing on startup of SAMLight

1

Disable homing on startup of SAMLight

If set to '1', homing is just performed when pressing 'Control→Home' and not when software is started.

 

RtsControl

Enables or disables RTC (Request to Send) for the RS232 connection for MDrive's RS232-USB-adapter if used.

Value

Function

0

set RTS_CONTROL_DISABLE

1

set RTS_CONTROL_ENABLE

If this parameter is not set the internal default state '1' is used.

This parameter is available starting with installer 3.7.5 Build 0033.

 

CheckForProgramRunning

Enables or disables checking for a MDrive subroutine after homing.

Value

Function

0

Disable CheckForProgramRunning

1

Enable CheckForProgramRunning

If this parameter is not set the internal default state is '1'. In case after homing an own subroutine is used that returns a '1' for 'PR BY' (Print Busy), CheckForProgramRunning should be set to '0'. This parameter is available starting with installer 3.7.5 Build 0035.

 

Axis parameters (type 5): All of the following parameters has to be defined for each axis after the global parameters in the settings file. Each of these axes can be configured differently.

 

axis

Sets the number of axis.

Value

Function

0...6

Index of axis

Zero based index of up to 7 axes. Defines the display order in SAMLight. This parameter has to be at the beginning of each axis specific parameter block.

 

dname

Sets the name of axis.

Value

Function

A...Z

Name of axis

Has to correspond to the device name 'DN' which is stored directly at the MDrive motor. (Refer to 'Hardware settings (type 5)').

Has to be an unique single character for each MDrive motor.

 

mode

Sets the type of the axis.

Value

Function

POSITION

Defines a straight axis [mm].

ANGLE

Defines a rotational axis [°].

Depending on the mode of the axis several parameters has to be adjusted (corr#, incperrot, sfactor, llimit, hlimit, defspeed, see below).

 

corr1 -1000 -20000000

corr2  -500 -10000000

corr3     0         0

corr4   500  10000000

corr5  1000  20000000

 

<corr#>      <mm#>       <steps#>

 

 

Correction table converts mm into steps and defines the range of the axis for POSITION mode.

These five parameters are defined without '=' sign in the form

<corr#> <mm#> <steps#>

Setup for linear corr table:

The range of the axis in mm corresponds to the difference of the max. value <mm5> and min. value <mm1>. The other mm-values have to be linearized.  The step-values can be calculated by:

<steps#>  = <mm#> * factor

The factor can be determined experimentally if not known.

 

Non-linear corrections:

This table can be used to compensate non-linearities of a straight axis by adjusting the values.

 

For ANGLE mode these parameters are ignored, the parameter 'incperrot' is used instead.

 

incperrot

Converts degrees into steps for ANGLE mode.

Unit: steps/360°

This value defines how many increments are needed for a whole rotation.

The default value is 51200 and depends on the MDrive setup 'MS' (micro steps). It can be  calculated by 200 * 'MS'.

For POSITION mode this parameter is ignored, the <corr#> table is used instead.

 

sfactor

Sets speed factor.

POSITION mode, unit: steps/mm

ANGLE mode, unit: steps/°

Value has to be equal to the factor of the corr table for a linear corr table.

Value has to be equal to
(1/360)*'incperrot'.

Converts mm/s (or °/s) used in SAMLight into steps/s.

 

llimit

Sets the lower limit for the axis.

Unit: steps

No movement below this limit will be possible. This value is used for POSITION and ANGLE mode and has to be equal to the <steps1> value of the corr table.

 

hlimit

Sets the upper limit for the axis.

Unit: steps

No movement above this limit will be possible. This value is used for POSITION and ANGLE mode and has to be equal to the <steps5> value of the corr table.

 

hslimit

Sets the upper speed limit.

Unit: steps/s

No speed above this speed limit will be possible. To get the 'hslimit' in steps/s like it is required here the value in mm/s (or °/s) has to be multiplied by the 'sfactor'.

 

defspeed

Sets default speed displayed in SAMLight user interface.

POSITION mode, unit: mm/s

ANGLE mode, unit: °/s

This value has to be smaller or equal than 'hslimit'/'sfactor'.

 

Optional axis parameters (type 5): All of the following optional parameters can be defined for each axis. Each axis can be configured differently. If no parameter is specified the corresponding feature will not be used.

 

invertDir

Defines the motion direction.

Value

Function

0

Default rotation

1

Inverted rotation

 

ival

Sets initialization parameters.

On startup of SAMLight every axis can be initialized with this ival parameter. This parameter can exist more than once and will be executed in the same order as they appear in the settings file.

Each parameter corresponds to any MDrive command the drive supports.

Recommended initialization parameters (refer to your MDrive manual for further information):

 

ival=IP

ival=EM 2

ival=DE

 

hval

Sets homing parameters.

With hval parameters MDrive commands a homing procedure for each axis can be defined. This parameter can exist more than once and will be executed in the same order as they appear in the settings file. The homing procedure will be executed on startup of SAMLight and by a manual homing. The homing procedure at startup of SAMLight can be disabled with global parameter  'DisableHomingDuringStartUp'.

Suggested Mdrive commands for programming a homing procedure (for further information refer to MDrive manual):

'PG', 'HI', 'HM', 'P', 'S1'

Example 1:

 

No homing movement

 

Current position is set to <position> in steps.

 

hval=P <position>

Example 2:

 

Referencing using a home switch

 

I/O number one is used for the home switch (low active); the drive is moving into negative direction with <speed> in steps/s until that input goes to low triggered by a home switch. Afterwards the current position is set to <position> in steps.

 

hval=PG 100

hval=VM <speed>

hval=S1 1,0

hval=HM 1

hval=H

hval=P <position>

hval=E

hval=PG

hval=EX 100

 

Example sc_motion_mdrive_settings.txt file for 1 straight and 1 rotational axis for 'Type=5':

# Global parameters:

PortName=COM1

PortParity=0

PortBaudRate=9600

TimeOut=10

Debug=0

 

# X-axis parameters:

axis=0

dname=X

mode=POSITION

corr1 -1000 -20000000

corr2  -500 -10000000

corr3     0         0

corr4   500  10000000

corr5  1000  20000000

sfactor=20000

llimit=-20000000

hlimit=20000000

hslimit=500000

defspeed=25

invertDir=0

 

ival=IP

ival=EM 2

ival=DE 1

 

hval=P 0

 

# R-axis parameters:

axis=1

dname=R

mode=ANGLE

incperrot=51200

sfactor=142        

hslimit=500000

defspeed=250

invertDir=0

 

ival=IP

ival=EM 2

ival=DE 1

 

hval=P 0