Skip to content

make the pid_loop more stateless #175

Open
@wcpettus

Description

@wcpettus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions