File tree Expand file tree Collapse file tree
lib/NayrodPID/src/PressureController Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ void PressureController::update(ControlMode mode) {
6262 float flowOutput = getPumpDutyCycleForFlowRate ();
6363 float pressureOutput = getPumpDutyCycleForPressure ();
6464 *_ctrlOutput = std::min (flowOutput, pressureOutput);
65- if (mode == ControlMode::FLOW ) {
65+ if (flowOutput < pressureOutput ) {
6666 _errorInteg = 0 .0f ; // Reset error buildup in flow target
6767 }
6868 } else if (mode == ControlMode::FLOW) {
@@ -97,6 +97,9 @@ float PressureController::pumpFlowModel(float alpha) const {
9797float PressureController::getPumpDutyCycleForFlowRate () const {
9898 // Afine model base on one Gaggia Classic Pro Unit measurements
9999 const float availableFlow = _Q1 * _filteredPressureSensor + _Q0;
100+ if (availableFlow <= 0 .0f ) {
101+ return 0 .0f ;
102+ }
100103 return *_rawFlowSetpoint / availableFlow * 100 .0f ;
101104}
102105
You can’t perform that action at this time.
0 commit comments