8 s-curve acceleration, 9 motion suspend/resume, 10 conditional moves (move while/until) – Lenze PM94P01C User Manual

Page 54: Programming

Advertising
background image

PM94P01C

52

Programming

2.11.8 S-curve Acceleration

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

MDV <distance>,<velocity>,S

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

2.11.9 Motion SUSPEND/RESUME

At times it is necessary to control the motion by preloading the motion stack with motion profiles. Then, based on the
User Program, execute those motion profiles at some predetermined instance. 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