Adds a configurable IIR pre-filter (beta, default 0.05, τ≈19 s at dt=1 s) applied to theta_ist before the derivative, so stirrer-induced temperature noise is attenuated before being amplified by differentiation rather than after. The shared filter/derivative/post-filter logic is factored into TempControllerBase._compute_heatrate(); both Normal and Smith subclasses call it, replacing their duplicated inline rate blocks. beta is read from TempCtrl.beta in the config (default 0.05 if absent) and added to config-sim.json.tpl and config-real.json.tpl. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
46 lines
644 B
Smarty
46 lines
644 B
Smarty
{
|
|
"ambient_temperature": 20,
|
|
"Controller" : {
|
|
"stirrer_name": "sim",
|
|
"plant_name": "sim",
|
|
"pid_type": "Smith"
|
|
},
|
|
"TempCtrl": {
|
|
"beta": 0.05,
|
|
"Hold": {
|
|
"kp": 0.4,
|
|
"ki": 0.0,
|
|
"kd": 0.0,
|
|
"kt": 0.0
|
|
},
|
|
"Heat": {
|
|
"kp": 0.08,
|
|
"ki": 0.02,
|
|
"kd": 0.0,
|
|
"kt": 1.5
|
|
},
|
|
"Cool": {
|
|
"kp": 0.08,
|
|
"ki": 0.02,
|
|
"kd": 0.0,
|
|
"kt": 1.5
|
|
},
|
|
"Thresholds": {
|
|
"HoldHeat": 1.0,
|
|
"HoldCool": 1.0,
|
|
"HeatHold": 1.0,
|
|
"HeatCool": 1.0,
|
|
"CoolHold": 1.0,
|
|
"CoolHeat": 1.0
|
|
}
|
|
},
|
|
"Heater": {
|
|
"port": "/dev/ttyUSB0",
|
|
"speed": "115200"
|
|
},
|
|
"Stirrer": {
|
|
"port": "/dev/ttyACM0",
|
|
"speed": "115200"
|
|
}
|
|
}
|