TempControllerBase: require PID gains via set_params(), not the constructor
Mirrors components/pid/pid.py's own Pid.set_params() pattern: params/ thresholds start out None, and set_params() configures pid_hold/pid_heat/ pid_cool from them. process()/process_fsm() fail naturally (TypeError on None) if called before set_params() - same as Pid.process() already does - rather than a new bespoke check. Updates all callers (server/brewpi.py, SudForecastEstimator, and the pid/sud demo scripts) to call set_params() right after construction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DkkuG48uHFCGKe6dPSERFk
This commit is contained in:
@@ -43,7 +43,8 @@ if __name__ == '__main__':
|
||||
temp_ist = 0
|
||||
temp_soll = 20
|
||||
heatrate_soll = 1.25
|
||||
ctrl = TempController(dt, ctrl_params)
|
||||
ctrl = TempController(dt)
|
||||
ctrl.set_params(ctrl_params)
|
||||
ctrl.set_enabled(True)
|
||||
plant = Pot(dt)
|
||||
plant.set_plant_params(plant_params)
|
||||
|
||||
@@ -43,7 +43,8 @@ if __name__ == '__main__':
|
||||
temp_ist = 0
|
||||
temp_soll = 20
|
||||
heatrate_soll = 1.25
|
||||
ctrl = TempController(dt, ctrl_params, plant_params, theta_amb)
|
||||
ctrl = TempController(dt, plant_params, theta_amb)
|
||||
ctrl.set_params(ctrl_params)
|
||||
ctrl.set_enabled(True)
|
||||
plant = Pot(dt)
|
||||
plant.set_plant_params(plant_params)
|
||||
|
||||
@@ -48,7 +48,8 @@ if __name__ == '__main__':
|
||||
"Td" : 60
|
||||
}
|
||||
|
||||
ctrl = TempController(dt, ctrl_params, plant_params, theta_amb)
|
||||
ctrl = TempController(dt, plant_params, theta_amb)
|
||||
ctrl.set_params(ctrl_params)
|
||||
plant = Pot(dt)
|
||||
plant.set_plant_params(plant_params)
|
||||
plant.set_ambient_temperature(theta_amb)
|
||||
|
||||
Reference in New Issue
Block a user