Motors.xml

From OKOS Wiki
Jump to navigation Jump to search

See Also: Sample Motors.xml File

The Motors.xml file is used to define the motor axes used in most ODIS software. It is written to be a layer of abstraction above the motor controller itself, so that multiple motor controllers can be defined and used in a system.

As of this writing, the file is usually located in the same directory as the ODIS application. Some applications define the location in a variable within the *.exe.config file. Depending on where ODIS was installed, you may need Administrative privileges to edit the file.

Format

Motors.xml is an XML text file. The definition and use of each XML tag is defined below. Each Board is defined within the Multiboard tag, and in turn, the axis list for the board is contained within the Axes Tag.

 <MultiBoard>				
   <Board>			
     (Board-Specific Tags)			
     <Axes>		
       <Axis>	
         <MAxisSetup>
           (Axis Setup Tags)
         </MAxisSetup>
       </Axis>	
     </Axes>		
   </Board>			
 </MultiBoard>

MultiBoard

  • Parent Tag: none

This is the root of the Motors.xml file. Only Board definitions are contained within this tag. There can be more than one Board tag within a MultiBoard tag.

Example

 <MultiBoard>
  <Board type="..." value="0">
   ...
   ...
  </Board>
  <Board type="..." value="1">
   ...
   ...
  </Board>
  ...
  ...
 </MultiBoard>


Board

  • Parent Tag: <MultiBoard>

Defines a type of Motor Controller. There can be multiple Board tags within the MultiBoard tag. A board tag will contain a single Axes tag as well as some board-specific configuration tags, listed below.

Attributes
There are three attributes assigned to this tag:

  1. type defines the type of board. See Supported Hardware for details. As of this writing, the possible values are:
    Tag Description
    DMC18x0 Any Galil x-axis board
    C870 Melec C-870 board
    C872 Melec C-872 board
    Copley Copley CANBus card
    Titan4CR Arcus 4-axis board
    Shell Dummy entry used for Simulation Mode
  2. value is an index, assigned if there is more than one in the system. The value is 0 based (e.g. 0 is board 1, 1 is board 2, etc).
  3. sn adds an optional Serial Number to the board. If present, the system will attempt to match the board settings to the serial number. This guarantees hardware order of motor controllers in case more than one device is present.

Example

 <Board type="DMC1830" value="0" sn="12345">
   <Axes>
   ...
   ...
   </Axes>
 </Board>

Address

  • Parent Tag: <Board>

(ITK boards only) Defines the IP address or Serial port used to connect to this motor controller board. If an IP address, it must be in standard format; e.g.: "192.168.0.1". If a serial port, use the format "COMx", where 'x' is the serial port number.

Note: ITK devices sometimes have axes on different connections; e.g. X and Y might be on a single IP Address, with the Z axis on a separate IP or Serial port. Each connection must be treated as a separate "Board".

Examples

  <Address>192.168.1.20</Address>
  <Address>COM3</Address>

CompareAxis

  • Parent Tag: <Board>

(Galil boards only) Defines which axis is to be used for as the Compare axis in Motor Triggering mode. This axis cannot be used for motion, and should generally be set to the last axis of the controller.

Example

 <CompareAxis>7</CompareAxis>

CompareRatio

  • Parent Tag: <Board>

(Galil boards only) Defines the count ratio between the Compare Axis and the Slave Axis. Some motor controllers will count both the rising and the falling edges of the Slave axis encoder output, in which case the ratio should be set to “2”.

Example

 <CompareRatio>2</CompareRatio>

EncoderDivisor

  • Parent Tag: <Board>

(Commander Motion Control only) Sets the divisor for the encoder step-down on the specified Encoder Source. For example, if the original Encoder resolution is 2000 counts/mm and the Divisor is set to 8, the actual encoder count output will be 2000/8 = 250 counts/mm.

Example

 <EncoderDivisor>8</EncoderDivisor>

EncoderSource

  • Parent Tag: <Board>

(Commander motion control only) Sets the axis used to do step-down encoder values on a Commander board. This is the axis that is used to output the reduced encoder count value, not the axis that changes the encoder count.

 <EncoderSource>3</EncoderSource>

LimitPolarity

  • Parent Tag: <Board> or <MAxisSetup> (see below)

The limit polarity sets the type of Limit switch. The two possible values are “NC” (Normally Closed) or “NO” normally open.

The location of this tag depends on the Motor controller. Galil controllers set limits on a per-board basis, therefore for Galil boards the tag is located under Board. See the MAxisSetup for limit polarity with other controllers.

