jens and Claude Sonnet 4.6
1bf3929b60
Drop model_params from base, enable Smith predictor delay correction
...
TempControllerBase no longer threads model_params through (only the
Smith subclass needs it, for its own Pot model and Kalman filters).
Enable the Smith predictor's actual delay-compensated error term
(theta_err now uses theta_ist_plant - theta_ist_model_delay +
theta_ist_model instead of the plain plant reading), which is the
correction this controller is named for.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-18 21:06:35 +02:00
jens and Claude Sonnet 4.6
78ee80f96d
Deduplicate TempController/TempController_smith into a shared base
...
Both controllers had nearly identical process_fsm(), process_pid(),
and all getters/setters; only Kalman/model setup and process()
genuinely differed, and the duplication had already drifted (the
Smith variant resets model state on entering HEAT, the plain one
didn't).
Add TempControllerBase with the shared logic and three small hooks
(init_kalman, on_state_entered, post_pid) subclasses use to plug in
their own Kalman/model behavior. Each subclass now contains only what
makes it different.
Also fixes a latent crash: TempController's constructor only accepted
(dt, params), but PidFactory/brewpi.py always call it with a third
model_params arg, so pid_type "Normal" would have raised TypeError.
The shared base's model_params=None default fixes this. Also
initializes the Smith controller's trace attributes in __init__
instead of leaving them undefined until the first process() call.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-06-18 20:50:01 +02:00
jens
879fa77ed3
- improved plot
2022-06-28 20:19:38 +02:00
jens
b8ed02eb3a
- put calculated power from heater into tc model
2021-10-18 21:32:37 +02:00
jens
7f66084082
- removed debug log
2021-10-18 17:58:36 +02:00
jens
54f2322c07
- added generic tracer class
...
- create tracer for TC
- tracer task runs TC-Tracer
2021-10-18 17:57:40 +02:00
jens
4a26e84c6e
- TC export some vars
...
- cleaned up test
- added model vars to test
2021-10-13 18:29:33 +02:00
jens
e8fa90e753
- PID/TC goes Idle state on first theat_ist measurement
2021-10-12 17:13:19 +02:00
jens
bf7ec2beaf
- PID: introduced INIT State
...
- refactored
2021-10-12 16:47:05 +02:00
jens
7eb9d16f4d
- updatd constants
2021-10-12 16:19:21 +02:00
jens
3c010d7bfd
- updatd constants
2021-10-12 13:24:19 +02:00
jens
b4a6c70591
- init kalman_model_delay
2021-10-12 12:07:36 +02:00
jens
16cb3d3b3c
- use heat diffusion for water model instead of delay line
2021-10-12 12:01:40 +02:00
jens
89ac2b8ea8
- updated tc params for test
2021-10-12 10:20:55 +02:00
jens
425567f3db
- refactored
...
- increased Hold.Pid.kp
- decrease state change HEAT TO HOLD windows to 1°C
2021-10-12 09:11:07 +02:00
jens
ff90c6d90c
- added initial for filling Delay line
...
- added gain parameter for Pot sim
- from state change to heat init model temp with plant temp
- updated config template
2021-10-11 19:54:03 +02:00
jens
20b0363e26
- reset kalman on change to HEAT state
2021-10-11 19:04:32 +02:00
jens
9b20276012
- fixed setting model correct power in idle
2021-10-11 18:28:25 +02:00
jens
132081eeb1
- added debig
2021-10-11 16:54:58 +01:00
jens
c5c39732cf
- do data signal wiring at one central place
...
- fixed initializations
2021-10-11 13:05:18 +02:00
jens
80fa983c96
- fixed kalman test for different dt
2021-10-10 13:56:48 +02:00
jens
dce3caa1eb
- refactored
2021-10-09 12:27:36 +02:00
jens
f6394e9e7a
- refactored
2021-10-09 10:52:35 +02:00
jens
b83ec71346
- refactored
2021-10-09 10:07:45 +02:00
jens
5923212055
- refactored
2021-10-09 09:46:52 +02:00
jens
529ae7ad2f
- adjusted params for TC tests
2021-10-02 13:10:10 +02:00
jens
2e143ee03f
- implemented APid
...
- choose Tempcontroller impl. from config
2021-10-02 12:24:42 +02:00
jens
bf019733b2
- added abstarct PID APid
...
- added PidFactory
- use variable args for factory
2021-10-02 11:10:43 +02:00
jens
70426b9280
- start HOLD at diference of 2.0 °C
2021-08-10 15:39:54 +02:00
jens
cc54887f9b
- TC: HOLD controller doesn't use Smith Predictor
2020-12-22 13:32:14 +01:00
jens
58411e297c
- use temp_controller_smith
2020-12-22 11:05:09 +01:00
jens
b55bd5b366
- refactored
2020-12-22 11:02:37 +01:00
jens
f2aff73f40
- refactored temp controllers
2020-12-22 10:51:38 +01:00
jens
4c93e85dd8
- improved temp controllers
2020-12-22 10:45:51 +01:00
jens
5762b7ab8f
- added temp_controller with Smith Prediction
2020-12-22 10:27:21 +01:00
jens
d777a955a4
- refactored dt
2020-12-22 10:26:56 +01:00
jens
b5a0e6a7ac
- removed dt from params
2020-12-21 16:06:17 +01:00
jens
972e447897
- no kd
2020-12-21 12:43:50 +01:00
jens
5865923854
- refactored params
2020-12-21 12:24:42 +01:00
jens
262f1ef663
- refactored params
2020-12-21 12:24:31 +01:00
jens
6649a03d44
- PID: no params for constructor
...
- adedd dt
- fixed set_params
2020-12-21 12:23:56 +01:00
jens
b9b1a1c613
- PID: added set_param()
2020-12-21 11:28:44 +01:00
jens
5f60312d4e
- Pid: D-Part need not to be error based
...
- increased pot delay to 30 s
2020-12-20 18:23:14 +01:00
jens
24437329f0
- Compensate for max heat rate to reduce overshoot
2020-12-16 19:54:38 +01:00
jens
71cd87085f
- load params from config.json
2020-12-16 18:42:05 +01:00
jens
6dd0920010
- refactored
2020-12-16 17:13:57 +01:00
jens
fa93a3911e
- refactored
2020-12-16 17:10:46 +01:00
jens
73d1c844b0
- improved Kalman eval
2020-12-16 09:07:52 +01:00
jens
2327b214fc
- increased kp
2020-12-13 16:31:20 +01:00
jens
0633e464ca
- refactored
...
- created TempSensorFactory
2020-12-13 16:21:08 +01:00