<< Click to Display Table of Contents > 

SAMLight Manual > Motion Control Settings > Step & direction motion controller > Type 14 - USC-2/-3 stepper controller

Type 14 - USC-2/-3 stepper controller
Previous pageReturn to chapter overviewNext page

Key features

Only available for USC-2 / USC-3 cards

Up to 6 axes can be controlled

All axes can move at the same time if they have the same speed. Otherwise they will move one after another. The X-, Y- and Z-axis can move interpolated so that they reach the final position of the movement at the same time.

The IOs of the USC-2/-3 card are used to control the stepper

Control the motor via step and direction signal

The signals are controlled on the USC-2/-3 card directly

The maximum possible frequency of the step signals is 16666.7 Hz

Output freq. lower than expected

oPeriod = Period_expected + Dead_time

oDead_time: 20us

Available in Flash-Mode

Fast homing procedures available

Keeps position values of axes after a movement was interrupted

It can be used via regular motion control in SAM programming, or via G-Code commands (RS-232, Telnet or flash commands)

Required settings

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

Define sc_motion_stepper_settings.txt in <SCAPS>\system\ as described below

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

Use SAMLight Version later than May 2013 and use related firmware on the USC-2/-3 card

How to create the settings file

The file 'sc_motion_stepper_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.

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) parameters 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 if you do not want to use them.

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

To save the stepper settings on the USC-2/-3 card (if you want to use it in Flash-mode) you need to click the Store button in the System→Settings→Optic→Advanced dialog in SAMLight.

 

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

 

Debug

Enables the debug log.

Value

Function

0

Disable debug mode

1

Enable debug mode

Enable debug mode to log debug information in '<SCAPS>\system\sc_motion_stepper_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.

 

Axis parameters (type 14): All of the following parameters have 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...5

Index of axis

Zero based index of up to 6 axes. Defines the order of axis movement and display order in 'SAMLight→Control'. 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

Only the first character is used as axis-name in 'SAMLight→Control'.

 

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 have to be adjusted (factor, incperrot, defspeed, see below).

 

incperrot

Converts degrees into steps for ANGLE mode.

Unit: steps/360°

This value defines how many increments are needed for a whole rotation. 'factor' has to be equal to (1/360)*'incperrot'. This parameter is only used in ANGLE mode.

 

factor

Converts mm (or °) into steps.

POSITION mode, unit: steps/mm

ANGLE mode, unit: steps/°

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

This value defines how many increments are needed for 1mm (or 1°). Depending on the factor of the axis several parameters have to be adjusted (incperrot, llimit, hlimit, hslimit, accel, decel, refspeed, refspeed2, refpos see below).

 

llimit

Sets the lower limit.

Unit: steps

No movement below this limit will be possible. Minimum value for llimit is '-1E13. To get the 'llimit' in steps like it is required here the value in mm (or °) has to be multiplied by the 'factor'.

 

hlimit

Sets the upper limit.

Unit: steps

No movement above this limit will be possible. Maximum value for hlimit value is '1E13' To get the 'hlimit' in steps like it is required here the value in mm (or °) has to be multiplied by the 'factor'.

 

hslimit

Sets the upper speed limit.

Unit: steps/s

No speed above this speed limit will be possible. The maximum possible frequency of the direction signals is 16666.7 Hz. 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 'factor'.

 

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'/'factor'.

 

accel

Sets increase of speed.

Unit: steps/s²

The values '0' and '-1' are not valid. If you want to avoid acceleration in general you can set 'accStartSpeed=hslimit/factor'. To get the 'accel' in steps/s² like it is required here the value in mm/s² (or °/s²) has to be multiplied by the 'factor'.

 

decel

Sets decrease of speed.

Unit: steps/s²

Please use only positive values for this parameter. The values '0' and '-1' are not valid. If you want to avoid deceleration in general you can set 'decStopSpeed=hslimit/factor'. To get the 'decel' in steps/s² like it is required here the value in mm/s² (or °/s²) has to be multiplied by the 'factor'.

 

accStartSpeed

Sets start speed.

POSITION mode, unit: mm/s

ANGLE mode, unit: °/s

This value has to be positive and smaller or equal than 'hslimit'/'factor'. If the in SAMLight demanded speed is smaller than the value for this parameter the axis will move with the lower speed without acceleration.

 

decStopSpeed

Sets stop speed.

POSITION mode, unit: mm/s

ANGLE mode, unit: °/s

This value has to be positive and smaller or equal than 'hslimit'/'factor'. If the in SAMLight demanded speed is smaller than the value for this parameter the axis will move with the lower speed without deceleration.

 

stepIO

Sets output bit of the scanner controller card for the step signal.

Value: refer to Stepper I/O parameters

 

dirIO

Sets output bit of the scanner controller card for the direction signal.

Value: refer to Stepper I/O parameters

 

dirvalue

Sets the polarity of the 'dirIO' signal for positive movement.

Value

Function

0

low active

1

high active

 

DelayAfterDir

Sets a delay which is executed after change of the direction.

This command is used to specify a delay in us to be waited between a change in direction and the first step in the new direction.

 

refIO

Sets input bit of the scanner controller card for the reference signal.

Value: refer to Stepper I/O parameters

Since all axes move successively the 'refIO' bit can be the same for all axes. Although the parameter 'refIO' has the same value for multiple axes it still has to be defined for every axis.

 

refvalue

Sets the polarity of the 'refIO' signal.

Value

Function

0

low active

1

high active

 

refmode

Sets the behavior of homing movement.

Value

Function

Common reference modes:

0

No homing movement, current position is set to 'refpos'
Use 'refmode=0' together with 'RefOnlyForHome=1'.

1

Go to switch in neg. dir. and leave it in pos. dir.

4