Example

 <LimitPolarity>NC</LimitPolarity>

SlaveAxis

  • Parent Tag: <Board>

(Galil boards only) Sets the axis that is used as the Slave axis for Motor Triggering. cannot be used for motion, and should generally be set to the next to last axis of the controller.

Example

 <SlaveAxis>6</SlaveAxis>

Axes

  • Parent Tag: <Board>

Contains the list of Axis definitions. Each axis definition is itself contained within an Axis tag. There should be only one Axes tag per Board tag.

Example

 <Axes>
   <Axis value="0">
   ...
   ...
   </Axis>
   <Axis value="1">
   ...
   ...
   </Axis>
   ...
   ...
 </Axes>

Axis

  • Parent Tag: <Axes>

Contains the definition for a single axis. An Axis tag contains exactly one MAxisSetup tag and nothing else. There can be more than one Axis tag per Axes tag.

Attributes

  1. value indicates the index into the axis array for the board (Zero-based). Thus 0 is the first axis of the board, 1 is the second, etc.

Example

 <Axis value="0">
    <MAxisSetup>
    ...
    ...
    </MAxisSetup>
 </Axis>

MAxisSetup

  • Parent Tag: <Axis>

The root tag for an axis setup. Most of the tags describing axis parameters are located here.

Example

 <MAxisSetup>
   <AxisName>X</AxisName>
   <AxisLength>300</AxisLength>
   ...
   ...
 </MAxisSetup>
AxisLock
  • Parent Tag: <MAxisSetup>

If present, contains an index to an axis whose motion can be "locked" to the current axis, e.g., in a system with two Y-Axes, 1 and 2, Axis 1 could have the "AxisLock" parameter with a value of 2. It is not correct for both "locked" axes to contain the "AxisLock" parameter, only the "primary" axis.

This tag is not required on "normal" systems. It is only used in systems that require simultaneous motion of multiple axes along the same plane.

Example

 <AxisLock>1</AxisLock>
AxisLength
  • Parent Tag: <MAxisSetup>

Contains the physical length of the axis (in the units defined in the Units tag). This should be the total allowable travel of the axis from limit to limit. This value is used to determine the dimensions of the scanning tank and the maximum allowable motion to use when searching for limits during Initialization. If Initialization direction is reversed, the axis position will be set to this value, rather than zero.

Example

 <AxisLength>200</AxisLength>
AxisName
  • Parent Tag: <MaxisSetup>

Contains a user-defined name for the axis. This name is shown in the Scan Manager and other windows when chosing a scan axis.

Example

 <AxisName>X-Axis</AxisName>
Direction
  • Parent Tag: <MAxisSetup>

Sets the count direction for a particular axis. Normally this is 1 (positive). If set to -1, the axis will move negatively when positive counts are sent, and vice versa.

Example

 <Direction>1</Direction>
EncoderCountsPerRotation
  • Parent Tag: <MaxisSetup>

Sets the number of encoder counts that occur per rotation of the axis motor. If present, this number overrides the <EncoderResolution> tag. Mostly used for Rotational axes (e.g. Turntables)

Example

 <EncoderCountsPerRotation>7200</EncoderCountsPerRotation>
EncoderPresent
  • Parent Tag: <MAxisSetup>

True or False. If true, the system will use the Encoder Resolution and/or Encoder Counts Per Rotation when doing Encoder Triggering.

Example

 <EncoderPresent>False</EncoderPresent>
EncoderResolution
  • Parent Tag: <MAxisSetup>

Sets the number of encoder counts per physical unit on an axis. The physical units defined for the axis are in the <Units> tag.

 <EncoderResolution>2000</EncoderResolution>
EncoderType
  • Parent Tag: <MAxisSetup>

Sets the Type of encoder on the axis. Values are "P" (Step/Dir) or "Q" (Quadrature).

Example

 <EncoderType>P</EncoderType>
LimitPolarity
  • Parent Tag: <Board> or <MAxisSetup> (see below)

The limit polarity sets the type of Limit switch. The two possible values are “NC” (Normally Closed) or “NO” normally open.

With Commander/Arcus controllers, the Limit Polarity can be set on a per-axis basis, and therefore the tag is located under MAxisSetup. See Board for limit polarity settings for Galil boards.

Example

 <LimitPolarity>NC</LimitPolarity>
LimitPresent
  • Parent Tag: <MaxisSetup>

