Reference – Lenze PM94P01C User Manual

Page 124

Advertising
background image

PM94P01C

122

Reference

Example Internal Torque Program

;Program slowly increases Motor Torque until nominal motor current is reached
VAR_DriveMode = 0

;Set Drive to Torque mode

VAR_Reference = 1

;Set Reference to Internal control

Program Start:
IREF = 0

;Reset Torque Reference to 0(Amps)

Wait While !In_A3

;Wait while Enable input is OFF

Enable

;Enable Drive

Torque_Loop:
Wait Time 500

;Set time between step increases in Torque

If REF < VAR_CurrentLimit

;If Set Torque < Motor Nominal Torque

IREF = IREF+0.1

;Then increase by 0.1(Amps)

GOTO Torque_Loop

;Loop to next torque increase

Else

Goto Program_Start

;Else restart program

Endif
END

Example Internal Velocity Program

;Program slowly increases and decreases Motor Velocity between Maximum Velocity Forward direction and
;Maximum Velocity Reverse direction producing a saw-tooth velocity profile.
Define MaxVelocityRPS 60

;Enter Maximum Velocity (RPS) value here

Define VelocityStepRPS 1

;Define Velocity INC/DEC per Step/Program Loop (RPS)

Define VelocityStepTime 200

;Define Time for Velocity Steps in mS

Define Velocity_Inc_Dec V0

;Define a Variable to identify if Velocity is currently INC/DECreasing

VAR_DriveMode = 1

;Set Drive to Velocity mode

VAR_Reference = 1

;Set Reference to Internal control

VAR_Enable_AccelDecel = 1

;Enable Accel/Decel Ramps

VAR_Accel_Limit = 3000

;Set Accel Rate required in RPS^2

VAR_Decel_Limit = 3000

;Set Decel Rate required in RPS^2

Program Start:
IREF = 0

;Reset Velocity Reference to 0(RPS)

Wait While !In_A3

;Wait while Enable input is OFF

Enable

;Enable Drive

Velocity_Loop:
Wait Time VelocityStep Time

;Set Time between Step Increases/Decreases in Velocity (mS)

If REF <= MaxVelocityRPS

;If Current Motor Velocity < MaxVelocityRPS

IREF = IREF+VelocityStepRPS

;Then increase Velocity by VelocityStepRPS

Else

Velocity_Inc_Dec = 1

;Set Variable to start decreasing velocity

Endif

Else

;If Speed Decreasing

If REF >= -1* MaxVelocityRPS

;If Current Motor Velocity > -MaxVelocityRPS

IREF = IREF-VelocityStepRPS

;Then decrease Velocity by VelocityStepRPS

Else

Velocity_Inc_Dec = 0

;Set Variable to start increasing velocity

Endif

Endif
Goto Velocity_Loop

;Loop to next Velocity Increase/Decrease

END

;End Code - Never Reached

On Fault

;Fault Handler

Resume Program_Start

;Resume at Program Start

EndFault

Advertising