man8/TMGtask

Table of Contents

Name

TMGtask - The Motion Group motor indexer serial I/O service

Synopsis

TMGtask <argument list>

Description

Serial I/O service for a The Motion Group stepper motor indexer.

Arguments

--dbman_host <hn>

The host where dbman is running. If this argument is not specified the default is localhost or the current current value of the DBMAN_HOST environment variable.
--local <iopath>

Run in local mode, and connect to the device path given.
--remote <host>,<socket>

When connecting remotely the host and socket to connect to.
--mngr <file>

A path to a CONFLIST style configuration file containing information used to configure the indexer.
--mngr_pn <name>

The first argument in each record contained in the CONFLIST is checked against this argument. If a match is found the record is loaded and used as part of the configuration information.

This enables the CONFLIST file to be shared between several invocations of TMGtask.

--show_tbl

If this argument is present the contents of a couple of tables are printed to stderr.
--diag

If this argument is present stdin and stdout are left open and signals are set so the program may be killed by SIGINT.

This argument is most useful when setting up the CONFLIST file or when using the --log_* arguments listed below.

--log_lim_sr

If this argument is present then the commands and responses used for polling the limit switches are printed.
--log_home=<n>

If this argument is present then the commands and responses used for the homing operation are printed.

Invoke the program with the --help option to find out the valid values for <n>.

--log_move=<n>

If this argument is present then the commands and responses used for processing a move operation are printed.

Invoke the program with the --help option to find out the valid values for <n>.

--log_prehome=<n>

If this argument is present then the commands and responses used for the prehoming operation are printed.

Invoke the program with the --help option to find out the valid values for <n>.

--help

Print the program help and exit.

Argument Usage

Argument processing is done using Unix long argument syntax. The values of all the arument parameters are printed on stderr when the program starts. Note that either local or remote mode must be specified. In remote mode host is the hostname of the terminal server and socket is the port number to connect to. The port number is extracted from /etc/services.

Motor Controller Master Control parameter name usage

These are the parameters controlling global aspects of the motor indexer operation. These parameters are placed in group g5.

comm1 - required


Drive enable status control.

This is a 1 bit control with these values:

0.0 = off
1.0 = enable

The control key should be set to IncN.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for indirect update by users and unconditional for the owner.

comm2 - optional


This control is used to initiate a homing operation on all of the axises. There also can be a HomeSC for each indexer channel. Either control may be used to initiate a homing operation.

This control is described as optional. However, it should either exist or the channel HomeSC should exist for correct operation.

This is a 1 bit control with these values:

0.0 = nop
1.0 = home

The control key should be set to Mom.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for indirect update by users and unconditional for the owner.

resp1 - optional


The global drive status. This parameter is a composite of the individual drive statuses.

This is a 2 bit parameter with these values:

0.0 = off
1.0 = rest
2.0 = moving
3.0 = error

The control key should be set to RSet.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for no update by users and direct update for the owner.

Motor Axis Operational parameter name usage

These are the paramaters required for basic operation. The setup parameters are listed separately below.

The individual motor axis parameters are placed in groups g1, g2, g3, and g4. One group is used for each motor axis. For example g1 corresponds to axis 0 and so forth.

comm1 - required


This is the displacement control. It is scaled in physical units. SpanMin and SpanMax should be used to represent the physical span of the parameter.

The control key should be set to RSetK.

The DATA.DTkey parameter is usually set to F.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for indirect update by users and unconditional for the owner.

comm2 - optional


This control is used to initiate a homing operation on the axis it is associated with. There is also a global HomeSC in group 5 which causes a homing operation to take place on all axises. Either control may be used to initiate a homing operation.

This is a 1 bit control with these values:

0.0 = nop
1.0 = home

The control key should be set to Mom.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for indirect update by users and unconditional for the owner.

resp1 - optional


This is the displacement readback. It is scaled in physical units. SpanMin, SpanMax, PhyMin, and PhyMax should be set to the same values as the displacement control (comm1).

The control key should be set to RSet.

The DATA.DTkey parameter is usually set to F.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for no update by users and direct update for the owner.

resp2 - required


This is the drive status for an individual channel.

This is a 3 bit parameter with these values:

0.0 = not_ready
1.0 = rest
2.0 = move_wait
3.0 = move
4.0 = home_wait
5.0 = home
6.0 = error
7.0 = *not_used*

The control key should be set to RSet.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for no update by users and direct update for the owner.

resp3 - required


This is the limit and home switch status for an individual channel.

This is a 2 bit parameter with these values:

0.0 = nop
1.0 = limit
2.0 = home
3.0 = both

The control key should be set to RSet.

This parameter should be owned by whatever task TMGtask registers as and the permissions set for no update by users and direct update for the owner.

Motor Axis Setup parameter name usage

All of the parameters in this section respond to the Label and RefName fields in the following way:

If the Label and RefName are not null the value comes from the database else the value comes from the preset field in the config table.

The index field is always set to 0.

int0 0 - optional


steps to db units scaling

If this parameter is not specified in the config file it defaults to 1.0.

