WDR_MechanicalCompensation (FB)
FUNCTION_BLOCK WDR_MechanicalCompensation
Description:
Calculates and provides mechanical compensation torques (friction and inertia) to improve winder/unwinder motion control accuracy and tension stability. The compensation torque is designed to be used as feedforward control in conjunction with tension PID control.
Key Features :
Computes friction compensation torque, both static and dynamic, to overcome resistance in the system.
Friction compensation :
Calculates static friction torque at low speeds to prevent stalling
Computes dynamic friction torque based on speed-dependent lookup table
Supports 7-point friction curve (5%, 10%, 20%, 40%, 60%, 80%, 100% speed)
Applies user-defined friction torque offset for fine-tuning
Optional low-pass filtering to reduce noise and sudden changes
Frictional loss torque is scaled by gear ratio. ActRollerTorque contains the scaled value.
Inertia compensation :
Calculates torque required to accelerate/decelerate roll mass. Inertia compensation provides feedforward torque offset to the motor during acceleration and deceleration.
- Supports two calculation methods:
SCALED_BY_WEIGHT_DIAMETE: Based on Full roll weight and Actual Diameter.
ESTIMATED_WEIGHT: Based on Estimated Weight from Actual Radius, Core Radius and Material Thickness.
Separate gain factors for acceleration, deceleration, and steady-state.
Optional low-pass filtering to reduce angular acceleration noise amplification.
Output inertia compensation torque will be scaled to gear ratio. ie, Inertia Compensation := (Total Inertia * Angular Acceleration)* Gear Ratio.
Output of block incldues individual friction and inertia compensation values (Nm and %) and Status indication for diagnostics and troubleshooting. Friction and inertia compensation will be set to zero if diameter hold is active.
Note
The mechanical compensation value for friction and inertia is added to the TorqueOffset output of the WDR_WinderControl function block. The output variable from WDR_MechanicalCompensation function block does not need to be mapped elsewhere. The output can be used here for result monitoring and diagnostics. The final feed-forward TorqueOffset also include feed-forward values such as stall torque and trim torque.
Note
Filtering is recommended for motor speed and inertia torque inputs to ensure stable angular acceleration with minimal noise and fluctuations. Since angular acceleration is derived from motor speed, fluctuations in speed directly impact inertia torque calculations. Use combined filtering for optimal results.
Recommended Settings:
MotorControlParameter.MotorSpeedLPSTime (Motor Speed Filter): 1000 ms (enabled in Winder Control function block)
MechCompenFilterPara.InertiaCompenLPSTime (Inertia Torque Filter): 1000 ms (enabled in Mechanical Compensation function block)
Combined filtering of both parameters produces smoother and more stable inertia torque values.
Note
Fixed Inertia: Sum of constant rotating component inertias from both motor and load sides:
Motor Side Components: Motor shaft inertia (J_motor) and Coupling inertia (J_coupling)
Load Side Components: Gearbox inertia (J_gearbox) and Empty core roller inertia (J_core)
Formula (Load Side Reference): J_fixed_inertia = (J_motor + J_coupling) × GearRatio² + J_gearbox + J_core
Empty Core Inertia Calculation, Formula: J_core = (m_core × (R_outer² + R_inner²)) / 2
Parameters: m_core = Core mass [kg], R_outer = Core outer radius [m] and R_inner = Core inner radius [m]
- InOut:
Scope
Name
Type
Initial
Comment
Input
EnableFrictionCompenBOOL[TRUE] Enables/disables friction torque compensation.
StaticFrictionSpeedLREAL[%] Minimum speed at which the winder does not stall. Must be below 5%.
StaticFrictionTorqueLREAL[%] Winder roller friction torque at the static-friction speed. Must be less than the torque at 5%. Can be captured from ActRollerTorque at stall speed.
FrictionTorqueOffsetLREAL[%] Winder roller friction Torque Additive is an extra torque added to the calculated friction compensation.
DynamicFriction[%] Defines the winder roller friction torque at Dyanamic(5%,10%,20%,40%,60%,80% and 100%) of the maximum speed. Can be captured from ActRollerTorque for different speed level.
EnableInertiaCompenBOOL[TRUE] Enables/disables inertia-based torque correction.
FixedInertiaLREAL[kgm²] Fixed inertia includes sum of the inertia of the motor shaft, couplings, gear-box and inertia of an empty roll.
InertiaCalcMethodMethod used to calculate inertia 1. ESTIMATED_WEIGHT 2.SCALED_BY_WEIGHT_DIAMETER
MaterialWidthLREAL[mm] Width of the material.
MaterialLengthLREAL[mm] Length of the material.
MaterialDensityLREAL[kg/m3] Density of the material.
FullRollWeightLREAL[kg] Total weight of wound web material on the roll, core weight excluded.
AccCompGainLREALGain for inertia torque during acceleration
DecCompGainLREALGain for inertia torque during deceleration
SteadySpeedCompGainLREALGain for inertia torque during steady speed
AnglurAccThresholdLREAL0.1
[RPM] Minimum RPM change per cycle used to detect angular accel/decel state.
MechCompenFilterParaLow pass filter parameters for friction and inertia compensation.
Output
BusyBOOL[TRUE] Indicates the function block is currently running.
ErrorBOOLIndicates 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.
FrictionCompenNmLREAL[Nm] Torque compensation needed to overcome static/dynamic friction.
FrictionCompenLREAL[%] Torque compensation needed to overcome static/dynamic friction.
TotalInertiaLREAL[kg/m3] Total calcualte inertia.
AngularAccelerationLREAL[rad/s²] Angualr Acceleration.
InertiaCompenNmLREAL[NM] Torque compensation calculated from material inertia and scaled for gear ratio.
InertiaCompenLREAL[%] Torque compensation calculated from material inertia and scaled for gear ratio.
StatusMessageWSTRING(255)“None”
Indicates Mechanical Compentation active status message.
Inout
WinderLinkStructured data to share common variables between mandatory function blocks.