Skip to content

Feature/gearpump#569

Open
Velkromod wants to merge 7 commits intojniebuhr:feature/gearpumpfrom
Velkromod:feature/gearpump
Open

Feature/gearpump#569
Velkromod wants to merge 7 commits intojniebuhr:feature/gearpumpfrom
Velkromod:feature/gearpump

Conversation

@Velkromod
Copy link

With these changes, the objective is to improve the performance of the gear pump allowing to read the pulses from the pump ESC tacho pin. It counts time between pulses to infiere RPM (2 pulses per revolution, on falling from 5v to 80mv), It is coded to read pulses in the GPIO 13. From there on flowmap using the gear pump datasheet is inferred the actual flow using interpolation of the flow curves (intersection from RPM and pressure), then it converts ml/min to ml/sec, and feed this info into dimmed pump and pressure controller. With all these changes it should allow for a smooth pressure control tailored to the MPB 015 24V 70W Gear Pump. Since all this code was written by IA it's prone to have errors, so is to be treated as experimental.

@cla-bot
Copy link

cla-bot bot commented Feb 2, 2026

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please contact @jniebuhr (mdwasp) on Discord to get yourself added.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 2, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f57aed24b5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 105 to +123
void DimmedPump::updatePower() {
// Update controller output and apply power to SSR + DAC.
_pressureController.update(static_cast<PressureController::ControlMode>(_mode));

if (_mode != ControlMode::POWER) {
_power = _controllerPower;
}

_power = std::clamp(_power, 0.0f, 100.0f);

_psm.set(static_cast<int>(_power));
mcp->setVoltage(MCP_VOLTAGE * _power / 100.0f);
}

void DimmedPump::setPower(float setpoint) {
_mode = ControlMode::POWER;
_power = std::clamp(setpoint, 0.0f, 100.0f);
_ctrlPressure = (_power > 0.0f) ? 20.0f : 0.0f;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Sync manual power into controller state

In POWER mode, updatePower() always runs _pressureController.update(...) before applying _power, but setPower() no longer propagates the manual setpoint into _controllerPower. As a result, the controller continues using a stale _controllerPower for flow/volume estimation (and related telemetry) while the actual pump output follows _power, so after switching to POWER mode the reported flow/coffee volume can stay at 0 or a previous value even though the pump is running. This regression only appears when operating in manual power mode; consider setting _controllerPower = _power in setPower() (or before the update call when _mode == POWER) so estimates track the real output.

Useful? React with 👍 / 👎.

@cla-bot
Copy link

cla-bot bot commented Feb 3, 2026

We require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please contact @jniebuhr (mdwasp) on Discord to get yourself added.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
4.2% Duplication on New Code (required ≤ 4%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant