Intelligent Motion Systems Modular LYNX System User Manual

Page 8

Advertising
background image

1 - 8

Modular LYNX System 12.05.2003

Once you have been able to move the motor, the next step is to write a simple program to illustrate one of the
dynamic features of the LYNX: the ability to convert motor steps to a dimension of linear or rotary distance.
Let’s begin by discussing the relationship between the MUNIT variable and user units. Typically when we
perform a move we want to know the distance of that move in a familiar unit of measurement. That means
translating motor steps to the desired unit of measurement. The LYNX Control Module has the capability of
doing this for you. You have already set the motor units variable (MUNIT) to a value 51,200. With the
driver set to a resolution of 256 micro-steps per step and a 1.8° step motor that will be equal to 1 revolution
of the motor, or one USER UNIT. A user unit can be any unit of measure. At this point, by entering the
instruction MOVR 1, the motor will turn one complete revolution relative to its current position. Therefore,
1 User Unit = 1 Motor Revolution. For the exercise below we will use degrees for our user unit. As the LYNX
Product Manual indicates, the calculation required to select degrees as our user unit in this case is:

51200 Micro-steps per rev ÷ 360 degrees = 142.222 Micro-steps per degree

By setting the MUNIT variable to 51200/360 the LYNX Control Module will perform the calculation to
convert the user unit to degrees. Now, when issued, a relative motion instruction “MOVR 90” the motor will
turn 90 degrees.

Now, enter a sample program that will convert motor steps to degrees, execute a 90° move, and report that
move every 100 milliseconds while the motor is moving. Type the following bold commands:

‘Enter Program Mode, start program at Location 2000.

PGM 2000

‘Label the program TSTPGM.

LBL TSTPGM

‘ Set the user units to degrees.

MUNIT = 51200/360

‘ Set the max. velocity to 25 degrees per second.

VM = 25

‘ Execute a relative move of 90 degrees.

MOVR 90

‘ Report the position every 100 ms while moving.

LBL PRINTPOS

DELAY 100

PRINT “Axis position is”, POS, “Degrees.”

BR PRINTPOS, MVG

‘End the program.

END

PGM

Now Type TSTPGM to run program.
This sample program will be stored starting at location 2000. It sets the conversion factor for the user units,
sets the maximum velocity and then starts a motion. While the motion is occurring, the position is reported
every 100 milliseconds.

At this point you may desire to restore the settings to their factory default as you may not wish to use
degrees as your user unit. To do this, you will use the CP, DVF, and IP instructions.

CP - Clear Program.

To clear the program, type CP 1, 1. This will completely clear program memory space. Should
you desire to only remove one program, the instruction “CP [Program Label]” i.e., “CP
TSTPGM” would clear only that program. In this exercise only one program was entered, “CP
TSTPGM” will clear it.

DVF - Delete User Defined Variables and Flags.

By entering DVF, all of the user defined variables will be removed. Although no Flags were set
in this exercise, this command would clear them were they used.

IP - Initialize Parameters

This instruction will restore all of the parameters to their factory default state.

After entering these instructions a SAVE instruction should be entered.

Advertising