int1 0 - optional


starting position when home (home offset) in physical units.

If this parameter is not specified in the config file it defaults to 0.0.

int2 0 - optional


move operation acceleration (steps/sec2)

If this parameter is not specified in the config file it defaults to 150.

int3 0 - optional


move operation velocity (steps/sec)

If this parameter is not specified in the config file it defaults to 200.

int4 0 - optional


move operation starting rate (steps/sec)

If this parameter is not specified in the config file it defaults to 0.

int5 0 - optional


home operation slewing rate (steps/sec)

If this parameter is not specified in the config file it defaults to 200.

int6 0 - optional


home operation TMO value

If this parameter is not specified in the config file it defaults to 60.0.

int7 0 - optional


move operation TMO value

If this parameter is not specified in the config file it defaults to 60.0.

int8 0 - optional


move behavior

The values are:

0.0 - after homing stop and set DC = DR
1.0 - after homing move to the present value of DC

If this parameter is not specified in the config file it defaults to 0.0.

int9 0 - optional


homing behavior

The values are:

0.0 - home normally
1.0 - perform a move before homing

If this parameter is not specified in the config file it defaults to 0.0.

See the NOTES section below.

int9 1 - optional


prehome move distance.

This specifies a position to move to before homing.

The value of home offset is used as the current drive position and the drive is moved relative to this position.

See the NOTES section below.

Displacement Ctl/Read database setup information

Calculations

Here is the basic formula used for displacement calculations.

DC = displacement control (physical units)

M = pulses/physical_unit

B = home offset (in physical units)

p = number of pulses to send to drive

p = (DC * M) + (M * B)

For example, using a screw pitch of 40 revs/inch and a microstepped 200 step/rev motor we get:

800 steps/rev = 200 steps/rev * 4

32000 steps/inch

25.406 mm/inch

1259.52 steps/mm

Ideas for setting up the database

The information given above in the Motor Axis Operational parameter name usage section describes setting up comm1 and resp1 using a DESC/DATA record configuration where DTkey=F and DRkey=I. Note that in this configuration Size and Offset aren’t really used for anything useful.

The DC and DR parameters don’t use Size directly because the calculations to go between physical units and steps are done in TMGtask.

However, it is convenient to set up the DESC record with DTkey=U and DRkey=I (or possibly U) and use Size, SpanMin, SpanMax, etc. because you can pick values for Size, SpanMin, and SpanMax which approximently correspond to the physical travel of the drive. That way when a new value is entered it is quantized on a step boundry.

From the example given in the Calculations section if Size=15 bits, then the total span = 26.0154 mm so:

Size=15

SpanMin=0.0

SpanMax=26.0154

This seems like a pretty good mating of the database with the motor indexer. PhyMin and PhyMax would be set as appropriate for the drive to keep it from running into the limit switches.

Startup Examples

TMGtask --dbman_host csdev1 --local /dev/com2 --ppath TMGconf --pname TMG1"
TMGtask --dbman_host csdev1 --remote csdev11,ETSraw1 --ppath TMGconf --pname TMG1"

Config File Example

The example below is for a four channel indexer system running a double slit assembly.