Go to switch in pos. dir. and leave it in neg. dir.

Uncommon reference modes:

2

Go to switch in neg. dir. and leave it in neg. dir.

5

Go to switch in pos. dir. and leave it in pos. dir.

11

Go to switch in neg. dir. and leave it in pos. dir. (no timeout)

44

Go to switch in pos. dir. and leave it in neg. dir. (no timeout)

 

refspeed

Sets the speed of the homing movement.

Unit: steps/s

This value defines how fast the motor moves in case of a homing movement to find the reference switch. Reference movements are USC-2 controlled and have a much higher maximum speed than stepper type 8. When no reference signal is detected the homing movement is stopped after 10000 mm (or °). In refmode 11 or 44 (no timeout) the reference movement will never stop if no reference switch could be found. To get the 'refspeed' in steps/s like it is required here the value in mm/s (or °/s) has to be multiplied by the 'factor'.

 

refspeed2

Sets the speed while leaving the reference switch.

Unit: steps/s

If refspeed2 is '-1', 'refspeed/4' is used. When the reference signal is not released the switch leaving movement is stopped after 100 mm (or °). In refmode 11 or 44 (no timeout) the reference movement will never stop if the reference switch is not released. To get the 'refspeed2' in steps/s like it is required here the value in mm/s (or °/s) has to be multiplied by the 'factor'.

 

refpos

Sets the home position of the axis.

Unit: steps

This value will be set after SAMLight startup and after a homing movement. refpos should be outside the position limits 'llimit' and 'hlimit' to avoid that the reference switch is activated during normal movement. To get the 'refpos' in steps like it is required here the value in mm (or °) has to be multiplied by the 'factor'.

 

Optional axis parameters (type 14): All of the following parameters are optional parameters. If a parameter is not specified the corresponding feature will not be used.

 

RefOnlyForHome

Sets movement behavior for this axis when reference switch is active during a normal movement. This parameter can be defined for each axis. Each axis can be configured differently.

Value

Function

0

Motion stops if reference switch is active.

1

Motion does not stop if reference switch is active (for normal movements).

The behavior of the homing process will not change due to this parameter. The default value (if not defined) for this parameter is '0'.

 

ForceSingleAxisMovement

Forces all defined axes to always move individually. This parameter is a global parameter for all axes.

Value

Function

0

No single axes movement forcing. Axes can move simultaneously under certain conditions.

1

All defined axes will move individually. No simultaneous movement of axes will occur.

Forcing of single axis movement can sometimes be desired for 2D splitting where usually individual axis speed is overwritten by the global splitting speed resulting in simultaneous movement.

Example sc_motion_stepper_settings.txt file for 1 straight and 1 rotational axis for 'Type=14':

# Global parameters:

Debug=0

DisableHomingDuringStartUp=1

 

# Z-axis parameters:

axis=0

dname=Z

mode=POSITION

 

factor=200.0

llimit=-400000

hlimit=400000

hslimit=6000

defspeed=20.0

accel=2000

decel=2000

accStartSpeed=5.0

decStopSpeed=5.0

 

stepIO=216

dirIO=217

dirvalue=0

 

refIO=16

refvalue=1

refmode=0

refspeed=2000

refspeed2=500

refpos=0.0

RefOnlyForHome=1

 

# R-axis parameters:

axis=1

dname=R

mode=ANGLE

 

factor=10.0

incperrot=3600

llimit=-1E13

hlimit=1E13

hslimit=6000

defspeed=400.0

accel=2000

decel=2000

accStartSpeed=5.0

decStopSpeed=5.0

 

stepIO=218

dirIO=219

dirvalue=0

 

refIO=17

refvalue=1

refmode=0

refspeed=2000

refspeed2=500

refpos=0.0

RefOnlyForHome=1

 

GCode cmd

Description

GCL M0

Stop execution (aborts moves).

GCL M46

Starts execution. This is required after GCL M0 for further motion commands.

GCL F?

Set movement speed to ? mm/s (e.g. GCL F10.0).

GCL G1??

Move to ??, where ?? is axis identifier (X, Y, Z, A, B, C) followed by position in mm (e.g. G1X1.5000). Multiple axis can be combined (e.g. G1X1Y2.5Z0)

GCL G90

Switch to absolute mode. After this all move coordinates are interpreted as absolute values (default).

GCL G91

Switch to relative mode. G1 commands are interpreted relative to previous position.

GCL G28?1

Home axis ?, where axis is X, Y, Z, A, B, C. Only one axis at a time.

GCL Q????

Get current axis position. ???? can be 7032-7037, for axis X, Y, Z, A, B, C respectively.

Table 8: Stepper GCode commands for a USC-2 in Flash mode

Necessary steps for changing from stepper type 8 to stepper type 14:

The parameters 'sfactor', 'SignalAxisMoving', 'SignalAxisMovingStateBitPosition', 'SignalAxisMovingState', 'SignalAxisMovingStatePreDelay', 'MoveThisAxisFirst' and 'corr#' are not supported in the stepper type 14 any more.

Optionally you can define the parameter 'RefOnlyForHome'. If you define 'RefOnlyForHome=1' you will have the behavior like you are used to from stepper mode 8.

The units for 'accel' and 'decel' have been changed to steps/s². This leads to a linear acceleration and deceleration of the speed of the axes. You need to adjust the values for these parameters as well. In stepper type 14 the values for these parameters will be much higher. The values '0' and '-1' are not valid in stepper type 14.

The 'refmode's 3 and 6 are no longer supported in stepper type 14.

In stepper type 14 the X, Y and Z axes can move in parallel so please do not use the same value for different axes for the parameter 'refIO'. Do not use external stop ('refIO=1') as well because fast homing mode is not necessary in stepper mode 14 any more.