The limit present tag tells the system if limits are present on each axis. If set to "False", Initialization via limits will be prevented for safety purposes.

Example

 <LimitPresent>true</LimitPresent>
MotorCountsPerRotation
  • Parent Tag: <MAxisSetup>

Sets the number of counts per rotation of the motor. If present, this value overrides the <MotorResolution> tag. Mostly used for Rotational axes (e.g. Turntables).

Example

 <MotorCountsPerRotation>7200</MotorCountsPerRotation>
MotorResolution
  • Parent Tag: <MAxisSetup>

Sets the number of counts per physical unit on an axis. The physical units defined for the axis are in the Units tag.

 <MotorResolution>10000</MotorResolution>
MotorType
  • Parent Tag: <MAxisSetup>

Sets the type of motor use on the axis. The type can be "stepper" (this includes servo axes that are controlled via step/direction pulses), or "servo".

Example

 <MotorType>stepper</MotorType>
PulseType
  • Parent Tag: <MAxisSetup>

Sets the output pulse type for the axis. Pulse type is “C” (CW/CCW), “S” (Stepper), or "Q" (Quadrature).

Example

 <PulseType>C</PulseType>
Illustration showing when a Rotator Diameter is required. The Rotator(s) are the light gray circles with the red dots. The part is the dark gray circle. It will require multiple turns of the rotator to move the part 360 degrees.
RotatorDiameter
  • Parent Tag: <MAxisSetup>

Sets the Rotator Diameter. this is used when a part will sit on the outer edge of the rotator, rather than both having a common axis of rotation. It is used to calculate how many turns of the rotator will be required to rotate the part a full 360 degrees.

 <RotatorDiameter>4</RotatorDiameter>
RotatorDiameterUnits
  • Parent Tag: <MAxisSetup>

Sets the units used to define the Rotator Diameter (see above).

Example

 <RotatorDiameterUnits>in</RotatorDiameterUnits>
Units
  • Parent Tag: <MAxisSetup>

Sets the physical units used to define this axis. For linear axes, can be set to “mm” (millimeters) or “in” (inches). For Rotational axes, this must be set to “deg” (degrees).

Example

 <Units>mm</Units>
UseSRates

Sets whether or not to use S-Curve motion on an axis.

 <UseSRates>False</UseSRates>

GalilBoard

  • Parent Tag: <MultiBoard>
    • Deprecated: use the <Board> tag instead.

  • Defines a Galil-manufactured board. There are two attributes assigned to this tag:
    • The type tag defines the type of DMC board. This should always be of a form “DMC18x0”, where “x” is the number of axes on the board. This is regardless of the actual type of the Galil board (e.g. 1846, 2162, etc.)
    • The value indicates which Galil board this is, if there is more than one in the system. The value is 0 based (e.g. 0 is board 1, 1 is board 2, etc.)
 <GalilBoard type="DMC1880" value="0">


MelecBoard

  • Parent Tag: <MultiBoard>
    • Deprecated: use the <Board> tag instead.

  • Defines a Melec-manufactured board. There are two attributes assigned to this tag:
    • The “type” tag defines the type of Melec board. Currently there are two possible values: “C870” and “C872”.
    • The “value” indicates which Melec board this is, if there is more than one in the system. The value is 0 based (e.g. 0 is board 1, 1 is board 2, etc.)
 <MelecBoard type="C870" value="0">

Configuring Multiple Devices

If multiple devices will be present (e.g. two Galil Motor Controllers), it is vital that the serial number of each device be present in the <Board> tag using the "sn" attribute. If missing, the detected order of the devices may not be guaranteed, causing the motion controls to be scrambled.

Example:

 <Board type="..." value="0" sn="494393">
  ...
  ...
 </Board>
 <Board type="..." value="1" sn="494394">

Axis Configuration Details

Each axis definition should reflect the physical parameters of the specified axis. All axes should have at least the following tags:

Important Notes:

  • The axis <MotorResolution> (or <MotorCountsPerRotation>) value must reflect the number of counts sent to the controller, which is not necessarily the same number of counts per rotation of the motor itself. For example, if there is a 3:1 gear-down ratio between the motor and the controller, the number of counts per rotation must be a 3x multiple of the motor counts.
  • The <MotorType> should reflect the controller configuration, not the motor itself. For example, some Servo motors can be controlled with Step/Direction pulses, in which case the <MotorType> should be set to "Stepper".
  • On a properly configured system, the <Direction> should almost always be 1.

Configuring a Linear Axis

