WDR_DiameterCalculation (FB)
FUNCTION_BLOCK WDR_DiameterCalculation
- Description:
This Function Block (FB) calculates and manages the current roll diameter of a material roll. Diameter feedback can be obtained in two ways: either directly from a diameter sensor or virtually, calculated using roll speed and material properties.
Key Features :
- WDR_DIAMETER_SOURCE.READ_FROM_DIAMETER_SENSOR:
Measures roll diameter directly using a diameter sensor. Sensor reading excludes core diameter (material only).
- WDR_DIAMETER_SOURCE.CALC_METHOD_ADDITION:
Calculates roll diameter by accumulating material thickness. Diameter grows incrementally with each wrap added.
- WDR_DIAMETER_SOURCE.CALC_METHOD_WEB_LENGTH:
Calculates roll diameter from total web length wound. Integrates line speed to determine web length, then applies geometric formula based on material thickness to compute diameter.
Calculates:
Roller diameter, according to the selected source. Unit: mm (ActRollDiameter).
Roller speed, scaled motor speed with gear ratio. Unit: RPM (ActRollSpeed).
Roller line speed, derived from the diameter and the roller speed. Unit: MPM (ActLineSpeed).
Material length, derived from the diameter roller line speed. Unit: m (ActMaterialLength).
Note
Line Speed Calculation Methods
Web Length Method: ActLineSpeed is derived from ActLineSpeedFromEnc (encoder feedback)
Other Methods: ActLineSpeed is calculated from measured rotational speed and diameter growth of the center rewinder/unwinder roller
Note
When Winder Mode = LINE_FEEDER.
Diameter source automatically switches to fixed diameter mode
Actual Roll diameter is equal to Core Diameter and remains constant
Diameter ratio equal to 1.0 as Core=Actual.
Note
Minimum Speed and Torque Check for Diameter Calculation
Diameter calculation initiates when either condition is met: actual roller speed ≥ MinSpeedForCal OR actual roller torque ≥ MinTorqueForCal.
Setting a value to zero disables that particular parameter check, allowing diameter calculation to continue or start based on the other parameter only.
Example: If MinSpeedForCal := 1 and MinTorqueForCal = 0, only the speed condition is checked.
If both parameters are set to zero, no condition checks are performed.
PresetDiameterMode: This parameter enables selection of the start diameter initialization method for winding/unwinding operations. Users can choose between automatic selection, user-defined preset configuration, or retention of previous cycle values.
AUTO: System automatically selects the starting diameter based on winder mode (no user input required)
Rewinder → Core diameter (material grows from core to full roll)
Unwinder → Full diameter (material shrinks from full to core)
Final Diameter := Preset Value + Diameter Calculation
PRESET: User manually enters the starting diameter value as a system parameter
PresetDiameter [mm] - User-defined custom start diameter (valid range: Core to Full)
Final Diameter := PresetDiameter + Diameter Calculation
Use case: Mid-roll restart, partial roll continuation, non-standard diameter requirements
RETAINED: System automatically loads the starting diameter from the previous winding cycle
Retained Diameter [mm] - Last saved diameter from previous cycle (valid range: Greater than core and Less than full)
- Diameter resets only when winder stops due to:
Full roll diameter reached
Core diameter reached
WinderStop parameter conditions met (Set diameter, Set time, or Set length reached)
Retained diameter continue holding previous value for winder stop triggred due to safety triggered and error state.
Retained Material Length [m] - Last accumulated material length from previous cycle
To manually reset the diameter, user can set WinderStop input to TRUE.
Final Diameter := Retained Value + Diameter Calculation
Use case: Long continuous operations, power-loss recovery, multi-cycle resumption
- InOut:
Scope
Name
Type
Initial
Comment
Input
EnableBOOL[TRUE] Enables the diameter computation logic.
FullRollDiameterLREAL[mm] Defines the full roll diameter. Diameter used for calculating decreasing diameter in unwinder mode.Range: > 0.
CoreDiameterLREAL[mm] Defines the core diameter. Diameter used for calculating increasing diameter in rewinder mode.Range: > 0.
DiameterSourceDiameter source 0 : Read from sensor , 1 : Calculation method addition, 3: Calculation method web length.
MaterialThicknessLREAL[mm] Thickness of the web material. Range: > 0.
DiameterAvgSampleSizeUINTAveraging samples of diameter value. Each sample = one task cycle, 0 = no averaging and >0(Higher value) = smoother but slower. Maximum should be <= 1000ms(DiameterAvgSampleSize*TaskTimeMs)
MinSpeedForCalLREAL[RPM] Minimum roller speed to continue diameter calculation. Calculation holds if speed drops below this value. Range: > 0.
MinTorqueForCalLREAL[%] Minimum roller torque to continue diameter calculation. Calculation holds if torque drops below this value. Range: > 0.
PresetDiameterModePreset diameter mode: 0.NONE, 1.AUTO =Auto-select Core/Full, 2.PRESET=Preset value, 3.RETAINED=Last cycle (includes ActMaterialLength).
PresetDiameterLREAL[mm] Preset diameter used when PresetDiameterMode = WDR_PRESET_DIAMETER_MODE.PRESET. Range: > 0.
DiameterHoldBOOL[TRUE] Pause diameter calculation. Example: manual threading operations
Output
BusyBOOL[TRUE] Indicates the function block is currently running.
ErrorBOOL[TRUE] Indicates an error occurred in the function block. The error flag resets after the error condition is resolved and when the Enable input transitions from TRUE to FALSE.
AppErrorIDApplication-specific error code.
ActRollDiameterLREAL[mm] Actual Line Roller/Rewinder/Unwinder roller diameter.
ActLineSpeedLREAL[MPM] Actual Line Roller/Rewinder/Unwinder line speed.
ActMaterialLengthLREAL[Meter] Actual total accumulated web length since start/reset.
DiameterRatioLREALRatio of Actual diameter to full diameter.
DiameterHoldActiveBOOL[TRUE] Indicates diameter hold mode is active.
StatusMessageWSTRING(255)“None”
Indicates diameter calculation active status message.
Inout
WinderLinkStructured data to share common variables between mandatory function blocks.