coffee/barista/thermostat.h
Rodrigo Arias Mallo 8502ee3c5c Implement PID thremostat controller
For now only the proportional (Kp) and derivative (Kd) components are
used, the integral term is 0.
2025-11-02 19:24:02 +01:00

33 lines
630 B
C

/* Copyright (c) 2025 Rodrigo Arias Mallo <rodarima@gmail.com>
* SPDX-License-Identifier: GPL-3.0-or-later */
#ifndef BARISTA_THERMOSTAT_H
#define BARISTA_THERMOSTAT_H
#ifdef __cplusplus
extern "C" {
#endif
enum thermostat_state {
THERMOSTAT_OFF = 0,
THERMOSTAT_ON,
};
struct thermostat {
enum thermostat_state st;
float temp_target;
float temp_min;
float temp_max;
int on;
};
void thermostat_set(struct thermostat *th, float temp_target);
void thermostat_off(struct thermostat *th);
float thermostat_state(struct thermostat *th, float T, float dT_dt);
#ifdef __cplusplus
}
#endif
#endif /* BARISTA_THERMOSTAT_H */