In PID.__init__(), the output_limits setter should be used rather than setting self._min_output and self._max_output directly. As it is now, the checks done in the setter (min < max etc.) are not done if setting the limits through __init__(), so the values can be weird.
It should also be done after the call to self.reset() so that the integral term is clamped properly from the beginning.
In
PID.__init__()
, the output_limits setter should be used rather than settingself._min_output
andself._max_output
directly. As it is now, the checks done in the setter (min < max etc.) are not done if setting the limits through__init__()
, so the values can be weird.It should also be done after the call to
self.reset()
so that the integral term is clamped properly from the beginning.