Skip to content

SPEEDYBEEF405V5: Adjust current meter offset and scale #866

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kedeng
Copy link
Contributor

@kedeng kedeng commented Aug 18, 2025

Adjust current meter offset and scale.

Summary by CodeRabbit

  • New Features
    • Added default current meter calibration for the SPEEDYBEEF405V5 target, providing preset scale and offset values for ADC-based current sensing.
    • Users should see more accurate current readings out of the box, reducing the need for manual calibration.
    • Improves telemetry reliability for power monitoring and consumption tracking on supported builds.
    • No changes required from users; existing setups will automatically use the new defaults when the ADC current meter source is selected.

Copy link
Contributor

coderabbitai bot commented Aug 18, 2025

Walkthrough

Adds two preprocessor macros to configs/SPEEDYBEEF405V5/config.h for ADC current meter calibration: DEFAULT_CURRENT_METER_SCALE set to 27 and DEFAULT_CURRENT_METER_OFFSET set to -2644. Inserted after DEFAULT_PID_PROCESS_DENOM; no existing lines modified or removed.

Changes

Cohort / File(s) Summary of Changes
Current meter calibration defaults (SPEEDYBEEF405V5)
configs/SPEEDYBEEF405V5/config.h
Added macros: DEFAULT_CURRENT_METER_SCALE 27, DEFAULT_CURRENT_METER_OFFSET -2644. Inserted near existing current meter defaults; no deletions or other edits.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Add SPEEDYBEEF405V5 #846 — Introduced/modified current meter default handling; this PR extends those defaults for SPEEDYBEEF405V5.

Suggested reviewers

  • sugaarK
  • haslinghuis
  • ot0tot

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or `` to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
configs/SPEEDYBEEF405V5/config.h (1)

122-123: Optional: annotate provenance of calibration values

Adding a brief inline note helps future maintainers understand that these numbers are board-calibrated.

Apply this diff if you want the inline comments:

-#define DEFAULT_CURRENT_METER_SCALE  27
-#define DEFAULT_CURRENT_METER_OFFSET -2644
+#define DEFAULT_CURRENT_METER_SCALE  27    // board-calibrated ADC current scale
+#define DEFAULT_CURRENT_METER_OFFSET -2644 // board-calibrated ADC current offset
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between df10848 and 9a19a5f.

📒 Files selected for processing (1)
  • configs/SPEEDYBEEF405V5/config.h (1 hunks)
🔇 Additional comments (2)
configs/SPEEDYBEEF405V5/config.h (2)

122-123: Calibrated ADC current meter defaults added — LGTM

These defaults look correct for a target-level override and align with CURRENT_METER_ADC being selected in this config.


122-123: DEFAULT_CURRENT_METER_SCALE/OFFSET definitions are unique for SPEEDYBEEF405V5
All occurrences of DEFAULT_CURRENT_METER_SCALE and DEFAULT_CURRENT_METER_OFFSET are defined only in configs/SPEEDYBEEF405V5/config.h (lines 122–123) and nowhere else in the repository. No conflicting or duplicate #define was found for this target.

@ot0tot
Copy link
Contributor

ot0tot commented Aug 19, 2025

The scale and offset do not make sense. How were these values determined? Can you post the schematic for the current sensor on the included ESC? Do these values even need to be set in the target?

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.

3 participants