Skip to content

Conversation

@asiemsen
Copy link
Collaborator

@asiemsen asiemsen commented Nov 3, 2025

Add Power Monitor Component

Description

This PR adds power monitor with telemetry of voltage, current, and power of both the system battery and the solar panels. Configuration for ActiveRateGroupOutputPorts was overridden and raised from 10 to 15.

How Has This Been Tested?

Integration test:

==== test session starts ====
platform darwin -- Python 3.13.5, pytest-8.3.3, pluggy-1.5.0
rootdir: /Users/nate/code/github.com/open-source-space-foundation/proves-core-reference
plugins: fprime-gds-4.0.2a8
collected 1 item                                                                                                                                                 

FprimeZephyrReference/test/int/power_monitor_test.py .                                                                                                     [100%]

==== 1 passed in 0.37s ====

@Mikefly123 Tested telemetry on CubeSat with both battery and solar panels connected.

image
  • Unit tests
  • Integration tests
  • Z Tests
  • Manual testing (describe steps)

Checklist

  • Written detailed sdd with requirements, channels, ports, commands, telemetry defined and correctly formatted and spelled
  • Have written relevant integration tests and have documented them in the sdd
  • Have done a code review with
  • Have tested this PR on every supported board with correct board definitions

Mikefly123
Mikefly123 previously approved these changes Nov 3, 2025
Copy link
Contributor

@Mikefly123 Mikefly123 left a comment

Choose a reason for hiding this comment

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

Hey @asiemsen @nateinaction thanks for the quick work on this! Looks great to me. We might want to revisit the naming of components, but it's semantics and I did just realize naming it this way matches our syntax on the CircuitPython side. So it would make sense to stay consistent so it is easier for people to transition.

I think we should merge it and keep moving forward!

Copy link
Contributor

Choose a reason for hiding this comment

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

A bit of a big nit pick, but we should probably just name this component INA219 or INA219PowerMonitor or something to maintain the Application / Manager / Driver design pattern separation between things.

A higher level PowerMonitorManager component might group together all of the individual power monitor components into a single interface with a little bit of logic that can be used to manipulate them.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah the lack of consistency around component naming is maddening. This specific plan where we create specific device "managers" in the Drv dir was discussed with @LeStarch but as long as we are consistent it doesn't matter. In this case this device manager is consistent with the Lis2mdl and Lsm6dso managers. I vote to keep the names as-is so we don't spend time futzing with the small potatoes stuff before launch. Some time post launch let's find agreement on a component naming scheme.

Also, as you said the power monitor component will likely change before launch similar to the imu component shifting to a detumble component so there will likely be a chance to change that higher level component this month.

Copy link
Contributor

Choose a reason for hiding this comment

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

Personal opinion, I kind of like the idea of having a single PowerMonitorManager that can have a configurable number of power monitors assigned to it. Totally understand though that we are in crunch time and this single component single driver pattern is easier to implement fast.

I think we might be able to figure out a bit of a design pattern for these "orchestrator components" in the loadswitch PR. If we do figure something good out over there we can come back to implement it on this side down the line!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I have refactored so we only have a single PowerMonitor component

Copy link
Contributor

Choose a reason for hiding this comment

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

Presuming since this is an all new file it was copied in from somewhere? It doesn't seem to cause an issues, but we might want to note in the PR description that this was done in case it does accidentally blow something up down the line.

Copy link
Contributor

Choose a reason for hiding this comment

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

AC Constants overrides some default F Prime Configurations so we can have more active ports. We also added it in the startup manager component https://github.com/Open-Source-Space-Foundation/proves-core-reference/pull/74/files#diff-5919945c60298d8e5d6218be6e1b60034dea557c091ff4ca0bec93a766a0788c

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is copied from upstream FPrime. I played around with reducing the number of constants pulled over but this seems to be the method to override FPrime defaults. Will note it in desc.

@Mikefly123
Copy link
Contributor

Also, the integration tests are failing, I think because we have a bad .uf2 on the deathstar. We should be able to fix that by tomorrow.

New integration tests should probably be added for the INA component as well, up to you guys if you want to wait on merging this until those are in or make a follow up PR for them.

@Mikefly123 Mikefly123 added the enhancement New feature or request label Nov 3, 2025
Copy link
Contributor

@ineskhou ineskhou left a comment

Choose a reason for hiding this comment

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

Looks great! I would just really want a sdd updated for clarity!

@ineskhou ineskhou moved this to In progress in v0.1-v0.3 Nov 3, 2025
ineskhou
ineskhou previously approved these changes Nov 4, 2025
Dialing things in to match the power monitor performance with our system
@Mikefly123 Mikefly123 self-requested a review November 4, 2025 01:28
Copy link
Contributor

@Mikefly123 Mikefly123 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Collaborator

@nateinaction nateinaction left a comment

Choose a reason for hiding this comment

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

WTG!

@asiemsen asiemsen merged commit 8d22001 into main Nov 4, 2025
2 of 3 checks passed
@asiemsen asiemsen deleted the power-monitor branch November 4, 2025 03:52
@github-project-automation github-project-automation bot moved this from In progress to Done in v0.1-v0.3 Nov 4, 2025
@asiemsen
Copy link
Collaborator Author

asiemsen commented Nov 4, 2025

Thanks for all the feedback and help on this!

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

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants