refactor: move pot hardware params and pid_type out of per-brew docs
Pot hardware constants (mass, material, L, Td) moved from sude/*.json to config.json's Pot section; Sud/SudForecastEstimator accept pot_config as baseline, per-brew pot sections may still override. Controller key removed; pid_type moved into TempCtrl. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,7 +51,7 @@ class SudForecastEstimator:
|
||||
real run actually is (the discrete steps end up duty-cycling it back
|
||||
down to something close to the commanded average)."""
|
||||
|
||||
def __init__(self, dt, theta_amb, pid_type, tempctrl_params, heater_powers, sim_warp_factor):
|
||||
def __init__(self, dt, theta_amb, pid_type, tempctrl_params, heater_powers, sim_warp_factor, pot_config=None):
|
||||
self.dt = dt
|
||||
self.theta_amb = theta_amb
|
||||
self.pid_type = pid_type
|
||||
@@ -61,6 +61,7 @@ class SudForecastEstimator:
|
||||
# pair straddling the commanded power.
|
||||
self.heater_powers = heater_powers
|
||||
self.sim_warp_factor = sim_warp_factor
|
||||
self.pot_config = pot_config or {}
|
||||
|
||||
def set_ambient_temperature(self, theta_amb):
|
||||
self.theta_amb = theta_amb
|
||||
@@ -93,7 +94,7 @@ class SudForecastEstimator:
|
||||
if start_theta is None:
|
||||
start_theta = self.theta_amb
|
||||
|
||||
sud = Sud()
|
||||
sud = Sud(self.pot_config)
|
||||
if not sud.load(doc) or not sud.schedule:
|
||||
return [0.0], [start_theta], SudState.DONE, {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user