Integrator with limits

signal.limited_integrator

Integrates the input, y' = k u, and stays between lower and upper. At a limit it stops integrating while the input pushes outward, so it leaves the limit as soon as the input turns back.

Ports

NameDomainDirection
usignalin
ysignalout

Parameters

NameUnitDefaultDescription
k11Gain
y010Start value, between the limits
upper11Upper limit
lower1-1Lower limit

Variables

NameUnitStartDescription
x1y0Integral

Equations

der(x) = if x >= upper then (if k * u > 0 then 0 else k * u) else if x <= lower then (if k * u < 0 then 0 else k * u) else k * u
when x >= upper then reinit(x, upper)
when x <= lower then reinit(x, lower)
y = x