Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor brew detection and brew handling #512

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
31f7264
remove brewdetection
LoQue90 Aug 20, 2024
a405529
adding brewtimer
LoQue90 Sep 7, 2024
977a44a
remove more SW Brew detection and cleanup
LoQue90 Sep 7, 2024
b65409f
remove Brew PID Time
LoQue90 Sep 8, 2024
99bff94
fix makros for brew() and brewTimer()
LoQue90 Sep 8, 2024
bdf5ba6
clean checkbrewswitch()
LoQue90 Sep 10, 2024
fa6d900
move shot timer log to brewHandler
LoQue90 Sep 16, 2024
7f1706a
add brewOn to brewTimer
LoQue90 Sep 16, 2024
6b1703b
remove more optocoupler makro
LoQue90 Sep 16, 2024
c4c7329
move brewOn from brewswitch to brew()
LoQue90 Sep 16, 2024
fd91f6e
remove mashine state kShotTimerAfterBrew
LoQue90 Sep 16, 2024
0cb44f1
rework displayed brewTime
LoQue90 Sep 16, 2024
cf326e0
include backflush if BREWCONTROL == 1
LoQue90 Sep 28, 2024
69b98de
add manual flush as own function
LoQue90 Sep 28, 2024
0e7bb98
fixes after rebase
LoQue90 Oct 11, 2024
4687343
rework brew() and backflush()
LoQue90 Oct 11, 2024
22561c9
bring brewcontrol setting onto website
LoQue90 Oct 13, 2024
3516b53
clean up MQTT Brew stuff
LoQue90 Oct 14, 2024
05a8132
don´t start backflush from kSteam
LoQue90 Oct 16, 2024
f3d1c1f
bring display settings onto the website
LoQue90 Oct 17, 2024
f39a2c9
rework scale shottimer
LoQue90 Oct 17, 2024
2d1770a
move backflush settings into own section
LoQue90 Oct 27, 2024
8c0b01f
enabled PID after brew was aborted
LoQue90 Nov 3, 2024
8a0c131
cleanup state machine
LoQue90 Dec 12, 2024
1304563
show heating Logo also if steam temp isn´t reached
LoQue90 Dec 12, 2024
ab65ec9
rename Shot timer, manual flush timer separated
LoQue90 Dec 13, 2024
18d2d02
add function for showing brew Timer
LoQue90 Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions data/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const vueApp = Vue.createApp({
// post parameter array the same as if it was posted from a form (the values are already updated
// from the v-model bindings)
var formBody = [];

this.parameters.forEach(param => {
var encodedKey = encodeURIComponent(param.name);
var encodedValue = encodeURIComponent(param.value);
Expand All @@ -41,7 +41,7 @@ const vueApp = Vue.createApp({
cache: 'no-cache',
body: formBody
};

this.isPostingForm = true

fetch("/parameters", requestOptions)
Expand Down Expand Up @@ -74,13 +74,15 @@ const vueApp = Vue.createApp({
sectionName(sectionId) {
const sectionNames = {
0: 'PID Parameters',
1: 'Temperature and Preinfusion',
2: 'Brew Detection and Brew PID Parameters',
1: 'Temperature',
2: 'Brew PID Parameters',
3: 'Brew Control',
4: 'Scale Parameters',
5: 'Power Settings'
5: 'Display Settings',
6: 'Maintenance',
7: 'Power Settings'
}

return sectionNames[sectionId]
},

Expand Down
517 changes: 286 additions & 231 deletions src/brewHandler.h

Large diffs are not rendered by default.

158 changes: 79 additions & 79 deletions src/defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,83 +20,83 @@ int writeSysParamsToStorage(void);
#define STR(x) STR_HELPER(x)

// default parameters
#define SETPOINT 95 // brew temperature setpoint
#define TEMPOFFSET 0 // brew temperature setpoint
#define STEAMSETPOINT 120 // steam temperature setpoint
#define SCALE_CALIBRATION_FACTOR 1.00 // Raw data is divided by this value to convert to readable data
#define SCALE2_CALIBRATION_FACTOR 1.00 // Raw data is divided by this value to convert to readable data
#define SCALE_KNOWN_WEIGHT 267.00 // Calibration weight for scale (weight of the tray)
#define AGGKP 62 // PID Kp (regular phase)
#define AGGTN 52 // PID Tn (regular phase)
#define AGGTV 11.5 // PID Tv (regular phase)
#define AGGIMAX 55 // PID Integrator Max (regular phase)
#define STARTKP 45 // PID Kp (coldstart phase)
#define STARTTN 130 // PID Tn (coldstart phase)
#define STEAMKP 150 // PID kp (steam phase)
#define AGGBKP 50 // PID Kp (brew detection phase)
#define AGGBTN 0 // PID Tn (brew detection phase)
#define AGGBTV 20 // PID Tv (brew detection phase)
#define BREW_TIME 25 // brew time in seconds (only used if pump is being controlled)
#define BREW_SW_TIME 25 // keep brew PID params for this many seconds after detection (only for software BD)
#define BREW_PID_DELAY 10 // delay until enabling PID controller during brew (no heating during this time)
#define BD_SENSITIVITY 120 // brew detection sensitivity, be careful: if too low, then there is the risk of wrong brew detection and rising temperature
#define PRE_INFUSION_TIME 2 // pre-infusion time in seconds
#define PRE_INFUSION_PAUSE_TIME 5 // pre-infusion pause time in seconds
#define SCALE_WEIGHTSETPOINT 30 // Target weight in grams
#define WIFI_CREDENTIALS_SAVED 0 // Flag if wifi setup is done. 0: not set up, 1: credentials set up via wifi manager
#define STANDBY_MODE_ON 0 // Standby mode off by default
#define STANDBY_MODE_TIME 30 // Time in minutes until the heater is turned off
#define BACKFLUSH_CYCLES 5 // number of cycles the backflush should run
#define BACKFLUSH_FILL_TIME 5 // time in seconds the pump is running during backflush
#define BACKFLUSH_FLUSH_TIME 10 // time in seconds the 3-way valve is open during backflush
#define SETPOINT 95 // brew temperature setpoint
#define TEMPOFFSET 0 // brew temperature setpoint
#define STEAMSETPOINT 120 // steam temperature setpoint
#define SCALE_CALIBRATION_FACTOR 1.00 // Raw data is divided by this value to convert to readable data
#define SCALE2_CALIBRATION_FACTOR 1.00 // Raw data is divided by this value to convert to readable data
#define SCALE_KNOWN_WEIGHT 267.00 // Calibration weight for scale (weight of the tray)
#define AGGKP 62 // PID Kp (regular phase)
#define AGGTN 52 // PID Tn (regular phase)
#define AGGTV 11.5 // PID Tv (regular phase)
#define AGGIMAX 55 // PID Integrator Max (regular phase)
#define STARTKP 45 // PID Kp (coldstart phase)
#define STARTTN 130 // PID Tn (coldstart phase)
#define STEAMKP 150 // PID kp (steam phase)
#define AGGBKP 50 // PID Kp (brew detection phase)
#define AGGBTN 0 // PID Tn (brew detection phase)
#define AGGBTV 20 // PID Tv (brew detection phase)
#define BREW_TIME 25 // brew time in seconds (only used if pump is being controlled)
#define BREW_PID_DELAY 10 // delay until enabling PID controller during brew (no heating during this time)
#define PRE_INFUSION_TIME 2 // pre-infusion time in seconds
#define PRE_INFUSION_PAUSE_TIME 5 // pre-infusion pause time in seconds
#define SCALE_WEIGHTSETPOINT 30 // Target weight in grams
#define WIFI_CREDENTIALS_SAVED 0 // Flag if wifi setup is done. 0: not set up, 1: credentials set up via wifi manager
#define STANDBY_MODE_ON 0 // Standby mode off by default
#define STANDBY_MODE_TIME 30 // Time in minutes until the heater is turned off
#define BACKFLUSH_CYCLES 5 // number of cycles the backflush should run
#define BACKFLUSH_FILL_TIME 5 // time in seconds the pump is running during backflush
#define BACKFLUSH_FLUSH_TIME 10 // time in seconds the 3-way valve is open during backflush
#define FEATURE_BREW_CONTROL 0 // enables function to control pump and solenoid valve
#define FEATURE_FULLSCREEN_BREW_TIMER 0 // enables full screen brew timer
#define FEATURE_FULLSCREEN_MANUAL_FLUSH_TIMER 0 // enables full screen manual flush timer
#define POST_BREW_TIMER_DURATION 3 // time in seconds that brew timer will be shown after brew finished
#define FEATURE_HEATING_LOGO 1 // enables full screen logo if mashine is heating
#define FEATURE_PID_OFF_LOGO 1 // enables full screen logo if pid is switched off

#define PID_KP_START_MIN 0
#define PID_KP_START_MAX 999
#define PID_TN_START_MIN 0
#define PID_TN_START_MAX 999
#define PID_KP_REGULAR_MIN 0
#define PID_KP_REGULAR_MAX 999
#define PID_TN_REGULAR_MIN 0
#define PID_TN_REGULAR_MAX 999
#define PID_TV_REGULAR_MIN 0
#define PID_TV_REGULAR_MAX 999
#define PID_I_MAX_REGULAR_MIN 0
#define PID_I_MAX_REGULAR_MAX 999
#define PID_KP_BD_MIN 0
#define PID_KP_BD_MAX 999
#define PID_TN_BD_MIN 0
#define PID_TN_BD_MAX 999
#define PID_TV_BD_MIN 0
#define PID_TV_BD_MAX 999
#define BREW_SETPOINT_MIN 20
#define BREW_SETPOINT_MAX 110
#define STEAM_SETPOINT_MIN 100
#define STEAM_SETPOINT_MAX 140
#define BREW_TEMP_OFFSET_MIN 0
#define BREW_TEMP_OFFSET_MAX 20
#define BREW_TEMP_TIME_MIN 1
#define BREW_TEMP_TIME_MAX 180
#define BREW_TIME_MIN 0
#define BREW_TIME_MAX 180
#define BREW_PID_DELAY_MIN 0
#define BREW_PID_DELAY_MAX 60
#define BREW_SW_TIME_MIN 1
#define BREW_SW_TIME_MAX 180
#define BD_THRESHOLD_MIN 0
#define BD_THRESHOLD_MAX 999
#define PRE_INFUSION_TIME_MIN 0
#define PRE_INFUSION_TIME_MAX 60
#define PRE_INFUSION_PAUSE_MIN 0
#define PRE_INFUSION_PAUSE_MAX 60
#define WEIGHTSETPOINT_MIN 0
#define WEIGHTSETPOINT_MAX 500
#define PID_KP_STEAM_MIN 0
#define PID_KP_STEAM_MAX 500
#define STANDBY_MODE_TIME_MIN 30
#define STANDBY_MODE_TIME_MAX 120
#define BACKFLUSH_CYCLES_MIN 2
#define BACKFLUSH_CYCLES_MAX 20
#define BACKFLUSH_FILL_TIME_MIN 5
#define BACKFLUSH_FILL_TIME_MAX 20
#define BACKFLUSH_FLUSH_TIME_MIN 5
#define BACKFLUSH_FLUSH_TIME_MAX 20
#define PID_KP_START_MIN 0
#define PID_KP_START_MAX 999
#define PID_TN_START_MIN 0
#define PID_TN_START_MAX 999
#define PID_KP_REGULAR_MIN 0
#define PID_KP_REGULAR_MAX 999
#define PID_TN_REGULAR_MIN 0
#define PID_TN_REGULAR_MAX 999
#define PID_TV_REGULAR_MIN 0
#define PID_TV_REGULAR_MAX 999
#define PID_I_MAX_REGULAR_MIN 0
#define PID_I_MAX_REGULAR_MAX 999
#define PID_KP_BD_MIN 0
#define PID_KP_BD_MAX 999
#define PID_TN_BD_MIN 0
#define PID_TN_BD_MAX 999
#define PID_TV_BD_MIN 0
#define PID_TV_BD_MAX 999
#define BREW_SETPOINT_MIN 20
#define BREW_SETPOINT_MAX 110
#define STEAM_SETPOINT_MIN 100
#define STEAM_SETPOINT_MAX 140
#define BREW_TEMP_OFFSET_MIN 0
#define BREW_TEMP_OFFSET_MAX 20
#define BREW_TIME_MIN 0
#define BREW_TIME_MAX 180
#define BREW_PID_DELAY_MIN 0
#define BREW_PID_DELAY_MAX 60
#define PRE_INFUSION_TIME_MIN 0
#define PRE_INFUSION_TIME_MAX 60
#define PRE_INFUSION_PAUSE_MIN 0
#define PRE_INFUSION_PAUSE_MAX 60
#define WEIGHTSETPOINT_MIN 0
#define WEIGHTSETPOINT_MAX 500
#define PID_KP_STEAM_MIN 0
#define PID_KP_STEAM_MAX 500
#define STANDBY_MODE_TIME_MIN 30
#define STANDBY_MODE_TIME_MAX 120
#define BACKFLUSH_CYCLES_MIN 2
#define BACKFLUSH_CYCLES_MAX 20
#define BACKFLUSH_FILL_TIME_MIN 5
#define BACKFLUSH_FILL_TIME_MAX 20
#define BACKFLUSH_FLUSH_TIME_MIN 5
#define BACKFLUSH_FLUSH_TIME_MAX 20
#define POST_BREW_TIMER_DURATION_MIN 0
#define POST_BREW_TIMER_DURATION_MAX 60
Loading
Loading