#
#    TMG 4 channel indexer config file
#
# 1st indexer
#
#    global controls
#
#    comm1 - required - drive enable status control
#    comm2 - optional - home status control
#
#    resp1 - optional - global status readback
#
#
TMG1 |g5|comm1 |0|DS 01-1|EnableSC|
TMG1 |g5|comm2 |0|DS 01-1|HomeSC |
TMG1 |g5|resp1 |0|DS 01-1|BusySR |
#
#
#    channel 0 -- -X axis
#
#    comm1 - required - displacement control
#    comm2 - optional - single axis home status control
#
#    resp1 - optional - displacement readback
#    resp2 - optional - status readback
#    resp3 - optional - limit switch status readback
#
#
TMG1 |g1|comm1 |0|DS 01-1|-XDC |
TMG1 |g1|comm2 |0|DS 01-1|-XhomeSC|
TMG1 |g1|resp1 |0|DS 01-1|-XDR |
TMG1 |g1|resp2 |0|DS 01-1|-XbusySR|
TMG1 |g1|resp3 |0|DS 01-1|-XlimSR |
#
#
#    int0 - optional - steps to db units scaling
#        steps / mm in this case..
#    int1 - optional - starting position when home (home offset)
#    int2 - optional - acceleration (steps/sec2)
#    int3 - optional - velocity (steps/sec)
#    int4 - optional - starting rate (steps/sec)
#    int5 - optional - homing starting rate (steps/sec)
#    int6 - optional - home tmo
#    int7 - optional - move tmo
#    int8 - optional - move behavior
#                0 = don’t move to position after homing
#                1 = move to position after homing
#
TMG1 |g1|int0 |0|NULL |NULL |1259.52
TMG1 |g1|int1 |0|NULL |NULL |0.0
TMG1 |g1|int2 |0|NULL |NULL |150.0
TMG1 |g1|int3 |0|NULL |NULL |200.0
TMG1 |g1|int4 |0|NULL |NULL |20.0
TMG1 |g1|int5 |0|NULL |NULL |200.0
TMG1 |g1|int6 |0|NULL |NULL |60.0
TMG1 |g1|int7 |0|NULL |NULL |60.0
TMG1 |g1|int8 |0|NULL |NULL |1.0
#
#
#
#    channel 1 -- +X axis
TMG1 |g2|comm1 |0|DS 01-1|+XDC |
TMG1 |g2|comm2 |0|DS 01-1|+XhomeSC|
TMG1 |g2|resp1 |0|DS 01-1|+XDR |
TMG1 |g2|resp2 |0|DS 01-1|+XbusySR|
TMG1 |g2|resp3 |0|DS 01-1|+XlimSR |
#
TMG1 |g2|int0 |0|NULL |NULL |1259.52
TMG1 |g2|int1 |0|NULL |NULL |1.0
TMG1 |g2|int2 |0|NULL |NULL |150.0
TMG1 |g2|int3 |0|NULL |NULL |200.0
TMG1 |g2|int4 |0|NULL |NULL |20.0
TMG1 |g2|int5 |0|NULL |NULL |200.0
TMG1 |g2|int6 |0|NULL |NULL |60.0
TMG1 |g2|int7 |0|NULL |NULL |60.0
TMG1 |g2|int8 |0|NULL |NULL |1.0
#
#
#    channel 2 -- -Y axis
#
TMG1 |g3|comm1 |0|DS 01-1|-YDC |
TMG1 |g3|comm2 |0|DS 01-1|-YhomeSC|
TMG1 |g3|resp1 |0|DS 01-1|-YDR |
TMG1 |g3|resp2 |0|DS 01-1|-YbusySR|
TMG1 |g3|resp3 |0|DS 01-1|-YlimSR |
#
TMG1 |g3|int0 |0|NULL |NULL |1259.52
TMG1 |g3|int1 |0|NULL |NULL |0.0
TMG1 |g3|int2 |0|NULL |NULL |150.0
TMG1 |g3|int3 |0|NULL |NULL |200.0
TMG1 |g3|int4 |0|NULL |NULL |20.0
TMG1 |g3|int5 |0|NULL |NULL |200.0
TMG1 |g3|int6 |0|NULL |NULL |60.0
TMG1 |g3|int7 |0|NULL |NULL |60.0
TMG1 |g3|int8 |0|NULL |NULL |1.0
#
#
#    channel 3 -- +Y axis
#
TMG1 |g4|comm1 |0|DS 01-1|+YDC |
TMG1 |g4|comm2 |0|DS 01-1|+YhomeSC|
TMG1 |g4|resp1 |0|DS 01-1|+YDR |
TMG1 |g4|resp2 |0|DS 01-1|+YbusySR|
TMG1 |g4|resp3 |0|DS 01-1|+YlimSR |
#
TMG1 |g4|int0 |0|NULL |NULL |1259.52
TMG1 |g4|int1 |0|NULL |NULL |0.0
TMG1 |g4|int2 |0|NULL |NULL |150.0
TMG1 |g4|int3 |0|NULL |NULL |200.0
TMG1 |g4|int4 |0|NULL |NULL |20.0
TMG1 |g4|int5 |0|NULL |NULL |200.0
TMG1 |g4|int6 |0|NULL |NULL |60.0
TMG1 |g4|int7 |0|NULL |NULL |60.0
TMG1 |g4|int8 |0|NULL |NULL |1.0

I/O polling rates

Polling of the limit switches is performed approximently once every 10 seconds if there isn’t a move in progress.

Notes

At this time (2/16/2002) the Linux com driver works improperly with the indexer and can NOT be used. The RTS line doesn’t cause the computer to immediately stop transmitting chars. Instead as many as 16 chars may be sent after the RTS line has changed. This is unacceptable to the indexer since it only has a 3 char input buffer. This is broken behavior in the Linux kernel and should be repaired.

Operation via a terminal server works properly.

If the drive isn’t powered when TMGtask is started the terminal servers that we use (Lantronix) won’t allow a connection therefore the program exits. The indexer requires the use of serial handshaking and apparently when handahaking is enabled connections aren’t allowed if the handshaking lines are in the wrong state.

However, once the program connects it seems to be able to stay connected if the drive is turned off although I haven’t checked carefully to see if it eventually disconnects.

Operation via a Cyclades serial card seems to work but hasn’t been tested recently.

TMGtask(8) uses a program loaded into the indexer memory. TMGutil(8) is used for loading the program. Watch the AccelNET release notes for changes to TMGtask which may cause the indexer’s internal program to need to be reloaded.

The int9 parameters probably aren’t much good unless you have a modified indexer which brings the CW and CCW limit inputs to the outside so they may be connected to the limit switches. At the time of this writing (06-04-2008) this has only been done to a single indexer unit which is part of an R&D project at NEC.

Manual page revision

$Id: TMGtask.8,v 1.7 2008/06/04 20:22:34 kitchen Exp $


Table of Contents