Programming – Lenze E94P PositionServo with MVOB User Manual

Page 84

Advertising
background image

82

L

PM94H201B_13xxxxxx_EN

Programming

2.15.10

Homing Mode Operation Example

The following steps are needed to execute the homing operation from the user program or under interface control.

1. Set Fast homing speed:

Variable #242

2. Set Slow homing speed:

Variable #243

3. Set Homing accel/decel:

Variable #239

4. Set home offset:

a. In User Units

Variable #240

b. In encoder pulses

Variable #241

5. Set Home Switch Input

Variable #246

6. Select Home Method

Variable #244

To start, execute the HOME command. Refer to the example herein.
There are two methods of starting pre-defined homing operation, the ‘HOME’ command and the Var_Start_Homing
variable. When Homing is initiated from the user program the ‘HOME’ command should always be used. The HOME
command is a blocking instruction that prevents further execution of the Main Program until homing operation is
completed. Any events that are enabled whilst homing is carried out will continue to process.

WARNING!

If using firmware prior to 4.50 then execution of homing functionality does not prevent simultaneous execution of subsequent
programming statements and it is required to immediately follow the HOME command with the following code line:

WAIT UNTIL VAR_EXSTATUS & 0x400000 == 0x400000.

Doing this ensures no further lines of code will be executed until homing is complete.

The home start variable (Var_Start_Homing) is used to initiate pre-defined homing functionality from a host interface. It
should not be used if the drive contains or is executing a user program. Var_Start_Homing range is: 0 or 1. When set to
0, no action occurs. When set to 1, the homing operation is started.

;Program start--------------------------------------------------------------------------------

;

;

UNITS=1

;rps

Accel=1000

Decel=1000

MaxV =20

;some program statements…

;

;

;Homing specific set up

VAR_HOME_FAST_VEL=

10

;rps

VAR_HOME_SLOW_VEL=

1

;rps

VAR_HOME_ACCEL=

100

;rps/sec^2

VAR_HOME_OFFSET=

0

;no offset from sensor

VAR_HOME_SWITCH_INPUT=

4

;input B1 (0-A1, 1-A2…3-A4, 4-B1,…11-C4)

VAR_HOME_METHOD=

4

;see table 21

ENABLE

HOME

;start homing sequence

;The statement below MUST be included immediately after the Home command on drives containing

;firmware releases prior to version 4.50

WAIT UNTIL VAR_EXSTATUS & 0x400000 == 0x400000 ;wait for homing complete

;Drive homed

;Program statements…

END

Advertising