A Linear Axis must use:

  1. Linear <Units>, e.g. "mm" or "in"
  2. The <MotorResolution> to define the number of counts per unit; e.g. on an axis that rotates once every 2000 counts and moves a lead screw one mm for every rotation, set the value to 2000 if the <Units> are set to "mm", or 50800 if the <Units> are set to "in".

Example:

     <Axis value="0">
       <MAxisSetup>
         <AxisName>X</AxisName>
         <Units>mm</Units>
         <AxisLength>10000</AxisLength>
         <MotorResolution>2000</MotorResolution>
         <Direction>1</Direction>
         <MotorType>Stepper</MotorType>
       </MAxisSetup>
     </Axis>

Configuring a Gimbal/Swivel

A Gimbal/Swivel axis must use:

  1. Rotational <Units>, e.g. "deg"
  2. The <AxisLength> value must not be 360 degrees. An axis with degree units and 360 degrees of rotation is treated as a Turntable/Rotator.
  3. Use the <MotorResolution> to define the number of counts per degree; e.g. on an Axis that needs 1000 counts to move 3 degrees, set the value to 333.333. This value can be fractional.

Example:

      <Axis value="4">
       <MAxisSetup>
         <AxisName>G</AxisName>
         <Units>deg</Units>
         <AxisLength>200</AxisLength>
         <MotorResolution>133.33</MotorResolution>
         <Direction>1</Direction>
         <MotorType>Stepper</MotorType>
       </MAxisSetup>
     </Axis>

Configuration a Turntable/Rotator

A Turntable/Rotator axis must use:

  1. Rotational <Units>, e.g. "deg"
  2. The <AxisLength> value must be 360 degrees.
  3. Use the <MotorCountsPerRotation> (NOT <MotorResolution>) to define the number of counts for one full rotation of the turntable; e.g., if the turntable axes moves 5 degrees per 1000 counts, set the value to 72000. This value can be fractional.

Example:

     <Axis value="3">
       <MAxisSetup>
         <AxisName>Rotator</AxisName>
         <Units>deg</Units>
         <AxisLength>360</AxisLength>
         <MotorCountsPerRotation>1440000</MotorCountsPerRotation>
         <Direction>1</Direction>
         <MotorType>Stepper</MotorType>
       </MAxisSetup>
     </Axis>

Configuring an Offset Rotator

If the Rotator is offset from the actual pivot point of the part, the <RotatorDiameter> and <RotatorDiameterUnits> must be added so that the proper counts per rotation can be calculated internally. DO NOT change the <MotorCountsPerRotation> to reflect the diameter of the part to be scanned: it should reflect the rotator motion only.

Encoder Configuration (Optional)

If Encoder positions can be read from the controller, you may wish to add the <EncoderResolution> and/or <EncoderCountsPerRotation> values so that the encoder feedback can be displayed. These have the same meaning as the <MotorResolution> and <MotorCountsPerRotation> values, respectively. For most steups this is informational and is only useful to compare motor position and encoder positions directly on the axes. This does not affect how Scans are triggered as that is a separate physical encoder input to the A/D board(s).

If there is no encoder feedback that can be read on a particular axis, set the <EncoderPresent> tag to "false".

Axis Mapping

Illustration showing a 3-axis ODIS system mapping virtual axes to non-consecutive axes in the Motion Control hardware.

Under normal circumstances, motor axes are listed in the order they occur, e.g. Axis 0 is from Board 0 Axis 0, Axis 1 is Board 0 Axis 1, etc. However, there may be times where an operator wishes to re-map the axes due to specific hardware requirements. In that case, the <Map> tag can be added to change the order of the axes.

Format

The Axis Map has the following format:

 <Map>
   <Axis index board boardAxis/>
   <Axis index .../>
 </Map>

For each Virtual Axis in the mapping, there must be an "Axis" tag with three attributes:

  1. index axis index (i.e. the order of the axis)
  2. board board ID
  3. boardAxis the axis on the specified board

All values are 0-based. The board ID will match the "value" attribute in the Board tags. the boardAxis ID will match the "value" attribute of the Axis contained within the Board tag.

If an axis map is present, only the axes described in the map will be used for motion.

Note: On Galil boards when using Motor triggering, the Slave and Compare axes must not be part of the axis map. Similarly, if doing encoder step-down on a Commander/Arcus board, the encoder source axis must not be part of the axis map.

It is important that the remainder of the Motors.xml file remain unchanged: in other words, the physical settings of the axes *must* still reflect the actual hardware configuration. The Mapping is simply virtual "wiring" so that the motor code can reference the axes in a user-desired order.

Location in Motors.xml

The axis map must be added to the Motors.xml file immediately after the <MultiBoard> tag, and before any <Board> tags.

<MultiBoard> 
 <Map>
   <Axis index="0" board="0" boardAxis="1"/>
   <Axis index="1" board="0" boardAxis="0"/>
   <Axis index="2" board="0" boardAxis="2"/>
   <Axis index="3" board="0" boardAxis="3"/>
 </Map>
 <Board type="DMC1880" ...

Examples

The axis map can be used to reorder the physical axes in the system.

 <Map>
   <Axis index="0" board="0" boardAxis="1"/>
   <Axis index="1" board="0" boardAxis="0"/>
   <Axis index="2" board="0" boardAxis="2"/>
   <Axis index="3" board="0" boardAxis="3"/>
 </Map>

In the above example, the first axis in the system actually maps to the second physical axis of the first board. The second axis maps to the first physical axis of the first board.

Mapping can be across multiple motion controllers. For example, assume two 3-axis boards in one system. An axis map might look like this:

 <Map>
   <Axis index="0" board="1" boardAxis="1"/>
   <Axis index="1" board="1" boardAxis="0"/>
   <Axis index="2" board="0" boardAxis="2"/>
   <Axis index="3" board="0" boardAxis="0"/>
   <Axis index="4" board="0" boardAxis="1"/>
   <Axis index="5" board="1" boardAxis="2"/>
 </Map>

In this example, the First and second axes are mapped to the second and first physical axes of the second motor controller. The 4th and 5th axes are mapped to the first and second axes of the first motor controller.

Encoder Step-Down

(Commander Motion Control only)

When using a high-resolution encoder, it is possible to overwhelm the system reading the encoder output. This is caused by the number of counts sent by the encoder exceeding the maximum input rate of the device reading the encoder position.

To slow the rate but retain the accuracy given by the high-resolution encoder, it is possible to use an axis on a Commander motion controller to effectively reduce the encoder resolution by dividing the rate by a given factor.

To do this, the EncoderSource and EncoderDivisor tags should be added to the Motors.xml file under the Board Tag. These specify which commander axis is used for encoder step-down, and what divisor value should be set.

Example:

 <Board type="Titan4CR" value="0">
   <EncoderSource>3</EncoderSource>
   <EncoderDivisor>8</EncoderDivisor>

In this case, we are using axis 3 of the Commander device as our Encoder source, and using a divisor of 8.

Note: the EncoderSource value is the index to the axis on the particular Board. It is not altered by the Axis Map.

Output of the Encoder Source Axis

On the axis used as an EncoderSource, the output can be configured by setting the PulseType tag.

Example:

   <Axis value="3">
     <MAxisSetup>
        <PulseType>Q</PulseType>
  

In this case, axis 3 of the commander will output Quadrature signals when used as the EncoderSource.

Motor Triggering

It is possible to trigger on Motor pulses using Motor Triggering. Instead of using the encoder position to generate pulses, the Motor position is used. To use this capability depends on the physical wiring of the system.

Galil Motor Triggering

This requires proper wiring of the Galil motion control as documented in Motor Trigger Connections. The Motors.xml Slave and Compare axes must also be set for motor triggering to operate properly. The Slave and Compare axes must not be used in normal motion and should be excluded from any Axis Map, if any. The Galil CMP (Compare) output associated with the Compare axis will send a pulse on every motor trigger.

The Slave axis must be configured in <MotorType> as a Stepper axis, and the Compare axis must be configured as a Servo axis. In addition, the <Direction> must be set the same as the axes that will be used to collect data.

Example:

 <Board value="0">
    <SlaveAxis>6</SlaveAxis>
    <CompareAxis>7</CompareAxis>

In this example, axis 6 will be used as a Slave axis, and axis 7 will be used as the Compare axis that will send the output to the Compare line. On an 8-axis board, the CMP line that will be used will be the one associated with axes EFGH.

Galil Motor Triggering with Servo Motors

In a system with exclusively Servo motion control as defined in the <MotorType> tag, the Slave and Compare axes are not used. Instead, the position of the servo axis will be used directly for Compare output.


Commander Motor Triggering

Motor Triggering can also be used on Commander/Arcus controllers: however, the trigger input must be physically wired to the axis on which to do motor triggering. Using any other axis will generate an error. Slave and Compare axes are not used, and the <MotorType> is not relevant.