Programming – Lenze E94P PositionServo with MVOB User Manual

Page 54

Advertising
background image

52

L

PM94H201B_13xxxxxx_EN

Programming

2.11.8 S-curve Acceleration/Deceleration

Instead of using a linear acceleration/deceleration, the motion created using segment moves (MDV statements) can use
S-curve acceleration/deceleration. The syntax for MDV move with S-curve acceleration/deceleration is:

MDV <distance>,<velocity>,S

Segment moves using S-curve acceleration/deceleration will take the same amount of time as linear acceleration/
deceleration segment moves. S-curve acceleration/deceleration is useful because it is much smoother at the beginning
and end of the segment, however, the peak acceleration/deceleration of the segment will be twice as high as the
acceleration/deceleration used in the linear acceleration/deceleration segment.

2.11.9 Motion SUSPEND/RESUME

At times it is necessary to control motion by preloading the motion stack with motion profiles and then executing them
consecutively, based on the user program and/or some logical condition being detected. The statement “MOTION
SUSPEND” will suspend motion until the statement “MOTION RESUME” is executed. While motion is suspended, any
motion statement executed by the User Program will be loaded into the motion stack. When the “MOTION RESUME”
statement is executed, the preloaded motion profiles will be executed in the order that they were loaded.

Example:

MOTION SUSPEND

MDV 10,2

;placed in stack

MDV 20,2

;placed in stack

MDV 2,0

;placed in stack

MOVED 3,C

;must use “,C “modifier. Otherwise program will hang.

MOTION RESUME
Caution should be taken when using MOVED, MOVEP and MOVE statements. If any of the MOVE instructions are
written without the “C” modifier, the program will hang or lock up. The “MOTION SUSPEND” command effectively halts
all execution of motion. In the example, as the program executes the “MDV” and “MOVED” statements, those move
profiles are loaded into the motion stack. If the final “MOVED” is missing the “C” modifier then the User Program will wait
until that move profile is complete before continuing on. Because motion has been suspended, the move will never be
complete and the program will hang on this instruction.

2.11.10

Conditional Moves (MOVE WHILE/UNTIL)

The statements “MOVE UNTIL <expression>” and “MOVE WHILE <expression>” will both start their motion profiles
based on their acceleration and max velocity profile settings. The “MOVE UNTIL <expression> statement will continue
the move until the <expression> becomes true. The “MOVE WHILE <expression>” will also continue its move while it’s
<expression> is true. Expression can be any valid arithmetic or logical expressions or their combination.

Examples:

MOVE WHILE APOS<20

;Move while the position is less then 20, then

;stop with current deceleration rate.

MOVE UNTIL APOS>V1

;Move positive until the position is greater than

;the value in variable V1

MOVE BACK UNTIL APOS<V1

;Move negative until the position is less than the

;value in variable V1

MOVE WHILE IN_A1

;Move positive while input A1 is activated.

MOVE WHILE !IN_A1

;Move positive while input A1 is not activated.

;The exclamation mark (!) in front of IN_A1 inverts

;(or negates) the value of IN_A1.

This last example is a convenient way to find a sensor or switch.

Advertising