Function block (FB) LineSpeed

A winder axis should wind or unwind material at a constant path speed. For this purpose, the "LineSpeed" function block can be connected to the drive axis via MOVIKIT® MultiMotion Auxiliary Velocity, for example.

The procedure for setting the parameters of MOVIKIT® MultiMotion Auxiliary Velocity and IEC programming is described in the corresponding manual.

 

User_PRG (PRG)

Declare required function blocks and configuration structures:

VAR

  _fbLineSpeedAxis1:SEW_Winder.LineSpeed;

  _fbDiameterAcqAxis1:SEW_Winder.DiameterAcquisition;

  _stConfigGeneralAxis1:SEW_Winder.ST_Config_General;

  _stConfigLineSpeedAxis1:SEW_Winder.ST_Config_LineSpeed;

  _stConfigDiameterAcqAxis1:

   SEW_Winder.ST_Config_DiameterAcquisition;

  //Steuersignale Anwendung

  _lrSetDiameter:LREAL;

  _xSetDiameter:BOOL;

  _xHoldDiameter:BOOL;

  _xUnwinder:BOOL;

  _lrDiameterSignal:LREAL;

  _xEnableApplicationStop:BOOL;

  _xPositive:BOOL;

  _xNegative:BOOL;

  _xStart:BOOL;

  _lrSetpointLineSpeed:LREAL;

  _lrSetpointLineSpeedAc:LREAL;

  _lrSetpointLineSpeedDe:LREAL;

  //Statussignale Anwendung

  _xActive:BOOL;

  _lrActualLineSpeed_Winder:LREAL;

  _xSetpointReached:BOOL;

END_VAR

 

PersistentVars

Declare persistent variables:

INFORMATION

Add the "Persistent variables" object in the device view under "Application" beforehand.

VAR_GLOBAL PERSISTENT RETAIN

  lrDmPersistentAxis1 : LREAL; // akt. Durchmesser speichern

END_VAR

 

User_PRG.Init

Initialization of the configuration structures:

_stConfigGeneralAxis1.lrGearRatioWinder := 3;

//Gesamtübersetzung Wickelantrieb

_stConfigGeneralAxis1.lrDiameterMin := 40; //[mm]

_stConfigGeneralAxis1.lrDiameterMax := 200; //[mm]

_stConfigGeneralAxis1.lrLineSpeedMax := 50; //[m/min]

_stConfigGeneralAxis1.lrLineSpeedStopDec:= 10; //[m/(min*s)]

_stConfigGeneralAxis1.lrAccDecMax := 3000; //[Umdr./(min* s)]

_stConfigGeneralAxis1.uiTaskCycleTime := 1; //[ms]

_stConfigDiameterAcqAxis1.eMode := 3; // Distanzsensor

_stConfigDiameterAcqAxis1.lrDiameterScalingU1 := 500; //[mV]

_stConfigDiameterAcqAxis1.lrDiameterScalingD1 := 40; //[mm]

_stConfigDiameterAcqAxis1.lrDiameterScalingU2 := 10000; //[mV]

_stConfigDiameterAcqAxis1.lrDiameterScalingD2 := 200; //[mm]

_stConfigDiameterAcqAxis1.uiDiameterFilterTime := 3000; //[ms]

_stConfigDiameterAcqAxis1.stGeneral := _stConfigGeneralAxis1;

//Konfigurationsstruktur General von Axis1 zuweisen

_stConfigLineSpeedAxis1.xActivateSpeedControl := FALSE;

//Geschwindigkeitsregelung nicht aktiviert

_stConfigLineSpeedAxis1.uiTolerance := 10; //[%]

_stConfigLineSpeedAxis1.uiInRangeTime := 500; //[ms]

_stConfigLineSpeedAxis1.uiOutRangeTime := 500; //[ms]

_stConfigLineSpeedAxis1.stGeneral := _stConfigGeneralAxis1;

//Konfigurationsstruktur General von Axis1 zuweisen

xInitDone := TRUE;

 

User_PRG.
HighPrio

Call of the function blocks and connection of MultiMotion Auxiliary Velocity:

// ------------ Durchmessererfassung für Achse 1 -------------

_fbDiameterAcqAxis1(

  lrSetDiameter:=_lrSetDiameter,

  xSetDiameter:=_xSetDiameter,

  xHoldDiameter:=_xHoldDiameter,

  xUnwinder:=_xUnwinder,

  lrDiameterSignal:=_lrDiameterSignal,

  xStandstill:=Interface_Axis1.Basic.Out.xStandstill,

  stConfig:=_stConfigDiameterAcqAxis1,

  lrDmPersistent:=PersistentVars.lrDmPersistentAxis1);

// ---------- konstante Bahngeschwindigkeit Achse 1 ----------

_fbLineSpeedAxis1(

  // FB Eingänge

  xActivate:=TRUE,

  xEnableApplicationStop:=_xEnableApplicationStop,

  xPositive:=_xPositive,

  xNegative:=_xNegative,

  xStart:=_xStart,

  lrSetpointLineSpeed:=_lrSetpointLineSpeed,

  lrSetpointLineSpeedAcc:=_lrSetpointLineSpeedAcc,

  lrSetpointLineSpeedDec:=_lrSetpointLineSpeedDec,

  lrActualDiameter:=_fbDiameterAcqAxis1.lrDiameterFiltered,

  lrActualVelocity:=Interface_Axis1.Basic.Out.lrActualVelocity,

  //Ausgangssignale Axis1 zuweisen

  iActualInverterMode:=Interface_Axis1.Inverter.Out.

  eActualInverterMode,

  xStandstill := Interface_Axis1.Basic.Out.xStandstill,

  // FB Ausgänge

  xActive => _xActive,

  lrActualLineSpeedWinder => _lrActualLineSpeed_Winder,

  xSetpointReached => _xSetpointReached,

  xEnable_ApplicationStop =>

  Interface_Axis1.Basic.In.xEnable_ApplicationStop,

  xModeVelocityActivate =>

  Interface_Axis1.Velocity.In.xActivate,

  //Eingangssignale Axis1 zuweisen

  xModeVelocityStart => Interface_Axis1.Velocity.In.xStart,

  lrModeVelocityVelocity =>

  Interface_Axis1.Velocity.In.lrVelocity,

  lrModeVelocityAcceleration =>

  Interface_Axis1.Velocity.In.lrAcceleration,

  lrModeVelocityDeceleration =>

  Interface_Axis1.Velocity.In.lrDeceleration,

  stConfig:=_stConfigLineSpeedAxis1);