FB_SimPosMotor

Position-controlled simulation motor.

This simulation motor travels automatically to the entered target position with a ramped velocity profile. The target position 'fTargetPosition' is transferred to 'bSet' with a rising edge. In addition to the present position, the current velocity and acceleration can be accessed at the outputs.

FB_SimPosMotor 1:

VAR_INPUT

VAR_INPUT
    bRun             : BOOL;    (* Motor running *)
    bSet             : BOOL;    (* Acitvates the move command *)
    fTargetPosition  : REAL;    (* Target Position ~(EUnit:mm)*)
    fMaxVelocity     : REAL := 1000;(* Maximal Velocity ~(EUnit:m/s)*)
    fMaxAcceleration : REAL := 100; (* Maximal Acceleration ~(EUnit:mm/s^2*)
END_VAR

bRun: Activates the simulation motor

bSet: Adoption of maximum velocity and target position on rising edge

fTargetPosition: Target position in mm

fMaxVelocity: Maximum velocity in mm/s

fMaxAcceleration: Max. acceleration in mm/s^2

VAR_OUTPUT

VAR_OUTPUT
    fPosition        : REAL := 0.0; (* Current position ~(EUnit:mm)*)
    bPositionReached : BOOL := TRUE; (* Position reached *)
    fVelocity        : REAL := 0.0;  (* Current velocity ~(EUnit:mm/s)*)
    fAcceleration    : REAL := 0.0;  (* Current acceleration ~(EUnit:mm/s^2)*)
END_VAR

fPosition: Current position in mm

bPositionReached: TRUE when the pre-assigned position is reached

fVelocity: Current velocity in mm/s

fAcceleration: Current acceleration in mm/s^2

Requirements

Development
Environment

Target System

PLC Libraries to include

TwinCAT v2.9.0 Build > 1020

PC (i386)

TcSimManager.Lib

(Standard.Lib; TcBase.Lib; TcSystem.Lib are included automatically)