MicroLYNX MUNIT and EUNIT

MicroLYNX user units explained

The MUNIT Variable

MUNIT is a setup variable that is used to simplify motion commands. After properly setting MUNIT, motion commands will be in convenient user units such as revolutions or inches. This document will show a technique in detail to set MUNIT for several common cases 

The indexer creates step clocks which are sent to the step motor drive. The definition of MUNIT is:

Clock pulses to drive

User unit

Conversion units

Unit analysis will be used such that the conversion units cancel and you will be left with step clocks / user unit.  In the case of a microstepping drive, you will have microsteps/user unit. The following factors will always be needed:

1 Motor resolution
    # of motor full steps
  Motor resolution =
    revolution
     
     
2 Motor resolution
    # of microsteps
  Drive resolution =
    motor step

Examples of other factor types that might be needed:

1 Mechanical resolution
    # of motor revolutions
  Linear = 
    revolution
     
    # of motor revolutions
  Gearbox = 
    output shaft revolution
     
     
2 Measurement conversions
  inch  
 
 
  mm  

Examples

Example 1

In this example we will use motor revolutions as our user unit.

Given: 1.8°/step motor, microstepping drive resolution = 64 micro steps/motor step

200 motor steps   64 microsteps   12800 steps

X
=
revolution   motor step   revolution

Thus MUNIT would equal 12800 and be entered MUNIT=12800.

Now, we may use the MOVR, or index relative to current position motion command as follows:

MOVR 10        'index the axis 10 revolutions

Example 2

In this example we will use degrees as our user unit.

Given: 0.9°/step motor, microstepping drive resolution = 256 microsteps/motor step

200 motor steps   256 microsteps   1 revolution   102400 steps

X
X
=
revolution   motor step   360 degrees   360 degrees

For increased accuracy let the math function of the indexer compute the value of MUNIT by entering  MUNIT=102400/360 (instead of MUNIT=284.444.....).

Now, use the MOVA, or index to absolute position, motion command as follows:

MOVA 270        'index the axis to the 270° position

Example 3

In this example we will use inches as our user unit.

Given: 15°/step motor, microstepping drive resolution = 256 micro steps/motor step, Linear Slide = 10mm/5 motor revs.

24 motor steps   256 microsteps   5 revolution   25.4 mm   780288 steps

X
X
X
=
revolution   motor step   10 mm   inch   10 inches

For increased accuracy let the math function of the indexer compute the value of MUNIT by entering  MUNIT=780288/10

Now, we may use the MOVR, or index relative to current position motion command as follows:

MOVR 6.25        'index the axis 6.25 inches

Example 4

Perhaps in your application it is more common to move at a constant velocity using the SLEW command.  The units for SLEW are user units/sec.  In a previous example the MUNIT for revolutions was found, therefore after setting MUNIT, the units for the SLEW command would be in revolutions/second.  Perhaps it would be more convenient to slew in RPM 

In this example we desire to slew the axis using RPMs as our unit of measure.

Given: To SLEW in revolutions/second from Example #1; MUNIT=12800

revolutions   60 seconds   revolutions

X
=
second   minute   minute

therefore,  MUNIT=12800*60 or MUNIT=768000

Now, when e use the SLEW, or index at constant velocity, motion command as follows:

SLEW 100        'index the axis at a velocity of 100 RPM

The EUNIT Variable

EUNIT is a setup variable that is used when an encoder is used to provide position feedback. This document will show a technique in detail to set EUNIT for several common cases. Encoders are specified in lines per revolution. For a two channel quadrature encoder, there are 4 edges or counts per line. As an example, a 500 line encoder would produce 2000 counts per revolution. The definition of EUNIT is:

# of encoder counts returned to indexer

user unit

Unit analysis is used such that the conversion units cancel and you will be left with encoder counts/user unit

NOTE: MUNIT and EUNIT must be set to the same user units!

Examples

Example 1

In this example we will use motor revolutions as our user unit.

Given: A 200 line encoder

800 encoder counts

revolution

EUNIT=800

Example 2

In this example we will use degrees as our user unit.

Given: A 500 line encoder

2000 counts   revolution   2000 encoder counts

X
=
revolution   360 degrees   360 degrees

For increased accuracy let the math function of the indexer compute the value

EUNIT = 2000/360 (instead of EUNIT = 5.555....)

Example 3

In this example we will use inches as our user unit.

Given: A 500 line encoder, Linear Slide = 10mm/5 motor revs.

2000 counts   5 revolutions   25.4 mm   254000 counts

X
X
=
revolution   10 mm   inch   10 inches

EUNIT=25400 or EUNIT = 25400/10

[top]