Currently the PID loop caches the cell heater current value and uses it to calculate the new current setpoint. This violates the design of stateless systems (if it wants to know the old current value, just provider.get), and makes it more involved to tune over the PID loop.
Simple correction:
go through the code for all instances of self._old_current, find what they do, and replace as appropriate
we already have a __get_current method which queries it
A consideration:
when we start the pid_loop, we use __get_current to start the self._old_current, this is a get on the cell_heater_current_output
all future updates are using the new set value we have just attempted to apply to cell_heater_current_limit
given the known difference between the output and limit setting, should consider which of those makes more sense to use when updating
Currently the PID loop caches the cell heater current value and uses it to calculate the new current setpoint. This violates the design of stateless systems (if it wants to know the old current value, just provider.get), and makes it more involved to tune over the PID loop.
Simple correction:
A consideration: